00001 #ifndef Impala_Test_SampleSimpleTest_h 00002 #define Impala_Test_SampleSimpleTest_h 00003 00004 #include "cppunit/extensions/HelperMacros.h" 00005 00006 namespace Impala 00007 { 00008 namespace Test 00009 { 00010 00011 // Derive from TestCase only for simple tests; otherwise derive from TestSuite 00012 class SampleSimpleTest : public CPPUNIT_NS::TestCase 00013 { 00014 00015 CPPUNIT_TEST_SUITE( SampleSimpleTest ); 00016 CPPUNIT_TEST( testHelloWorld ); 00017 CPPUNIT_TEST( testAssertEqual ); 00018 CPPUNIT_TEST( testNothing ); 00019 CPPUNIT_TEST_SUITE_END(); 00020 00021 public: 00022 00023 void testHelloWorld() 00024 { 00025 cout << "Hello, world" << endl; 00026 } 00027 00028 void testAssertEqual() 00029 { 00030 //CPPUNIT_ASSERT_EQUAL(2, 1); // will fail 00031 CPPUNIT_ASSERT_EQUAL(1, 1); // will succeed 00032 } 00033 00034 void testNothing() 00035 { 00036 } 00037 00038 }; //class 00039 00040 CPPUNIT_TEST_SUITE_REGISTRATION( SampleSimpleTest ); 00041 00042 } // namespace Test 00043 } // namespace Impala 00044 00045 #endif