CoCppUnit.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include "cppunit/extensions/HelperMacros.h"
00024 #include "DataTestSuite.h"
00025 #include "DataTestCaller.h"
00026
00035 #define CPPUNIT_DATA_TEST( testMethod ) \
00036 CPPUNIT_TEST_SUITE_ADD_TEST( \
00037 ( new CPPUNIT_NS::DataTestSuite<TestFixtureType>( \
00038 context.getTestNameFor( #testMethod), \
00039 &TestFixtureType::testMethod, \
00040 &TestFixtureType::testMethod##_data, \
00041 context ) ) )
00042
00048 #define CPPUNIT_DATA_FOR( testMethod ) \
00049 CppUnitVector <std::pair <std::string, void *> > \
00050 testMethod##_data() \
00051 { CppUnitVector <std::pair <std::string, void *> > __returnData; \
00052 typedef testMethod##Data __testDataTypedef;
00053
00059 #define CPPUNIT_DATA_FOR_END() \
00060 return __returnData; }
00061
00070 #define CPPUNIT_DATA_SET( name ) \
00071 { __testDataTypedef *t = new __testDataTypedef; \
00072 __returnData.push_back( \
00073 std::pair <std::string, void *> ( name, t ) );
00074
00081 #define CPPUNIT_DATA_SET_END() \
00082 }
00083
00088 #define CPPUNIT_FETCH_DATA( testMethod ) \
00089 std::auto_ptr <testMethod##Data> t ((testMethod##Data *) __currentTestData);