From c4d97b4d586fdae21a02aff7a02605ffd487b188 Mon Sep 17 00:00:00 2001 From: Baptiste Lepilleur Date: Sun, 30 Sep 2001 13:45:33 +0000 Subject: Contrib/msvc/CppUnit. contrib/msvc/CppUnit.WWTpl: added, template for WorkSpace Whiz! to create new classes and unit tests. * doc/FAQ: * INSTALL-WIN32.txt: moved FAQ from install-WIN32 to that file. Added a generic question to hint at the helper macros. * include/cppunit/extensions/HelperMacros.h: bug #464844, moved declaration of ThisTestCaseFactory from CPPUNIT_TEST_SUITE_END to CPPUNIT_TEST_SUITE where the Fixture class name is available from the macro parameter. --- include/cppunit/extensions/HelperMacros.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'include/cppunit') diff --git a/include/cppunit/extensions/HelperMacros.h b/include/cppunit/extensions/HelperMacros.h index fa38f12..ee3274b 100644 --- a/include/cppunit/extensions/HelperMacros.h +++ b/include/cppunit/extensions/HelperMacros.h @@ -101,6 +101,13 @@ #define CPPUNIT_TEST_SUITE( ATestCaseType ) \ private: \ typedef ATestCaseType __ThisTestCaseType; \ + class ThisTestCaseFactory : public CppUnit::TestFactory \ + { \ + virtual CppUnit::Test *makeTest() \ + { \ + return new ATestCaseType(); \ + } \ + }; \ public: \ static void \ registerTests( CppUnit::TestSuite *suite, \ @@ -175,14 +182,8 @@ __ThisTestCaseType::registerTests( builder.suite(), &factory ); \ return builder.takeSuite(); \ } \ - private: \ - class ThisTestCaseFactory : public CppUnit::TestFactory \ - { \ - virtual CppUnit::Test *makeTest() \ - { \ - return new __ThisTestCaseType(); \ - } \ - } + private: /* dummy typedef so that the macro can still end with ';'*/ \ + typedef ThisTestCaseFactory __ThisTestCaseFactory #define __CPPUNIT_CONCATENATE_DIRECT( s1, s2 ) s1##s2 #define __CPPUNIT_CONCATENATE( s1, s2 ) __CPPUNIT_CONCATENATE_DIRECT( s1, s2 ) -- cgit v1.2.1