summaryrefslogtreecommitdiff
path: root/examples/cppunittest/TestAssertTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/cppunittest/TestAssertTest.cpp')
-rw-r--r--examples/cppunittest/TestAssertTest.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/examples/cppunittest/TestAssertTest.cpp b/examples/cppunittest/TestAssertTest.cpp
index 3960b8e..cd36fd0 100644
--- a/examples/cppunittest/TestAssertTest.cpp
+++ b/examples/cppunittest/TestAssertTest.cpp
@@ -49,6 +49,8 @@ TestAssertTest::testAssertThrow()
{
int x;
CPPUNIT_ASSERT_THROW( x = 1234, std::string );
+ // prevent warning
+ x += 1;
}
catch ( CPPUNIT_NS::Exception & )
{
@@ -64,6 +66,8 @@ TestAssertTest::testAssertNoThrow()
{
int x;
CPPUNIT_ASSERT_NO_THROW( x = 1234 );
+ // prevent warning
+ x += 1;
try
{
@@ -86,6 +90,8 @@ TestAssertTest::testAssertAssertionFail()
{
int x;
CPPUNIT_ASSERT_ASSERTION_FAIL( x = 1234 );
+ // prevent warning
+ x += 1;
}
catch ( CPPUNIT_NS::Exception & )
{
@@ -101,6 +107,8 @@ TestAssertTest::testAssertAssertionPass()
{
int x;
CPPUNIT_ASSERT_ASSERTION_PASS( x = 1234 );
+ // prevent warning
+ x += 1;
try
{