From e05ed58bf8562d214fe2c2bb42c9a4f8503da63b Mon Sep 17 00:00:00 2001 From: hexcoder- Date: Tue, 16 Jun 2020 19:44:52 +0200 Subject: fix test.sh for failing unit tests --- test/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test') diff --git a/test/test.sh b/test/test.sh index 95aa6159..921e2087 100755 --- a/test/test.sh +++ b/test/test.sh @@ -1121,7 +1121,7 @@ test "1" = "`../afl-fuzz | grep -i 'without python' >/dev/null; echo $?`" && { $ECHO "$BLUE[*] Execution cmocka Unit-Tests $GREY" unset AFL_CC -make -C .. unit || "$CODE" = "1" +make -C .. unit || CODE=1 INCOMPLETE=1 : $ECHO "$GREY[*] all test cases completed.$RESET" test "$INCOMPLETE" = "0" && $ECHO "$GREEN[+] all test cases executed" -- cgit 1.4.1 From a14f3c90a81e01f80623bc3642ab98ab9e488ecb Mon Sep 17 00:00:00 2001 From: hexcoder- Date: Tue, 16 Jun 2020 22:37:56 +0200 Subject: fix unit tests when exit is called at the end --- test/unittests/unit_list.c | 2 +- test/unittests/unit_maybe_alloc.c | 2 +- test/unittests/unit_preallocable.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/unittests/unit_list.c b/test/unittests/unit_list.c index 86d4748b..10697909 100644 --- a/test/unittests/unit_list.c +++ b/test/unittests/unit_list.c @@ -126,6 +126,6 @@ int main(int argc, char **argv) { }; //return cmocka_run_group_tests (tests, setup, teardown); - return cmocka_run_group_tests (tests, NULL, NULL); + __real_exit( cmocka_run_group_tests (tests, NULL, NULL) ); } diff --git a/test/unittests/unit_maybe_alloc.c b/test/unittests/unit_maybe_alloc.c index 4e093cfe..d9b3a0d4 100644 --- a/test/unittests/unit_maybe_alloc.c +++ b/test/unittests/unit_maybe_alloc.c @@ -156,6 +156,6 @@ int main(int argc, char **argv) { }; //return cmocka_run_group_tests (tests, setup, teardown); - return cmocka_run_group_tests (tests, NULL, NULL); + __real_exit( cmocka_run_group_tests (tests, NULL, NULL) ); } diff --git a/test/unittests/unit_preallocable.c b/test/unittests/unit_preallocable.c index 888bb485..a6c42bbb 100644 --- a/test/unittests/unit_preallocable.c +++ b/test/unittests/unit_preallocable.c @@ -109,6 +109,6 @@ int main(int argc, char **argv) { }; //return cmocka_run_group_tests (tests, setup, teardown); - return cmocka_run_group_tests (tests, NULL, NULL); + __real_exit( cmocka_run_group_tests (tests, NULL, NULL) ); } -- cgit 1.4.1 From 889e54eab858b1928f74a8c179b32275b62f2286 Mon Sep 17 00:00:00 2001 From: hexcoder- Date: Tue, 16 Jun 2020 23:07:33 +0200 Subject: unit tests: fix stupid compiler warning for gcc 4.8.4 --- test/unittests/unit_list.c | 2 ++ test/unittests/unit_maybe_alloc.c | 2 ++ test/unittests/unit_preallocable.c | 2 ++ 3 files changed, 6 insertions(+) (limited to 'test') diff --git a/test/unittests/unit_list.c b/test/unittests/unit_list.c index 10697909..4c2063b6 100644 --- a/test/unittests/unit_list.c +++ b/test/unittests/unit_list.c @@ -128,4 +128,6 @@ int main(int argc, char **argv) { //return cmocka_run_group_tests (tests, setup, teardown); __real_exit( cmocka_run_group_tests (tests, NULL, NULL) ); + // fake return for dumb compilers + return 0; } diff --git a/test/unittests/unit_maybe_alloc.c b/test/unittests/unit_maybe_alloc.c index d9b3a0d4..429d38ed 100644 --- a/test/unittests/unit_maybe_alloc.c +++ b/test/unittests/unit_maybe_alloc.c @@ -158,4 +158,6 @@ int main(int argc, char **argv) { //return cmocka_run_group_tests (tests, setup, teardown); __real_exit( cmocka_run_group_tests (tests, NULL, NULL) ); + // fake return for dumb compilers + return 0; } diff --git a/test/unittests/unit_preallocable.c b/test/unittests/unit_preallocable.c index a6c42bbb..b0963a15 100644 --- a/test/unittests/unit_preallocable.c +++ b/test/unittests/unit_preallocable.c @@ -111,4 +111,6 @@ int main(int argc, char **argv) { //return cmocka_run_group_tests (tests, setup, teardown); __real_exit( cmocka_run_group_tests (tests, NULL, NULL) ); + // fake return for dumb compilers + return 0; } -- cgit 1.4.1