#include <T2TestingFramework.h>
Definition at line 20 of file T2TestingFramework.h.
◆ FailCallback_t
◆ SuccessCallback_t
◆ TestMethod_t
◆ T2TestingFramework()
T2TestingFramework::T2TestingFramework |
( |
| ) |
|
|
default |
◆ ~T2TestingFramework()
T2TestingFramework::~T2TestingFramework |
( |
| ) |
|
|
default |
◆ FindCategory()
Definition at line 45 of file T2TestingFramework.cpp.
46{
47 Category* pCategory = m_pHeadCategory;
48
49 while ( pCategory )
50 {
51 if ( !strcmp( pCategory->pchName, a_pchName ) )
52 return pCategory;
53
54 pCategory = pCategory->pNext;
55 }
56
58}
◆ GetCurrentTest()
Test * T2TestingFramework::GetCurrentTest |
( |
| ) |
const |
|
inline |
◆ RegisterCategory()
Definition at line 60 of file T2TestingFramework.cpp.
61{
63
64 if ( !pCategory )
65 {
66 pCategory = New<Category>();
67 pCategory->pchName = a_pchName;
68 pCategory->pNext = m_pHeadCategory;
69
70 m_pHeadCategory = pCategory;
71 }
72
73 return pCategory;
74}
Category * FindCategory(const TCHAR *a_pchName)
◆ RegisterTest()
Definition at line 76 of file T2TestingFramework.cpp.
77{
78 if ( !a_pCategory )
80
81 Test* pTest = New<Test>();
82 pTest->pchName = a_pchTestName;
83 pTest->pCategory = a_pCategory;
84 pTest->fnMethod = a_fnMethod;
85 pTest->pNext = a_pCategory->pHeadTest;
86
87 a_pCategory->pHeadTest = pTest;
88
89 return pTest;
90}
◆ RunTests()
Definition at line 122 of file T2TestingFramework.cpp.
123{
125 Category* pCategory = m_pHeadCategory;
126
127
130
131 while ( pCategory )
132 {
133 Test* pTest = pCategory->pHeadTest;
134
135 while ( pTest )
136 {
137 if ( !pTest->bWasExecuted )
138 {
139
140 m_pCurrentTest = pTest;
141
142 pTest->fnMethod();
143 pTest->bWasExecuted =
TTRUE;
144
145
146 iNumFails += pTest->iNumFails;
147 pCategory->iNumTotalFails += pTest->iNumFails;
148 }
149
150 m_pCurrentTest =
TNULL;
151 pTest = pTest->pNext;
152 }
153
154 pCategory = pCategory->
pNext;
155 }
156
157
160
161 return iNumFails;
162}
T2TestingFramework::SuccessCallback_t g_fnSuccessCallback
T2TestingFramework::FailCallback_t g_fnFailCallback
◆ SignalRequirementResult()
void T2TestingFramework::SignalRequirementResult |
( |
Test * | a_pTest, |
|
|
const TCHAR * | a_pchFileName, |
|
|
TINT | a_iLineNum, |
|
|
const TCHAR * | a_pchStatement, |
|
|
TBOOL | a_bFailed ) |
Definition at line 95 of file T2TestingFramework.cpp.
96{
97 if ( !a_pTest )
98 return;
99
100 Check* pCheck = New<Check>();
101 pCheck->pchFileName = a_pchFileName;
102 pCheck->pchStatement = a_pchStatement;
103 pCheck->iLineNum = a_iLineNum;
104 pCheck->bFailed = a_bFailed;
105 pCheck->pNext = a_pTest->pHeadCheck;
106
107 a_pTest->pHeadCheck = pCheck;
108
109 if ( a_bFailed )
110 {
111 a_pTest->iNumFails += 1;
112
113 if ( g_fnFailCallback )
115 }
116 else if ( g_fnSuccessCallback )
117 {
119 }
120}
The documentation for this class was generated from the following files: