diff options
| author | Baptiste Lepilleur <gaiacrtn@free.fr> | 2002-06-13 17:17:42 +0000 |
|---|---|---|
| committer | Baptiste Lepilleur <gaiacrtn@free.fr> | 2002-06-13 17:17:42 +0000 |
| commit | 7f0766499db248afe9985a5700c22f9a8ce7ce6c (patch) | |
| tree | ba70577fe0ed4343b5127d1e8848cbe0ccebf4fe /examples/simple/ExampleTestCase.cpp | |
| parent | abd178318ae3cdb6cc0a700e77414a33ef9297ca (diff) | |
| download | cppunit-7f0766499db248afe9985a5700c22f9a8ce7ce6c.tar.gz | |
Include/cppunit/NotEqualException.
include/cppunit/NotEqualException.h:
* src/cppunit/NotEqualException.cpp: removed.
* include/cppunit/Exception.h:
* src/cppunit/Exception.cpp: removed 'type' related stuffs.
* include/cppunit/TextTestResult.h:
* src/cppunit/TextTestResult.cpp: delegate printing to TextOutputter.
* examples/simple/ExampleTestCase.h:
* examples/simple/ExampleTestCase.cpp: reindented.
* src/qttestrunner/build:
* src/qttestrunner/qttestrunner.pro:
* src/qttestrunner/TestBrowserDlgImpl.h:
* src/qttestrunner/TestRunnerModel.h: applied Thomas Neidhart's patch,
'Some minor fixes to compile QTTestrunner under Linux.'.
Diffstat (limited to 'examples/simple/ExampleTestCase.cpp')
| -rw-r--r-- | examples/simple/ExampleTestCase.cpp | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/examples/simple/ExampleTestCase.cpp b/examples/simple/ExampleTestCase.cpp index a71b7bd..838b2d0 100644 --- a/examples/simple/ExampleTestCase.cpp +++ b/examples/simple/ExampleTestCase.cpp @@ -2,49 +2,49 @@ CPPUNIT_TEST_SUITE_REGISTRATION( ExampleTestCase ); -void ExampleTestCase::example () +void ExampleTestCase::example() { - CPPUNIT_ASSERT_DOUBLES_EQUAL (1.0, 1.1, 0.05); - CPPUNIT_ASSERT (1 == 0); - CPPUNIT_ASSERT (1 == 1); + CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.0, 1.1, 0.05 ); + CPPUNIT_ASSERT( 1 == 0 ); + CPPUNIT_ASSERT( 1 == 1 ); } -void ExampleTestCase::anotherExample () +void ExampleTestCase::anotherExample() { - CPPUNIT_ASSERT (1 == 2); + CPPUNIT_ASSERT (1 == 2); } -void ExampleTestCase::setUp () +void ExampleTestCase::setUp() { - m_value1 = 2.0; - m_value2 = 3.0; + m_value1 = 2.0; + m_value2 = 3.0; } -void ExampleTestCase::testAdd () +void ExampleTestCase::testAdd() { - double result = m_value1 + m_value2; - CPPUNIT_ASSERT (result == 6.0); + double result = m_value1 + m_value2; + CPPUNIT_ASSERT( result == 6.0 ); } -void ExampleTestCase::testDivideByZero () +void ExampleTestCase::testDivideByZero() { - int zero = 0; - int result = 8 / zero; + int zero = 0; + int result = 8 / zero; } -void ExampleTestCase::testEquals () +void ExampleTestCase::testEquals() { - std::auto_ptr<long> l1 (new long (12)); - std::auto_ptr<long> l2 (new long (12)); - - CPPUNIT_ASSERT_EQUAL (12, 12); - CPPUNIT_ASSERT_EQUAL (12L, 12L); - CPPUNIT_ASSERT_EQUAL (*l1, *l2); - - CPPUNIT_ASSERT (12L == 12L); - CPPUNIT_ASSERT_EQUAL (12, 13); - CPPUNIT_ASSERT_DOUBLES_EQUAL (12.0, 11.99, 0.5); + std::auto_ptr<long> l1( new long (12) ); + std::auto_ptr<long> l2( new long (12) ); + + CPPUNIT_ASSERT_EQUAL( 12, 12 ); + CPPUNIT_ASSERT_EQUAL( 12L, 12L ); + CPPUNIT_ASSERT_EQUAL( *l1, *l2 ); + + CPPUNIT_ASSERT( 12L == 12L ); + CPPUNIT_ASSERT_EQUAL( 12, 13 ); + CPPUNIT_ASSERT_DOUBLES_EQUAL( 12.0, 11.99, 0.5 ); } |
