Thread: [Cppunit-cvs] cppunit2/include/cpput exceptionguard.h,1.1,1.2 parametrizedsource.h,1.4,1.5 registry.
Brought to you by:
blep
From: Baptiste L. <bl...@us...> - 2005-02-27 14:38:40
|
Update of /cvsroot/cppunit/cppunit2/include/cpput In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11085/include/cpput Modified Files: exceptionguard.h parametrizedsource.h registry.h tablefixture.h testcase.h testfixture.h Removed Files: functor.h Log Message: * changed cppunit 2 to use the new functors (cpptl/functor.h). bind_cfn & bind_memfn simplified some of the test code. Index: testcase.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/testcase.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** testcase.h 27 Feb 2005 10:15:41 -0000 1.8 --- testcase.h 27 Feb 2005 14:38:26 -0000 1.9 *************** *** 3,7 **** # include <cpput/forwards.h> ! # include <cpput/functor.h> # include <cpput/test.h> # include <cpptl/sharedptr.h> --- 3,7 ---- # include <cpput/forwards.h> ! # include <cpptl/functor.h> # include <cpput/test.h> # include <cpptl/sharedptr.h> *************** *** 41,50 **** { public: ! TestCase( const Functor0 &run, const CppTL::ConstString &name ); ! TestCase( const Functor0 &setUp, ! const Functor0 &run, ! const Functor0 &tearDown, const CppTL::ConstString &name ); --- 41,50 ---- { public: ! TestCase( const CppTL::Functor0 &run, const CppTL::ConstString &name ); ! TestCase( const CppTL::Functor0 &setUp, ! const CppTL::Functor0 &run, ! const CppTL::Functor0 &tearDown, const CppTL::ConstString &name ); *************** *** 57,73 **** private: ! Functor0 setUp_; ! Functor0 run_; ! Functor0 tearDown_; }; ! TestPtr CPPUT_API makeTestCase( const Functor0 &run, const CppTL::ConstString &name ); ! TestPtr CPPUT_API makeTestCase( const Functor0 &setUp, ! const Functor0 &run, ! const Functor0 &tearDown, const CppTL::ConstString &name ); --- 57,73 ---- private: ! CppTL::Functor0 setUp_; ! CppTL::Functor0 run_; ! CppTL::Functor0 tearDown_; }; ! TestPtr CPPUT_API makeTestCase( const CppTL::Functor0 &run, const CppTL::ConstString &name ); ! TestPtr CPPUT_API makeTestCase( const CppTL::Functor0 &setUp, ! const CppTL::Functor0 &run, ! const CppTL::Functor0 &tearDown, const CppTL::ConstString &name ); *************** *** 77,86 **** template<typename FixtureType> TestPtr makeFixtureTestCase( const CppTL::SharedPtr<FixtureType> &fixture, ! const Functor0 &run, const CppTL::ConstString &name ) { ! return makeTestCase( makeMemFn0<FixtureType>( fixture, &FixtureType::setUp ), run, ! makeMemFn0<FixtureType>( fixture, &FixtureType::tearDown ), name ); } --- 77,86 ---- template<typename FixtureType> TestPtr makeFixtureTestCase( const CppTL::SharedPtr<FixtureType> &fixture, ! const CppTL::Functor0 &run, const CppTL::ConstString &name ) { ! return makeTestCase( CppTL::memfn0( fixture, &FixtureType::setUp ), run, ! CppTL::memfn0( fixture, &FixtureType::tearDown ), name ); } Index: parametrizedsource.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/parametrizedsource.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** parametrizedsource.h 17 Nov 2004 08:59:05 -0000 1.4 --- parametrizedsource.h 27 Feb 2005 14:38:26 -0000 1.5 *************** *** 56,60 **** typedef CppTL::SharedPtr<TestParameterFactory> TestParameterFactoryPtr; ! typedef FunctorR1<TestParameterFactoryPtr, std::string> SuiteParameterFactory; --- 56,60 ---- typedef CppTL::SharedPtr<TestParameterFactory> TestParameterFactoryPtr; ! typedef CppTL::Functor1R<TestParameterFactoryPtr, std::string> SuiteParameterFactory; Index: exceptionguard.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/exceptionguard.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** exceptionguard.h 22 Feb 2005 21:26:52 -0000 1.1 --- exceptionguard.h 27 Feb 2005 14:38:26 -0000 1.2 *************** *** 3,7 **** # include <cpput/forwards.h> ! # include <cpput/functor.h> # include <deque> --- 3,7 ---- # include <cpput/forwards.h> ! # include <cpptl/sharedptr.h> # include <deque> *************** *** 82,86 **** void removeLast(); ! bool protect( Functor0 test ) const; private: --- 82,86 ---- void removeLast(); ! bool protect( CppTL::Functor0 test ) const; private: Index: registry.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/registry.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** registry.h 27 Feb 2005 10:15:41 -0000 1.2 --- registry.h 27 Feb 2005 14:38:26 -0000 1.3 *************** *** 4,8 **** # include <cpput/forwards.h> # include <cpptl/conststring.h> ! # include <cpput/functor.h> # include <deque> # include <map> --- 4,8 ---- # include <cpput/forwards.h> # include <cpptl/conststring.h> ! # include <cpptl/functor.h> # include <deque> # include <map> *************** *** 11,15 **** namespace CppUT { ! typedef FunctorR0<TestPtr> TestFactory; typedef int TestFactoryId; --- 11,15 ---- namespace CppUT { ! typedef CppTL::Functor0R<TestPtr> TestFactory; typedef int TestFactoryId; *************** *** 103,109 **** { CppTL::ConstString suiteNameByValue( suiteName ); ! TestFactory factory = makeFnR0<TestPtr>( ! bindR1( makeCFnR1<TestPtr, CppTL::ConstString>( &SuiteType::suite ), ! suiteNameByValue ) ); if ( parentSuiteName == "" ) parentSuiteName == Registry::defaultParentSuiteName(); --- 103,108 ---- { CppTL::ConstString suiteNameByValue( suiteName ); ! TestFactory factory = CppTL::bind_cfnr<TestPtr>( &SuiteType::suite, ! suiteNameByValue ); if ( parentSuiteName == "" ) parentSuiteName == Registry::defaultParentSuiteName(); Index: testfixture.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/testfixture.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** testfixture.h 27 Feb 2005 10:15:41 -0000 1.6 --- testfixture.h 27 Feb 2005 14:38:26 -0000 1.7 *************** *** 204,209 **** fixture = fixtureFactory(); \ suite->add( ::CppUT::makeFixtureTestCase( fixture, \ ! ::CppUT::makeMemFn0<CppUT_ThisType>( fixture, \ ! &CppUT_ThisType::testMethod ), \ #testMethod ) ) --- 204,209 ---- fixture = fixtureFactory(); \ suite->add( ::CppUT::makeFixtureTestCase( fixture, \ ! ::CppTL::memfn0( fixture, \ ! &CppUT_ThisType::testMethod ), \ #testMethod ) ) --- functor.h DELETED --- Index: tablefixture.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/tablefixture.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tablefixture.h 17 Nov 2004 08:59:05 -0000 1.2 --- tablefixture.h 27 Feb 2005 14:38:26 -0000 1.3 *************** *** 114,118 **** Binders binders_; ! typedef std::map< std::string, Functor0 > Actions; Actions actions_; }; --- 114,118 ---- Binders binders_; ! typedef std::map< std::string, CppTL::Functor0 > Actions; Actions actions_; }; |