
Hi, I tried to use boost unittest lib at my linux box (SuSE 10.0 gcc version 4.0.2 ). I'm able to compile #include using boost::unit_test::test_suite; // most frequently you implement test cases as a free functions void free_test_function() { BOOST_CHECK( 2 == 1 ); } test_suite* init_unit_test_suite( int argc, char* argv[] ) { test_suite* test= BOOST_TEST_SUITE( "Example" ); test->add( BOOST_TEST_CASE( &free_test_function )); return test; } and to link against boost_unit_test_framework. make all-am make[1]: Entering directory `/home/pberg/boost_example_unittest' if g++ -DHAVE_CONFIG_H -I. -I. -I. -I/usr/local/include -g -O2 -MT main.o -MD -MP -MF ".deps/main.Tpo" -c -o main.o main.cpp; \ then mv -f ".deps/main.Tpo" ".deps/main.Po"; else rm -f ".deps/main.Tpo"; exit 1; fi g++ -I/usr/local/include -g -O2 -lboost_unit_test_framework -o sharedpointer main.o /usr/lib/gcc/i586-suse-linux/4.0.2/../../../../i586-suse-linux/bin/ld: warning: libstdc++.so.5, needed by /usr/local/lib/libboost_unit_test_framework.so, may conflict with libstdc++.so.6 make[1]: Leaving directory `/home/pberg/boost_example_unittest' However at execution time I get: porschberg(pberg):/home/pberg/boost_example_unittest> ./sharedpointer *** glibc detected *** free(): invalid pointer: 0x0804ba10 *** Abgebrochen I "valgrinded" the executable and here is the output: *** errors detected in test suite "Example"; see standard output for details ==30533== ==30533== Mismatched free() / delete / delete [] ==30533== at 0x1B904A69: free (vg_replace_malloc.c:152) ==30533== by 0x1BC2FC80: operator delete(void*) (in /usr/lib/libstdc++.so.5.0 .7) ==30533== by 0x1B95840B: boost::unit_test::test_suite::~test_suite() (in /usr /local/lib/libboost_unit_test_framework.so.1.33.1) ==30533== by 0x1B9407FA: boost::unit_test::framework_impl::~framework_impl() (in /usr/local/lib/libboost_unit_test_framework.so.1.33.1) ==30533== by 0x1B93DF5E: (within /usr/local/lib/libboost_unit_test_framework. so.1.33.1) ==30533== by 0x1BA9D313: exit (in /lib/tls/libc-2.3.5.so) ==30533== by 0x1BA87EA7: __libc_start_main (in /lib/tls/libc-2.3.5.so) ==30533== by 0x8049120: ??? (start.S:119) ==30533== Address 0x1BC5D908 is 0 bytes inside a block of size 52 alloc'd ==30533== at 0x1B9046D3: operator new(unsigned) (vg_replace_malloc.c:132) ==30533== by 0x8049201: init_unit_test_suite(int, char**) (main.cpp:12) ==30533== by 0x1B93EEBD: boost::unit_test::framework::init(int, char**) (in / usr/local/lib/libboost_unit_test_framework.so.1.33.1) ==30533== by 0x1B94CF93: main (in /usr/local/lib/libboost_unit_test_framework .so.1.33.1) ==30533== ==30533== Mismatched free() / delete / delete [] ==30533== at 0x1B904A69: free (vg_replace_malloc.c:152) ==30533== by 0x1BC2FC80: operator delete(void*) (in /usr/lib/libstdc++.so.5.0 .7) ==30533== by 0x1B940927: boost::unit_test::framework_impl::~framework_impl() (in /usr/local/lib/libboost_unit_test_framework.so.1.33.1) ==30533== by 0x1B93DF5E: (within /usr/local/lib/libboost_unit_test_framework. so.1.33.1) ==30533== by 0x1BA9D313: exit (in /lib/tls/libc-2.3.5.so) ==30533== by 0x1BA87EA7: __libc_start_main (in /lib/tls/libc-2.3.5.so) ==30533== by 0x8049120: ??? (start.S:119) ==30533== Address 0x1BC5D9E8 is 0 bytes inside a block of size 44 alloc'd ==30533== at 0x1B9046D3: operator new(unsigned) (vg_replace_malloc.c:132) ==30533== by 0x804929E: init_unit_test_suite(int, char**) (unit_test_suite.hp p:222) ==30533== by 0x1B93EEBD: boost::unit_test::framework::init(int, char**) (in / usr/local/lib/libboost_unit_test_framework.so.1.33.1) ==30533== by 0x1B94CF93: main (in /usr/local/lib/libboost_unit_test_framework .so.1.33.1) ==30533== ==30533== ERROR SUMMARY: 7 errors from 7 contexts (suppressed: 24 from 2) ==30533== malloc/free: in use at exit: 9643 bytes in 6 blocks. ==30533== malloc/free: 24 allocs, 19 frees, 11593 bytes allocated. ==30533== For counts of detected errors, rerun with: -v ==30533== searching for pointers to 6 not-freed blocks. ==30533== checked 210328 bytes. ==30533== ==30533== LEAK SUMMARY: ==30533== definitely lost: 19 bytes in 1 blocks. ==30533== possibly lost: 0 bytes in 0 blocks. ==30533== still reachable: 9624 bytes in 5 blocks. ==30533== suppressed: 0 bytes in 0 blocks. ==30533== Use --leak-check=full to see details of leaked memory. I looked through the mailing list archives with no luck. Could someone give a hint ? Thomas