-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest.cpp
More file actions
72 lines (58 loc) · 1.01 KB
/
test.cpp
File metadata and controls
72 lines (58 loc) · 1.01 KB
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
#include "test.h"
#include "testregistry.h"
#include "testresult.h"
#ifdef _MSC_VER
#ifdef _DEBUG
#include "afx.h"
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
#endif
Test::Test() : bIsFailed(false)
{
}
void Test::run (TestResult& result)
{
runTest (result);
result.testWasRun();
}
void Test::runTest( TestResult& result )
{
setUp();
bIsFailed = false;
doTest(result);
if (!bIsFailed)
{
Success success(getName());
result.addSuccess(success);
}
tearDown();
}
Test::~Test()
{
}
TestCreator::TestCreator(bool bSlow)
{
if(!bSlow)
{
TestRegistry::addFastTest (this);
}
else
{
TestRegistry::addSlowTest(this);
}
}
void TestCreator::run( TestResult& result )
{
Test& test = GetTestInstance();
test.run(result);
}
TestCreator::~TestCreator()
{
}
TestCreatorForTestOnlyOneTest::TestCreatorForTestOnlyOneTest() : TestCreator(false)
{
TestRegistry::addOnlyTest(this);
}
//end of file