]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
valgrind more unit tests.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 1 May 2018 12:12:21 +0000 (12:12 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 1 May 2018 12:12:21 +0000 (12:12 +0000)
git-svn-id: file:///svn/unbound/trunk@4667 be551aaa-1e26-0410-a405-d3ace91eadb9

testcode/unitmain.c
testdata/03-testbound.tdir/03-testbound.test

index 57883d183b9f1cf7cb03821017f6d3b67b8e48d6..fecde80cc3d13e145649e5ec7cb2061f599a7f9c 100644 (file)
@@ -905,6 +905,9 @@ main(int argc, char* argv[])
 #ifdef CLIENT_SUBNET
        ecs_test();
 #endif /* CLIENT_SUBNET */
+       if(log_get_lock()) {
+               lock_quick_destroy((lock_quick_type*)log_get_lock());
+       }
        checklock_stop();
        printf("%d checks ok.\n", testcount);
 #ifdef HAVE_SSL
index aefdc18554f448d44aa925f95ce90d8fbf66d86c..00d362287634a7fcfff170576646c235ef481ca5 100644 (file)
@@ -26,13 +26,15 @@ VALGRIND_FLAGS="--leak-check=full --show-leak-kinds=all"
 
 # self-test (unit test of testbound)
 if test $do_valgrind = "yes"; then
+       echo "valgrind yes"
+       echo
        if (valgrind $VALGRIND_FLAGS $PRE/testbound -s >tmpout 2>&1;); then
                echo "selftest   OK  "
        else
                echo "selftest FAILED"
                exit 1
        fi
-       if grep "All heap blocks were freed -- no leaks are possible" tmpout >/dev/null 2>&1; then
+       if grep "All heap blocks were freed -- no leaks are possible" tmpout; then
                :  # clean
        else
                cat tmpout
@@ -40,7 +42,7 @@ if test $do_valgrind = "yes"; then
                grep "in use at exit" tmpout
                exit 1
        fi
-       if grep "ERROR SUMMARY: 0 errors from 0 contexts" tmpout >/dev/null 2>&1; then
+       if grep "ERROR SUMMARY: 0 errors from 0 contexts" tmpout; then
                :  # clean
        else
                cat tmpout
@@ -102,13 +104,14 @@ for input in $PRE/testdata/*.rpl $PRE/testdata/*.crpl; do
        fi
 
        if test $do_valgrind = "yes"; then
+               echo
                if (valgrind $VALGRIND_FLAGS $PRE/testbound -p $input >tmpout 2>&1;); then
                        echo "  OK   $cleaninput: $header"
                else
                        echo "FAILED $cleaninput: $header"
                        exitval=1
                fi
-               if grep "All heap blocks were freed -- no leaks are possible" tmpout >/dev/null 2>&1; then
+               if grep "All heap blocks were freed -- no leaks are possible" tmpout; then
                        :  # clean
                else
                        grep "^==" tmpout
@@ -116,7 +119,7 @@ for input in $PRE/testdata/*.rpl $PRE/testdata/*.crpl; do
                        grep "in use at exit" tmpout
                        exitval=1
                fi
-               if grep "ERROR SUMMARY: 0 errors from 0 contexts" tmpout >/dev/null 2>&1; then
+               if grep "ERROR SUMMARY: 0 errors from 0 contexts" tmpout; then
                        :  # clean
                else
                        grep "^==" tmpout