22 Nov
2008
22 Nov
'08
12:45 a.m.
Peter Klotz
Here the test_unit pointer is not correct and does not match the one initially registered!
So what? Id match, right? test_unit* is shifted by 4 bytes from test_suite* (it does have virtual destructor). In fact I do not see a reason, why test_suite need virtual destructor. Maybe if I remove it, valgrind will be happy? Though I still believe code is valid as is.
I agree that deregister_test_unit() does not delete the test_suite but the pointers ought to match.
No they should not.
Maybe you can run my simple test case using valgrind. I used version 3.3.1 under Ubuntu 8.10 i386 (gcc 4.3.2) and Red Hat Enterprise Linux 5 x86_64 (gcc 4.1.2).
I do not have valgrind easily accessible at home.