aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhexcoder- <heiko@hexco.de>2020-01-09 09:50:51 +0100
committerhexcoder- <heiko@hexco.de>2020-01-09 09:50:51 +0100
commit781123a9061c6f89f8b2964a1f8d9c80c7ff605d (patch)
tree3b1a056ef20e5583bc5f720402b28f5276d15ca0
parent553d9f5cfc6a9adc1a0a89bab477cb02ff174e58 (diff)
downloadafl++-781123a9061c6f89f8b2964a1f8d9c80c7ff605d.tar.gz
NetBSDs wc -l prints spaces before the number, so string test
failed -> use pattern matching with "case" instead.
-rwxr-xr-xtest/test.sh9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/test.sh b/test/test.sh
index 51b53de4..9e3c882e 100755
--- a/test/test.sh
+++ b/test/test.sh
@@ -152,11 +152,12 @@ test "$SYS" = "i686" -o "$SYS" = "x86_64" -o "$SYS" = "amd64" && {
mkdir -p in2
../afl-cmin -i in -o in2 -- ./test-instr.plain > /dev/null 2>&1
CNT=`ls in2/ | wc -l`
- test "$CNT" = 1 && $ECHO "$GREEN[+] afl-cmin correctly minimized testcase numbers"
- test "$CNT" = 1 || {
- $ECHO "$RED[!] afl-cmin did not correctly minimize testcase numbers"
+ case "$CNT" in
+1| *1) $ECHO "$GREEN[+] afl-cmin correctly minimized testcase numbers" ;;
+*) $ECHO "$RED[!] afl-cmin did not correctly minimize testcase numbers"
CODE=1
- }
+ ;;
+ esac
../afl-tmin -m200 -i in/in2 -o in2/in2 -- ./test-instr.plain > /dev/null 2>&1
SIZE=`ls -l in2/in2 2> /dev/null | awk '{print$5}'`
test "$SIZE" = 1 && $ECHO "$GREEN[+] afl-tmin correctly minimized the testcase"