Skip to content

Commit

Permalink
Add test for func(), which is an alias for sym()
Browse files Browse the repository at this point in the history
Signed-off-by: Eugene Loh <eugene.loh@oracle.com>
Reviewed-by: Kris Van Hees <kris.van.hees@oracle.com>
  • Loading branch information
euloh authored and kvanhees committed Nov 30, 2021
1 parent 361d344 commit c194ba4
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions test/unittest/actions/symmod/tst.symmod.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,16 @@ fi
NAM=$MOD'`'$NAM
# run DTrace to test mod() and sym()
read MYMOD MYNAM <<< `$dtrace -qn 'BEGIN {mod(0x'$ADD'); sym(0x'$ADD'); exit(0) }'`
# also test func(), but it is simply an alias for sym()
read MYMOD MYNAM MYFUN <<< `$dtrace -qn 'BEGIN {mod(0x'$ADD'); sym(0x'$ADD'); func(0x'$ADD'); exit(0) }'`
if [ $? -ne 0 ]; then
exit 1
fi

# reporting
echo test $ADD $MOD $NAM
echo expect $MOD $NAM
echo actual $MYMOD $MYNAM
echo expect $MOD $NAM $NAM
echo actual $MYMOD $MYNAM $MYFUN

if [ $MOD != $MYMOD ]; then
echo fail: $MOD does not match $MYMOD
Expand All @@ -38,5 +39,9 @@ if [ $NAM != $MYNAM ]; then
echo fail: $NAM does not match $MYNAM
exit 1
fi
if [ $NAM != $MYFUN ]; then
echo fail: $NAM does not match $MYFUN
exit 1
fi

exit 0

0 comments on commit c194ba4

Please sign in to comment.