summaryrefslogtreecommitdiff
path: root/include/cppunit/Asserter.h
diff options
context:
space:
mode:
authorBaptiste Lepilleur <gaiacrtn@free.fr>2002-07-13 09:33:50 +0000
committerBaptiste Lepilleur <gaiacrtn@free.fr>2002-07-13 09:33:50 +0000
commitf1bf3276752a10a2cdf4e3cf3087399d199c4566 (patch)
tree13dc67edcf465f44b9fe835f5e0b201511774d07 /include/cppunit/Asserter.h
parent570132ec2707c8bac6c27c758254f05e293fe613 (diff)
downloadcppunit-f1bf3276752a10a2cdf4e3cf3087399d199c4566.tar.gz
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.
Diffstat (limited to 'include/cppunit/Asserter.h')
-rw-r--r--include/cppunit/Asserter.h60
1 files changed, 30 insertions, 30 deletions
diff --git a/include/cppunit/Asserter.h b/include/cppunit/Asserter.h
index 5a10236..8ad783d 100644
--- a/include/cppunit/Asserter.h
+++ b/include/cppunit/Asserter.h
@@ -42,18 +42,18 @@ class Message;
* CPPUNIT_SOURCELINE() )
* \endcode
*/
-namespace Asserter
+struct Asserter
{
/*! Throws a Exception with the specified message and location.
*/
- void CPPUNIT_API fail( const Message &message,
- const SourceLine &sourceLine = SourceLine() );
+ static void CPPUNIT_API fail( const Message &message,
+ const SourceLine &sourceLine = SourceLine() );
/*! Throws a Exception with the specified message and location.
* \deprecated Use fail( Message, SourceLine ) instead.
*/
- void CPPUNIT_API fail( std::string message,
- const SourceLine &sourceLine = SourceLine() );
+ static void CPPUNIT_API fail( std::string message,
+ const SourceLine &sourceLine = SourceLine() );
/*! Throws a Exception with the specified message and location.
* \param shouldFail if \c true then the exception is thrown. Otherwise
@@ -61,9 +61,9 @@ namespace Asserter
* \param message Message explaining the assertion failiure.
* \param sourceLine Location of the assertion.
*/
- void CPPUNIT_API failIf( bool shouldFail,
- const Message &message,
- const SourceLine &sourceLine = SourceLine() );
+ static void CPPUNIT_API failIf( bool shouldFail,
+ const Message &message,
+ const SourceLine &sourceLine = SourceLine() );
/*! Throws a Exception with the specified message and location.
* \deprecated Use failIf( bool, Message, SourceLine ) instead.
@@ -72,9 +72,9 @@ namespace Asserter
* \param message Message explaining the assertion failiure.
* \param sourceLine Location of the assertion.
*/
- void CPPUNIT_API failIf( bool shouldFail,
- std::string message,
- const SourceLine &sourceLine = SourceLine() );
+ static void CPPUNIT_API failIf( bool shouldFail,
+ std::string message,
+ const SourceLine &sourceLine = SourceLine() );
/*! \brief Returns a expected value string for a message.
* Typically used to create 'not equal' message, or to check that a message
@@ -85,7 +85,7 @@ namespace Asserter
* \return \a expectedValue prefixed with "Expected: ".
* \see makeActual().
*/
- std::string CPPUNIT_API makeExpected( const std::string &expectedValue );
+ static std::string CPPUNIT_API makeExpected( const std::string &expectedValue );
/*! \brief Returns an actual value string for a message.
* Typically used to create 'not equal' message, or to check that a message
@@ -96,12 +96,12 @@ namespace Asserter
* \return \a actualValue prefixed with "Actual : ".
* \see makeExpected().
*/
- std::string CPPUNIT_API makeActual( const std::string &actualValue );
+ static std::string CPPUNIT_API makeActual( const std::string &actualValue );
- Message CPPUNIT_API makeNotEqualMessage( const std::string &expectedValue,
- const std::string &actualValue,
- const AdditionalMessage &additionalMessage = AdditionalMessage(),
- const std::string &shortDescription = "equality assertion failed");
+ static Message CPPUNIT_API makeNotEqualMessage( const std::string &expectedValue,
+ const std::string &actualValue,
+ const AdditionalMessage &additionalMessage = AdditionalMessage(),
+ const std::string &shortDescription = "equality assertion failed");
/*! Throws an Exception with the specified message and location.
* \param expected Text describing the expected value.
@@ -110,11 +110,11 @@ namespace Asserter
* what are the differences between the expected and actual value.
* \param sourceLine Location of the assertion.
*/
- void CPPUNIT_API failNotEqual( std::string expected,
- std::string actual,
- const SourceLine &sourceLine,
- const AdditionalMessage &additionalMessage = AdditionalMessage(),
- std::string shortDescription = "equality assertion failed" );
+ static void CPPUNIT_API failNotEqual( std::string expected,
+ std::string actual,
+ const SourceLine &sourceLine,
+ const AdditionalMessage &additionalMessage = AdditionalMessage(),
+ std::string shortDescription = "equality assertion failed" );
/*! Throws an Exception with the specified message and location.
* \param shouldFail if \c true then the exception is thrown. Otherwise
@@ -125,14 +125,14 @@ namespace Asserter
* where the "difference" is located.
* \param sourceLine Location of the assertion.
*/
- void CPPUNIT_API failNotEqualIf( bool shouldFail,
- std::string expected,
- std::string actual,
- const SourceLine &sourceLine,
- const AdditionalMessage &additionalMessage = AdditionalMessage(),
- std::string shortDescription = "equality assertion failed" );
-
-} // namespace Asserter
+ static void CPPUNIT_API failNotEqualIf( bool shouldFail,
+ std::string expected,
+ std::string actual,
+ const SourceLine &sourceLine,
+ const AdditionalMessage &additionalMessage = AdditionalMessage(),
+ std::string shortDescription = "equality assertion failed" );
+
+};
CPPUNIT_NS_END