[Cppunit-cvs] cppunit2/include/cpput forwards.h,1.15,1.16 lighttestrunner.h,1.1,1.2 test.h,1.5,1.6 t
Brought to you by:
blep
From: Baptiste L. <bl...@us...> - 2005-07-20 21:07:31
|
Update of /cvsroot/cppunit/cppunit2/include/cpput In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8806/include/cpput Modified Files: forwards.h lighttestrunner.h test.h testcase.h testfixture.h testrunner.h testsuite.h Log Message: * Added IntrusivePtr, a reference counted smart-pointer * Changed Test hierarchy and TestFixture to use IntrusivePtr instead of SharedPtr (this allows simple upcasting). Index: testcase.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/testcase.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** testcase.h 27 Feb 2005 14:38:26 -0000 1.9 --- testcase.h 20 Jul 2005 21:06:49 -0000 1.10 *************** *** 5,9 **** # include <cpptl/functor.h> # include <cpput/test.h> - # include <cpptl/sharedptr.h> # include <string> --- 5,8 ---- *************** *** 75,80 **** const Message &message ); template<typename FixtureType> ! TestPtr makeFixtureTestCase( const CppTL::SharedPtr<FixtureType> &fixture, const CppTL::Functor0 &run, const CppTL::ConstString &name ) --- 74,80 ---- const Message &message ); + /// @todo Use traits to get smart-pointer type and allow for any type of smart-pointer template<typename FixtureType> ! TestPtr makeFixtureTestCase( const CppTL::IntrusivePtr<FixtureType> &fixture, const CppTL::Functor0 &run, const CppTL::ConstString &name ) Index: testsuite.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/testsuite.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** testsuite.h 27 Feb 2005 10:15:41 -0000 1.4 --- testsuite.h 20 Jul 2005 21:06:49 -0000 1.5 *************** *** 35,40 **** void add( const TestPtr &test ); - // notes: should we defines this only if smart-pointer does not - // have templated constructor ? void add( const TestSuitePtr &test ); --- 35,38 ---- Index: testrunner.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/testrunner.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** testrunner.h 4 Jul 2005 08:11:25 -0000 1.5 --- testrunner.h 20 Jul 2005 21:06:49 -0000 1.6 *************** *** 4,7 **** --- 4,8 ---- # include <cpput/forwards.h> # include <opentest/testrunner.h> + # include <cpptl/intrusiveptr.h> # include <map> Index: lighttestrunner.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/lighttestrunner.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** lighttestrunner.h 2 Jul 2005 20:27:35 -0000 1.1 --- lighttestrunner.h 20 Jul 2005 21:06:49 -0000 1.2 *************** *** 4,7 **** --- 4,8 ---- # include <cpput/forwards.h> # include <cpput/testinfo.h> + # include <cpptl/intrusiveptr.h> # include <deque> Index: test.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/test.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** test.h 27 Feb 2005 10:15:41 -0000 1.5 --- test.h 20 Jul 2005 21:06:49 -0000 1.6 *************** *** 4,7 **** --- 4,8 ---- # include <cpput/forwards.h> # include <opentest/properties.h> + # include <cpptl/intrusiveptr.h> # include <string> *************** *** 11,15 **** class TestVisitor; ! class CPPUT_API Test { // ensure that this class can only be derived by AbstractTestCase and --- 12,16 ---- class TestVisitor; ! class CPPUT_API Test : public CppTL::IntrusiveCount { // ensure that this class can only be derived by AbstractTestCase and Index: testfixture.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/testfixture.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** testfixture.h 28 Feb 2005 21:36:19 -0000 1.8 --- testfixture.h 20 Jul 2005 21:06:49 -0000 1.9 *************** *** 11,15 **** namespace CppUT { ! class CPPUT_API TestFixture { public: --- 11,15 ---- namespace CppUT { ! class CPPUT_API TestFixture : public CppTL::IntrusiveCount { public: *************** *** 31,35 **** namespace Impl { ! typedef CppTL::SharedPtr<TestFixture> TestFixturePtr; class CPPUT_API FixtureFactory --- 31,35 ---- namespace Impl { ! typedef CppTL::IntrusivePtr<TestFixture> TestFixturePtr; class CPPUT_API FixtureFactory *************** *** 100,104 **** } ! CPPUT_DEDUCED_TYPENAME CppTL::SharedPtr<FixtureType> operator()() { return ::CppTL::staticPointerCast<FixtureType>( factory_() ); --- 100,104 ---- } ! CPPUT_DEDUCED_TYPENAME CppTL::IntrusivePtr<FixtureType> operator()() { return ::CppTL::staticPointerCast<FixtureType>( factory_() ); *************** *** 127,131 **** { ::CppUT::Impl::FixtureFactoryWrapper<CppUT_ThisType> fixtureFactory( factory_ ); ! ::CppTL::SharedPtr<FixtureType> fixture; // CPPUT_TESTSUITE_EXTEND (if defined) --- 127,131 ---- { ::CppUT::Impl::FixtureFactoryWrapper<CppUT_ThisType> fixtureFactory( factory_ ); ! ::CppTL::IntrusivePtr<FixtureType> fixture; // CPPUT_TESTSUITE_EXTEND (if defined) *************** *** 179,183 **** ::CppUT::Impl::FixtureFactoryWrapper<CppUT_ThisType> fixtureFactory( \ factory_ ); \ ! ::CppTL::SharedPtr<FixtureType> fixture # define CPPUT_TESTSUITE_EXTEND( FixtureType, ParentFixtureType ) \ --- 179,183 ---- ::CppUT::Impl::FixtureFactoryWrapper<CppUT_ThisType> fixtureFactory( \ factory_ ); \ ! ::CppTL::IntrusivePtr<FixtureType> fixture # define CPPUT_TESTSUITE_EXTEND( FixtureType, ParentFixtureType ) \ Index: forwards.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/forwards.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** forwards.h 27 Feb 2005 15:47:37 -0000 1.15 --- forwards.h 20 Jul 2005 21:06:49 -0000 1.16 *************** *** 21,30 **** class TestVisitor; ! typedef CppTL::SharedPtr<AbstractTestCase> AbstractTestCasePtr; ! typedef CppTL::SharedPtr<AbstractTestSuite> AbstractTestSuitePtr; typedef CppTL::SharedPtr<ExceptionGuardElement> ExceptionGuardElementPtr; ! typedef CppTL::SharedPtr<Test> TestPtr; typedef CppTL::SharedPtr<TestInfoData> TestInfoDataPtr; ! typedef CppTL::SharedPtr<TestSuite> TestSuitePtr; typedef CppTL::SharedPtr<TestResultUpdater> TestResultUpdaterPtr; --- 21,30 ---- class TestVisitor; ! typedef CppTL::IntrusivePtr<AbstractTestCase> AbstractTestCasePtr; ! typedef CppTL::IntrusivePtr<AbstractTestSuite> AbstractTestSuitePtr; typedef CppTL::SharedPtr<ExceptionGuardElement> ExceptionGuardElementPtr; ! typedef CppTL::IntrusivePtr<Test> TestPtr; typedef CppTL::SharedPtr<TestInfoData> TestInfoDataPtr; ! typedef CppTL::IntrusivePtr<TestSuite> TestSuitePtr; typedef CppTL::SharedPtr<TestResultUpdater> TestResultUpdaterPtr; |