#include <TestBase.h>
Public Types | |
typedef void(UserTestClass::*) | FunctionType () |
Public Member Functions | |
TestWrapperTemplate (std::string nameInit, boost::shared_ptr< UserTestClass > &pUserTestCaseInit) | |
void | runTest (FunctionType pFunction) |
Private Attributes | |
std::string | name |
boost::shared_ptr< UserTestClass > | pUserTestCase |
Definition at line 189 of file TestBase.h.
typedef void(UserTestClass::*) TestWrapperTemplate< UserTestClass >::FunctionType() |
Definition at line 192 of file TestBase.h.
TestWrapperTemplate< UserTestClass >::TestWrapperTemplate | ( | std::string | nameInit, | |
boost::shared_ptr< UserTestClass > & | pUserTestCaseInit | |||
) | [inline] |
Definition at line 200 of file TestBase.h.
References TestWrapperTemplate< UserTestClass >::name.
00203 : pUserTestCase(pUserTestCaseInit) 00204 { 00205 name = nameInit; 00206 }
void TestWrapperTemplate< UserTestClass >::runTest | ( | FunctionType | pFunction | ) | [inline] |
Definition at line 208 of file TestBase.h.
References TestWrapperTemplate< UserTestClass >::name, TestWrapperTemplate< UserTestClass >::pUserTestCase, and TRACE_SEVERE.
00209 { 00210 pUserTestCase->beforeTestCase(name); 00211 pUserTestCase->testCaseSetUp(); 00212 try { 00213 try { 00214 ((*pUserTestCase).*pFunction)(); 00215 } catch (std::exception &ex) { 00216 pUserTestCase->notifyTrace(name, TRACE_SEVERE, ex.what()); 00217 throw ex; 00218 } 00219 } catch (...) { 00220 try { 00221 pUserTestCase->testCaseTearDown(); 00222 } catch (...) { 00223 // ignore teardown errors after failure 00224 } 00225 throw; 00226 } 00227 try { 00228 pUserTestCase->testCaseTearDown(); 00229 } catch (...) { 00230 pUserTestCase->afterTestCase(name); 00231 throw; 00232 } 00233 pUserTestCase->afterTestCase(name); 00234 }
std::string TestWrapperTemplate< UserTestClass >::name [private] |
Definition at line 195 of file TestBase.h.
Referenced by TestWrapperTemplate< UserTestClass >::runTest(), and TestWrapperTemplate< UserTestClass >::TestWrapperTemplate().
boost::shared_ptr<UserTestClass> TestWrapperTemplate< UserTestClass >::pUserTestCase [private] |
Definition at line 196 of file TestBase.h.
Referenced by TestWrapperTemplate< UserTestClass >::runTest().