From f1bf3276752a10a2cdf4e3cf3087399d199c4566 Mon Sep 17 00:00:00 2001 From: Baptiste Lepilleur Date: Sat, 13 Jul 2002 09:33:50 +0000 Subject: Include/cppunit/ui/text/TestRunner. include/cppunit/ui/text/TestRunner.h: * src/cppunit/TextTestRunner.cpp: Renamed TextUi::TestRunner TextTestRunner and moved it to the CppUnit namespace. Added a deprecated typedef for compatibility with previous version. * include/cppunit/ui/text/TextTestRunner.h: added. * include/cppunit/ui/mfc/TestRunner.h: * src/cppunit/msvc6/testrunner/TestRunner.cpp: Renamed MfcUi::TestRunner MfcTestRunner. Added deprecated typedef for compatibility. Renamed TestRunner.cpp to MfcTestRunner.cpp. * include/cppunit/ui/mfc/MfcTestRunner.h: added. * include/cppunit/ui/qt/TestRunner.h: * src/qttestrunner/TestRunner.cpp: renamed QtUi::TestRunner QtTestRunner and moved it to CppUnit namespace. Added a deprecated typedef for compatibility. Renamed TestRunner.cpp to QtTestRunner.cpp. * include/cppunit/ui/qt/TestRunner.h: * src/qttestrunner/TestRunner.h: Moved TestRunner to CppUnit namespace and renamed it QtTestRunner. Added deprecated typedef for compatibility. * include/cppunit/Asserter.h: * src/cppunit/Asserter.cpp: changed namespace Asserter to a struct and made all methods static. * include/cppunit/extensions/HelperMacros.h: * include/cppunit/extensions/SourceLine.h: * include/cppunit/extensions/TestAssert.h: * include/cppunit/extensions/TestPlugIn.h: * include/cppunit/Portability.h: changed CPPUNIT_NS(symbol) to a symbol macro that expand either to CppUnit or nothing. The symbol is no longer a parameter. * include/cppunit/portability/CppUnitVector.h: * include/cppunit/portability/CppUnitDeque.h: * include/cppunit/portability/CppUnitMap.h: added. STL Wrapper for compilers that do not support template default argumenent and need the allocator to be passed when instantiating STL container. * examples/cppunittest/*.h: * examples/cppunittest/*.cpp: * src/msvc6/testrunner/*.h: * src/msvc6/testrunner/*.cpp: * src/msvc6/testpluginrunner/*.h: * src/msvc6/testpluginrunner/*.cpp: * src/qttestrunner/*.h: * src/qttestrunner/*.cpp: replaced occurence of CppUnit:: by CPPUNIT_NS. * src/cppunit/TestSuite.h: replaced occurence of std::vector by CppUnitVector. --- src/cppunit/Asserter.cpp | 58 ++++++++++++++++++++++-------------------------- 1 file changed, 27 insertions(+), 31 deletions(-) (limited to 'src/cppunit/Asserter.cpp') diff --git a/src/cppunit/Asserter.cpp b/src/cppunit/Asserter.cpp index 1c72aff..a9cf95c 100644 --- a/src/cppunit/Asserter.cpp +++ b/src/cppunit/Asserter.cpp @@ -6,29 +6,26 @@ CPPUNIT_NS_BEGIN -namespace Asserter -{ - void -fail( std::string message, - const SourceLine &sourceLine ) +Asserter::fail( std::string message, + const SourceLine &sourceLine ) { fail( Message( "assertion failed", message ), sourceLine ); } void -fail( const Message &message, - const SourceLine &sourceLine ) +Asserter::fail( const Message &message, + const SourceLine &sourceLine ) { throw Exception( message, sourceLine ); } void -failIf( bool shouldFail, - const Message &message, - const SourceLine &sourceLine ) +Asserter::failIf( bool shouldFail, + const Message &message, + const SourceLine &sourceLine ) { if ( shouldFail ) fail( message, sourceLine ); @@ -36,33 +33,33 @@ failIf( bool shouldFail, void -failIf( bool shouldFail, - std::string message, - const SourceLine &sourceLine ) +Asserter::failIf( bool shouldFail, + std::string message, + const SourceLine &sourceLine ) { failIf( shouldFail, Message( "assertion failed", message ), sourceLine ); } std::string -makeExpected( const std::string &expectedValue ) +Asserter::makeExpected( const std::string &expectedValue ) { return "Expected: " + expectedValue; } std::string -makeActual( const std::string &actualValue ) +Asserter::makeActual( const std::string &actualValue ) { return "Actual : " + actualValue; } Message -makeNotEqualMessage( const std::string &expectedValue, - const std::string &actualValue, - const AdditionalMessage &additionalMessage, - const std::string &shortDescription ) +Asserter::makeNotEqualMessage( const std::string &expectedValue, + const std::string &actualValue, + const AdditionalMessage &additionalMessage, + const std::string &shortDescription ) { Message message( shortDescription, makeExpected( expectedValue ), @@ -74,11 +71,11 @@ makeNotEqualMessage( const std::string &expectedValue, void -failNotEqual( std::string expected, - std::string actual, - const SourceLine &sourceLine, - const AdditionalMessage &additionalMessage, - std::string shortDescription ) +Asserter::failNotEqual( std::string expected, + std::string actual, + const SourceLine &sourceLine, + const AdditionalMessage &additionalMessage, + std::string shortDescription ) { fail( makeNotEqualMessage( expected, actual, @@ -89,17 +86,16 @@ failNotEqual( std::string expected, void -failNotEqualIf( bool shouldFail, - std::string expected, - std::string actual, - const SourceLine &sourceLine, - const AdditionalMessage &additionalMessage, - std::string shortDescription ) +Asserter::failNotEqualIf( bool shouldFail, + std::string expected, + std::string actual, + const SourceLine &sourceLine, + const AdditionalMessage &additionalMessage, + std::string shortDescription ) { if ( shouldFail ) failNotEqual( expected, actual, sourceLine, additionalMessage, shortDescription ); } -} // namespace Asserter CPPUNIT_NS_END -- cgit v1.2.1