Re: [Cppunit-devel] A better version of CPPUNIT_TEST_SUITE_REGISTRATION macro(?)
Brought to you by:
blep
From: Baptiste L. <bl...@us...> - 2005-07-18 21:59:30
|
MessageDo you mean link error ? I don't understand how changing = something in a.cpp could fix the compilation of b.cpp... Do you have a sample to reproduce this ? I'm really curious. Baptiste. ----- Original Message -----=20 From: Gola Bartlomiej-ABG014=20 To: 'cpp...@li...'=20 Sent: Wednesday, July 13, 2005 12:06 PM Subject: [Cppunit-devel] A better version of = CPPUNIT_TEST_SUITE_REGISTRATION macro(?) Hi, I've encountered a problem when using CPPUNIT_TEST_SUITE_REGISTRATION = macro. I have several files with various tests and in each one of them = I'm using the above macro to register the test class. The problem arises = when you put the registration macro in the same line (but in the = separate files!) which generates compilation error (identifier = redefinition). To resolve the problem, I've modified the = CPPUNIT_TEST_SUITE_REGISTRATION macro: instead of using the = "autoRegisterRegistry__" prefix for a class name, a little bit more = complex syntax could be used. The modified macro: #define CPPUNIT_TEST_SUITE_REGISTRATION( ATestFixtureType ) \ static CPPUNIT_NS::AutoRegisterSuite< ATestFixtureType > \ CPPUNIT_MAKE_UNIQUE_NAME( CPPUNIT_JOIN(ATestFixtureType, = _AutoRegisterSuite_) ) The original version: #define CPPUNIT_TEST_SUITE_REGISTRATION( ATestFixtureType ) \ static CPPUNIT_NS::AutoRegisterSuite< ATestFixtureType > \ CPPUNIT_MAKE_UNIQUE_NAME(autoRegisterRegistry__ ) If you think it is a good idea I would more than happy if you used my = solution in the next CppUnit version. Best regards and thanks for a great test framework, Bartek Gola |