diff options
| author | Baptiste Lepilleur <gaiacrtn@free.fr> | 2001-10-07 18:37:53 +0000 |
|---|---|---|
| committer | Baptiste Lepilleur <gaiacrtn@free.fr> | 2001-10-07 18:37:53 +0000 |
| commit | 150339335e3c5538c1e496ae01babf148bd29ec5 (patch) | |
| tree | 9f354aaee81e08c27dc6da0709074babde7672f5 /src/cppunit/TestAssert.cpp | |
| parent | 4410db53e88dc5aca9f86abaf9dffccbd5f94471 (diff) | |
| download | cppunit-150339335e3c5538c1e496ae01babf148bd29ec5.tar.gz | |
Include/cppunit/CompilerTestResultOutputter.
include/cppunit/CompilerTestResultOutputter.h :
renamed CompilerOutputter.h
* src/cppunit/CompilerTestResultOutputter.cpp :
renamed CompilerOutputter.cpp
* include/cppunit/CompilerTestResultOutputter.h :
* src/cppunit/CompilerTestResultOutputter.cpp : ajust max line length
for wrapping. Added static factory method defaultOutputter(). Print
the number of test runs on success.
* include/cppunit/CompilerTestResultOutputter.h : renamed
CompilerOutputter.h.
* src/cppunit/CompilerTestResultOutputter.cpp : renamed
CompilerOutputter.cpp.
* examples/cppunittest/CppUnitTestMain.cpp : use factory method
CompilerTestResultOutputter::defaultOutputter().
* src/msvc6/DSPlugIn/DSPlugIn.dsp : removed COM registration in
post-build step. IT is automatically done by VC++ when the add-in is
added. Caused build to failed if the add-in was used in VC++.
* NEWS : updated.
* src/cppunit/TestAssert.cpp : modified deprecated assert
implementations to use Asserter.
* examples/cppunittest/XmlTestResultOutputterTest.h :
renamed XmlOutputterTest.h.
* examples/cppunittest/XmlTestResultOutputterTest.cpp :
renamed XmlOutputterTest.cpp.
* NEWS :
* examples/cppunittest/CppUnitTestMain.cpp :
* examples/cppunittest/CppUnitTestMain.dsp :
* examples/cppunittest/Makefile.am :
* examples/cppunittest/XmlTestResultOutputterTest.h :
* examples/cppunittest/XmlTestResultOutputterTest.cpp :
* examples/msvc6/CppUniTestApp/CppUnitTestApp.dsp
* include/cppunit/CompilerOutputter.h :
* include/cppunit/Makefile.am :
* include/cppunit/XmlTestResultOutputter.h :
* src/cppunit/CompilerOutputter.cpp :
* src/cppunit/cppunit.dsp :
* src/cppunit/Makefile.am :
* src/cppunit/XmlTestResultOutputter.cpp : change due to renaming
CompilerTestResultOutputter to CompilerOutputter,
XmlTestResultOutputter to XmlOuputter, XmlTestResultOutputterTest
to XmlOutputterTest.
Diffstat (limited to 'src/cppunit/TestAssert.cpp')
| -rw-r--r-- | src/cppunit/TestAssert.cpp | 44 |
1 files changed, 24 insertions, 20 deletions
diff --git a/src/cppunit/TestAssert.cpp b/src/cppunit/TestAssert.cpp index 802d5e4..b5999e1 100644 --- a/src/cppunit/TestAssert.cpp +++ b/src/cppunit/TestAssert.cpp @@ -13,34 +13,38 @@ namespace CppUnit { #ifdef CPPUNIT_ENABLE_SOURCELINE_DEPRECATED /// Check for a failed general assertion -void TestAssert::assertImplementation (bool condition, - std::string conditionExpression, - long lineNumber, - std::string fileName) -{ - if (!condition) - throw Exception (conditionExpression, - lineNumber, - fileName); +void +TestAssert::assertImplementation( bool condition, + std::string conditionExpression, + long lineNumber, + std::string fileName ) +{ + Asserter::failIf( condition, + conditionExpression, + SourceLine( fileName, lineNumber ) ); } /// Reports failed equality -void TestAssert::assertNotEqualImplementation( std::string expected, - std::string actual, - long lineNumber, - std::string fileName ) +void +TestAssert::assertNotEqualImplementation( std::string expected, + std::string actual, + long lineNumber, + std::string fileName ) { - throw NotEqualException( expected, actual, lineNumber, fileName ); + Asserter::failNotEqual( expected, + actual, + SouceLine( fileName, lineNumber ), "" ); } /// Check for a failed equality assertion -void TestAssert::assertEquals (double expected, - double actual, - double delta, - long lineNumber, - std::string fileName) +void +TestAssert::assertEquals( double expected, + double actual, + double delta, + long lineNumber, + std::string fileName ) { if (fabs (expected - actual) > delta) assertNotEqualImplementation( assertion_traits<double>::toString(expected), @@ -49,7 +53,7 @@ void TestAssert::assertEquals (double expected, fileName ); } -#else +#else // CPPUNIT_ENABLE_SOURCELINE_DEPRECATED void TestAssert::assertDoubleEquals( double expected, |
