1 #ifndef __GENEORDERTEST_H__
2 #define __GENEORDERTEST_H__
4 #include <cppunit/TestFixture.h>
5 #include <cppunit/extensions/HelperMacros.h>
8 * A test case that is designed to produce
9 * example errors and failures.
13 #define TESTNAME ExampleTest
16 class TESTNAME : public CPPUNIT_NS::TestFixture
18 CPPUNIT_TEST_SUITE( TESTNAME );
19 CPPUNIT_TEST( example );
20 CPPUNIT_TEST( anotherExample );
21 CPPUNIT_TEST( testAdd );
22 CPPUNIT_TEST( testEquals );
23 CPPUNIT_TEST_SUITE_END();
40 CPPUNIT_ASSERT_DOUBLES_EQUAL (1.0, 1.1, 0.05);
41 CPPUNIT_ASSERT (1 == 0);
42 CPPUNIT_ASSERT (1 == 1);
45 void anotherExample ()
47 CPPUNIT_ASSERT (1 == 2);
52 double result = m_value1 + m_value2;
53 CPPUNIT_ASSERT (result == 6.0);
58 std::auto_ptr<long> l1 (new long (12));
59 std::auto_ptr<long> l2 (new long (12));
61 CPPUNIT_ASSERT_EQUAL (12, 12);
62 CPPUNIT_ASSERT_EQUAL (12L, 12L);
63 CPPUNIT_ASSERT_EQUAL (*l1, *l2);
65 CPPUNIT_ASSERT (12L == 12L);
66 CPPUNIT_ASSERT_EQUAL (12, 13);
67 CPPUNIT_ASSERT_DOUBLES_EQUAL (12.0, 11.99, 0.5);
71 CPPUNIT_TEST_SUITE_REGISTRATION( TESTNAME );