1 // ////////////////////////////////////////////////////////////////////////// 2 // Header file TestCaseTest.h for class TestCaseTest 3 // (c)Copyright 2000, Baptiste Lepilleur. 4 // Created: 2000/06/09 5 // ////////////////////////////////////////////////////////////////////////// 6 #ifndef TESTCASETEST_H 7 #define TESTCASETEST_H 8 9 #include <cppunit/extensions/HelperMacros.h> 10 #include <cppunit/TestResult.h> 11 #include "MockTestListener.h" 12 #include <stdexcept> 13 14 15 class TestCaseTest : public CPPUNIT_NS::TestFixture 16 { 17 CPPUNIT_TEST_SUITE( TestCaseTest ); 18 CPPUNIT_TEST( testSetUpFailure ); 19 CPPUNIT_TEST( testRunTestFailure ); 20 CPPUNIT_TEST( testTearDownFailure ); 21 CPPUNIT_TEST( testFailAll ); 22 CPPUNIT_TEST( testNoFailure ); 23 CPPUNIT_TEST( testTwoRun ); 24 CPPUNIT_TEST( testCountTestCases ); 25 CPPUNIT_TEST( testDefaultConstructor ); 26 CPPUNIT_TEST( testConstructorWithName ); 27 CPPUNIT_TEST( testGetChildTestCount ); 28 CPPUNIT_TEST_EXCEPTION( testGetChildTestAtThrow, std::out_of_range ); 29 CPPUNIT_TEST_SUITE_END(); 30 31 public: 32 TestCaseTest(); 33 34 virtual ~TestCaseTest(); 35 36 void setUp(); 37 void tearDown(); 38 39 void testSetUpFailure(); 40 void testRunTestFailure(); 41 void testTearDownFailure(); 42 void testFailAll(); 43 void testNoFailure(); 44 void testTwoRun(); 45 46 void testCountTestCases(); 47 48 void testDefaultConstructor(); 49 void testConstructorWithName(); 50 51 void testGetChildTestCount(); 52 void testGetChildTestAtThrow(); 53 54 private: 55 TestCaseTest( const TestCaseTest © ); 56 void operator =( const TestCaseTest © ); 57 58 void checkFailure( bool failSetUp, 59 bool failRunTest, 60 bool failTearDown ); 61 /* 62 void checkResult( int failures, 63 int errors, 64 int testsRun, 65 CPPUNIT_NS::TestResult *result ); 66 */ 67 private: 68 CPPUNIT_NS::TestResult *m_result; 69 MockTestListener *m_testListener; 70 }; 71 72 73 #endif // TESTCASETEST_H 74