Fix some memory leaks in tests

This commit is contained in:
Daniel Arndt
2017-11-03 00:24:34 +01:00
parent 8d0b0db5de
commit d327f90bd8
6 changed files with 8 additions and 0 deletions

View File

@@ -143,6 +143,7 @@ int test2(){
ia >> BOOST_SERIALIZATION_NVP(j2);
}
BOOST_CHECK(*j1 == *j2);
delete j1;
BOOST_CHECK(j2 == j2->j);
std::remove(testfile);
return EXIT_SUCCESS;

View File

@@ -44,6 +44,7 @@ int test_main( int /* argc */, char* /* argv */[] )
}
BOOST_CHECK(tb != tb1);
BOOST_CHECK(*tb == *tb1);
delete tb;
std::remove(testfile);
return EXIT_SUCCESS;
}

View File

@@ -198,6 +198,7 @@ test_main( int /* argc */, char* /* argv */[] )
BOOST_CHECK(1 == save_count);
BOOST_CHECK(1 == load_count);
BOOST_CHECK(*bp2 == *bp);
delete bp;
std::remove(testfile);
return EXIT_SUCCESS;

View File

@@ -87,6 +87,7 @@ void save_exported(const char *testfile)
delete rb1;
delete rb2;
delete rd21;
}
// save exported polymorphic class

View File

@@ -117,5 +117,8 @@ int test_main(int /* argc */, char * /* argv */[])
// Try to save and load pointers to Bs, to an xml archive
test_save_and_load<xml_oarchive, xml_iarchive>(b, b1);
delete a;
delete b;
return EXIT_SUCCESS;
}

View File

@@ -45,6 +45,7 @@ int test_main( int /* argc */, char* /* argv */[] )
}
BOOST_CHECK(ta != ta1);
BOOST_CHECK(*ta == *ta1);
delete ta;
std::remove(testfile);
return EXIT_SUCCESS;
}