ENGINE-474 - base test driver (and BloblistTest.cc) now leak-free according to valgrind. ENGINE-474
authorKrista Bennett <krista@pep-project.org>
Wed, 12 Dec 2018 15:01:53 +0100
branchENGINE-474
changeset 318627e08d7f5e07
parent 3183 324de911c575
child 3193 b15d10a898cd
ENGINE-474 - base test driver (and BloblistTest.cc) now leak-free according to valgrind.
test/src/TestDriver.cc
test/src/engine_tests/BloblistTests.cc
     1.1 --- a/test/src/TestDriver.cc	Tue Dec 11 14:19:34 2018 +0100
     1.2 +++ b/test/src/TestDriver.cc	Wed Dec 12 15:01:53 2018 +0100
     1.3 @@ -54,6 +54,10 @@
     1.4      }
     1.5  
     1.6      Test::Output* output = new Test::pEpTestOutput(); // blah
     1.7 -    return test_runner->run(*output, false) ? 0 : 1;
     1.8 +    int result = test_runner->run(*output, false) ? 0 : -1;
     1.9 +
    1.10      delete(output);
    1.11 +    delete(test_runner);
    1.12 +
    1.13 +    return result;
    1.14  }
     2.1 --- a/test/src/engine_tests/BloblistTests.cc	Tue Dec 11 14:19:34 2018 +0100
     2.2 +++ b/test/src/engine_tests/BloblistTests.cc	Wed Dec 12 15:01:53 2018 +0100
     2.3 @@ -117,11 +117,9 @@
     2.4      cout << "freeing bloblists...\n";
     2.5      free_bloblist(new_bl);
     2.6      free_bloblist(duplist);
     2.7 -    new_bl = NULL;
     2.8 -    duplist = NULL;
     2.9 -    free(text1);
    2.10 -    free(text2);
    2.11 -    free(text3);
    2.12 -    free(text4);    
    2.13 +    free_bloblist(bl1);
    2.14 +    free_bloblist(bl2);
    2.15 +    free_bloblist(bl3);
    2.16 +    free_bloblist(bl4);
    2.17      cout << "done.\n";
    2.18  }