aboutsummaryrefslogtreecommitdiff
path: root/pathologist/src/pathologist/test_monkey_npe.sh
blob: 5f3d528ae75c32ac4d75fcaae0d3a3d7f8a70e8b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/sh
echo -n "Test Monkey with Bug - Null Pointer Exception -"
gnunet-monkey -m text -d bug_null_pointer_exception.db -b bug_null_pointer_exception -o npe.out || (echo "Monkey Failed!" && exit 1)
grep "Bug detected in file:bug_null_pointer_exception.c" npe.out > /dev/null || (echo "FAIL" && exit 1)
grep "function:crashFunction" npe.out > /dev/null || (echo "FAIL" && exit 1)
grep "line:14" npe.out > /dev/null || (echo "FAIL" && exit 1)
grep "reason:(null)" npe.out > /dev/null || (echo "FAIL" && exit 1)
grep "received signal:SIGSEGV" npe.out > /dev/null || (echo "FAIL" && exit 1)
grep "Segmentation fault" npe.out > /dev/null || (echo "FAIL" && exit 1)
grep " Details:" npe.out > /dev/null || (echo "FAIL" && exit 1)
grep " Expression:crashStruct is NULL" npe.out > /dev/null || (echo "FAIL" && exit 1)
rm -f npe.out
echo "PASS"