[Cppunit-cvs] cppunit2/src/cpputtest cpputtest.vcproj,1.8,1.9 testbasicassertion.cpp,1.3,1.4 testfun
Brought to you by:
blep
Update of /cvsroot/cppunit/cppunit2/src/cpputtest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16247/src/cpputtest Modified Files: cpputtest.vcproj testbasicassertion.cpp testfunctor.cpp testtestcase.cpp testtestcontext.cpp testtestrunresult.cpp testtestsuite.cpp Log Message: * moved the assertion implementation to using TestInfo. * added assertion (tested/failed) counter to TestInfo. Index: testtestrunresult.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/testtestrunresult.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** testtestrunresult.cpp 4 Aug 2004 08:01:15 -0000 1.4 --- testtestrunresult.cpp 20 Nov 2004 12:17:52 -0000 1.5 *************** *** 31,34 **** --- 31,35 ---- try { + CppUT::TestInfo::startNewTest(); CppUT::TestRunResult result; CppUT::TestContext context; *************** *** 86,90 **** CPPUT_ASSERT_FALSE( result.failureAt(3).isAssertionFailure() ); } ! catch ( CppUT::AssertException &e ) { std::cout << "testResult() failed: " << e.what() << std::endl; --- 87,91 ---- CPPUT_ASSERT_FALSE( result.failureAt(3).isAssertionFailure() ); } ! catch ( CppUT::AbortingAssertionException &e ) { std::cout << "testResult() failed: " << e.what() << std::endl; Index: testtestsuite.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/testtestsuite.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** testtestsuite.cpp 17 Nov 2004 21:47:10 -0000 1.3 --- testtestsuite.cpp 20 Nov 2004 12:17:52 -0000 1.4 *************** *** 34,37 **** --- 34,38 ---- try { + CppUT::TestInfo::startNewTest(); MockTestVisitor visitor; CppUT::TestSuitePtr suite1 = CppUT::makeTestSuite( "Suite 1" ); *************** *** 56,60 **** CPPUT_ASSERT( test2 == suite1->testAt(1), "returned test[1] is not added test" ); } ! catch ( CppUT::AssertException &e ) { std::cout << "testTestsuite() failed: " << e.what() << std::endl; --- 57,61 ---- CPPUT_ASSERT( test2 == suite1->testAt(1), "returned test[1] is not added test" ); } ! catch ( CppUT::AbortingAssertionException &e ) { std::cout << "testTestsuite() failed: " << e.what() << std::endl; Index: cpputtest.vcproj =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/cpputtest.vcproj,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** cpputtest.vcproj 17 Nov 2004 21:47:10 -0000 1.8 --- cpputtest.vcproj 20 Nov 2004 12:17:51 -0000 1.9 *************** *** 209,212 **** --- 209,218 ---- <File RelativePath=".\testbasicassertion.cpp"> + <FileConfiguration + Name="Debug|Win32"> + <Tool + Name="VCCLCompilerTool" + GeneratePreprocessedFile="0"/> + </FileConfiguration> </File> <File Index: testtestcase.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/testtestcase.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** testtestcase.cpp 17 Nov 2004 21:47:10 -0000 1.6 --- testtestcase.cpp 20 Nov 2004 12:17:52 -0000 1.7 *************** *** 253,256 **** --- 253,257 ---- try { + CppUT::TestInfo::startNewTest(); testCaseSimpleRun(); testCaseSetUpRunTearDown(); *************** *** 261,265 **** testParametrizedFixture(); } ! catch ( CppUT::AssertException &e ) { std::cout << "testTestCase() failed: " << e.what() << std::endl; --- 262,266 ---- testParametrizedFixture(); } ! catch ( CppUT::AbortingAssertionException &e ) { std::cout << "testTestCase() failed: " << e.what() << std::endl; Index: testtestcontext.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/testtestcontext.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** testtestcontext.cpp 4 Aug 2004 19:41:18 -0000 1.8 --- testtestcontext.cpp 20 Nov 2004 12:17:52 -0000 1.9 *************** *** 128,132 **** static void callbackThrowAssertException() { ! throw CppUT::AssertException( "test assertion" ); } --- 128,132 ---- static void callbackThrowAssertException() { ! throw CppUT::AbortingAssertionException( "test assertion" ); } *************** *** 170,174 **** static void callbackTestRunThrowAssertException( CppUT::TestContext * ) { ! throw CppUT::AssertException( "test assertion" ); } --- 170,174 ---- static void callbackTestRunThrowAssertException( CppUT::TestContext * ) { ! throw CppUT::AbortingAssertionException( "test assertion" ); } *************** *** 379,382 **** --- 379,383 ---- try { + CppUT::TestInfo::startNewTest(); testTestContextProtect(); testTestContextProtectTestRun(); *************** *** 385,389 **** testTestContextGuardChain(); } ! catch ( CppUT::AssertException &e ) { std::cout << "testTestContext() failed: " << e.what() << std::endl; --- 386,390 ---- testTestContextGuardChain(); } ! catch ( CppUT::AbortingAssertionException &e ) { std::cout << "testTestContext() failed: " << e.what() << std::endl; Index: testbasicassertion.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/testbasicassertion.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** testbasicassertion.cpp 4 Aug 2004 08:42:27 -0000 1.3 --- testbasicassertion.cpp 20 Nov 2004 12:17:52 -0000 1.4 *************** *** 6,9 **** --- 6,10 ---- static bool testAssertThrow() { + CppUT::TestInfo::startNewTest(); try { *************** *** 16,26 **** } try { CPPUT_ASSERT_THROW( 1234, std::exception ); ! std::cout << "Test 2: expected AssertException not thrown by CPPUT_ASSERT_THROW." << std::endl; return false; } ! catch ( CppUT::AssertException & ) { } --- 17,28 ---- } + CppUT::TestInfo::startNewTest(); try { CPPUT_ASSERT_THROW( 1234, std::exception ); ! std::cout << "Test 2: expected AbortingAssertionException not thrown by CPPUT_ASSERT_THROW." << std::endl; return false; } ! catch ( CppUT::AbortingAssertionException & ) { } *************** *** 32,53 **** static bool testAssertNoThrow() { try { CPPUT_ASSERT_NO_THROW( 1234 ); } ! catch ( CppUT::AssertException &e ) { ! std::cout << "Test 3: CPPUT_ASSERT_NO_THROW should not have thrown an exception." << std::endl << e.what() << std::endl; return false; } try { CPPUT_ASSERT_NO_THROW( throw std::exception( "dummy" ) ); ! std::cout << "Test 4: expected AssertException not thrown by CPPUT_ASSERT_THROW." << std::endl; return false; } ! catch ( CppUT::AssertException & ) { } --- 34,59 ---- static bool testAssertNoThrow() { + CppUT::TestInfo::startNewTest(); try { CPPUT_ASSERT_NO_THROW( 1234 ); } ! 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; } + CppUT::TestInfo::startNewTest(); try { CPPUT_ASSERT_NO_THROW( throw std::exception( "dummy" ) ); ! std::cout << "Test 4: expected AbortingAssertionException " ! "not thrown by CPPUT_ASSERT_THROW." << std::endl; return false; } ! catch ( CppUT::AbortingAssertionException & ) { } *************** *** 71,79 **** return false; try { - CPPUT_ASSERT_THROW( CPPUT_SUCCEED( CppUT::Message( "warning..." ) ), - CppUT::SuccessException ); - // CPPUT_ASSERT CPPUT_ASSERT_ASSERTION_PASS( CPPUT_ASSERT( true ) ); --- 77,83 ---- return false; + CppUT::TestInfo::startNewTest(); try { // CPPUT_ASSERT CPPUT_ASSERT_ASSERTION_PASS( CPPUT_ASSERT( true ) ); *************** *** 81,85 **** CPPUT_ASSERT_ASSERTION_PASS( CPPUT_ASSERT( true, "should pass" ) ); ! CPPUT_ASSERT_ASSERTION_FAIL( CPPUT_ASSERT( false, "should throw AssertException" ) ); CPPUT_ASSERT_ASSERTION_PASS( CPPUT_ASSERT_EXPR( true ) ); --- 85,90 ---- CPPUT_ASSERT_ASSERTION_PASS( CPPUT_ASSERT( true, "should pass" ) ); ! CPPUT_ASSERT_ASSERTION_FAIL( CPPUT_ASSERT( false, ! "should throw AbortingAssertionException" ) ); CPPUT_ASSERT_ASSERTION_PASS( CPPUT_ASSERT_EXPR( true ) ); *************** *** 91,95 **** CPPUT_ASSERT_ASSERTION_PASS( CPPUT_ASSERT_FALSE( false, "should pass" ) ); ! CPPUT_ASSERT_ASSERTION_FAIL( CPPUT_ASSERT_FALSE( true, "should throw AssertException" ) ); CPPUT_ASSERT_ASSERTION_PASS( CPPUT_ASSERT_EXPR_FALSE( false ) ); --- 96,101 ---- CPPUT_ASSERT_ASSERTION_PASS( CPPUT_ASSERT_FALSE( false, "should pass" ) ); ! CPPUT_ASSERT_ASSERTION_FAIL( CPPUT_ASSERT_FALSE( true, ! "should throw AbortingAssertionException" ) ); CPPUT_ASSERT_ASSERTION_PASS( CPPUT_ASSERT_EXPR_FALSE( false ) ); *************** *** 120,124 **** CPPUT_ASSERT_ASSERTION_FAIL( CPPUT_ASSERT_NOT_EQUAL( "abc", std::string("abc") ) ); } ! catch ( CppUT::AssertException &e ) { std::cout << "testAssertions() failed: " << e.what() << std::endl; --- 126,130 ---- CPPUT_ASSERT_ASSERTION_FAIL( CPPUT_ASSERT_NOT_EQUAL( "abc", std::string("abc") ) ); } ! catch ( CppUT::AbortingAssertionException &e ) { std::cout << "testAssertions() failed: " << e.what() << std::endl; Index: testfunctor.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/testfunctor.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** testfunctor.cpp 17 Nov 2004 08:59:34 -0000 1.4 --- testfunctor.cpp 20 Nov 2004 12:17:52 -0000 1.5 *************** *** 194,206 **** try { testFunctor(); testFunctor1(); ! testConstReferenceSupport(); ! testReferenceSupport(); testBindValue(); testBindConstRef(); testBindRef(); } ! catch ( CppUT::AssertException &e ) { std::cout << "testTestContext() failed: " << e.what() << std::endl; --- 194,207 ---- try { + CppUT::TestInfo::startNewTest(); testFunctor(); testFunctor1(); ! testConstReferenceSupport(); ! testReferenceSupport(); testBindValue(); testBindConstRef(); testBindRef(); } ! catch ( CppUT::AbortingAssertionException &e ) { std::cout << "testTestContext() failed: " << e.what() << std::endl; |