[Cppunit-cvs] cppunit2/src/cpput assert.cpp,1.14,1.15 registry.cpp,1.2,1.3 testcase.cpp,1.12,1.13 te
Brought to you by:
blep
From: Baptiste L. <bl...@us...> - 2005-11-08 21:45:03
|
Update of /cvsroot/cppunit/cppunit2/src/cpput In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6802/src/cpput Modified Files: assert.cpp registry.cpp testcase.cpp testinfo.cpp testsuite.cpp Log Message: - changed most interface to use std::string instead of CppTL::ConstString - CppTL::ConstString is now an implementation detail and is used to store string in objects as it is thread-safe. Index: registry.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpput/registry.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** registry.cpp 27 Feb 2005 10:17:05 -0000 1.2 --- registry.cpp 8 Nov 2005 21:44:55 -0000 1.3 *************** *** 7,11 **** ! CppTL::ConstString Registry::defaultParentSuiteName() { --- 7,11 ---- ! std::string Registry::defaultParentSuiteName() { *************** *** 29,34 **** void ! Registry::addChild( const CppTL::ConstString &parentSuiteName, ! const CppTL::ConstString &childSuiteName ) { // ParentChildRelationShips::iterator it = relations_.find( childSuiteName ); --- 29,34 ---- void ! Registry::addChild( const std::string &parentSuiteName, ! const std::string &childSuiteName ) { // ParentChildRelationShips::iterator it = relations_.find( childSuiteName ); *************** *** 40,45 **** bool ! Registry::removeChild( const CppTL::ConstString &parentSuiteName, ! const CppTL::ConstString &childSuiteName ) { ParentChildRelationShips::iterator it = relations_.find( parentSuiteName ); --- 40,45 ---- bool ! Registry::removeChild( const std::string &parentSuiteName, ! const std::string &childSuiteName ) { ParentChildRelationShips::iterator it = relations_.find( parentSuiteName ); *************** *** 57,66 **** TestFactoryId ! Registry::add( const CppTL::ConstString &parentSuiteName, const TestFactory &testFactory ) { TestFactoryId id = nextFactoryId(); ! registry_[ parentSuiteName ].push_back( TestFactoryWithId( testFactory, id ) ); ! parentSuiteById_[ id ] = parentSuiteName; return id; } --- 57,69 ---- TestFactoryId ! Registry::add( const std::string &parentSuiteName, const TestFactory &testFactory ) { + CppTL::ConstString actualParentSuiteName = parentSuiteName; + if ( parentSuiteName.empty() ) + actualParentSuiteName = defaultParentSuiteName(); TestFactoryId id = nextFactoryId(); ! registry_[ actualParentSuiteName ].push_back( TestFactoryWithId( testFactory, id ) ); ! parentSuiteById_[ id ] = actualParentSuiteName; return id; } *************** *** 123,127 **** TestSuitePtr ! Registry::createTests( const CppTL::ConstString &suiteName ) const { if ( suiteName == defaultParentSuiteName() ) --- 126,130 ---- TestSuitePtr ! Registry::createTests( const std::string &suiteName ) const { if ( suiteName == defaultParentSuiteName() ) *************** *** 144,148 **** void ! Registry::addCreatedTests( const CppTL::ConstString &suiteName, const TestSuitePtr &suite ) const { --- 147,151 ---- void ! Registry::addCreatedTests( const std::string &suiteName, const TestSuitePtr &suite ) const { *************** *** 153,157 **** void ! Registry::addChildSuite( const CppTL::ConstString &suiteName, const TestSuitePtr &suite ) const { --- 156,160 ---- void ! Registry::addChildSuite( const std::string &suiteName, const TestSuitePtr &suite ) const { *************** *** 161,165 **** { const CppTL::ConstString &childSuiteName = itChild->second; ! suite->add( createTests( childSuiteName ) ); ++itChild; } --- 164,168 ---- { const CppTL::ConstString &childSuiteName = itChild->second; ! suite->add( createTests( childSuiteName.str() ) ); ++itChild; } *************** *** 168,172 **** void ! Registry::addSuiteRegisteredTests( const CppTL::ConstString &suiteName, const TestSuitePtr &suite ) const { --- 171,175 ---- void ! Registry::addSuiteRegisteredTests( const std::string &suiteName, const TestSuitePtr &suite ) const { Index: assert.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpput/assert.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** assert.cpp 6 Sep 2005 07:21:05 -0000 1.14 --- assert.cpp 8 Nov 2005 21:44:54 -0000 1.15 *************** *** 70,75 **** Message ! buildEqualityFailedMessage( const CppTL::ConstString &expected, ! const CppTL::ConstString &actual, const Message &message ) { --- 70,75 ---- Message ! buildEqualityFailedMessage( const std::string &expected, ! const std::string &actual, const Message &message ) { *************** *** 83,88 **** Message ! buildUnequalityFailedMessage( const CppTL::ConstString &expected, ! const CppTL::ConstString &actual, const Message &message ) { --- 83,88 ---- Message ! buildUnequalityFailedMessage( const std::string &expected, ! const std::string &actual, const Message &message ) { Index: testsuite.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpput/testsuite.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** testsuite.cpp 20 Jul 2005 21:06:51 -0000 1.9 --- testsuite.cpp 8 Nov 2005 21:44:55 -0000 1.10 *************** *** 13,17 **** ! AbstractTestSuite::AbstractTestSuite( const CppTL::ConstString &name ) : Test( name ) { --- 13,17 ---- ! AbstractTestSuite::AbstractTestSuite( const std::string &name ) : Test( name ) { *************** *** 36,40 **** // //////////////////////////////////////////////////////////////////// ! TestSuite::TestSuite( const CppTL::ConstString &name ) : AbstractTestSuite( name ) { --- 36,40 ---- // //////////////////////////////////////////////////////////////////// ! TestSuite::TestSuite( const std::string &name ) : AbstractTestSuite( name ) { *************** *** 71,75 **** ! TestSuitePtr makeTestSuite( const CppTL::ConstString &name ) { return TestSuitePtr( new TestSuite( name ) ); --- 71,75 ---- ! TestSuitePtr makeTestSuite( const std::string &name ) { return TestSuitePtr( new TestSuite( name ) ); Index: testinfo.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpput/testinfo.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** testinfo.cpp 8 Nov 2005 20:25:49 -0000 1.17 --- testinfo.cpp 8 Nov 2005 21:44:55 -0000 1.18 *************** *** 62,66 **** void ! Assertion::setTestDataType( const CppTL::ConstString &type ) { testDataType_ = type; --- 62,66 ---- void ! Assertion::setTestDataType( const std::string &type ) { testDataType_ = type; *************** *** 68,82 **** ! const CppTL::ConstString & Assertion::testDataType() const { ! return testDataType_; } void ! Assertion::setTestData( const CppTL::ConstString &name, const Json::Value &value, ! const CppTL::ConstString &type ) { testData_["name"]["type"] = type; --- 68,82 ---- ! std::string Assertion::testDataType() const { ! return testDataType_.str(); } void ! Assertion::setTestData( const std::string &name, const Json::Value &value, ! const std::string &type ) { testData_["name"]["type"] = type; *************** *** 92,96 **** ! CppTL::ConstString Assertion::toString() const { --- 92,96 ---- ! std::string Assertion::toString() const { *************** *** 115,119 **** buffer += testData_.toStyledString() + "\n"; } ! return buffer; } --- 115,119 ---- buffer += testData_.toStyledString() + "\n"; } ! return buffer.c_str(); } *************** *** 149,153 **** void ! TestStatus::setStatistics( const CppTL::ConstString &name, const Json::Value &value ) { --- 149,153 ---- void ! TestStatus::setStatistics( const std::string &name, const Json::Value &value ) { *************** *** 162,166 **** void ! TestStatus::addSpecific( const CppTL::ConstString &type, const Json::Value &value ) { --- 162,166 ---- void ! TestStatus::addSpecific( const std::string &type, const Json::Value &value ) { *************** *** 337,340 **** --- 337,345 ---- } + void log( const std::string &log ) + { + TestInfo::threadInstance().log( log ); + } + void log( const CppTL::ConstString &log ) { Index: testcase.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpput/testcase.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** testcase.cpp 10 Aug 2005 21:34:29 -0000 1.12 --- testcase.cpp 8 Nov 2005 21:44:55 -0000 1.13 *************** *** 15,19 **** ! AbstractTestCase::AbstractTestCase( const CppTL::ConstString &name ) : Test( name ) { --- 15,19 ---- ! AbstractTestCase::AbstractTestCase( const std::string &name ) : Test( name ) { *************** *** 76,80 **** TestCase::TestCase( const CppTL::Functor0 &run, ! const CppTL::ConstString &name ) : AbstractTestCase( name ) , run_( run ) --- 76,80 ---- TestCase::TestCase( const CppTL::Functor0 &run, ! const std::string &name ) : AbstractTestCase( name ) , run_( run ) *************** *** 86,90 **** const CppTL::Functor0 &run, const CppTL::Functor0 &tearDown, ! const CppTL::ConstString &name ) : AbstractTestCase( name ) , setUp_( setUp ) --- 86,90 ---- const CppTL::Functor0 &run, const CppTL::Functor0 &tearDown, ! const std::string &name ) : AbstractTestCase( name ) , setUp_( setUp ) *************** *** 121,125 **** TestPtr makeTestCase( const CppTL::Functor0 &run, ! const CppTL::ConstString &name ) { return TestPtr( new TestCase( run, name ) ); --- 121,125 ---- TestPtr makeTestCase( const CppTL::Functor0 &run, ! const std::string &name ) { return TestPtr( new TestCase( run, name ) ); *************** *** 130,134 **** const CppTL::Functor0 &run, const CppTL::Functor0 &tearDown, ! const CppTL::ConstString &name ) { return TestPtr( new TestCase( setUp, run, tearDown, name ) ); --- 130,134 ---- const CppTL::Functor0 &run, const CppTL::Functor0 &tearDown, ! const std::string &name ) { return TestPtr( new TestCase( setUp, run, tearDown, name ) ); *************** *** 141,145 **** { public: ! FailingTestCase( const CppTL::ConstString &name, const CppUT::Message &message ) : CppUT::AbstractTestCase( name ) --- 141,145 ---- { public: ! FailingTestCase( const std::string &name, const CppUT::Message &message ) : CppUT::AbstractTestCase( name ) *************** *** 158,162 **** ! TestPtr CPPUT_API makeFailingTestCase( const CppTL::ConstString &name, const Message &message ) { --- 158,162 ---- ! TestPtr CPPUT_API makeFailingTestCase( const std::string &name, const Message &message ) { |