blob: 48c73aef56ae1d49a363cc4dbdc4f1d5157ffa5d (
plain)
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
|
// //////////////////////////////////////////////////////////////////////////
// Header file TestCaseTest.h for class TestCaseTest
// (c)Copyright 2000, Baptiste Lepilleur.
// Created: 2000/06/09
// //////////////////////////////////////////////////////////////////////////
#ifndef TESTCASETEST_H
#define TESTCASETEST_H
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/TestResult.h>
#include "MockTestListener.h"
#include <stdexcept>
class TestCaseTest : public CPPUNIT_NS::TestFixture
{
CPPUNIT_TEST_SUITE( TestCaseTest );
CPPUNIT_TEST( testSetUpFailure );
CPPUNIT_TEST( testRunTestFailure );
CPPUNIT_TEST( testTearDownFailure );
CPPUNIT_TEST( testFailAll );
CPPUNIT_TEST( testNoFailure );
CPPUNIT_TEST( testTwoRun );
CPPUNIT_TEST( testCountTestCases );
CPPUNIT_TEST( testDefaultConstructor );
CPPUNIT_TEST( testConstructorWithName );
CPPUNIT_TEST( testGetChildTestCount );
CPPUNIT_TEST_EXCEPTION( testGetChildTestAtThrow, std::out_of_range );
CPPUNIT_TEST_SUITE_END();
public:
TestCaseTest();
virtual ~TestCaseTest();
void setUp();
void tearDown();
void testSetUpFailure();
void testRunTestFailure();
void testTearDownFailure();
void testFailAll();
void testNoFailure();
void testTwoRun();
void testCountTestCases();
void testDefaultConstructor();
void testConstructorWithName();
void testGetChildTestCount();
void testGetChildTestAtThrow();
private:
TestCaseTest( const TestCaseTest © );
void operator =( const TestCaseTest © );
void checkFailure( bool failSetUp,
bool failRunTest,
bool failTearDown );
/*
void checkResult( int failures,
int errors,
int testsRun,
CPPUNIT_NS::TestResult *result );
*/
private:
CPPUNIT_NS::TestResult *m_result;
MockTestListener *m_testListener;
};
#endif // TESTCASETEST_H
|