id summary reporter owner description type status milestone component version severity resolution keywords cc 5582 There is a memory leak in the BOOST_AUTO_TEST_CASE_TEMPLATE Anton Matosov Gennadiy Rozental "There is memory leak in the boost::unit_test::ut_detail::generate_test_case_4_type::operator() which is used by boost::unit_test::ut_detail::template_test_case_gen which in its turn is used by BOOST_AUTO_TEST_CASE_TEMPLATE The problematic code is provided below. The test_case created here never gets deleted. {{{ template void operator()( mpl::identity ) { ... m_holder.m_test_cases.push_back( new test_case( full_name, test_case_template_invoker() ) ); } }}} Below is the code that can be used to reproduce the issue: {{{ #define BOOST_TEST_MAIN #include #include #include #include BOOST_AUTO_TEST_SUITE( TestMemLeak ) BOOST_AUTO_TEST_CASE_TEMPLATE( TestCase, Type, boost::mpl::list ) { } BOOST_AUTO_TEST_SUITE_END() }}} '''Note:''' This leak is detected only when application is linked with C runtime statically. Configured test application can be found in the attachment Execution output: {{{ Running 1 test case... *** No errors detected Detected memory leaks! Dumping objects -> {103} normal block at 0x00808D50, 4 bytes long. Data: 69 6E 74 00 {102} normal block at 0x00808D18, 8 bytes long. Data:

50 8D 80 00 00 00 00 00 Object dump complete. }}}" Bugs closed Boost 1.59.0 test Boost 1.46.1 Problem fixed test unit_test memory leak