From: amosjeffries <> Date: Wed, 27 Feb 2008 18:24:18 +0000 (+0000) Subject: Author: rousskov X-Git-Tag: SQUID_3_0_STABLE2~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7282a548bcca6a0c6f606af9a6cb76b5ac43a1b8;p=thirdparty%2Fsquid.git Author: rousskov Added a CPPUNIT assertion to test whether a failed CPPUNIT test case properly destructs local objects on exit. If a previous test case fails for any reason, the new assertion will fail instead of store_dir.cc aborting. This may save us from tracking non-existent StoreController initialization bugs. --- diff --git a/src/tests/testUfs.cc b/src/tests/testUfs.cc index cd8a98c7f0..4d9dd0f951 100644 --- a/src/tests/testUfs.cc +++ b/src/tests/testUfs.cc @@ -225,6 +225,11 @@ testUfs::testUfsDefaultEngine() if (0 > system ("rm -rf " TESTDIR)) throw std::runtime_error("Failed to clean test work directory"); + // This assertion may fail if previous test cases fail. + // Apparently, CPPUNIT_ASSERT* failure may prevent destructors of local + // objects such as "StorePointer aRoot" from being called. + CPPUNIT_ASSERT(!store_table); // or StoreHashIndex ctor will abort below + StorePointer aRoot (new StoreController); Store::Root(aRoot); SwapDirPointer aStore (new UFSSwapDir("ufs", "Blocking"));