1 #ifndef TESTASSERTTEST_H
2 #define TESTASSERTTEST_H
3 
4 #include <cppunit/extensions/HelperMacros.h>
5 
6 
7 class TestAssertTest : public CPPUNIT_NS::TestFixture
8 {
9   CPPUNIT_TEST_SUITE( TestAssertTest );
10   CPPUNIT_TEST( testAssertThrow );
11   CPPUNIT_TEST( testAssertNoThrow );
12   CPPUNIT_TEST( testAssertAssertionFail );
13   CPPUNIT_TEST( testAssertAssertionPass );
14   CPPUNIT_TEST( testAssert );
15   CPPUNIT_TEST( testAssertEqual );
16   CPPUNIT_TEST( testAssertLess );
17   CPPUNIT_TEST( testAssertGreater );
18   CPPUNIT_TEST( testAssertLessEqual );
19   CPPUNIT_TEST( testAssertGreaterEqual );
20   CPPUNIT_TEST( testAssertMessageTrue );
21   CPPUNIT_TEST( testAssertMessageFalse );
22   CPPUNIT_TEST( testAssertDoubleEquals );
23   CPPUNIT_TEST( testAssertDoubleEqualsPrecision );
24   CPPUNIT_TEST( testAssertDoubleNonFinite );
25   CPPUNIT_TEST( testFail );
26   CPPUNIT_TEST_SUITE_END();
27 
28 public:
29   TestAssertTest();
30 
31   virtual ~TestAssertTest();
32 
33   virtual void setUp();
34   virtual void tearDown();
35 
36   void testAssertThrow();
37   void testAssertNoThrow();
38   void testAssertAssertionFail();
39   void testAssertAssertionPass();
40 
41   void testBasicAssertions();
42 
43   void testAssert();
44 
45   void testAssertEqual();
46   void testAssertLess();
47   void testAssertGreater();
48   void testAssertLessEqual();
49   void testAssertGreaterEqual();
50 
51   void testAssertMessageTrue();
52   void testAssertMessageFalse();
53 
54   void testAssertDoubleEquals();
55   void testAssertDoubleEqualsPrecision();
56   void testAssertDoubleNonFinite();
57 
58   void testAssertLongEquals();
59   void testAssertLongNotEquals();
60 
61   void testFail();
62 
63 private:
64   TestAssertTest( const TestAssertTest &copy );
65   void operator =( const TestAssertTest &copy );
66 
67   void checkDoubleNotEquals( double expected,
68                              double actual,
69                              double delta );
70 
71   void checkMessageContains( CPPUNIT_NS::Exception *e,
72                              std::string expectedMessage );
73 
74 private:
75 };
76 
77 #endif  // TESTASSERTTEST_H
78