diff options
| author | Baptiste Lepilleur <gaiacrtn@free.fr> | 2002-07-03 06:02:49 +0000 |
|---|---|---|
| committer | Baptiste Lepilleur <gaiacrtn@free.fr> | 2002-07-03 06:02:49 +0000 |
| commit | ad45759ab7a47c7a7932f7e6be66f3ea106b643b (patch) | |
| tree | 827097bba87b959981cc3676f0e4d90630649c0b /src/cppunit/Asserter.cpp | |
| parent | d8e61dcb0fd9046b44ca3e9e6868b5429eee8aa9 (diff) | |
| download | cppunit-ad45759ab7a47c7a7932f7e6be66f3ea106b643b.tar.gz | |
Include/cppunit/XmlOutputter.
include/cppunit/XmlOutputter.h: fixed XmlOutputter constructed default
value initializatino which caused compilation error with BC5.
* src/cppunit/PlugInManager.cpp: added missing CPPUNIT_NO_TESTPLUGIN guard.
* src/msvc6/testrunner/TestRunner.dsp:
* src/msvc6/testrunner/TestRunner.rc:
* src/msvc6/testrunner/TestRunnerDlg.cpp:
* src/msvc6/testrunner/TestRunnerDlg.h:
* src/msvc6/testrunner/TreeHierarchyDlg.cpp:
* src/msvc6/testrunner/TreeHierarchyDlg.h:
* src/msvc6/testpluginrunner/TestPlugInRunner.dsp:
* src/msvc6/testpluginrunner/TestPlugInRunner.rc:
* src/msvc6/testpluginrunner/TestPlugInRunnerApp.cpp:
* src/msvc6/testpluginrunner/TestPlugInRunnerDlg.cpp:
* src/msvc6/testpluginrunner/TestPlugInRunnerDlg.h: applied Steven Mitter
patch to fix bug #530426 (conflict between TestRunner and host application
resources). Adapted patch to compile work with Unicode.
* src/msvc6/testrunner/ResourceLoaders.h:
* src/msvc6/testrunner/ResourceLoaders.cpp:
* src/msvc6/testrunner/Change-Diary-ResourceBugFix.txt: added, from
Steven Mitter's patch. Simplified loadCString() to compile with Unicode.
* src/cppunit/cppunit.dsp:
* src/cppunit/cppunit_dll.dsp:
* src/DllPlugInTester/DllPlugInTester.dsp:
* src/msvc6/testrunner/TestRunner.dsp:
* src/msvc6/testpluginrunner/TestPlugInRunner.dsp: all lib, dll and exe are
now created in the intermediate directory. A post-build rule is used to
copy them to the lib/ directory.
Diffstat (limited to 'src/cppunit/Asserter.cpp')
| -rw-r--r-- | src/cppunit/Asserter.cpp | 59 |
1 files changed, 31 insertions, 28 deletions
diff --git a/src/cppunit/Asserter.cpp b/src/cppunit/Asserter.cpp index e43c19b..0b64f4f 100644 --- a/src/cppunit/Asserter.cpp +++ b/src/cppunit/Asserter.cpp @@ -10,7 +10,6 @@ namespace CppUnit namespace Asserter { - void fail( std::string message, const SourceLine &sourceLine ) @@ -46,31 +45,32 @@ failIf( bool shouldFail, } -void -failNotEqual( std::string expected, - std::string actual, - const SourceLine &sourceLine, - const Message &additionalMessage, - std::string shortDescription ) +std::string +makeExpected( const std::string &expectedValue ) { - Message message( shortDescription, - "Expected: " + expected, - "Actual : " + actual ); - message.addDetail( additionalMessage ); - fail( message, sourceLine ); + return "Expected: " + expectedValue; } -void -failNotEqualIf( bool shouldFail, - std::string expected, - std::string actual, - const SourceLine &sourceLine, - const Message &additionalMessage, - std::string shortDescription ) +std::string +makeActual( const std::string &actualValue ) { - if ( shouldFail ) - failNotEqual( expected, actual, sourceLine, additionalMessage, shortDescription ); + return "Actual : " + actualValue; +} + + +Message +makeNotEqualMessage( const std::string &expectedValue, + const std::string &actualValue, + const AdditionalMessage &additionalMessage, + const std::string &shortDescription ) +{ + Message message( shortDescription, + makeExpected( expectedValue ), + makeActual( actualValue ) ); + message.addDetail( additionalMessage ); + + return message; } @@ -78,12 +78,14 @@ void failNotEqual( std::string expected, std::string actual, const SourceLine &sourceLine, - std::string additionalMessage ) + const AdditionalMessage &additionalMessage, + std::string shortDescription ) { - Message message; - if ( !additionalMessage.empty() ) - message.addDetail( additionalMessage ); - failNotEqual( expected, actual, sourceLine, message ); + fail( makeNotEqualMessage( expected, + actual, + additionalMessage, + shortDescription ), + sourceLine ); } @@ -92,10 +94,11 @@ failNotEqualIf( bool shouldFail, std::string expected, std::string actual, const SourceLine &sourceLine, - std::string additionalMessage ) + const AdditionalMessage &additionalMessage, + std::string shortDescription ) { if ( shouldFail ) - failNotEqual( expected, actual, sourceLine, additionalMessage ); + failNotEqual( expected, actual, sourceLine, additionalMessage, shortDescription ); } |
