cppunit-cvs Mailing List for CppUnit - C++ port of JUnit (Page 28)
Brought to you by:
blep
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(94) |
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
|
Feb
(114) |
Mar
(80) |
Apr
|
May
|
Jun
(36) |
Jul
(67) |
Aug
(37) |
Sep
(33) |
Oct
(28) |
Nov
(91) |
Dec
(16) |
2006 |
Jan
(1) |
Feb
(7) |
Mar
(45) |
Apr
|
May
|
Jun
(36) |
Jul
(7) |
Aug
|
Sep
(32) |
Oct
(3) |
Nov
|
Dec
|
2007 |
Jan
(29) |
Feb
(11) |
Mar
(5) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(35) |
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
(14) |
Mar
|
Apr
|
May
|
Jun
(5) |
Jul
(13) |
Aug
|
Sep
|
Oct
(3) |
Nov
|
Dec
(15) |
From: Baptiste L. <bl...@us...> - 2005-02-28 20:32:46
|
Update of /cvsroot/cppunit/cppunit2/include/cpptl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32384/include/cpptl Modified Files: conststring.h Log Message: * removed some warnings. Index: conststring.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpptl/conststring.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** conststring.h 27 Feb 2005 17:12:17 -0000 1.4 --- conststring.h 28 Feb 2005 20:32:35 -0000 1.5 *************** *** 493,497 **** break; case cszString: ! length_ = strlen( csz_ ); break; case string: --- 493,497 ---- break; case cszString: ! length_ = size_type( strlen( csz_ ) ); break; case string: *************** *** 503,507 **** # ifndef CPPTL_CONSTSTRING_NO_STDSTRING case stdString: ! length_ = stdString_->length(); break; # endif --- 503,507 ---- # ifndef CPPTL_CONSTSTRING_NO_STDSTRING case stdString: ! length_ = size_type( stdString_->length() ); break; # endif *************** *** 557,561 **** inline ConstString::ConstString( const value_type *csz ) ! : length_( csz ? strlen( csz ) : 0 ) , buffer_( new value_type[length_+1] ) { --- 557,561 ---- inline ConstString::ConstString( const value_type *csz ) ! : length_( csz ? size_type(strlen( csz )) : 0 ) , buffer_( new value_type[length_+1] ) { *************** *** 567,571 **** inline ConstString::ConstString( const value_type *begin, const value_type *end ) ! : length_( end - begin ) , buffer_( new value_type[end-begin+1] ) { --- 567,571 ---- inline ConstString::ConstString( const value_type *begin, const value_type *end ) ! : length_( size_type(end - begin) ) , buffer_( new value_type[end-begin+1] ) { *************** *** 608,612 **** inline ConstString::ConstString( const std::string &string ) ! : length_( string.length() ) , buffer_( new value_type[length_+1] ) { --- 608,612 ---- inline ConstString::ConstString( const std::string &string ) ! : length_( size_type(string.length()) ) , buffer_( new value_type[length_+1] ) { *************** *** 996,1000 **** StringBuffer::operator +=( const char *other ) { ! size_type otherLength = strlen(other); size_type newLength = length_ + otherLength; prepareBuffer( newLength ); --- 996,1000 ---- StringBuffer::operator +=( const char *other ) { ! size_type otherLength = size_type(strlen(other)); size_type newLength = length_ + otherLength; prepareBuffer( newLength ); |
From: Baptiste L. <bl...@us...> - 2005-02-28 20:31:38
|
Update of /cvsroot/cppunit/cppunit2/examples/parametrized_test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31999/parametrized_test Added Files: .cvsignore SConscript main.cpp Log Message: * an example of making parametrized test cases. --- NEW FILE: .cvsignore --- *.plg *.old *.WW *.old --- NEW FILE: main.cpp --- #include <cpput/testcase.h> #include <cpput/testsuite.h> #include <cpput/testrunner.h> // cppunit2 testrunner for opentest #include <cpput/assert.h> #include <opentest/texttestdriver.h> #include <opentest/properties.h> static void testMultiply( int x, int y, int expected_result ) { int result = x * y; CPPUT_ASSERT_EQUAL( expected_result, result ); } int main( int argc, const char *argv[] ) { CppUT::TestSuitePtr allSuite = CppUT::makeTestSuite( "All tests" ); allSuite->add( CppUT::makeTestCase( CppTL::bind_cfn( testMultiply, 7, 2, 7*2 ), "multiply 7*2" ) ); allSuite->add( CppUT::makeTestCase( CppTL::bind_cfn( testMultiply, 7, 5, 7*4 ), "multiply 7*5 (failing demo)" ) ); CppUT::TestRunner runner; CppUT::AbstractTestSuitePtr rootSuite = CppTL::staticPointerCast<CppUT::AbstractTestSuite>( allSuite ); runner.setRootSuite( rootSuite ); OpenTest::TextTestDriver driver( runner ); bool sucessful = driver.run(); return sucessful ? 0 : 1; } --- NEW FILE: SConscript --- # parametrized_test build script Import( 'env' ) env = env.Copy( LIBPATH = '#libs', LIBS = ['cpput'] ) parametrized_test_sources=""" main.cpp """.split() parametrized_test_exe = env.Program( target='parametrized_test', source=parametrized_test_sources ) bin_dir='#bin' env.Install( bin_dir, parametrized_test_exe ) |
From: Baptiste L. <bl...@us...> - 2005-02-28 20:30:21
|
Update of /cvsroot/cppunit/cppunit2/examples/parametrized_test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31475/parametrized_test Log Message: Directory /cvsroot/cppunit/cppunit2/examples/parametrized_test added to the repository |
From: Baptiste L. <bl...@us...> - 2005-02-28 20:29:51
|
Update of /cvsroot/cppunit/cppunit2/examples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31347/examples Log Message: Directory /cvsroot/cppunit/cppunit2/examples added to the repository |
From: Baptiste L. <bl...@us...> - 2005-02-27 17:42:41
|
Update of /cvsroot/cppunit/cppunit2/src/cpput In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30794/src/cpput Modified Files: exceptionguard.cpp Log Message: * added tests for ExceptionGuard. * fixed bug in ExceptionGuard::append() Index: exceptionguard.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpput/exceptionguard.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** exceptionguard.cpp 27 Feb 2005 14:38:27 -0000 1.3 --- exceptionguard.cpp 27 Feb 2005 17:42:32 -0000 1.4 *************** *** 115,119 **** guard->setNextInChain( ExceptionGuardElementPtr() ); guards_.back()->setNextInChain( guard ); ! guards_.insert( guards_.end()-1, guard ); } --- 115,119 ---- guard->setNextInChain( ExceptionGuardElementPtr() ); guards_.back()->setNextInChain( guard ); ! guards_.push_back( guard ); } |
From: Baptiste L. <bl...@us...> - 2005-02-27 17:42:41
|
Update of /cvsroot/cppunit/cppunit2/src/cpputtest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30794/src/cpputtest Modified Files: cpputtest.vcproj main.cpp SConscript Log Message: * added tests for ExceptionGuard. * fixed bug in ExceptionGuard::append() Index: SConscript =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/SConscript,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** SConscript 27 Feb 2005 16:12:08 -0000 1.6 --- SConscript 27 Feb 2005 17:42:32 -0000 1.7 *************** *** 10,14 **** main.cpp registrytest.cpp ! testbasicassertion.cpp testfunctor.cpp testfixturetest.cpp --- 10,15 ---- main.cpp registrytest.cpp ! testbasicassertion.cpp ! testexceptionguard.cpp testfunctor.cpp testfixturetest.cpp Index: main.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/main.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** main.cpp 27 Feb 2005 16:30:28 -0000 1.15 --- main.cpp 27 Feb 2005 17:42:32 -0000 1.16 *************** *** 14,18 **** bool testBasicAssertions(); ! //bool testTestContext(); //bool testTestRunResult(); bool testTestSuite(); --- 14,18 ---- bool testBasicAssertions(); ! bool testExceptionGuard(); //bool testTestRunResult(); bool testTestSuite(); *************** *** 25,29 **** return testBasicAssertions() && testFunctors() && ! // testTestRunResult() && // testTestContext() && testTestSuite() && --- 25,29 ---- return testBasicAssertions() && testFunctors() && ! testExceptionGuard() && // testTestContext() && testTestSuite() && Index: cpputtest.vcproj =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/cpputtest.vcproj,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** cpputtest.vcproj 27 Feb 2005 16:12:07 -0000 1.15 --- cpputtest.vcproj 27 Feb 2005 17:42:32 -0000 1.16 *************** *** 219,222 **** --- 219,225 ---- </File> <File + RelativePath=".\testexceptionguard.cpp"> + </File> + <File RelativePath="testfixturetest.cpp"> <FileConfiguration *************** *** 241,259 **** </File> <File - RelativePath=".\testtestcontext.cpp"> - <FileConfiguration - Name="Release|Win32" - ExcludedFromBuild="TRUE"> - <Tool - Name="VCCLCompilerTool"/> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - ExcludedFromBuild="TRUE"> - <Tool - Name="VCCLCompilerTool"/> - </FileConfiguration> - </File> - <File RelativePath=".\testtestrunresult.cpp"> <FileConfiguration --- 244,247 ---- |
From: Baptiste L. <bl...@us...> - 2005-02-27 17:12:40
|
Update of /cvsroot/cppunit/cppunit2/include/cpptl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21318/include/cpptl Modified Files: conststring.h Log Message: * fixed bug in StringBufer::truncate() (length was not set) * in constructor, ending zero is set before filling the buffer (nicer for debugging) Index: conststring.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpptl/conststring.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** conststring.h 27 Feb 2005 15:26:27 -0000 1.3 --- conststring.h 27 Feb 2005 17:12:17 -0000 1.4 *************** *** 590,595 **** , buffer_( new value_type[length_+1] ) { - concatenator.copyToBuffer( buffer_ ); buffer_[length_] = 0; } --- 590,595 ---- , buffer_( new value_type[length_+1] ) { buffer_[length_] = 0; + concatenator.copyToBuffer( buffer_ ); } *************** *** 600,605 **** , buffer_( new value_type[length_+1] ) { - memcpy( buffer_, buffer.c_str(), length_ ); buffer_[length_] = 0; } --- 600,605 ---- , buffer_( new value_type[length_+1] ) { buffer_[length_] = 0; + memcpy( buffer_, buffer.c_str(), length_ ); } *************** *** 611,616 **** , buffer_( new value_type[length_+1] ) { - memcpy( buffer_, string.c_str(), length_ ); buffer_[length_] = 0; } # endif --- 611,616 ---- , buffer_( new value_type[length_+1] ) { buffer_[length_] = 0; + memcpy( buffer_, string.c_str(), length_ ); } # endif *************** *** 968,971 **** --- 968,972 ---- { buffer_[length] = 0; + length_ = length; } |
From: Baptiste L. <bl...@us...> - 2005-02-27 16:50:54
|
Update of /cvsroot/cppunit/cppunit2/src/cpputtest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14477/src/cpputtest Modified Files: testbasicassertion.cpp testfunctor.cpp testtestcase.cpp testtestsuite.cpp Log Message: * catch any exceptions that the test may leak. Index: testbasicassertion.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/testbasicassertion.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** testbasicassertion.cpp 27 Feb 2005 16:30:34 -0000 1.8 --- testbasicassertion.cpp 27 Feb 2005 16:50:35 -0000 1.9 *************** *** 126,134 **** CPPUT_ASSERT_ASSERTION_FAIL(( CPPUT_ASSERT_NOT_EQUAL( "abc", std::string("abc") ) )); } ! catch ( CppUT::AbortingAssertionException &e ) { printf( "testBasicAssertions() failed: %s\n", e.what() ); return false; } return true; --- 126,139 ---- CPPUT_ASSERT_ASSERTION_FAIL(( CPPUT_ASSERT_NOT_EQUAL( "abc", std::string("abc") ) )); } ! catch ( const CppUT::AbortingAssertionException &e ) { printf( "testBasicAssertions() failed: %s\n", e.what() ); return false; } + catch ( ... ) + { + printf( "testBasicAssertions() failed (uncaught exception)." ); + return false; + } return true; Index: testtestsuite.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/testtestsuite.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** testtestsuite.cpp 27 Feb 2005 16:30:34 -0000 1.7 --- testtestsuite.cpp 27 Feb 2005 16:50:36 -0000 1.8 *************** *** 56,64 **** CPPUT_ASSERT( test2 == suite1->testAt(1), "returned test[1] is not added test" ); } ! catch ( CppUT::AbortingAssertionException &e ) { printf( "testTestsuite() failed: %s\n", e.what() ); return false; } return true; --- 56,69 ---- CPPUT_ASSERT( test2 == suite1->testAt(1), "returned test[1] is not added test" ); } ! catch ( const CppUT::AbortingAssertionException &e ) { printf( "testTestsuite() failed: %s\n", e.what() ); return false; } + catch ( ... ) + { + printf( "testTestsuite() failed (uncaught exception)." ); + return false; + } return true; Index: testtestcase.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/testtestcase.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** testtestcase.cpp 27 Feb 2005 16:30:34 -0000 1.14 --- testtestcase.cpp 27 Feb 2005 16:50:36 -0000 1.15 *************** *** 243,251 **** testParametrizedFixture(); } ! catch ( CppUT::AbortingAssertionException &e ) { printf( "testTestCase() failed: %s\n", e.what() ); return false; } return true; --- 243,256 ---- testParametrizedFixture(); } ! catch ( const CppUT::AbortingAssertionException &e ) { printf( "testTestCase() failed: %s\n", e.what() ); return false; } + catch ( ... ) + { + printf( "testTestCase() failed (uncaught exception)." ); + return false; + } return true; Index: testfunctor.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/testfunctor.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** testfunctor.cpp 27 Feb 2005 16:30:34 -0000 1.9 --- testfunctor.cpp 27 Feb 2005 16:50:36 -0000 1.10 *************** *** 241,249 **** testBindRef(); } ! catch ( CppUT::AbortingAssertionException &e ) { printf( "testFunctors() failed: %s\n", e.what() ); return false; } return true; --- 241,254 ---- testBindRef(); } ! catch ( const CppUT::AbortingAssertionException &e ) { printf( "testFunctors() failed: %s\n", e.what() ); return false; } + catch ( ... ) + { + printf( "testFunctors() failed (uncaught exception)." ); + return false; + } return true; |
From: Baptiste L. <bl...@us...> - 2005-02-27 16:30:49
|
Update of /cvsroot/cppunit/cppunit2/src/cpputtest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9420/src/cpputtest Modified Files: main.cpp testbasicassertion.cpp testfunctor.cpp testtestcase.cpp testtestsuite.cpp Log Message: * removed dependency on <iostream>. * added progress traces while running bootstrap tests. Index: testbasicassertion.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/testbasicassertion.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** testbasicassertion.cpp 23 Feb 2005 23:09:29 -0000 1.7 --- testbasicassertion.cpp 27 Feb 2005 16:30:34 -0000 1.8 *************** *** 1,4 **** #include <cpput/assert.h> ! #include <iostream> #include <stdexcept> --- 1,4 ---- #include <cpput/assert.h> ! #include <stdio.h> #include <stdexcept> *************** *** 13,17 **** catch ( ... ) { ! std::cout << "Test 1: CPPUT_ASSERT_THROW should not have thrown an exception" << std::endl; return false; } --- 13,17 ---- catch ( ... ) { ! printf( "Test 1: CPPUT_ASSERT_THROW should not have thrown an exception\n" ); return false; } *************** *** 21,25 **** { CPPUT_ASSERT_THROW( 1234, std::exception ); ! std::cout << "Test 2: expected AbortingAssertionException not thrown by CPPUT_ASSERT_THROW." << std::endl; return false; } --- 21,25 ---- { CPPUT_ASSERT_THROW( 1234, std::exception ); ! printf( "Test 2: expected AbortingAssertionException not thrown by CPPUT_ASSERT_THROW.\n" ); return false; } *************** *** 41,47 **** catch ( CppUT::AbortingAssertionException &e ) { ! std::cout << "Test 3: CPPUT_ASSERT_NO_THROW should not " ! "have thrown an exception." << std::endl ! << e.what() << std::endl; return false; } --- 41,46 ---- catch ( CppUT::AbortingAssertionException &e ) { ! printf( "Test 3: CPPUT_ASSERT_NO_THROW should not " ! "have thrown an exception.\n%s\n", e.what() ); return false; } *************** *** 51,56 **** { CPPUT_ASSERT_NO_THROW( throw std::runtime_error( "dummy" ) ); ! std::cout << "Test 4: expected AbortingAssertionException " ! "not thrown by CPPUT_ASSERT_THROW." << std::endl; return false; } --- 50,55 ---- { CPPUT_ASSERT_NO_THROW( throw std::runtime_error( "dummy" ) ); ! printf( "Test 4: expected AbortingAssertionException " ! "not thrown by CPPUT_ASSERT_THROW.\n" ); return false; } *************** *** 72,75 **** --- 71,75 ---- bool testBasicAssertions() { + printf( "Running bootstrap test: testBasicAssertions()...\n" ); if ( !testAssertThrow() ) return false; *************** *** 128,132 **** catch ( CppUT::AbortingAssertionException &e ) { ! std::cout << "testAssertions() failed: " << e.what() << std::endl; return false; } --- 128,132 ---- catch ( CppUT::AbortingAssertionException &e ) { ! printf( "testBasicAssertions() failed: %s\n", e.what() ); return false; } Index: main.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/main.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** main.cpp 27 Feb 2005 16:12:07 -0000 1.14 --- main.cpp 27 Feb 2005 16:30:28 -0000 1.15 *************** *** 1,5 **** #include <cpput/test.h> #include <cpput/testsuite.h> ! #include <iostream> #include "assertenumtest.h" #include "assertstringtest.h" --- 1,5 ---- #include <cpput/test.h> #include <cpput/testsuite.h> ! #include <stdio.h> #include "assertenumtest.h" #include "assertstringtest.h" *************** *** 38,46 **** if ( !bootStrapSuccess ) { ! std::cout << "bootstrap tests failed..." << std::endl; return 1; } ! std::cout << "All bootstrap tests passed successfuly..." << std::endl; CppUT::TestSuitePtr allSuite = CppUT::makeTestSuite( "All tests" ); --- 38,46 ---- if ( !bootStrapSuccess ) { ! printf( "bootstrap tests failed...\n" ); return 1; } ! printf( "All bootstrap tests passed successfuly...\n" ); CppUT::TestSuitePtr allSuite = CppUT::makeTestSuite( "All tests" ); Index: testtestsuite.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/testtestsuite.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** testtestsuite.cpp 20 Nov 2004 15:26:38 -0000 1.6 --- testtestsuite.cpp 27 Feb 2005 16:30:34 -0000 1.7 *************** *** 2,6 **** #include <cpput/testcase.h> #include <cpput/testsuite.h> ! #include <iostream> #include "mocktestvisitor.h" --- 2,6 ---- #include <cpput/testcase.h> #include <cpput/testsuite.h> ! #include <stdio.h> #include "mocktestvisitor.h" *************** *** 30,33 **** --- 30,34 ---- bool testTestSuite() { + printf( "Running bootstrap test: testTestSuite()...\n" ); try { *************** *** 57,61 **** catch ( CppUT::AbortingAssertionException &e ) { ! std::cout << "testTestsuite() failed: " << e.what() << std::endl; return false; } --- 58,62 ---- catch ( CppUT::AbortingAssertionException &e ) { ! printf( "testTestsuite() failed: %s\n", e.what() ); return false; } Index: testtestcase.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/testtestcase.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** testtestcase.cpp 27 Feb 2005 14:38:28 -0000 1.13 --- testtestcase.cpp 27 Feb 2005 16:30:34 -0000 1.14 *************** *** 1,5 **** #include <cpput/assert.h> #include <cpput/testcase.h> ! #include <iostream> #include <stdexcept> #include "mocktestvisitor.h" --- 1,5 ---- #include <cpput/assert.h> #include <cpput/testcase.h> ! #include <stdio.h> #include <stdexcept> #include "mocktestvisitor.h" *************** *** 231,234 **** --- 231,235 ---- bool testTestCase() { + printf( "Running bootstrap test: testTestCase()...\n" ); try { *************** *** 244,248 **** catch ( CppUT::AbortingAssertionException &e ) { ! std::cout << "testTestCase() failed: " << e.what() << std::endl; return false; } --- 245,249 ---- catch ( CppUT::AbortingAssertionException &e ) { ! printf( "testTestCase() failed: %s\n", e.what() ); return false; } Index: testfunctor.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/testfunctor.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** testfunctor.cpp 27 Feb 2005 14:38:28 -0000 1.8 --- testfunctor.cpp 27 Feb 2005 16:30:34 -0000 1.9 *************** *** 1,5 **** #include <cpput/assert.h> #include <cpptl/functor.h> ! #include <iostream> --- 1,5 ---- #include <cpput/assert.h> #include <cpptl/functor.h> ! #include <stdio.h> *************** *** 227,230 **** --- 227,231 ---- bool testFunctors() { + printf( "Running bootstrap test: testFunctors()...\n" ); try { *************** *** 242,246 **** catch ( CppUT::AbortingAssertionException &e ) { ! std::cout << "testFunctors() failed: " << e.what() << std::endl; return false; } --- 243,247 ---- catch ( CppUT::AbortingAssertionException &e ) { ! printf( "testFunctors() failed: %s\n", e.what() ); return false; } |
From: Baptiste L. <bl...@us...> - 2005-02-27 16:12:23
|
Update of /cvsroot/cppunit/cppunit2/src/cpputtest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3706/src/cpputtest Modified Files: cpputtest.vcproj main.cpp minitestrunner.h SConscript testfixturetest.cpp testfixturetest.h Log Message: * ported the TestFixture tests back to the new framework architecture. Index: testfixturetest.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/testfixturetest.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** testfixturetest.h 17 Nov 2004 08:59:34 -0000 1.4 --- testfixturetest.h 27 Feb 2005 16:12:08 -0000 1.5 *************** *** 3,11 **** # include <cpput/assert.h> - # include <cpput/testcase.h> - # include <cpput/testsuite.h> - # include <cpput/testcontext.h> # include <cpput/testfixture.h> - # include <cpput/testrunresult.h> --- 3,7 ---- Index: main.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/main.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** main.cpp 27 Feb 2005 15:27:09 -0000 1.13 --- main.cpp 27 Feb 2005 16:12:07 -0000 1.14 *************** *** 7,11 **** #include "registrytest.h" #include "enumeratortest.h" ! //#include "testfixturetest.h" #include <cpput/testrunner.h> // cppunit2 testrunner for opentest --- 7,11 ---- #include "registrytest.h" #include "enumeratortest.h" ! #include "testfixturetest.h" #include <cpput/testrunner.h> // cppunit2 testrunner for opentest *************** *** 46,50 **** CppUT::TestSuitePtr allSuite = CppUT::makeTestSuite( "All tests" ); allSuite->add( RegistryTest::suite() ); ! // allSuite->add( TestFixtureTest::suite() ); allSuite->add( AssertStringTest::suite() ); allSuite->add( EnumeratorTest::suite() ); --- 46,50 ---- CppUT::TestSuitePtr allSuite = CppUT::makeTestSuite( "All tests" ); allSuite->add( RegistryTest::suite() ); ! allSuite->add( TestFixtureTest::suite() ); allSuite->add( AssertStringTest::suite() ); allSuite->add( EnumeratorTest::suite() ); Index: minitestrunner.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/minitestrunner.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** minitestrunner.h 27 Feb 2005 15:47:38 -0000 1.1 --- minitestrunner.h 27 Feb 2005 16:12:07 -0000 1.2 *************** *** 15,38 **** void run( CppUT::TestPtr test ) { ! if ( test->isTestSuite() ) ! run( CppTL::staticPointerCast<CppUT::TestSuite>( test ) ); ! else ! run( CppTL::staticPointerCast<CppUT::AbstractTestCase>( test ) ); } void run( CppUT::AbstractTestCasePtr test ) { ! ++tested_; ! if ( test->runTest() ) ! ++passed_; ! else ! ++failed_; } void run( CppUT::TestSuitePtr suite ) { ! ++suite_; ! for ( int index =0; index < suite->testCount(); ++index ) ! run( suite->testAt( index ) ); } --- 15,32 ---- void run( CppUT::TestPtr test ) { ! // This override prevent errors occuring during testing to ! // count has failure of the test running that testing. ! CppUT::TestInfo::ScopedContextOverride override; ! doRun( test ); } void run( CppUT::AbstractTestCasePtr test ) { ! run( CppTL::staticPointerCast<CppUT::Test>( test ) ); } void run( CppUT::TestSuitePtr suite ) { ! run( CppTL::staticPointerCast<CppUT::Test>( suite ) ); } *************** *** 49,52 **** --- 43,71 ---- int passed_; int failed_; + + private: + void doRun( CppUT::TestPtr test ) + { + if ( test->isTestSuite() ) + doRun( CppTL::staticPointerCast<CppUT::TestSuite>( test ) ); + else + doRun( CppTL::staticPointerCast<CppUT::AbstractTestCase>( test ) ); + } + + void doRun( CppUT::AbstractTestCasePtr test ) + { + ++tested_; + if ( test->runTest() ) + ++passed_; + else + ++failed_; + } + + void doRun( CppUT::TestSuitePtr suite ) + { + ++suite_; + for ( int index =0; index < suite->testCount(); ++index ) + doRun( suite->testAt( index ) ); + } }; Index: cpputtest.vcproj =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/cpputtest.vcproj,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** cpputtest.vcproj 27 Feb 2005 15:47:38 -0000 1.14 --- cpputtest.vcproj 27 Feb 2005 16:12:07 -0000 1.15 *************** *** 221,232 **** RelativePath="testfixturetest.cpp"> <FileConfiguration ! Name="Release|Win32" ! ExcludedFromBuild="TRUE"> <Tool Name="VCCLCompilerTool"/> </FileConfiguration> <FileConfiguration ! Name="Debug|Win32" ! ExcludedFromBuild="TRUE"> <Tool Name="VCCLCompilerTool"/> --- 221,230 ---- RelativePath="testfixturetest.cpp"> <FileConfiguration ! Name="Release|Win32"> <Tool Name="VCCLCompilerTool"/> </FileConfiguration> <FileConfiguration ! Name="Debug|Win32"> <Tool Name="VCCLCompilerTool"/> Index: testfixturetest.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/testfixturetest.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** testfixturetest.cpp 17 Nov 2004 08:59:34 -0000 1.4 --- testfixturetest.cpp 27 Feb 2005 16:12:08 -0000 1.5 *************** *** 1,3 **** --- 1,4 ---- #include "testfixturetest.h" + #include "minitestrunner.h" #include <set> *************** *** 146,150 **** const CppUT::TestSuitePtr &suite ) { ! suite->add( CppUT::makeTestCase( CppUT::makeMemFn0( fixture, testMethod ), testName ) ); } --- 147,151 ---- const CppUT::TestSuitePtr &suite ) { ! suite->add( CppUT::makeTestCase( CppTL::memfn0( fixture, testMethod ), testName ) ); } *************** *** 155,163 **** { CppUT::TestPtr suite = EmptyFixture::suite(); ! CppUT::TestContext context; ! CppUT::TestRunResult result; ! context.add( result ); ! suite->run( context ); ! CPPUT_ASSERT_EQUAL( 0, result.testCount() ); } --- 156,162 ---- { CppUT::TestPtr suite = EmptyFixture::suite(); ! MiniTestRunner runner; ! runner.run( suite ); ! CPPUT_ASSERT_EQUAL( 0, runner.tested_ ); } *************** *** 167,176 **** { CppUT::TestPtr suite = TwoTestFixture::suite(); ! CppUT::TestContext context; ! CppUT::TestRunResult result; ! context.add( result ); ! suite->run( context ); ! CPPUT_ASSERT_EQUAL( 2, result.testCount() ); ! CPPUT_ASSERT_EQUAL( 1, result.failureCount() ); } --- 166,173 ---- { CppUT::TestPtr suite = TwoTestFixture::suite(); ! MiniTestRunner runner; ! runner.run( suite ); ! CPPUT_ASSERT_EQUAL( 2, runner.tested_ ); ! CPPUT_ASSERT_EQUAL( 1, runner.failed_ ); } *************** *** 180,189 **** { CppUT::TestPtr suite = ExtendTestFixture::suite(); ! CppUT::TestContext context; ! CppUT::TestRunResult result; ! context.add( result ); ! suite->run( context ); ! CPPUT_ASSERT_EQUAL( 3, result.testCount() ); ! CPPUT_ASSERT_EQUAL( 2, result.failureCount() ); } --- 177,184 ---- { CppUT::TestPtr suite = ExtendTestFixture::suite(); ! MiniTestRunner runner; ! runner.run( suite ); ! CPPUT_ASSERT_EQUAL( 3, runner.tested_ ); ! CPPUT_ASSERT_EQUAL( 2, runner.failed_ ); } *************** *** 193,202 **** { CppUT::TestPtr suite = ConcretTestFixture::suite(); ! CppUT::TestContext context; ! CppUT::TestRunResult result; ! context.add( result ); ! suite->run( context ); ! CPPUT_ASSERT_EQUAL( 3, result.testCount() ); ! CPPUT_ASSERT_EQUAL( 3, result.failureCount() ); } --- 188,195 ---- { CppUT::TestPtr suite = ConcretTestFixture::suite(); ! MiniTestRunner runner; ! runner.run( suite ); ! CPPUT_ASSERT_EQUAL( 3, runner.tested_ ); ! CPPUT_ASSERT_EQUAL( 3, runner.failed_ ); } *************** *** 206,216 **** { CppUT::TestPtr suite = NoSharedFixtureTest::suite(); ! CppUT::TestContext context; ! CppUT::TestRunResult result; ! context.add( result ); SharedFixtureTestBase::instances_.clear(); ! suite->run( context ); ! CPPUT_ASSERT_EQUAL( 3, result.testCount() ); ! CPPUT_ASSERT_EQUAL( 0, result.failureCount() ); CPPUT_ASSERT_EQUAL( 3, int(SharedFixtureTestBase::instances_.size() ) ); } --- 199,207 ---- { CppUT::TestPtr suite = NoSharedFixtureTest::suite(); ! MiniTestRunner runner; SharedFixtureTestBase::instances_.clear(); ! runner.run( suite ); ! CPPUT_ASSERT_EQUAL( 3, runner.tested_ ); ! CPPUT_ASSERT_EQUAL( 0, runner.failed_ ); CPPUT_ASSERT_EQUAL( 3, int(SharedFixtureTestBase::instances_.size() ) ); } *************** *** 221,231 **** { CppUT::TestPtr suite = SharedFixtureTest::suite(); ! CppUT::TestContext context; ! CppUT::TestRunResult result; ! context.add( result ); SharedFixtureTestBase::instances_.clear(); ! suite->run( context ); ! CPPUT_ASSERT_EQUAL( 3, result.testCount() ); ! CPPUT_ASSERT_EQUAL( 0, result.failureCount() ); CPPUT_ASSERT_EQUAL( 1, int(SharedFixtureTestBase::instances_.size() ) ); } --- 212,220 ---- { CppUT::TestPtr suite = SharedFixtureTest::suite(); ! MiniTestRunner runner; SharedFixtureTestBase::instances_.clear(); ! runner.run( suite ); ! CPPUT_ASSERT_EQUAL( 3, runner.tested_ ); ! CPPUT_ASSERT_EQUAL( 0, runner.failed_ ); CPPUT_ASSERT_EQUAL( 1, int(SharedFixtureTestBase::instances_.size() ) ); } Index: SConscript =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/SConscript,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** SConscript 27 Feb 2005 15:27:09 -0000 1.5 --- SConscript 27 Feb 2005 16:12:08 -0000 1.6 *************** *** 12,16 **** testbasicassertion.cpp testfunctor.cpp ! testfunctor3.cpp testtestcase.cpp testtestsuite.cpp --- 12,16 ---- testbasicassertion.cpp testfunctor.cpp ! testfixturetest.cpp testtestcase.cpp testtestsuite.cpp |
From: Baptiste L. <bl...@us...> - 2005-02-27 15:48:02
|
Update of /cvsroot/cppunit/cppunit2/include/cpput In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28959/include/cpput Modified Files: forwards.h Log Message: * extracted MiniTestRunner from registry test. Index: forwards.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/forwards.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** forwards.h 27 Feb 2005 10:14:28 -0000 1.14 --- forwards.h 27 Feb 2005 15:47:37 -0000 1.15 *************** *** 21,30 **** class TestVisitor; ! typedef CppTL::SharedPtr<Test> TestPtr; typedef CppTL::SharedPtr<ExceptionGuardElement> ExceptionGuardElementPtr; typedef CppTL::SharedPtr<TestInfoData> TestInfoDataPtr; - typedef CppTL::SharedPtr<AbstractTestSuite> AbstractTestSuitePtr; - typedef CppTL::SharedPtr<TestResultUpdater> TestResultUpdaterPtr; typedef CppTL::SharedPtr<TestSuite> TestSuitePtr; --- 21,31 ---- 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; |
From: Baptiste L. <bl...@us...> - 2005-02-27 15:48:01
|
Update of /cvsroot/cppunit/cppunit2/src/cpputtest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28959/src/cpputtest Modified Files: cpputtest.vcproj registrytest.cpp Added Files: minitestrunner.h Log Message: * extracted MiniTestRunner from registry test. Index: registrytest.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/registrytest.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** registrytest.cpp 27 Feb 2005 15:27:09 -0000 1.3 --- registrytest.cpp 27 Feb 2005 15:47:38 -0000 1.4 *************** *** 1,5 **** #include "registrytest.h" ! #include <cpput/testcase.h> ! #include <cpput/testsuite.h> --- 1,4 ---- #include "registrytest.h" ! #include "minitestrunner.h" *************** *** 95,106 **** RegistryTest::runTestSuite( CppUT::TestSuitePtr suite ) { ! for ( int index =0; index < suite->testCount(); ++index ) ! { ! CppUT::TestPtr test = suite->testAt(index); ! if ( test->isTestSuite() ) ! runTestSuite( CppTL::staticPointerCast<CppUT::TestSuite>( test ) ); ! else ! CppTL::staticPointerCast<CppUT::AbstractTestCase>( test )->runTest(); ! } } --- 94,99 ---- RegistryTest::runTestSuite( CppUT::TestSuitePtr suite ) { ! MiniTestRunner runner; ! runner.run( suite ); } --- NEW FILE: minitestrunner.h --- #ifndef CPPUTTEST_MINITESTRUNNER_H_INCLUDED # define CPPUTTEST_MINITESTRUNNER_H_INCLUDED # include <cpput/testcase.h> # include <cpput/testsuite.h> class MiniTestRunner { public: MiniTestRunner() { reset(); } void run( CppUT::TestPtr test ) { if ( test->isTestSuite() ) run( CppTL::staticPointerCast<CppUT::TestSuite>( test ) ); else run( CppTL::staticPointerCast<CppUT::AbstractTestCase>( test ) ); } void run( CppUT::AbstractTestCasePtr test ) { ++tested_; if ( test->runTest() ) ++passed_; else ++failed_; } void run( CppUT::TestSuitePtr suite ) { ++suite_; for ( int index =0; index < suite->testCount(); ++index ) run( suite->testAt( index ) ); } void reset() { suite_ = 0; tested_ = 0; passed_ = 0; failed_ = 0; } int suite_; int tested_; int passed_; int failed_; }; #endif // CPPUTTEST_MINITESTRUNNER_H_INCLUDED Index: cpputtest.vcproj =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/cpputtest.vcproj,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** cpputtest.vcproj 27 Feb 2005 15:27:09 -0000 1.13 --- cpputtest.vcproj 27 Feb 2005 15:47:38 -0000 1.14 *************** *** 185,188 **** --- 185,191 ---- </File> <File + RelativePath=".\minitestrunner.h"> + </File> + <File RelativePath=".\mocktestlistener.h"> </File> |
From: Baptiste L. <bl...@us...> - 2005-02-27 15:27:17
|
Update of /cvsroot/cppunit/cppunit2/src/cpputtest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23414/src/cpputtest Modified Files: cpputtest.vcproj main.cpp registrytest.cpp registrytest.h SConscript Log Message: * ported the Registry tests back to the new framework architecture. Index: registrytest.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/registrytest.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** registrytest.h 17 Nov 2004 08:59:34 -0000 1.3 --- registrytest.h 27 Feb 2005 15:27:09 -0000 1.4 *************** *** 36,39 **** --- 36,41 ---- void runTest( const std::string &testName ); + void runTestSuite( CppUT::TestSuitePtr suite ); + CppUT::TestFactory makeTestFactory( const std::string &testName ); Index: SConscript =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/SConscript,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SConscript 26 Feb 2005 11:40:58 -0000 1.4 --- SConscript 27 Feb 2005 15:27:09 -0000 1.5 *************** *** 8,12 **** assertstringtest.cpp enumeratortest.cpp ! main.cpp testbasicassertion.cpp testfunctor.cpp --- 8,13 ---- assertstringtest.cpp enumeratortest.cpp ! main.cpp ! registrytest.cpp testbasicassertion.cpp testfunctor.cpp Index: registrytest.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/registrytest.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** registrytest.cpp 17 Nov 2004 21:47:10 -0000 1.2 --- registrytest.cpp 27 Feb 2005 15:27:09 -0000 1.3 *************** *** 1,5 **** #include "registrytest.h" #include <cpput/testcase.h> ! #include <cpput/testcontext.h> --- 1,5 ---- #include "registrytest.h" #include <cpput/testcase.h> ! #include <cpput/testsuite.h> *************** *** 36,41 **** CppUT::TestSuitePtr suite = registry_->createDefaultTests(); ! CppUT::TestContext context; ! suite->run( context ); CPPUT_ASSERT_EQUAL( 1, testNames_.count( "Test1" ) ); CPPUT_ASSERT_EQUAL( 1, testNames_.count( "Test2" ) ); --- 36,41 ---- CppUT::TestSuitePtr suite = registry_->createDefaultTests(); ! runTestSuite( suite ); ! CPPUT_ASSERT_EQUAL( 1, testNames_.count( "Test1" ) ); CPPUT_ASSERT_EQUAL( 1, testNames_.count( "Test2" ) ); *************** *** 53,63 **** CppUT::TestSuitePtr suite2 = registry_->createTests( "Name2" ); ! CppUT::TestContext context; ! suite->run( context ); CPPUT_ASSERT_EQUAL( 1, testNames_.count( "Test1" ) ); CPPUT_ASSERT_EQUAL( 1, testNames_.count( "Test2" ) ); CPPUT_ASSERT_EQUAL( 0, testNames_.count( "Test3" ) ); ! suite2->run( context ); CPPUT_ASSERT_EQUAL( 1, testNames_.count( "Test3" ) ); } --- 53,62 ---- CppUT::TestSuitePtr suite2 = registry_->createTests( "Name2" ); ! runTestSuite( suite ); CPPUT_ASSERT_EQUAL( 1, testNames_.count( "Test1" ) ); CPPUT_ASSERT_EQUAL( 1, testNames_.count( "Test2" ) ); CPPUT_ASSERT_EQUAL( 0, testNames_.count( "Test3" ) ); ! runTestSuite( suite2 ); CPPUT_ASSERT_EQUAL( 1, testNames_.count( "Test3" ) ); } *************** *** 75,80 **** CppUT::TestSuitePtr suite = registry_->createTests( "Name" ); ! CppUT::TestContext context; ! suite->run( context ); CPPUT_ASSERT_EQUAL( 1, testNames_.count( "Test1" ) ); CPPUT_ASSERT_EQUAL( 1, testNames_.count( "Test2" ) ); --- 74,78 ---- CppUT::TestSuitePtr suite = registry_->createTests( "Name" ); ! runTestSuite( suite ); CPPUT_ASSERT_EQUAL( 1, testNames_.count( "Test1" ) ); CPPUT_ASSERT_EQUAL( 1, testNames_.count( "Test2" ) ); *************** *** 87,94 **** RegistryTest::makeTest( const std::string &testName ) { ! return CppUT::makeTestCase( CppUT::bind1( ! CppUT::makeMemFn1( this, ! &RegistryTest::runTest), ! testName ), testName ); } --- 85,91 ---- RegistryTest::makeTest( const std::string &testName ) { ! return CppUT::makeTestCase( CppTL::bind_memfn( this, ! &RegistryTest::runTest, ! testName ), testName ); } *************** *** 96,99 **** --- 93,110 ---- void + RegistryTest::runTestSuite( CppUT::TestSuitePtr suite ) + { + for ( int index =0; index < suite->testCount(); ++index ) + { + CppUT::TestPtr test = suite->testAt(index); + if ( test->isTestSuite() ) + runTestSuite( CppTL::staticPointerCast<CppUT::TestSuite>( test ) ); + else + CppTL::staticPointerCast<CppUT::AbstractTestCase>( test )->runTest(); + } + } + + + void RegistryTest::runTest( const std::string &testName ) { *************** *** 105,110 **** RegistryTest::makeTestFactory( const std::string &testName ) { ! return CppUT::bindR1( CppUT::makeMemFnR1<CppUT::TestPtr>( ! this, &RegistryTest::makeTest ), ! testName ); } --- 116,119 ---- RegistryTest::makeTestFactory( const std::string &testName ) { ! return CppTL::bind_memfnr( this, &RegistryTest::makeTest, testName ); } Index: main.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/main.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** main.cpp 27 Feb 2005 14:38:28 -0000 1.12 --- main.cpp 27 Feb 2005 15:27:09 -0000 1.13 *************** *** 5,9 **** #include "assertstringtest.h" #include "commandlineoptionstest.h" ! //#include "registrytest.h" #include "enumeratortest.h" //#include "testfixturetest.h" --- 5,9 ---- #include "assertstringtest.h" #include "commandlineoptionstest.h" ! #include "registrytest.h" #include "enumeratortest.h" //#include "testfixturetest.h" *************** *** 45,49 **** CppUT::TestSuitePtr allSuite = CppUT::makeTestSuite( "All tests" ); ! // allSuite->add( RegistryTest::suite() ); // allSuite->add( TestFixtureTest::suite() ); allSuite->add( AssertStringTest::suite() ); --- 45,49 ---- CppUT::TestSuitePtr allSuite = CppUT::makeTestSuite( "All tests" ); ! allSuite->add( RegistryTest::suite() ); // allSuite->add( TestFixtureTest::suite() ); allSuite->add( AssertStringTest::suite() ); Index: cpputtest.vcproj =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/cpputtest.vcproj,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** cpputtest.vcproj 27 Feb 2005 14:38:28 -0000 1.12 --- cpputtest.vcproj 27 Feb 2005 15:27:09 -0000 1.13 *************** *** 193,204 **** RelativePath="registrytest.cpp"> <FileConfiguration ! Name="Release|Win32" ! ExcludedFromBuild="TRUE"> <Tool Name="VCCLCompilerTool"/> </FileConfiguration> <FileConfiguration ! Name="Debug|Win32" ! ExcludedFromBuild="TRUE"> <Tool Name="VCCLCompilerTool"/> --- 193,202 ---- RelativePath="registrytest.cpp"> <FileConfiguration ! Name="Release|Win32"> <Tool Name="VCCLCompilerTool"/> </FileConfiguration> <FileConfiguration ! Name="Debug|Win32"> <Tool Name="VCCLCompilerTool"/> |
From: Baptiste L. <bl...@us...> - 2005-02-27 15:26:36
|
Update of /cvsroot/cppunit/cppunit2/include/cpptl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23202/include/cpptl Modified Files: conststring.h Log Message: * fixed bug in ConstString copy constructor for length == 0 Index: conststring.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpptl/conststring.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** conststring.h 27 Feb 2005 10:11:45 -0000 1.2 --- conststring.h 27 Feb 2005 15:26:27 -0000 1.3 *************** *** 9,12 **** --- 9,14 ---- # endif + /// @todo optimize case where length == 0 in ConstString constructor. + namespace CppTL { class StringConcatenator *************** *** 618,624 **** ConstString::ConstString( const ConstString &other ) : length_( other.length_ ) { ! buffer_ = new value_type[length_+1]; ! memcpy( buffer_, other.buffer_, length_+1 ); } --- 620,630 ---- ConstString::ConstString( const ConstString &other ) : length_( other.length_ ) + , buffer_( 0 ) { ! if ( length_ > 0 ) ! { ! buffer_ = new value_type[length_+1]; ! memcpy( buffer_, other.buffer_, length_+1 ); ! } } |
From: Baptiste L. <bl...@us...> - 2005-02-27 14:39:05
|
Update of /cvsroot/cppunit/cppunit2/include/cpptl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11085/include/cpptl Modified Files: forwards.h functor.h functor.py Log Message: * changed cppunit 2 to use the new functors (cpptl/functor.h). bind_cfn & bind_memfn simplified some of the test code. Index: forwards.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpptl/forwards.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** forwards.h 27 Feb 2005 10:14:03 -0000 1.2 --- forwards.h 27 Feb 2005 14:38:25 -0000 1.3 *************** *** 23,26 **** --- 23,28 ---- // functor.h class Functor0; + template<class ReturnType> + class Functor0R; Index: functor.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpptl/functor.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** functor.h 26 Feb 2005 11:40:58 -0000 1.2 --- functor.h 27 Feb 2005 14:38:25 -0000 1.3 *************** *** 1028,1031 **** --- 1028,1054 ---- } + template< class Functor, class Arg1 > + inline Functor0 + bind( Functor functor, Arg1 a1 ) + { + return fn0( bind1( functor, a1 ) ); + } + + template< class Arg1, class FA1 > + inline Functor0 + bind_cfn( void (*function)( FA1 ), Arg1 a1 ) + { + return fn0( bind1( cfn1( function ), a1 ) ); + } + + template< class Holder, class Object, class Arg1, class FA1 > + inline Functor0 + bind_memfn( const Holder &holder, + void (Object::*member)( FA1 ), + Arg1 a1 ) + { + return fn0( bind1( memfn1( holder, member ), a1 ) ); + } + // Functor1R *************** *** 1067,1070 **** --- 1090,1116 ---- } + template< class Functor, class Arg1 > + inline Functor0R<CPPTL_TYPENAME Functor::result_type> + bindr( Functor functor, Arg1 a1 ) + { + return fn0r( bind1r( functor, a1 ) ); + } + + template< class Return, class Arg1, class FA1 > + inline Functor0R<Return> + bind_cfnr( Return (*function)( FA1 ), Arg1 a1 ) + { + return fn0r( bind1r( cfn1r( function ), a1 ) ); + } + + template< class Holder, class Object, class Return, class Arg1, class FA1 > + inline Functor0R<Return> + bind_memfnr( const Holder &holder, + Return (Object::*member)( FA1 ), + Arg1 a1 ) + { + return fn0r( bind1r( memfn1r( holder, member ), a1 ) ); + } + // Functor2 *************** *** 1106,1109 **** --- 1152,1178 ---- } + template< class Functor, class Arg1, class Arg2 > + inline Functor0 + bind( Functor functor, Arg1 a1, Arg2 a2 ) + { + return fn0( bind1( bind2( functor, a2 ), a1 ) ); + } + + template< class Arg1, class Arg2, class FA1, class FA2 > + inline Functor0 + bind_cfn( void (*function)( FA1, FA2 ), Arg1 a1, Arg2 a2 ) + { + return fn0( bind1( bind2( cfn2( function ), a2 ), a1 ) ); + } + + template< class Holder, class Object, class Arg1, class Arg2, class FA1, class FA2 > + inline Functor0 + bind_memfn( const Holder &holder, + void (Object::*member)( FA1, FA2 ), + Arg1 a1, Arg2 a2 ) + { + return fn0( bind1( bind2( memfn2( holder, member ), a2 ), a1 ) ); + } + // Functor2R *************** *** 1149,1152 **** --- 1218,1244 ---- } + template< class Functor, class Arg1, class Arg2 > + inline Functor0R<CPPTL_TYPENAME Functor::result_type> + bindr( Functor functor, Arg1 a1, Arg2 a2 ) + { + return fn0r( bind1r( bind2r( functor, a2 ), a1 ) ); + } + + template< class Return, class Arg1, class Arg2, class FA1, class FA2 > + inline Functor0R<Return> + bind_cfnr( Return (*function)( FA1, FA2 ), Arg1 a1, Arg2 a2 ) + { + return fn0r( bind1r( bind2r( cfn2r( function ), a2 ), a1 ) ); + } + + template< class Holder, class Object, class Return, class Arg1, class Arg2, class FA1, class FA2 > + inline Functor0R<Return> + bind_memfnr( const Holder &holder, + Return (Object::*member)( FA1, FA2 ), + Arg1 a1, Arg2 a2 ) + { + return fn0r( bind1r( bind2r( memfn2r( holder, member ), a2 ), a1 ) ); + } + Index: functor.py =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpptl/functor.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** functor.py 26 Feb 2005 11:40:58 -0000 1.2 --- functor.py 27 Feb 2005 14:38:25 -0000 1.3 *************** *** 349,352 **** --- 349,391 ---- # ,BindArg + multi_bind_generator = \ + """%(multi_bind_template_decl)s + inline %(multi_bind_functor_instantiation)s + %(multi_bind)s( Functor functor, %(fn_parameters)s ) + { + return %(multi_bind_fn)s( %(multi_functor_generation)s ); + } + + %(multi_bind_cfn_template_decl)s + inline %(multi_bind_cfn_instantiation)s + %(multi_bind_cfn)s( %(return_type)s (*function)( %(multi_bind_fn_parameter_types)s ), %(fn_parameters)s ) + { + return %(multi_bind_fn)s( %(multi_cfn_functor_generation)s ); + } + + %(multi_bind_memfn_template_decl)s + inline %(multi_bind_cfn_instantiation)s + %(multi_bind_memfn)s( const Holder &holder, + %(return_type)s (Object::*member)( %(multi_bind_fn_parameter_types)s ), + %(fn_parameters)s ) + { + return %(multi_bind_fn)s( %(multi_memfn_functor_generation)s ); + } + + """ + # multi_bind_template_decl : template<class Functor, class Return, class Arg1> + # multi_bind_functor_instantiation : Functor0R<CPPTL_TYPENAME Functor::result_type> + # multi_bind : bindr + # multi_bind_fn : fn0r + # multi_functor_generation : bind1r( bind2r( functor, a2 ), a1 ) + # multi_bind_cfn_template_decl : template<class Return, class FA1, class FA2, class Arg1, class Arg2> + # multi_bind_cfn_instantiation : Functor0R<Return> + # multi_bind_cfn : bind_cfnr + # multi_bind_fn_parameter_types : Arg1, Arg2 + # multi_cfn_functor_generation : bind1r( bind2r( cfn2r(function), a2 ), a1 ) + # multi_bind_memfn_template_decl : template<class Holder, class Object, class Return, class FA1, class FA2, class Arg1, class Arg2> + # multi_bind_memfn : bind_memfnr + # multi_memfn_functor_generation : bind1r( bind2r( memfn2r(member), a2 ), a1 ) + *************** *** 364,368 **** if not is_void: base_template_parameters.append( 'Return' ) ! base_template_parameters.extend( [ 'Arg%d' % n for n in xrange(1,count+1) ] ) self.base_template_decl = self.makeTemplateDecl( base_template_parameters ) self.impl_base_instantiation = self.impl_base + self.makeTemplateInstantiation( base_template_parameters ) --- 403,408 ---- if not is_void: base_template_parameters.append( 'Return' ) ! args_template_parameters = [ 'Arg%d' % n for n in xrange(1,count+1) ] ! base_template_parameters.extend( args_template_parameters ) self.base_template_decl = self.makeTemplateDecl( base_template_parameters ) self.impl_base_instantiation = self.impl_base + self.makeTemplateInstantiation( base_template_parameters ) *************** *** 410,413 **** --- 450,479 ---- bind_functor_deduced_types = ['Functor'] + functor_deduced_types + ['BindArg'] self.bind_functor_deduced_types = '<' + '\n ,'.join( bind_functor_deduced_types ) + ' >' + self.multi_bind_template_decl = self.makeTemplateDecl( ['Functor'] + args_template_parameters ) + if is_void: + self.multi_bind_functor_instantiation = 'Functor0' + self.multi_bind_cfn_instantiation = self.multi_bind_functor_instantiation + else: + self.multi_bind_functor_instantiation = 'Functor0R<CPPTL_TYPENAME Functor::result_type>' + self.multi_bind_cfn_instantiation = 'Functor0R<Return>' + self.multi_bind = 'bind%s' % return_suffix.lower() + self.multi_bind_fn = 'fn0%s' % return_suffix.lower() + self.multi_functor_generation = self.generateMultiBindFunctor( count, + 'bind%d' + return_suffix.lower(), + 'functor' ) + multi_bind_fn_types = [ 'FA%d' % n for n in xrange(1,count+1) ] + multi_bind_cfn_template_parameters = base_template_parameters + multi_bind_fn_types + self.multi_bind_cfn_template_decl = self.makeTemplateDecl( multi_bind_cfn_template_parameters ) + self.multi_bind_cfn = 'bind_cfn%s' % return_suffix.lower() + self.multi_bind_fn_parameter_types = ', '.join( multi_bind_fn_types ) + self.multi_cfn_functor_generation = self.generateMultiBindFunctor( count, + 'bind%d' + return_suffix.lower(), + self.cfn + '( function )' ) + multi_bind_memfn_template_parameters = ['Holder','Object'] + multi_bind_cfn_template_parameters + self.multi_bind_memfn_template_decl = self.makeTemplateDecl( multi_bind_memfn_template_parameters ) + self.multi_bind_memfn = 'bind_memfn%s' % return_suffix.lower() + self.multi_memfn_functor_generation = self.generateMultiBindFunctor( count, + 'bind%d' + return_suffix.lower(), + self.memfn + '( holder, member )' ) def __getitem__( self, key ): *************** *** 424,428 **** return '< ' + ', '.join( parameters ) + ' >' ! def getFunctorArgTypeName( self, n ): names = [ 'arg%d_type' % n ] if n == 1: --- 490,494 ---- return '< ' + ', '.join( parameters ) + ' >' ! def getFunctorArgTypeNames( self, n ): names = [ 'arg%d_type' % n ] if n == 1: *************** *** 430,443 **** elif n == 2: names.append( 'second_argument_type' ) ! return names[-1] def makeArgumentTypedef( self, n ): ! names = [ 'arg%d_type' % n ] ! if n == 1: ! names.append( 'first_argument_type' ) ! elif n == 2: ! names.append( 'second_argument_type' ) return '\n'.join( [ ' typedef Arg%d %s;' % (n, name) for name in names ] ) + '\n' functors_impl = '' functors = '' --- 496,516 ---- elif n == 2: names.append( 'second_argument_type' ) ! return names ! ! def getFunctorArgTypeName( self, n ): ! return self.getFunctorArgTypeNames(n)[-1] def makeArgumentTypedef( self, n ): ! names = self.getFunctorArgTypeNames(n) return '\n'.join( [ ' typedef Arg%d %s;' % (n, name) for name in names ] ) + '\n' + def generateMultiBindFunctor( self, n, bind_fn, bind_args ): + functor = bind_args + while n > 0: + functor = (bind_fn % n) + '( ' + functor + ', a%d' % n + ' )' + n -= 1 + return functor + + functors_impl = '' functors = '' *************** *** 453,456 **** --- 526,531 ---- functors += functor % parameters functor_generators += generator % parameters + if argument_count > 0: + functor_generators += multi_bind_generator % parameters final_header = header % locals() |
From: Baptiste L. <bl...@us...> - 2005-02-27 14:38:40
|
Update of /cvsroot/cppunit/cppunit2/src/cpput In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11085/src/cpput Modified Files: cpput.vcproj exceptionguard.cpp testcase.cpp testsuite.cpp Removed Files: functor.py Log Message: * changed cppunit 2 to use the new functors (cpptl/functor.h). bind_cfn & bind_memfn simplified some of the test code. Index: cpput.vcproj =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpput/cpput.vcproj,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** cpput.vcproj 27 Feb 2005 10:16:37 -0000 1.27 --- cpput.vcproj 27 Feb 2005 14:38:27 -0000 1.28 *************** *** 212,218 **** </File> <File - RelativePath="..\..\include\cpptl\functor3.h"> - </File> - <File RelativePath="..\..\include\cpptl\sharedptr.h"> </File> --- 212,215 ---- *************** *** 360,369 **** </File> <File - RelativePath="..\..\include\cpput\functor.h"> - </File> - <File - RelativePath=".\functor.py"> - </File> - <File RelativePath="..\..\include\cpput\message.h"> </File> --- 357,360 ---- Index: testsuite.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpput/testsuite.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** testsuite.cpp 27 Feb 2005 10:17:05 -0000 1.6 --- testsuite.cpp 27 Feb 2005 14:38:27 -0000 1.7 *************** *** 1,4 **** #include <cpput/testsuite.h> - #include <cpput/functor.h> #include <cpput/testvisitor.h> --- 1,3 ---- Index: testcase.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpput/testcase.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** testcase.cpp 27 Feb 2005 10:17:05 -0000 1.9 --- testcase.cpp 27 Feb 2005 14:38:27 -0000 1.10 *************** *** 1,5 **** #include <cpput/testcase.h> #include <cpput/assert.h> ! #include <cpput/functor.h> #include <cpput/message.h> #include <cpput/exceptionguard.h> --- 1,5 ---- #include <cpput/testcase.h> #include <cpput/assert.h> ! #include <cpptl/functor.h> #include <cpput/message.h> #include <cpput/exceptionguard.h> *************** *** 45,55 **** AbstractTestCase::runTest( const ExceptionGuard &guardsChain ) { ! bool initialized = guardsChain.protect( makeMemFn0( this, ! &AbstractTestCase::setUp ) ); if ( initialized ) { ! guardsChain.protect( makeMemFn0( this, &AbstractTestCase::run ) ); ! guardsChain.protect( makeMemFn0( this, &AbstractTestCase::tearDown) ); } --- 45,55 ---- AbstractTestCase::runTest( const ExceptionGuard &guardsChain ) { ! bool initialized = guardsChain.protect( CppTL::memfn0( this, ! &AbstractTestCase::setUp ) ); if ( initialized ) { ! guardsChain.protect( CppTL::memfn0( this, &AbstractTestCase::run ) ); ! guardsChain.protect( CppTL::memfn0( this, &AbstractTestCase::tearDown) ); } *************** *** 74,78 **** // //////////////////////////////////////////////////////////////////// ! TestCase::TestCase( const Functor0 &run, const CppTL::ConstString &name ) : AbstractTestCase( name ) --- 74,78 ---- // //////////////////////////////////////////////////////////////////// ! TestCase::TestCase( const CppTL::Functor0 &run, const CppTL::ConstString &name ) : AbstractTestCase( name ) *************** *** 82,88 **** ! TestCase::TestCase( const Functor0 &setUp, ! const Functor0 &run, ! const Functor0 &tearDown, const CppTL::ConstString &name ) : AbstractTestCase( name ) --- 82,88 ---- ! TestCase::TestCase( const CppTL::Functor0 &setUp, ! const CppTL::Functor0 &run, ! const CppTL::Functor0 &tearDown, const CppTL::ConstString &name ) : AbstractTestCase( name ) *************** *** 119,124 **** ! TestPtr makeTestCase( const Functor0 &run, ! const CppTL::ConstString &name ) { return TestPtr( new TestCase( run, name ) ); --- 119,124 ---- ! TestPtr makeTestCase( const CppTL::Functor0 &run, ! const CppTL::ConstString &name ) { return TestPtr( new TestCase( run, name ) ); *************** *** 126,133 **** ! TestPtr makeTestCase( const Functor0 &setUp, ! const Functor0 &run, ! const Functor0 &tearDown, ! const CppTL::ConstString &name ) { return TestPtr( new TestCase( setUp, run, tearDown, name ) ); --- 126,133 ---- ! TestPtr makeTestCase( const CppTL::Functor0 &setUp, ! const CppTL::Functor0 &run, ! const CppTL::Functor0 &tearDown, ! const CppTL::ConstString &name ) { return TestPtr( new TestCase( setUp, run, tearDown, name ) ); --- functor.py DELETED --- Index: exceptionguard.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpput/exceptionguard.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** exceptionguard.cpp 27 Feb 2005 10:17:05 -0000 1.2 --- exceptionguard.cpp 27 Feb 2005 14:38:27 -0000 1.3 *************** *** 2,5 **** --- 2,6 ---- #include <cpput/testinfo.h> #include <cpput/typehelper.h> + #include <cpptl/functor.h> namespace CppUT { *************** *** 10,19 **** struct ExceptionGuardElement::Context { ! Context( Functor0 test ) : test_( test ) { } ! Functor0 test_; }; --- 11,20 ---- struct ExceptionGuardElement::Context { ! Context( CppTL::Functor0 test ) : test_( test ) { } ! CppTL::Functor0 test_; }; *************** *** 130,134 **** bool ! ExceptionGuard::protect( Functor0 test ) const { ExceptionGuardElement::Context context( test ); --- 131,135 ---- bool ! ExceptionGuard::protect( CppTL::Functor0 test ) const { ExceptionGuardElement::Context context( test ); |
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_; }; |
From: Baptiste L. <bl...@us...> - 2005-02-27 14:38:40
|
Update of /cvsroot/cppunit/cppunit2/src/cpputtest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11085/src/cpputtest Modified Files: cpputtest.vcproj main.cpp testfunctor.cpp testtestcase.cpp Log Message: * changed cppunit 2 to use the new functors (cpptl/functor.h). bind_cfn & bind_memfn simplified some of the test code. Index: main.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/main.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** main.cpp 26 Feb 2005 11:40:58 -0000 1.11 --- main.cpp 27 Feb 2005 14:38:28 -0000 1.12 *************** *** 19,23 **** bool testTestCase(); bool testFunctors(); - bool testFunctors3(); --- 19,22 ---- *************** *** 26,30 **** return testBasicAssertions() && testFunctors() && - testFunctors3() && // testTestRunResult() && // testTestContext() && --- 25,28 ---- Index: testtestcase.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/testtestcase.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** testtestcase.cpp 27 Feb 2005 10:17:06 -0000 1.12 --- testtestcase.cpp 27 Feb 2005 14:38:28 -0000 1.13 *************** *** 89,94 **** int testCall = 0; CppUT::TestPtr test = CppUT::makeTestCase( ! CppUT::bind1( CppUT::makeCFn1( &callback ), ! &testCall ), "Test 1" ); CPPUT_ASSERT_EQUAL( "Test 1", test->name() ); --- 89,93 ---- int testCall = 0; CppUT::TestPtr test = CppUT::makeTestCase( ! CppTL::bind_cfn( &callback, &testCall ), "Test 1" ); CPPUT_ASSERT_EQUAL( "Test 1", test->name() ); *************** *** 114,120 **** { return CppUT::makeTestCase( ! CppUT::bind1( CppUT::makeCFn1(setUpCallback), testSetUpCall ), ! CppUT::bind1( CppUT::makeCFn1(runCallback), testRunCall ), ! CppUT::bind1( CppUT::makeCFn1(tearDownCallback), testTearDownCall ), name ); } --- 113,119 ---- { return CppUT::makeTestCase( ! CppTL::bind_cfn(setUpCallback, testSetUpCall ), ! CppTL::bind_cfn(runCallback, testRunCall ), ! CppTL::bind_cfn(tearDownCallback, testTearDownCall ), name ); } *************** *** 200,205 **** CppUT::TestPtr test = CppUT::makeFixtureTestCase( fixture, ! CppUT::makeMemFn0( fixture, ! &TestTestCaseFixture::run ), "Test1" ); CPPUT_ASSERT( test->isTestCase() ); --- 199,203 ---- CppUT::TestPtr test = CppUT::makeFixtureTestCase( fixture, ! CppTL::memfn0( fixture, &TestTestCaseFixture::run ), "Test1" ); CPPUT_ASSERT( test->isTestCase() ); *************** *** 217,223 **** TestTestCaseFixturePtr fixture = TestTestCaseFixturePtr( new TestTestCaseFixture() ); CppUT::TestPtr test = CppUT::makeTestCase( ! CppUT::bind1( CppUT::makeMemFn1( fixture, &TestTestCaseFixture::runWithParameter ), 1 ), ! CppUT::bind1( CppUT::makeMemFn1( fixture, &TestTestCaseFixture::runWithParameter ), 10 ), ! CppUT::bind1( CppUT::makeMemFn1( fixture, &TestTestCaseFixture::runWithParameter ), 100 ), "Test1" ); CPPUT_ASSERT( test->isTestCase() ); --- 215,221 ---- TestTestCaseFixturePtr fixture = TestTestCaseFixturePtr( new TestTestCaseFixture() ); CppUT::TestPtr test = CppUT::makeTestCase( ! CppTL::bind_memfn( fixture, &TestTestCaseFixture::runWithParameter, 1 ), ! CppTL::bind_memfn( fixture, &TestTestCaseFixture::runWithParameter, 10 ), ! CppTL::bind_memfn( fixture, &TestTestCaseFixture::runWithParameter, 100 ), "Test1" ); CPPUT_ASSERT( test->isTestCase() ); Index: cpputtest.vcproj =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/cpputtest.vcproj,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** cpputtest.vcproj 27 Feb 2005 10:17:54 -0000 1.11 --- cpputtest.vcproj 27 Feb 2005 14:38:28 -0000 1.12 *************** *** 239,245 **** </File> <File - RelativePath=".\testfunctor3.cpp"> - </File> - <File RelativePath=".\testtestcase.cpp"> </File> --- 239,242 ---- Index: testfunctor.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/testfunctor.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** testfunctor.cpp 26 Feb 2005 11:45:50 -0000 1.7 --- testfunctor.cpp 27 Feb 2005 14:38:28 -0000 1.8 *************** *** 1,4 **** #include <cpput/assert.h> ! #include <cpput/functor.h> #include <iostream> --- 1,4 ---- #include <cpput/assert.h> ! #include <cpptl/functor.h> #include <iostream> *************** *** 31,34 **** --- 31,39 ---- } + static double returnCallback1( int x ) + { + return x / 2.0; + } + struct TestFunctor { *************** *** 51,54 **** --- 56,79 ---- { bool flag_; + int value_; + + HelperObject() + : flag_( false ) + , value_( 0 ) + { + } + + HelperObject( const HelperObject &other ) + : flag_( other.flag_ ) + , value_( other.value_ + 1 ) + { + } + + HelperObject &operator =( const HelperObject &other ) + { + flag_ = other.flag_; + value_ = other.value_ + 1; + return *this; + } void setFlagOn() *************** *** 61,64 **** --- 86,94 ---- flag_ = value; } + + double compute1( int x ) + { + return (x + value_) / 2.0; + } }; *************** *** 68,72 **** static void testFunctor() { ! CppUT::Functor0 fn = CppUT::makeFn0( &callback0 ); callbackCalled = false; fn(); --- 98,102 ---- static void testFunctor() { ! CppTL::Functor0 fn = CppTL::cfn0( &callback0 ); callbackCalled = false; fn(); *************** *** 75,79 **** callbackCalled = false; TestFunctor testFunctor; ! fn = CppUT::makeFn0( testFunctor ); fn(); CPPUT_ASSERT( callbackCalled, "Functor() did not call functor object." ); --- 105,109 ---- callbackCalled = false; TestFunctor testFunctor; ! fn = CppTL::fn0( testFunctor ); fn(); CPPUT_ASSERT( callbackCalled, "Functor() did not call functor object." ); *************** *** 81,90 **** CppTL::SharedPtr<HelperObject> helper( new HelperObject() ); helper->flag_ = false; ! fn = CppUT::makeMemFn0( helper, &HelperObject::setFlagOn ); fn(); CPPUT_ASSERT( helper->flag_, "Functor() did not call object method (shared_ptr)." ); helper->flag_ = false; ! fn = CppUT::makeMemFn0( helper.get(), &HelperObject::setFlagOn ); fn(); CPPUT_ASSERT( helper->flag_, "Functor() did not call object method (ptr)." ); --- 111,120 ---- CppTL::SharedPtr<HelperObject> helper( new HelperObject() ); helper->flag_ = false; ! fn = CppTL::memfn0( helper, &HelperObject::setFlagOn ); fn(); CPPUT_ASSERT( helper->flag_, "Functor() did not call object method (shared_ptr)." ); helper->flag_ = false; ! fn = CppTL::memfn0( helper.get(), &HelperObject::setFlagOn ); fn(); CPPUT_ASSERT( helper->flag_, "Functor() did not call object method (ptr)." ); *************** *** 94,98 **** static void testFunctor1() { ! CppUT::Functor1<bool> fn = CppUT::makeCFn1( &callback1 ); callbackCalled = false; fn( true ); --- 124,128 ---- static void testFunctor1() { ! CppTL::Functor1<bool> fn = CppTL::cfn1( &callback1 ); callbackCalled = false; fn( true ); *************** *** 103,107 **** CppTL::SharedPtr<HelperObject> helper( new HelperObject() ); helper->flag_ = false; ! fn = CppUT::makeMemFn1( helper, &HelperObject::setFlag ); fn( true ); CPPUT_ASSERT( helper->flag_, "Functor1(true) did not call object method." ); --- 133,137 ---- CppTL::SharedPtr<HelperObject> helper( new HelperObject() ); helper->flag_ = false; ! fn = CppTL::memfn1( helper, &HelperObject::setFlag ); fn( true ); CPPUT_ASSERT( helper->flag_, "Functor1(true) did not call object method." ); *************** *** 111,126 **** namespace { - static std::string callWithRefParam0; ! void callWithConstRef( const std::string &str ) { ! callWithRefParam0 = str; } ! void callWithRef( std::string &str ) { ! callWithRefParam0 = str; ! str += "called"; } --- 141,168 ---- + static void testFunctor1R() + { + CppTL::Functor1R<double,int> fn = CppTL::cfn1r( &returnCallback1 ); + callbackCalled = false; + CPPUT_ASSERT_EQUAL( 1.0, fn( 2 ) ); + + CppTL::SharedPtr<HelperObject> helper( new HelperObject() ); + helper->value_ = 0; + fn = CppTL::memfn1r( helper, &HelperObject::compute1 ); + CPPUT_ASSERT_EQUAL( 1.0, fn( 2 ) ); + helper->value_ = 10; + CPPUT_ASSERT_EQUAL( 6.0, fn( 2 ) ); + } + namespace { ! int extractHelperObjectValue( const HelperObject &object ) { ! return object.value_; } ! void doubleHelperObjectValue( HelperObject &object ) { ! object.value_ *= 2; } *************** *** 128,180 **** ! static void testConstReferenceSupport() { ! CppUT::Functor1<const std::string &> fncref1( CppUT::makeCFn1( &callWithConstRef ) ); ! callWithRefParam0 = ""; ! const std::string &s = "test1"; ! fncref1( s ); ! CPPUT_ASSERT_EQUAL( "test1", callWithRefParam0 ); } ! static void testReferenceSupport() { ! CppUT::Functor1<std::string &> fnref1( CppUT::makeCFn1( &callWithRef ) ); ! callWithRefParam0 = ""; ! std::string s = "test1"; ! fnref1( s ); ! CPPUT_ASSERT_EQUAL( "test1", callWithRefParam0 ); ! CPPUT_ASSERT_EQUAL( "test1called", s ); } static void testBindValue() { ! CppUT::Functor1<const std::string &> fn1 = CppUT::makeCFn1( &callback1string ); ! CppUT::Functor0 fn0 = CppUT::bind1( fn1, "str" ); ! callbackCalled = false; ! badValue = false; ! expected = "str"; ! fn0(); ! CPPUT_ASSERT( callbackCalled, "bind1() did not call C function." ); ! CPPUT_ASSERT( badValue, "bind1() did not pass the binded value." ); ! ! callbackCalled = false; ! CppUT::Functor0 fbind12 = CppUT::bind( CppUT::makeCFn2( &callback12 ), ! "str", ! 1234 ); ! fbind12(); ! CPPUT_ASSERT( callbackCalled, "bind(f,x,y) did not call C function." ); } - static void testBindConstRef() { ! CppUT::Functor1<const std::string &> fncref1 = CppUT::makeCFn1( &callWithConstRef ); ! std::string s = "test2"; ! CppUT::Functor0 fn0 = CppUT::bind1( fncref1, CppUT::cref(s) ); ! callWithRefParam0 = ""; ! fn0(); ! CPPUT_ASSERT_EQUAL( "test2", callWithRefParam0 ); } --- 170,214 ---- ! static void testConstReferenceParameterSupport() { ! CppTL::Functor1R<int,const HelperObject &> fncref1( CppTL::cfn1r( &extractHelperObjectValue ) ); ! HelperObject object; ! object.value_ = 12345678; ! CPPUT_ASSERT_EQUAL( 12345678, fncref1( object ) ); } ! static void testReferenceParameterSupport() { ! CppTL::Functor1<HelperObject &> fnref1( CppTL::cfn1( &doubleHelperObjectValue ) ); ! HelperObject object; ! object.value_ = 1111; ! fnref1( object ); ! CPPUT_ASSERT_EQUAL( 1111*2, object.value_ ); } + namespace { + int multiply( int x, int y ) + { + return x * y; + } + } + static void testBindValue() { ! CppTL::Functor2R<int,int,int> fn2 = CppTL::cfn2r( &multiply ); ! CppTL::Functor1R<int,int> fn1 = CppTL::fn1r( CppTL::bind2r( fn2, 3 ) ); ! CPPUT_ASSERT_EQUAL( 2*3, fn1(2) ); ! CPPUT_ASSERT_EQUAL( 5*3, fn1(5) ); } static void testBindConstRef() { ! CppTL::Functor1R<int,const HelperObject &> fn1( CppTL::cfn1r( &extractHelperObjectValue ) ); ! HelperObject object; ! object.value_ = 12345678; ! CppTL::Functor0R<int> fn0 = CppTL::fn0r( CppTL::bind1r( fn1, CppTL::cref(object) ) ); ! CPPUT_ASSERT_EQUAL( 12345678, fn0() ); } *************** *** 182,196 **** static void testBindRef() { ! CppUT::Functor1<std::string &> fnref1 = CppUT::makeCFn1( &callWithRef ); ! std::string s = "test3"; ! CppUT::Functor0 fn0 = CppUT::bind1( fnref1, CppUT::ref(s) ); ! callWithRefParam0 = ""; fn0(); ! CPPUT_ASSERT_EQUAL( "test3", callWithRefParam0 ); ! CPPUT_ASSERT_EQUAL( "test3called", s ); } - bool testFunctors() { --- 216,228 ---- static void testBindRef() { ! CppTL::Functor1<HelperObject &> fnref1( CppTL::cfn1( &doubleHelperObjectValue ) ); ! HelperObject object; ! object.value_ = 1111; ! CppTL::Functor0 fn0 = CppTL::fn0( CppTL::bind1( fnref1, CppTL::ref( object ) ) ); fn0(); ! CPPUT_ASSERT_EQUAL( 1111*2, object.value_ ); } bool testFunctors() { *************** *** 200,205 **** testFunctor(); testFunctor1(); ! testConstReferenceSupport(); ! testReferenceSupport(); testBindValue(); testBindConstRef(); --- 232,239 ---- testFunctor(); testFunctor1(); ! testFunctor1R(); ! ! testConstReferenceParameterSupport(); ! testReferenceParameterSupport(); testBindValue(); testBindConstRef(); |
From: Baptiste L. <bl...@us...> - 2005-02-27 10:18:04
|
Update of /cvsroot/cppunit/cppunit2/src/cpputtest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3185/src/cpputtest Modified Files: cpputtest.vcproj Log Message: * added ConstString and StringBuffer Index: cpputtest.vcproj =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/cpputtest.vcproj,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** cpputtest.vcproj 26 Feb 2005 11:40:58 -0000 1.10 --- cpputtest.vcproj 27 Feb 2005 10:17:54 -0000 1.11 *************** *** 103,106 **** --- 103,107 ---- ObjectFile=".\..\..\build\cpputtest\debug/" ProgramDataBaseFileName=".\..\..\build\cpputtest\debug/" + BrowseInformation="1" WarningLevel="3" SuppressStartupBanner="TRUE" |
From: Baptiste L. <bl...@us...> - 2005-02-27 10:17:15
|
Update of /cvsroot/cppunit/cppunit2/src/cpputtest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2955/src/cpputtest Modified Files: commandlineoptionstest.cpp commandlineoptionstest.h testtestcase.cpp Log Message: * use CppTL::ConstString instead of std::string for thread-safety Index: testtestcase.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/testtestcase.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** testtestcase.cpp 23 Feb 2005 23:06:50 -0000 1.11 --- testtestcase.cpp 27 Feb 2005 10:17:06 -0000 1.12 *************** *** 111,115 **** void (*tearDownCallback)( int *), int *testTearDownCall, ! const std::string &name ) { return CppUT::makeTestCase( --- 111,115 ---- void (*tearDownCallback)( int *), int *testTearDownCall, ! const CppTL::ConstString &name ) { return CppUT::makeTestCase( Index: commandlineoptionstest.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/commandlineoptionstest.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** commandlineoptionstest.cpp 23 Jun 2004 20:39:28 -0000 1.4 --- commandlineoptionstest.cpp 27 Feb 2005 10:17:06 -0000 1.5 *************** *** 48,52 **** CommandLineOptionsTest::checkParseBadOption( CommandLineOptions::OptionsDescription &description, const char *argv[], ! const std::string &badOptionName ) { try --- 48,52 ---- CommandLineOptionsTest::checkParseBadOption( CommandLineOptions::OptionsDescription &description, const char *argv[], ! const CppTL::ConstString &badOptionName ) { try *************** *** 128,132 **** CommandLineOptions::OptionsDescription options( "test" ); int time; ! std::string excluded; double duration; options.add( "time,t", time, "" ); --- 128,132 ---- CommandLineOptions::OptionsDescription options( "test" ); int time; ! CppTL::ConstString excluded; double duration; options.add( "time,t", time, "" ); Index: commandlineoptionstest.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/commandlineoptionstest.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** commandlineoptionstest.h 15 Jun 2004 00:45:50 -0000 1.2 --- commandlineoptionstest.h 27 Feb 2005 10:17:06 -0000 1.3 *************** *** 55,59 **** void checkParseBadOption( CppUTTools::CommandLineOptions::OptionsDescription &description, const char *argv[], ! const std::string &badOptionName ); enum LogLevel { --- 55,59 ---- void checkParseBadOption( CppUTTools::CommandLineOptions::OptionsDescription &description, const char *argv[], ! const CppTL::ConstString &badOptionName ); enum LogLevel { |
From: Baptiste L. <bl...@us...> - 2005-02-27 10:17:15
|
Update of /cvsroot/cppunit/cppunit2/src/cpput In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2955/src/cpput Modified Files: assert.cpp dllproxy.cpp exceptionguard.cpp properties.cpp registry.cpp testcase.cpp testinfo.cpp testsuite.cpp Log Message: * use CppTL::ConstString instead of std::string for thread-safety Index: assert.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpput/assert.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** assert.cpp 21 Nov 2004 22:28:54 -0000 1.7 --- assert.cpp 27 Feb 2005 10:17:05 -0000 1.8 *************** *** 54,58 **** Message newMessage( translate( "Assertion expression did not fail as expected." ) ); ! newMessage.add( message ); fail( message ); } --- 54,58 ---- Message newMessage( translate( "Assertion expression did not fail as expected." ) ); ! newMessage.extend( message ); fail( message ); } *************** *** 67,71 **** Message newMessage( translate( "Assertion expression did not pass as expected." ) ); ! newMessage.add( message ); fail( message ); } --- 67,71 ---- Message newMessage( translate( "Assertion expression did not pass as expected." ) ); ! newMessage.extend( message ); fail( message ); } *************** *** 73,78 **** Message ! buildEqualityFailedMessage( const std::string &expected, ! const std::string &actual, const Message &message ) { --- 73,78 ---- Message ! buildEqualityFailedMessage( const CppTL::ConstString &expected, ! const CppTL::ConstString &actual, const Message &message ) { *************** *** 86,91 **** Message ! buildUnequalityFailedMessage( const std::string &expected, ! const std::string &actual, const Message &message ) { --- 86,91 ---- Message ! buildUnequalityFailedMessage( const CppTL::ConstString &expected, ! const CppTL::ConstString &actual, const Message &message ) { Index: registry.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpput/registry.cpp,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** registry.cpp 27 Jan 2004 20:34:35 -0000 1.1.1.1 --- registry.cpp 27 Feb 2005 10:17:05 -0000 1.2 *************** *** 7,11 **** ! std::string Registry::defaultParentSuiteName() { --- 7,11 ---- ! CppTL::ConstString Registry::defaultParentSuiteName() { *************** *** 29,34 **** void ! Registry::addChild( const std::string &parentSuiteName, ! const std::string &childSuiteName ) { // ParentChildRelationShips::iterator it = relations_.find( childSuiteName ); --- 29,34 ---- void ! Registry::addChild( const CppTL::ConstString &parentSuiteName, ! const CppTL::ConstString &childSuiteName ) { // ParentChildRelationShips::iterator it = relations_.find( childSuiteName ); *************** *** 40,45 **** bool ! Registry::removeChild( const std::string &parentSuiteName, ! const std::string &childSuiteName ) { ParentChildRelationShips::iterator it = relations_.find( parentSuiteName ); --- 40,45 ---- bool ! Registry::removeChild( const CppTL::ConstString &parentSuiteName, ! const CppTL::ConstString &childSuiteName ) { ParentChildRelationShips::iterator it = relations_.find( parentSuiteName ); *************** *** 57,61 **** TestFactoryId ! Registry::add( const std::string &parentSuiteName, const TestFactory &testFactory ) { --- 57,61 ---- TestFactoryId ! Registry::add( const CppTL::ConstString &parentSuiteName, const TestFactory &testFactory ) { *************** *** 81,85 **** return false; ! std::string parentSuiteName = parentIt->second; TestFactoryRegistry::iterator itRegistry = registry_.find( parentSuiteName ); if ( itRegistry == registry_.end() ) --- 81,85 ---- return false; ! CppTL::ConstString parentSuiteName = parentIt->second; TestFactoryRegistry::iterator itRegistry = registry_.find( parentSuiteName ); if ( itRegistry == registry_.end() ) *************** *** 107,111 **** /* void ! Registry::destroy( const std::string &suiteName ) { registry_.erase( suiteName ); --- 107,111 ---- /* void ! Registry::destroy( const CppTL::ConstString &suiteName ) { registry_.erase( suiteName ); *************** *** 123,127 **** TestSuitePtr ! Registry::createTests( const std::string &suiteName ) const { if ( suiteName == defaultParentSuiteName() ) --- 123,127 ---- TestSuitePtr ! Registry::createTests( const CppTL::ConstString &suiteName ) const { if ( suiteName == defaultParentSuiteName() ) *************** *** 144,148 **** void ! Registry::addCreatedTests( const std::string &suiteName, const TestSuitePtr &suite ) const { --- 144,148 ---- void ! Registry::addCreatedTests( const CppTL::ConstString &suiteName, const TestSuitePtr &suite ) const { *************** *** 153,157 **** void ! Registry::addChildSuite( const std::string &suiteName, const TestSuitePtr &suite ) const { --- 153,157 ---- void ! Registry::addChildSuite( const CppTL::ConstString &suiteName, const TestSuitePtr &suite ) const { *************** *** 160,164 **** while ( itChild != itChildEnd ) { ! const std::string &childSuiteName = itChild->second; suite->add( createTests( childSuiteName ) ); ++itChild; --- 160,164 ---- while ( itChild != itChildEnd ) { ! const CppTL::ConstString &childSuiteName = itChild->second; suite->add( createTests( childSuiteName ) ); ++itChild; *************** *** 168,172 **** void ! Registry::addSuiteRegisteredTests( const std::string &suiteName, const TestSuitePtr &suite ) const { --- 168,172 ---- void ! Registry::addSuiteRegisteredTests( const CppTL::ConstString &suiteName, const TestSuitePtr &suite ) const { Index: exceptionguard.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpput/exceptionguard.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** exceptionguard.cpp 22 Feb 2005 21:26:49 -0000 1.1 --- exceptionguard.cpp 27 Feb 2005 10:17:05 -0000 1.2 *************** *** 84,88 **** private: ! void addFault( const std::string &exceptionType, const char *what ) { --- 84,88 ---- private: ! void addFault( const CppTL::ConstString &exceptionType, const char *what ) { Index: testcase.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpput/testcase.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** testcase.cpp 22 Feb 2005 21:26:49 -0000 1.8 --- testcase.cpp 27 Feb 2005 10:17:05 -0000 1.9 *************** *** 15,19 **** ! AbstractTestCase::AbstractTestCase( const std::string &name ) : Test( name ) { --- 15,19 ---- ! AbstractTestCase::AbstractTestCase( const CppTL::ConstString &name ) : Test( name ) { *************** *** 75,79 **** TestCase::TestCase( const Functor0 &run, ! const std::string &name ) : AbstractTestCase( name ) , run_( run ) --- 75,79 ---- TestCase::TestCase( const Functor0 &run, ! const CppTL::ConstString &name ) : AbstractTestCase( name ) , run_( run ) *************** *** 85,89 **** const Functor0 &run, const Functor0 &tearDown, ! const std::string &name ) : AbstractTestCase( name ) , setUp_( setUp ) --- 85,89 ---- const Functor0 &run, const Functor0 &tearDown, ! const CppTL::ConstString &name ) : AbstractTestCase( name ) , setUp_( setUp ) *************** *** 120,124 **** TestPtr makeTestCase( const Functor0 &run, ! const std::string &name ) { return TestPtr( new TestCase( run, name ) ); --- 120,124 ---- TestPtr makeTestCase( const Functor0 &run, ! const CppTL::ConstString &name ) { return TestPtr( new TestCase( run, name ) ); *************** *** 129,133 **** const Functor0 &run, const Functor0 &tearDown, ! const std::string &name ) { return TestPtr( new TestCase( setUp, run, tearDown, name ) ); --- 129,133 ---- const Functor0 &run, const Functor0 &tearDown, ! const CppTL::ConstString &name ) { return TestPtr( new TestCase( setUp, run, tearDown, name ) ); *************** *** 140,144 **** { public: ! FailingTestCase( const std::string &name, const CppUT::Message &message ) : CppUT::AbstractTestCase( name ) --- 140,144 ---- { public: ! FailingTestCase( const CppTL::ConstString &name, const CppUT::Message &message ) : CppUT::AbstractTestCase( name ) *************** *** 157,161 **** ! TestPtr CPPUT_API makeFailingTestCase( const std::string &name, const Message &message ) { --- 157,161 ---- ! TestPtr CPPUT_API makeFailingTestCase( const CppTL::ConstString &name, const Message &message ) { Index: dllproxy.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpput/dllproxy.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** dllproxy.cpp 14 Jun 2004 23:25:06 -0000 1.2 --- dllproxy.cpp 27 Feb 2005 10:17:05 -0000 1.3 *************** *** 72,77 **** } ! throw DllProxyError( translate( "Failed to load dynamic library: " ) + path + "\n" + ! getLastErrorDetail() ); } --- 72,78 ---- } ! CppTL::ConstString message = translate( "Failed to load dynamic library: " ) ! + path + "\n" + getLastErrorDetail(); ! throw DllProxyError( message.c_str() ); } Index: testsuite.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpput/testsuite.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** testsuite.cpp 20 Nov 2004 15:26:38 -0000 1.5 --- testsuite.cpp 27 Feb 2005 10:17:05 -0000 1.6 *************** *** 14,18 **** ! AbstractTestSuite::AbstractTestSuite( const std::string &name ) : Test( name ) { --- 14,18 ---- ! AbstractTestSuite::AbstractTestSuite( const CppTL::ConstString &name ) : Test( name ) { *************** *** 37,41 **** // //////////////////////////////////////////////////////////////////// ! TestSuite::TestSuite( const std::string &name ) : AbstractTestSuite( name ) { --- 37,41 ---- // //////////////////////////////////////////////////////////////////// ! TestSuite::TestSuite( const CppTL::ConstString &name ) : AbstractTestSuite( name ) { *************** *** 75,79 **** ! TestSuitePtr makeTestSuite( const std::string &name ) { return TestSuitePtr( new TestSuite( name ) ); --- 75,79 ---- ! TestSuitePtr makeTestSuite( const CppTL::ConstString &name ) { return TestSuitePtr( new TestSuite( name ) ); Index: properties.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpput/properties.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** properties.cpp 21 Nov 2004 22:26:32 -0000 1.6 --- properties.cpp 27 Feb 2005 10:17:05 -0000 1.7 *************** *** 84,88 **** ! Value::Value( const std::string &value ) { guts_.type_ = vtString; --- 84,88 ---- ! Value::Value( const CppTL::ConstString &value ) { guts_.type_ = vtString; *************** *** 272,276 **** } ! std::string Value::asString() const { --- 272,276 ---- } ! CppTL::ConstString Value::asString() const { *************** *** 281,285 **** default: throwBadCast(); ! return std::string(); // keep the compiler happy } } --- 281,285 ---- default: throwBadCast(); ! return CppTL::ConstString(); // keep the compiler happy } } *************** *** 439,443 **** ! std::string Value::toString() const { --- 439,443 ---- ! CppTL::ConstString Value::toString() const { *************** *** 455,459 **** return CppTL::toString( guts_.realValue_ ); case vtString: ! return "'" + asString() + "'"; /// @todo string should be escaped... case vtProperties: return asProperties().toString(); --- 455,459 ---- return CppTL::toString( guts_.realValue_ ); case vtString: ! return CppTL::quoteString( asString() ); case vtProperties: return asProperties().toString(); *************** *** 469,473 **** // ////////////////////////////////////////////////////////////////// ! Property::Property( const std::string &name, const Value &value ) : name_( name ) --- 469,473 ---- // ////////////////////////////////////////////////////////////////// ! Property::Property( const CppTL::ConstString &name, const Value &value ) : name_( name ) *************** *** 477,481 **** ! const std::string & Property::name() const { --- 477,481 ---- ! const CppTL::ConstString & Property::name() const { *************** *** 510,514 **** ! PropertyPath::PropertyPath( const std::string &path, char separator ) { --- 510,514 ---- ! PropertyPath::PropertyPath( const CppTL::ConstString &path, char separator ) { *************** *** 534,538 **** if ( path[index] == separator ) { ! names_.push_back( std::string( path+startIndex, path + index ) ); startIndex = index + 1; } --- 534,538 ---- if ( path[index] == separator ) { ! names_.push_back( CppTL::ConstString( path+startIndex, path + index ) ); startIndex = index + 1; } *************** *** 541,545 **** if ( startIndex < index ) ! names_.push_back( std::string( path+startIndex, path + index ) ); } --- 541,545 ---- if ( startIndex < index ) ! names_.push_back( CppTL::ConstString( path+startIndex, path + index ) ); } *************** *** 553,557 **** PropertyPath & ! PropertyPath::add( const std::string &name ) { names_.push_back( name ); --- 553,557 ---- PropertyPath & ! PropertyPath::add( const CppTL::ConstString &name ) { names_.push_back( name ); *************** *** 587,591 **** ! const std::string & PropertyPath::name() const { --- 587,591 ---- ! const CppTL::ConstString & PropertyPath::name() const { *************** *** 785,789 **** Properties & ! Properties::set( const std::string &name, const Value &value ) { --- 785,789 ---- Properties & ! Properties::set( const CppTL::ConstString &name, const Value &value ) { *************** *** 803,807 **** Properties & ! Properties::setIfNew( const std::string &name, const Value &value ) { --- 803,807 ---- Properties & ! Properties::setIfNew( const CppTL::ConstString &name, const Value &value ) { *************** *** 998,1002 **** Properties::PropertyList::iterator ! Properties::find( const std::string &name ) { PropertyList::iterator it = properties_.begin(); --- 998,1002 ---- Properties::PropertyList::iterator ! Properties::find( const CppTL::ConstString &name ) { PropertyList::iterator it = properties_.begin(); *************** *** 1010,1014 **** Properties::PropertyList::const_iterator ! Properties::find( const std::string &name ) const { PropertyList::const_iterator it = properties_.begin(); --- 1010,1014 ---- Properties::PropertyList::const_iterator ! Properties::find( const CppTL::ConstString &name ) const { PropertyList::const_iterator it = properties_.begin(); *************** *** 1029,1038 **** while ( true ) { ! const std::string &propertyName = names.next(); PropertyList::const_iterator it = properties->find( propertyName ); if ( it == properties->properties_.end() ) { ! throw std::invalid_argument( "OpenTest::Properties: bad property path, '" ! + propertyName + "' is not defined." ); } const Value &value = it->value(); --- 1029,1038 ---- while ( true ) { ! const CppTL::ConstString &propertyName = names.next(); PropertyList::const_iterator it = properties->find( propertyName ); if ( it == properties->properties_.end() ) { ! throw std::invalid_argument( std::string("OpenTest::Properties: bad property path, '") ! + propertyName.c_str() + "' is not defined." ); } const Value &value = it->value(); *************** *** 1054,1058 **** while ( names.hasNext() ) { ! const std::string &propertyName = names.next(); PropertyList::const_iterator it = properties->find( propertyName ); if ( it == properties->properties_.end() ) --- 1054,1058 ---- while ( names.hasNext() ) { ! const CppTL::ConstString &propertyName = names.next(); PropertyList::const_iterator it = properties->find( propertyName ); if ( it == properties->properties_.end() ) *************** *** 1084,1088 **** while ( names.hasNext() ) { ! const std::string &name = names.next(); PropertyList::iterator it = properties->find( name ); if ( it == properties->properties_.end() ) --- 1084,1088 ---- while ( names.hasNext() ) { ! const CppTL::ConstString &name = names.next(); PropertyList::iterator it = properties->find( name ); if ( it == properties->properties_.end() ) *************** *** 1094,1099 **** if ( !it->value().isProperties() ) { ! throw std::invalid_argument( "Properties: invalid path, '" ! + name + "' is not a properties." ); } properties = &(it->value().asProperties()); --- 1094,1099 ---- if ( !it->value().isProperties() ) { ! throw std::invalid_argument( std::string("Properties: invalid path, '") ! + name.c_str() + "' is not a properties." ); } properties = &(it->value().asProperties()); *************** *** 1111,1115 **** ! std::string Properties::toString() const { --- 1111,1115 ---- ! CppTL::ConstString Properties::toString() const { *************** *** 1118,1125 **** ! std::string ! Properties::toString( const std::string &prefix ) const { ! std::string str; PropertyList::const_iterator it = properties_.begin(); PropertyList::const_iterator itEnd = properties_.end(); --- 1118,1125 ---- ! CppTL::ConstString ! Properties::toString( const CppTL::ConstString &prefix ) const { ! CppTL::StringBuffer str; PropertyList::const_iterator it = properties_.begin(); PropertyList::const_iterator itEnd = properties_.end(); *************** *** 1128,1158 **** const Value &value = it->value(); if ( value.isProperties() ) ! str += value.asProperties().toString( prefix + "/" + it->name() ); else ! { ! str += prefix; ! str += "/"; ! str += it->name(); ! str += " = "; ! str += value.toString(); ! str += "\n"; ! } } for ( unsigned int index = 0; index < indexedProperties_.size(); ++index ) { ! std::string localPrefix = prefix; ! localPrefix += "["; ! localPrefix += CppTL::toString( index ); ! localPrefix += "]"; if ( indexedProperties_[index].isProperties() ) str += indexedProperties_[index].asProperties().toString( localPrefix ); else ! { ! str += localPrefix; ! str += " = "; ! str += indexedProperties_[index].toString(); ! str += "\n"; ! } } return str; --- 1128,1143 ---- const Value &value = it->value(); if ( value.isProperties() ) ! str += value.asProperties().toString( prefix+ "/" + it->name() ); else ! str += prefix + "/" + it->name() + " = " + value.toString() + "\n"; } for ( unsigned int index = 0; index < indexedProperties_.size(); ++index ) { ! CppTL::ConstString localPrefix = prefix + "[" + CppTL::toString(index) + "]"; if ( indexedProperties_[index].isProperties() ) str += indexedProperties_[index].asProperties().toString( localPrefix ); else ! str += localPrefix + " = " + indexedProperties_[index].toString() + "\n"; } return str; Index: testinfo.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpput/testinfo.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** testinfo.cpp 21 Nov 2004 22:22:24 -0000 1.7 --- testinfo.cpp 27 Feb 2005 10:17:05 -0000 1.8 *************** *** 88,92 **** std::string message; if ( abortingAssertionMode_ != fastAbortingAssertion ) ! message = result_.toString(); throw AbortingAssertionException( message ); } --- 88,92 ---- std::string message; if ( abortingAssertionMode_ != fastAbortingAssertion ) ! message = result_.toString().c_str(); throw AbortingAssertionException( message ); } *************** *** 221,225 **** } ! void log( const std::string &text ) { appendToResult( "logs", text ); --- 221,225 ---- } ! void log( const CppTL::ConstString &text ) { appendToResult( "logs", text ); |
From: Baptiste L. <bl...@us...> - 2005-02-27 10:16:46
|
Update of /cvsroot/cppunit/cppunit2/src/cpput In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2807/src/cpput Modified Files: cpput.vcproj Log Message: * added ConstString and StringBuffer Index: cpput.vcproj =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpput/cpput.vcproj,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** cpput.vcproj 26 Feb 2005 11:40:58 -0000 1.26 --- cpput.vcproj 27 Feb 2005 10:16:37 -0000 1.27 *************** *** 90,97 **** ObjectFile=".\..\..\build\cpput\debug/" ProgramDataBaseFileName=".\..\..\build\cpput\debug/" WarningLevel="3" SuppressStartupBanner="TRUE" DebugInformationFormat="4" ! CompileAs="0"/> <Tool Name="VCCustomBuildTool"/> --- 90,99 ---- ObjectFile=".\..\..\build\cpput\debug/" ProgramDataBaseFileName=".\..\..\build\cpput\debug/" + BrowseInformation="1" WarningLevel="3" SuppressStartupBanner="TRUE" DebugInformationFormat="4" ! CompileAs="0" ! ShowIncludes="FALSE"/> <Tool Name="VCCustomBuildTool"/> *************** *** 204,207 **** --- 206,212 ---- </File> <File + RelativePath="..\..\include\cpptl\forwards.h"> + </File> + <File RelativePath="..\..\include\cpptl\functor.h"> </File> *************** *** 364,370 **** </File> <File - RelativePath="..\..\include\cpput\properties.h"> - </File> - <File RelativePath=".\registry.cpp"> </File> --- 369,372 ---- |
From: Baptiste L. <bl...@us...> - 2005-02-27 10:16:25
|
Update of /cvsroot/cppunit/cppunit2/include/opentest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2583/include/opentest Modified Files: properties.h testrunner.h texttestdriver.h Log Message: * use CppTL::ConstString instead of std::string for thread-safety Index: testrunner.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/opentest/testrunner.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** testrunner.h 19 Nov 2004 21:39:13 -0000 1.3 --- testrunner.h 27 Feb 2005 10:15:57 -0000 1.4 *************** *** 34,41 **** } ! virtual TestId beginSuite( const std::string &name, const Properties &data ) = 0; ! virtual TestId addTest( const std::string &name, const Properties &data ) = 0; --- 34,41 ---- } ! virtual TestId beginSuite( const CppTL::ConstString &name, const Properties &data ) = 0; ! virtual TestId addTest( const CppTL::ConstString &name, const Properties &data ) = 0; Index: texttestdriver.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/opentest/texttestdriver.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** texttestdriver.h 26 Feb 2005 11:45:06 -0000 1.7 --- texttestdriver.h 27 Feb 2005 10:15:57 -0000 1.8 *************** *** 76,88 **** TextTestDriver( TestRunner &runner ); ! // void selectTest( const std::string &name ); bool run(); private: // overriden from TestDeclarator ! TestId beginSuite( const std::string &name, const Properties &data ); ! TestId addTest( const std::string &name, const Properties &data ); --- 76,88 ---- TextTestDriver( TestRunner &runner ); ! // void selectTest( const CppTL::ConstString &name ); bool run(); private: // overriden from TestDeclarator ! TestId beginSuite( const CppTL::ConstString &name, const Properties &data ); ! TestId addTest( const CppTL::ConstString &name, const Properties &data ); *************** *** 123,127 **** { TestInfo( TestId id, ! const std::string &name, const Properties &info, const ParentSuites &parents ) --- 123,127 ---- { TestInfo( TestId id, ! const CppTL::ConstString &name, const Properties &info, const ParentSuites &parents ) *************** *** 134,138 **** TestId id_; ! std::string name_; Properties info_; ParentSuites parents_; --- 134,138 ---- TestId id_; ! CppTL::ConstString name_; Properties info_; ParentSuites parents_; *************** *** 152,159 **** void declareTestOrSuite( TestId id, ! const std::string &name, const Properties &data ); ! std::string getTestPath( TestId test, unsigned int maxParent = (unsigned int)-1 ) const; void reportFailure( const TestResult &testResult, --- 152,159 ---- void declareTestOrSuite( TestId id, ! const CppTL::ConstString &name, const Properties &data ); ! CppTL::ConstString getTestPath( TestId test, unsigned int maxParent = (unsigned int)-1 ) const; void reportFailure( const TestResult &testResult, *************** *** 318,322 **** inline TestId ! TextTestDriver::beginSuite( const std::string &name, const Properties &data ) { --- 318,322 ---- inline TestId ! TextTestDriver::beginSuite( const CppTL::ConstString &name, const Properties &data ) { *************** *** 330,334 **** inline TestId ! TextTestDriver::addTest( const std::string &name, const Properties &data ) { --- 330,334 ---- inline TestId ! TextTestDriver::addTest( const CppTL::ConstString &name, const Properties &data ) { *************** *** 349,353 **** void TextTestDriver::declareTestOrSuite( TestId id, ! const std::string &name, const Properties &data ) { --- 349,353 ---- void TextTestDriver::declareTestOrSuite( TestId id, ! const CppTL::ConstString &name, const Properties &data ) { *************** *** 423,427 **** PropertiesAccessor status = result.accessor()["result"]["status"]; bool succeeded = status.getValue( "success", false ).asBool(); ! std::string statusInfo = succeeded ? "OK" : "FAIL"; if ( succeeded ) successes_.push_back( results_.size() - 1 ); --- 423,427 ---- PropertiesAccessor status = result.accessor()["result"]["status"]; bool succeeded = status.getValue( "success", false ).asBool(); ! CppTL::ConstString statusInfo = succeeded ? "OK" : "FAIL"; if ( succeeded ) successes_.push_back( results_.size() - 1 ); *************** *** 429,433 **** failures_.push_back( results_.size() - 1 ); ! std::string resultType = status.getValue( "type", "" ).asString(); if ( !resultType.empty() ) statusInfo += " (" + resultType + ")"; --- 429,433 ---- failures_.push_back( results_.size() - 1 ); ! CppTL::ConstString resultType = status.getValue( "type", "" ).asString(); if ( !resultType.empty() ) statusInfo += " (" + resultType + ")"; *************** *** 506,514 **** std::cout << getTestPath( testResult.test() ) << std::endl; ! std::string failureType = info["result"]["status"].getValue("type","").asString(); if ( !failureType.empty() ) std::cout << "Failure type : " << failureType << std::endl; ! std::string message = info["result"]["status"].getValue("message","").asString(); if ( !message.empty() ) std::cout << message << std::endl; --- 506,514 ---- std::cout << getTestPath( testResult.test() ) << std::endl; ! CppTL::ConstString failureType = info["result"]["status"].getValue("type","").asString(); if ( !failureType.empty() ) std::cout << "Failure type : " << failureType << std::endl; ! CppTL::ConstString message = info["result"]["status"].getValue("message","").asString(); if ( !message.empty() ) std::cout << message << std::endl; *************** *** 540,544 **** std::cout << getTestPath( testResult.test() ) << std::endl; ! std::string failureType = failure.getValue( "failure_type", isAssertion ? "assertion" : "fault" ).asString(); --- 540,544 ---- std::cout << getTestPath( testResult.test() ) << std::endl; ! CppTL::ConstString failureType = failure.getValue( "failure_type", isAssertion ? "assertion" : "fault" ).asString(); *************** *** 549,553 **** while ( enumMessages.hasNext() ) { // @todo check type ! std::string message = enumMessages.next().asString(); std::cout << message << std::endl; } --- 549,553 ---- while ( enumMessages.hasNext() ) { // @todo check type ! CppTL::ConstString message = enumMessages.next().asString(); std::cout << message << std::endl; } *************** *** 558,562 **** while ( enumLogs.hasNext() ) { // @todo check type ! std::string log = enumLogs.next().asString(); std::cout << log << std::endl; } --- 558,562 ---- while ( enumLogs.hasNext() ) { // @todo check type ! CppTL::ConstString log = enumLogs.next().asString(); std::cout << log << std::endl; } *************** *** 565,572 **** } ! inline std::string TextTestDriver::getTestPath( TestId test, unsigned int maxParent ) const { ! std::string path; const TestInfo &info = getTestInfo( test ); path = "/" + info.name_; --- 565,572 ---- } ! inline CppTL::ConstString TextTestDriver::getTestPath( TestId test, unsigned int maxParent ) const { ! CppTL::ConstString path; const TestInfo &info = getTestInfo( test ); path = "/" + info.name_; Index: properties.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/opentest/properties.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** properties.h 23 Feb 2005 21:40:13 -0000 1.10 --- properties.h 27 Feb 2005 10:15:57 -0000 1.11 *************** *** 3,10 **** # include <opentest/forwards.h> # include <cpptl/enumerator.h> # include <stdexcept> # include <deque> - # include <string> # include <vector> # include <typeinfo> // for std::bad_cast --- 3,10 ---- # include <opentest/forwards.h> + # include <cpptl/conststring.h> # include <cpptl/enumerator.h> # include <stdexcept> # include <deque> # include <vector> # include <typeinfo> // for std::bad_cast *************** *** 12,18 **** namespace OpenTest { - /// @todo For thread-safety, std::string need to be replaced with an implementation - /// that guaranty that the copy constructor is thread-safe. - class OPENTEST_API ValueBadCast : public std::bad_cast { --- 12,15 ---- *************** *** 74,78 **** Value( const char *value ); ! Value( const std::string &value ); Value( const Properties &value ); --- 71,75 ---- Value( const char *value ); ! Value( const CppTL::ConstString &value ); Value( const Properties &value ); *************** *** 100,104 **** long double asReal() const; ! std::string asString() const; const Properties &asProperties() const; --- 97,101 ---- long double asReal() const; ! CppTL::ConstString asString() const; const Properties &asProperties() const; *************** *** 141,145 **** Properties &append( const Value &value ); ! std::string toString() const; private: --- 138,142 ---- Properties &append( const Value &value ); ! CppTL::ConstString toString() const; private: *************** *** 169,175 **** { public: ! typedef CppTL::AnyEnumerator<std::string> NamesEnum; ! PropertyPath( const std::string &path, char separator = '/' ); --- 166,172 ---- { public: ! typedef CppTL::AnyEnumerator<CppTL::ConstString> NamesEnum; ! PropertyPath( const CppTL::ConstString &path, char separator = '/' ); *************** *** 179,183 **** NamesEnum names() const; ! PropertyPath &add( const std::string &name ); PropertyPath &addPath( const PropertyPath &path ); --- 176,180 ---- NamesEnum names() const; ! PropertyPath &add( const CppTL::ConstString &name ); PropertyPath &addPath( const PropertyPath &path ); *************** *** 185,194 **** PropertyPath parent() const; ! const std::string &name() const; bool isEmpty() const; private: ! typedef std::deque<std::string> PropertyNames; PropertyPath( const PropertyNames &names ); --- 182,191 ---- PropertyPath parent() const; ! const CppTL::ConstString &name() const; bool isEmpty() const; private: ! typedef std::deque<CppTL::ConstString> PropertyNames; PropertyPath( const PropertyNames &names ); *************** *** 204,211 **** { public: ! Property( const std::string &name, const Value &value ); ! const std::string &name() const; const Value &value() const; --- 201,208 ---- { public: ! Property( const CppTL::ConstString &name, const Value &value ); ! const CppTL::ConstString &name() const; const Value &value() const; *************** *** 214,218 **** private: ! std::string name_; Value value_; }; --- 211,215 ---- private: ! CppTL::ConstString name_; Value value_; }; *************** *** 232,236 **** typedef CppTL::AnyEnumerator<Value> ValueEnum; typedef CppTL::AnyEnumerator<Property> PropertyEnum; ! typedef CppTL::AnyEnumerator<std::string> NameEnum; Properties(); --- 229,233 ---- typedef CppTL::AnyEnumerator<Value> ValueEnum; typedef CppTL::AnyEnumerator<Property> PropertyEnum; ! typedef CppTL::AnyEnumerator<CppTL::ConstString> NameEnum; Properties(); *************** *** 250,259 **** Properties &set( const Property &property ); ! Properties &set( const std::string &name, const Value &value ); Properties &setIfNew( const Property &property ); ! Properties &setIfNew( const std::string &name, const Value &value ); --- 247,256 ---- Properties &set( const Property &property ); ! Properties &set( const CppTL::ConstString &name, const Value &value ); Properties &setIfNew( const Property &property ); ! Properties &setIfNew( const CppTL::ConstString &name, const Value &value ); *************** *** 304,308 **** PropertyEnum properties() const; ! std::string toString() const; private: --- 301,305 ---- PropertyEnum properties() const; ! CppTL::ConstString toString() const; private: *************** *** 314,320 **** struct NameAdaptor { ! typedef std::string result_type; ! std::string operator()( const Property &property ) const { return property.name(); --- 311,317 ---- struct NameAdaptor { ! typedef CppTL::ConstString result_type; ! CppTL::ConstString operator()( const Property &property ) const { return property.name(); *************** *** 322,328 **** }; ! PropertyList::iterator find( const std::string &name ); ! PropertyList::const_iterator find( const std::string &name ) const; PropertyList::const_iterator resolvePath( const PropertyPath &path ) const; --- 319,325 ---- }; ! PropertyList::iterator find( const CppTL::ConstString &name ); ! PropertyList::const_iterator find( const CppTL::ConstString &name ) const; PropertyList::const_iterator resolvePath( const PropertyPath &path ) const; *************** *** 336,340 **** void checkPathNotEmpty( const PropertyPath &path ) const; ! std::string toString( const std::string &prefix ) const; PropertyList properties_; --- 333,337 ---- void checkPathNotEmpty( const PropertyPath &path ) const; ! CppTL::ConstString toString( const CppTL::ConstString &prefix ) const; PropertyList properties_; |
From: Baptiste L. <bl...@us...> - 2005-02-27 10:15:51
|
Update of /cvsroot/cppunit/cppunit2/include/cpput In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2513/include/cpput Modified Files: assert.h message.h registry.h stringize.h test.h testcase.h testfixture.h testinfo.h testsuite.h translate.h typehelper.h Log Message: * use CppTL::ConstString instead of std::string for thread-safety Index: testinfo.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/testinfo.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** testinfo.h 21 Nov 2004 22:22:24 -0000 1.7 --- testinfo.h 27 Feb 2005 10:15:41 -0000 1.8 *************** *** 99,103 **** bool CPPUT_API testHasFailed(); ! void CPPUT_API log( const std::string &text ); void CPPUT_API appendFaultToResult( const OpenTest::Properties &fault ); --- 99,103 ---- bool CPPUT_API testHasFailed(); ! void CPPUT_API log( const CppTL::ConstString &text ); void CPPUT_API appendFaultToResult( const OpenTest::Properties &fault ); Index: testsuite.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/testsuite.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** testsuite.h 17 Nov 2004 21:47:09 -0000 1.3 --- testsuite.h 27 Feb 2005 10:15:41 -0000 1.4 *************** *** 13,17 **** AbstractTestSuite(); ! AbstractTestSuite( const std::string &name ); virtual int testCount() const = 0; --- 13,17 ---- AbstractTestSuite(); ! AbstractTestSuite( const CppTL::ConstString &name ); virtual int testCount() const = 0; *************** *** 31,35 **** { public: ! TestSuite( const std::string &name ); void add( const TestPtr &test ); --- 31,35 ---- { public: ! TestSuite( const CppTL::ConstString &name ); void add( const TestPtr &test ); *************** *** 50,54 **** ! TestSuitePtr CPPUT_API makeTestSuite( const std::string &name ); } // namespace CppUT --- 50,54 ---- ! TestSuitePtr CPPUT_API makeTestSuite( const CppTL::ConstString &name ); } // namespace CppUT Index: assert.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/assert.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** assert.h 20 Nov 2004 15:06:59 -0000 1.6 --- assert.h 27 Feb 2005 10:15:41 -0000 1.7 *************** *** 25,30 **** const Message &message = Message() ); ! Message CPPUT_API buildEqualityFailedMessage( const std::string &expected, ! const std::string &actual, const Message &message = Message() ); --- 25,30 ---- const Message &message = Message() ); ! Message CPPUT_API buildEqualityFailedMessage( const CppTL::ConstString &expected, ! const CppTL::ConstString &actual, const Message &message = Message() ); *************** *** 67,72 **** } ! Message CPPUT_API buildUnequalityFailedMessage( const std::string &expected, ! const std::string &actual, const Message &message = Message() ); --- 67,72 ---- } ! Message CPPUT_API buildUnequalityFailedMessage( const CppTL::ConstString &expected, ! const CppTL::ConstString &actual, const Message &message = Message() ); *************** *** 171,175 **** message.add( "Type: " + \ ::CppUT::extractObjectType( e, "std::exception" ) ); \ ! message.add( std::string("What: ") + e.what() ); \ ::CppUT::fail( message ); \ } catch ( ... ) { \ --- 171,175 ---- message.add( "Type: " + \ ::CppUT::extractObjectType( e, "std::exception" ) ); \ ! message.add( CppTL::ConstString("What: ") + e.what() ); \ ::CppUT::fail( message ); \ } catch ( ... ) { \ Index: registry.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/registry.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** registry.h 27 Jan 2004 20:34:28 -0000 1.1.1.1 --- registry.h 27 Feb 2005 10:15:41 -0000 1.2 *************** *** 2,7 **** # define CPPUT_REGISTRY_H_INCLUDED - # include <cpput/config.h> # include <cpput/forwards.h> # include <cpput/functor.h> # include <deque> --- 2,7 ---- # define CPPUT_REGISTRY_H_INCLUDED # include <cpput/forwards.h> + # include <cpptl/conststring.h> # include <cpput/functor.h> # include <deque> *************** *** 19,23 **** { public: ! static std::string defaultParentSuiteName(); static Registry &instance(); --- 19,23 ---- { public: ! static CppTL::ConstString defaultParentSuiteName(); static Registry &instance(); *************** *** 25,35 **** Registry(); ! void addChild( const std::string &parentSuiteName, ! const std::string &childSuiteName ); ! bool removeChild( const std::string &parentSuiteName, ! const std::string &childSuiteName ); ! TestFactoryId add( const std::string &parentSuiteName, const TestFactory &testFactory ); --- 25,35 ---- Registry(); ! void addChild( const CppTL::ConstString &parentSuiteName, ! const CppTL::ConstString &childSuiteName ); ! bool removeChild( const CppTL::ConstString &parentSuiteName, ! const CppTL::ConstString &childSuiteName ); ! TestFactoryId add( const CppTL::ConstString &parentSuiteName, const TestFactory &testFactory ); *************** *** 38,53 **** bool remove( TestFactoryId testFactoryId ); ! TestSuitePtr createTests( const std::string &suiteName ) const; TestSuitePtr createDefaultTests() const; ! void addCreatedTests( const std::string &suiteName, const TestSuitePtr &suite ) const; private: ! void addChildSuite( const std::string &suiteName, const TestSuitePtr &suite ) const; ! void addSuiteRegisteredTests( const std::string &suiteName, const TestSuitePtr &suite ) const; --- 38,53 ---- bool remove( TestFactoryId testFactoryId ); ! TestSuitePtr createTests( const CppTL::ConstString &suiteName ) const; TestSuitePtr createDefaultTests() const; ! void addCreatedTests( const CppTL::ConstString &suiteName, const TestSuitePtr &suite ) const; private: ! void addChildSuite( const CppTL::ConstString &suiteName, const TestSuitePtr &suite ) const; ! void addSuiteRegisteredTests( const CppTL::ConstString &suiteName, const TestSuitePtr &suite ) const; *************** *** 57,67 **** typedef std::deque<TestFactoryWithId> TestFactories; ! typedef std::map<std::string,TestFactories> TestFactoryRegistry; TestFactoryRegistry registry_; ! typedef std::multimap<std::string,std::string> ParentChildRelationShips; ParentChildRelationShips relations_; ! typedef std::map<TestFactoryId,std::string> TestFactoryParentSuiteById; TestFactoryParentSuiteById parentSuiteById_; --- 57,67 ---- typedef std::deque<TestFactoryWithId> TestFactories; ! typedef std::map<CppTL::ConstString,TestFactories> TestFactoryRegistry; TestFactoryRegistry registry_; ! typedef std::multimap<CppTL::ConstString,CppTL::ConstString> ParentChildRelationShips; ParentChildRelationShips relations_; ! typedef std::map<TestFactoryId,CppTL::ConstString> TestFactoryParentSuiteById; TestFactoryParentSuiteById parentSuiteById_; *************** *** 81,85 **** { public: ! SuiteRegisterer( const std::string &suiteName = "" ) { registerSuite( suiteName, "" ); --- 81,85 ---- { public: ! SuiteRegisterer( const CppTL::ConstString &suiteName = "" ) { registerSuite( suiteName, "" ); *************** *** 87,92 **** SuiteRegisterer( Impl::RegisterToNamedSuiteTag, ! const std::string &parentSuiteName, ! const std::string &suiteName = std::string( "" ) ) { registerSuite( suiteName, parentSuiteName ); --- 87,92 ---- SuiteRegisterer( Impl::RegisterToNamedSuiteTag, ! const CppTL::ConstString &parentSuiteName, ! const CppTL::ConstString &suiteName = CppTL::ConstString( "" ) ) { registerSuite( suiteName, parentSuiteName ); *************** *** 99,108 **** protected: ! void registerSuite( const std::string &suiteName, ! const std::string &parentSuiteName ) { ! std::string suiteNameByValue( suiteName ); TestFactory factory = makeFnR0<TestPtr>( ! bindR1( makeCFnR1<TestPtr, std::string>( &SuiteType::suite ), suiteNameByValue ) ); if ( parentSuiteName == "" ) --- 99,108 ---- protected: ! void registerSuite( const CppTL::ConstString &suiteName, ! const CppTL::ConstString &parentSuiteName ) { ! CppTL::ConstString suiteNameByValue( suiteName ); TestFactory factory = makeFnR0<TestPtr>( ! bindR1( makeCFnR1<TestPtr, CppTL::ConstString>( &SuiteType::suite ), suiteNameByValue ) ); if ( parentSuiteName == "" ) *************** *** 144,149 **** { public: ! SuiteRelationshipRegisterer( const std::string &parentSuiteName, ! const std::string &childSuiteName ) : parentSuiteName_( parentSuiteName ) , childSuiteName_( childSuiteName ) --- 144,149 ---- { public: ! SuiteRelationshipRegisterer( const CppTL::ConstString &parentSuiteName, ! const CppTL::ConstString &childSuiteName ) : parentSuiteName_( parentSuiteName ) , childSuiteName_( childSuiteName ) *************** *** 158,163 **** private: ! std::string parentSuiteName_; ! std::string childSuiteName_; }; --- 158,163 ---- private: ! CppTL::ConstString parentSuiteName_; ! CppTL::ConstString childSuiteName_; }; Index: message.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/message.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** message.h 23 Feb 2005 21:41:54 -0000 1.5 --- message.h 27 Feb 2005 10:15:41 -0000 1.6 *************** *** 3,8 **** # include <cpput/config.h> ! //# include <opentest/properties.h> ! # include <string> # include <vector> --- 3,7 ---- # include <cpput/config.h> ! # include <cpptl/conststring.h> # include <vector> *************** *** 17,21 **** } ! Message( const std::string &shortDescription ) { add( shortDescription ); --- 16,30 ---- } ! Message( const CppTL::StringBuffer &shortDescription ) ! { ! add( shortDescription ); ! } ! ! Message( const CppTL::StringConcatenator &shortDescription ) ! { ! add( shortDescription ); ! } ! ! Message( const CppTL::ConstString &shortDescription ) { add( shortDescription ); *************** *** 35,43 **** const char *detail ) { ! insertAt( index, std::string(detail) ); } void insertAt( int index, ! const std::string &detail ) { details_.insert( details_.begin() + index, detail ); --- 44,52 ---- const char *detail ) { ! insertAt( index, CppTL::ConstString(detail) ); } void insertAt( int index, ! const CppTL::ConstString &detail ) { details_.insert( details_.begin() + index, detail ); *************** *** 54,66 **** void add( const char *detail ) // needed to solve ambiguity due to implicit constructor { ! add( std::string(detail) ); } ! void add( const std::string &detail ) { details_.push_back( detail ); } ! void add( const Message &other ) { insertAt( details_.size(), other ); --- 63,75 ---- void add( const char *detail ) // needed to solve ambiguity due to implicit constructor { ! add( CppTL::ConstString(detail) ); } ! void add( const CppTL::ConstString &detail ) { details_.push_back( detail ); } ! void extend( const Message &other ) { insertAt( details_.size(), other ); *************** *** 72,83 **** } ! std::string at( int index ) const { return details_.at( index ); } ! std::string toString() const { ! std::string message; Details::const_iterator it = details_.begin(); Details::const_iterator itEnd = details_.end(); --- 81,92 ---- } ! CppTL::ConstString at( int index ) const { return details_.at( index ); } ! CppTL::ConstString toString() const { ! CppTL::ConstString message; Details::const_iterator it = details_.begin(); Details::const_iterator itEnd = details_.end(); *************** *** 110,114 **** //} ! //void setResultType( const std::string &resultType ) //{ // properties().set( "cpput.result_type", resultType ); --- 119,123 ---- //} ! //void setResultType( const CppTL::ConstString &resultType ) //{ // properties().set( "cpput.result_type", resultType ); *************** *** 123,127 **** //Properties properties_; ! typedef std::vector<std::string> Details; Details details_; }; --- 132,136 ---- //Properties properties_; ! typedef std::vector<CppTL::ConstString> Details; Details details_; }; Index: translate.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/translate.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** translate.h 27 Jan 2004 20:34:29 -0000 1.1.1.1 --- translate.h 27 Feb 2005 10:15:41 -0000 1.2 *************** *** 3,7 **** # include <cpput/config.h> ! # include <string> --- 3,7 ---- # include <cpput/config.h> ! # include <cpptl/conststring.h> *************** *** 9,13 **** /// Translate the specified message ! inline std::string CPPUT_API translate( const char *message ) { return message; --- 9,13 ---- /// Translate the specified message ! inline CppTL::ConstString CPPUT_API translate( const char *message ) { return message; Index: test.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/test.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** test.h 20 Nov 2004 16:17:32 -0000 1.4 --- test.h 27 Feb 2005 10:15:41 -0000 1.5 *************** *** 22,26 **** } ! std::string name() const { return info().getValue( "configuration/name", "" ).asString(); --- 22,26 ---- } ! CppTL::ConstString name() const { return info().getValue( "configuration/name", "" ).asString(); *************** *** 29,33 **** /// @warning You must never change the name of the test after /// registering the test or scheduling it for running. ! void setName( const std::string &name ) { info()["configuration/name"] = name; --- 29,33 ---- /// @warning You must never change the name of the test after /// registering the test or scheduling it for running. ! void setName( const CppTL::ConstString &name ) { info()["configuration/name"] = name; *************** *** 63,67 **** } ! Test( const std::string &name ) { setName( name ); --- 63,67 ---- } ! Test( const CppTL::ConstString &name ) { setName( name ); Index: stringize.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/stringize.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** stringize.h 15 Jun 2004 07:45:42 -0000 1.2 --- stringize.h 27 Feb 2005 10:15:41 -0000 1.3 *************** *** 5,16 **** # include <cpput/config.h> # include <string> namespace CppUT { - // implemented in assertstring.cpp - std::string CPPUT_API quoteString( const std::string &str ); - - template<class ValueType> struct DefaultStringizer --- 5,13 ---- # include <cpput/config.h> # include <string> + # include <cpptl/stringtools.h> namespace CppUT { template<class ValueType> struct DefaultStringizer *************** *** 51,54 **** --- 48,56 ---- } + inline std::string convertToString( const CppTL::ConstString &s ) + { + return s.c_str(); + } + inline NotConvertibleToStdString convertToString( ... ) { *************** *** 75,79 **** std::string stringize( const ValueType &value, const std::string &str ) { ! return quoteString( str ); } --- 77,81 ---- std::string stringize( const ValueType &value, const std::string &str ) { ! return CppTL::quoteString( str ).c_str(); } Index: testcase.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/testcase.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** testcase.h 22 Feb 2005 21:14:38 -0000 1.7 --- testcase.h 27 Feb 2005 10:15:41 -0000 1.8 *************** *** 15,19 **** { public: ! AbstractTestCase( const std::string &name ); /// @warning: TestInfo::startNewTest() must be called before each test --- 15,19 ---- { public: ! AbstractTestCase( const CppTL::ConstString &name ); /// @warning: TestInfo::startNewTest() must be called before each test *************** *** 42,51 **** public: TestCase( const Functor0 &run, ! const std::string &name ); TestCase( const Functor0 &setUp, const Functor0 &run, const Functor0 &tearDown, ! const std::string &name ); public: // overridden from AbstractTestCase --- 42,51 ---- public: TestCase( const Functor0 &run, ! const CppTL::ConstString &name ); TestCase( const Functor0 &setUp, const Functor0 &run, const Functor0 &tearDown, ! const CppTL::ConstString &name ); public: // overridden from AbstractTestCase *************** *** 64,68 **** TestPtr CPPUT_API makeTestCase( const Functor0 &run, ! const std::string &name ); --- 64,68 ---- TestPtr CPPUT_API makeTestCase( const Functor0 &run, ! const CppTL::ConstString &name ); *************** *** 70,76 **** const Functor0 &run, const Functor0 &tearDown, ! const std::string &name ); ! TestPtr CPPUT_API makeFailingTestCase( const std::string &name, const Message &message ); --- 70,76 ---- const Functor0 &run, const Functor0 &tearDown, ! const CppTL::ConstString &name ); ! TestPtr CPPUT_API makeFailingTestCase( const CppTL::ConstString &name, const Message &message ); *************** *** 78,82 **** TestPtr makeFixtureTestCase( const CppTL::SharedPtr<FixtureType> &fixture, const Functor0 &run, ! const std::string &name ) { return makeTestCase( makeMemFn0<FixtureType>( fixture, &FixtureType::setUp ), --- 78,82 ---- TestPtr makeFixtureTestCase( const CppTL::SharedPtr<FixtureType> &fixture, const Functor0 &run, ! const CppTL::ConstString &name ) { return makeTestCase( makeMemFn0<FixtureType>( fixture, &FixtureType::setUp ), Index: typehelper.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/typehelper.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** typehelper.h 23 Feb 2005 21:43:44 -0000 1.3 --- typehelper.h 27 Feb 2005 10:15:41 -0000 1.4 *************** *** 11,20 **** namespace Impl { ! inline std::string CPPUT_API extractTypeId( const std::type_info &type, ! const char *hint ) { // VC6 define the macro _CPPRTTI when RTTI is enabled. Is that standard & portable ? ! std::string typeName( type.name() ); const int classKeywordLength = 6; if ( typeName.substr( 0, classKeywordLength ) == "class " ) --- 11,20 ---- namespace Impl { ! inline CppTL::ConstString CPPUT_API extractTypeId( const std::type_info &type, ! const char *hint ) { // VC6 define the macro _CPPRTTI when RTTI is enabled. Is that standard & portable ? ! CppTL::ConstString typeName( type.name() ); const int classKeywordLength = 6; if ( typeName.substr( 0, classKeywordLength ) == "class " ) *************** *** 25,30 **** template<class AType> ! std::string extractType( CppTL::Type<AType>, ! const char *hint ) { return Impl::extractTypeId( typeid( AType ), hint ); --- 25,30 ---- template<class AType> ! CppTL::ConstString extractType( CppTL::Type<AType>, ! const char *hint ) { return Impl::extractTypeId( typeid( AType ), hint ); *************** *** 32,37 **** template<typename Object> ! std::string extractObjectType( const Object &object, ! const char *hint ) { return Impl::extractTypeId( typeid(object), hint ); --- 32,37 ---- template<typename Object> ! CppTL::ConstString extractObjectType( const Object &object, ! const char *hint ) { return Impl::extractTypeId( typeid(object), hint ); Index: testfixture.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/testfixture.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** testfixture.h 17 Nov 2004 08:59:05 -0000 1.5 --- testfixture.h 27 Feb 2005 10:15:41 -0000 1.6 *************** *** 118,122 **** typedef FixtureType CppUT_ThisType; ! static std::string defaultSuiteName() { return ::CppUT::extractType<CppUT_ThisType>( #FixtureType ); --- 118,122 ---- typedef FixtureType CppUT_ThisType; ! static CppTL::ConstString defaultSuiteName() { return ::CppUT::extractType<CppUT_ThisType>( #FixtureType ); *************** *** 160,164 **** # else // if CPPUT_USE_RTTI_TO_NAME_SUITE # define CPPUT_TESTSUITE_NAME_FROM_TYPE( FixtureType ) \ ! std::string( #FixtureType ) # endif // if CPPUT_USE_RTTI_TO_NAME_SUITE --- 160,164 ---- # else // if CPPUT_USE_RTTI_TO_NAME_SUITE # define CPPUT_TESTSUITE_NAME_FROM_TYPE( FixtureType ) \ ! CppTL::ConstString( #FixtureType ) # endif // if CPPUT_USE_RTTI_TO_NAME_SUITE *************** *** 169,173 **** typedef FixtureType CppUT_ThisType; \ \ ! static std::string defaultSuiteName() \ { \ return CPPUT_TESTSUITE_NAME_FROM_TYPE( FixtureType ); \ --- 169,173 ---- typedef FixtureType CppUT_ThisType; \ \ ! static CppTL::ConstString defaultSuiteName() \ { \ return CPPUT_TESTSUITE_NAME_FROM_TYPE( FixtureType ); \ *************** *** 188,192 **** } \ \ ! static ::CppUT::TestPtr suite( std::string suiteName = std::string("") ) \ { \ if ( suiteName.empty() ) \ --- 188,192 ---- } \ \ ! static ::CppUT::TestPtr suite( CppTL::ConstString suiteName = CppTL::ConstString("") ) \ { \ if ( suiteName.empty() ) \ *************** *** 215,219 **** { \ ::CppUT::TestSuitePtr &parentSuite = suite; \ ! std::string suiteName = CppUT::translate( "SharedSetUp" ); \ ::CppUT::TestSuitePtr suite = ::CppUT::makeTestSuite( suiteName ); \ fixtureFactory.useNewFixture(); \ --- 215,219 ---- { \ ::CppUT::TestSuitePtr &parentSuite = suite; \ ! CppTL::ConstString suiteName = CppUT::translate( "SharedSetUp" ); \ ::CppUT::TestSuitePtr suite = ::CppUT::makeTestSuite( suiteName ); \ fixtureFactory.useNewFixture(); \ |
From: Baptiste L. <bl...@us...> - 2005-02-27 10:15:05
|
Update of /cvsroot/cppunit/cppunit2/include/cpput In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2316/include/cpput Removed Files: properties.h Log Message: * removed, replaced by opentest/properties. --- properties.h DELETED --- |