diff options
Diffstat (limited to 'examples/cppunittest/ExceptionTest.cpp')
| -rw-r--r-- | examples/cppunittest/ExceptionTest.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/examples/cppunittest/ExceptionTest.cpp b/examples/cppunittest/ExceptionTest.cpp index ab60eed..e166130 100644 --- a/examples/cppunittest/ExceptionTest.cpp +++ b/examples/cppunittest/ExceptionTest.cpp @@ -34,12 +34,12 @@ ExceptionTest::tearDown() void ExceptionTest::testConstructor() { - const std::string message( "a message" ); + const CppUnit::Message message( "a message" ); const CppUnit::SourceLine sourceLine( "dir/afile.cpp", 17 ); CppUnit::Exception e( message, sourceLine ); - CPPUNIT_ASSERT_EQUAL( message, std::string( e.what() ) ); + CPPUNIT_ASSERT_EQUAL( message.shortDescription(), e.message().shortDescription() ); CPPUNIT_ASSERT( sourceLine == e.sourceLine() ); } @@ -49,7 +49,7 @@ ExceptionTest::testDefaultConstructor() { CppUnit::Exception e; - CPPUNIT_ASSERT_EQUAL( std::string(""), std::string( e.what() ) ); + CPPUNIT_ASSERT( CppUnit::Message() == e.message() ); CPPUNIT_ASSERT( !e.sourceLine().isValid() ); } @@ -58,7 +58,7 @@ void ExceptionTest::testCopyConstructor() { CppUnit::SourceLine sourceLine( "fileName.cpp", 123 ); - CppUnit::Exception e( "message", sourceLine ); + CppUnit::Exception e( CppUnit::Message("message"), sourceLine ); CppUnit::Exception other( e ); checkIsSame( e, other ); } @@ -68,7 +68,7 @@ void ExceptionTest::testAssignment() { CppUnit::SourceLine sourceLine( "fileName.cpp", 123 ); - CppUnit::Exception e( "message", sourceLine ); + CppUnit::Exception e( CppUnit::Message("message"), sourceLine ); CppUnit::Exception other; other = e; checkIsSame( e, other ); @@ -79,7 +79,7 @@ void ExceptionTest::testClone() { CppUnit::SourceLine sourceLine( "fileName.cpp", 123 ); - CppUnit::Exception e( "message", sourceLine ); + CppUnit::Exception e( CppUnit::Message("message"), sourceLine ); std::auto_ptr<CppUnit::Exception> other( e.clone() ); checkIsSame( e, *other.get() ); } @@ -89,7 +89,7 @@ void ExceptionTest::testIsInstanceOf() { CppUnit::SourceLine sourceLine( "fileName.cpp", 123 ); - CppUnit::Exception e( "message", sourceLine ); + CppUnit::Exception e( CppUnit::Message("message"), sourceLine ); CPPUNIT_ASSERT( e.isInstanceOf( CppUnit::Exception::type() ) ); CPPUNIT_ASSERT( !e.isInstanceOf( CppUnit::NotEqualException::type() ) ); } |
