1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
|
#ifndef TESTCALLERTEST_H
#define TESTCALLERTEST_H
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/TestCase.h>
#include <cppunit/TestResult.h>
#include <cppunit/TestSuite.h>
#include "MockTestListener.h"
#include "TrackedTestCase.h"
class TestCallerTest : public CPPUNIT_NS::TestFixture,
Tracker
{
CPPUNIT_TEST_SUITE( TestCallerTest );
CPPUNIT_TEST( testBasicConstructor );
CPPUNIT_TEST( testReferenceConstructor );
CPPUNIT_TEST( testPointerConstructor );
// CPPUNIT_TEST( testExpectFailureException );
// CPPUNIT_TEST( testExpectException );
// CPPUNIT_TEST( testExpectedExceptionNotCaught );
CPPUNIT_TEST_SUITE_END();
public:
TestCallerTest();
virtual ~TestCallerTest();
void setUp();
void tearDown();
void testBasicConstructor();
void testReferenceConstructor();
void testPointerConstructor();
// void testExpectFailureException();
// void testExpectException();
// void testExpectedExceptionNotCaught();
private:
class ExceptionThrower : public CPPUNIT_NS::TestCase
{
public:
void testThrowFailureException();
void testThrowException();
void testThrowNothing();
};
virtual void onConstructor();
virtual void onDestructor();
virtual void onSetUp();
virtual void onTearDown();
virtual void onTest();
void checkNothingButConstructorCalled();
void checkRunningSequenceCalled();
void checkTestName( std::string testName );
TestCallerTest( const TestCallerTest © );
void operator =( const TestCallerTest © );
private:
int m_constructorCount;
int m_destructorCount;
int m_setUpCount;
int m_tearDownCount;
int m_testCount;
const std::string m_testName;
MockTestListener *m_testListener;
CPPUNIT_NS::TestResult *m_result;
};
// Inlines methods for TestCallerTest:
// -----------------------------------
#endif // TESTCALLERTEST_H
|