[test] regression between 1.32.0 and 1.33.1 in "included" test framework

Hi All, I've recently found a reproducible regression in Boost.Test while moving from 1.32.0 to 1.33.1. This regression is apparently present in the HEAD and 1.34 candidate as well. I can confirm this problem (and the fix) on HP aC++ 06.12 (ia64), HP aCC 03.67 (PA-RISC) and Sun Studio 11 (SPARC, with and without -library=stlport4). According to one of our compiler vendors this is reproducible on Tru64/Alpha cxx as well. The fix is to change the test_unit::m_dependencies member (in boost/test/unit_test_suite.hpp, unit_test_suite_impl.hpp in trunk) from std::list<test_unit_id> to std::vector<test_unit_id> (yes, I know that doesn't make a whole lot of sense). The test case is: --- #include <boost/test/included/unit_test_framework.hpp> #include <boost/shared_ptr.hpp> class DummyTest : public boost::unit_test_framework::test_suite { public: DummyTest() : boost::unit_test_framework::test_suite( "DummyTest" ) {} void testDummy() { BOOST_CHECK( true ); } }; boost::unit_test_framework::test_suite * init_unit_test_suite( int argc, char * argv[] ) { boost::unit_test_framework::test_suite * test = BOOST_TEST_SUITE( "Test Test Suite" ); boost::shared_ptr<DummyTest> suite_a( new DummyTest() ); test->add( BOOST_CLASS_TEST_CASE( &DummyTest::testDummy, suite_a ) ); return test; } --- When the test has run, and once in global destructors, the binary dumps core repeatably. The stack trace of the crash is: --- [michael@uxcpth05 testtest]$ echo "where" | gdb a.out core HP gdb 5.4.0 for HP Itanium (32 or 64 bit) and target HP-UX 11.2x. Copyright 1986 - 2001 Free Software Foundation, Inc. Hewlett-Packard Wildebeest 5.4.0 (based on GDB) is covered by the GNU General Public License. Type "show copying" to see the conditions to change it and/or distribute copies. Type "show warranty" for warranty/support. .. Core was generated by `a.out'. Program terminated with signal 11, Segmentation fault. SEGV_ACCERR - Invalid Permissions for object #0 inline std::list<unsigned long,std::allocator<unsigned long>
After applying the fix above the test runs reliably. It'd be great to have this fix applied to the 1.34.0 candidate and the trunk. Regards, Michael

"Michael van der Westhuizen" <r1mikey@gmail.com> wrote in message news:d21d65950610270423n5bf2f72ak9cfdacd30408f13b@mail.gmail.com...
I do see a crash. The error is caused by obvios misuse of Boost::Test facilties. I plead guilty to lack of proper check though.
This fix only hides actual issue.
You are *NOT* supposed to be doing this.
Correct definition would look like: class DummyTest { public: void testDummy() { BOOST_CHECK( true ); } };
I will make sure this code wont compile. Gennadiy

Hi Gennadiy, On 11/8/06, Gennadiy Rozental <gennadiy.rozental@thomson.com> wrote:
[snip a whole lot of broken code]
Oh dear - that was very wrong, wasn't it! Thanks, I've corrected this in our tests, and can confirm that this was all caused by our code, not the test framework.
I will make sure this code wont compile.
Gennadiy
Please do that - it'll help protect people like me from ourselves :-) Michael
participants (2)
-
Gennadiy Rozental
-
Michael van der Westhuizen