1 /* 2 * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de. 3 * Distributed under the terms of the MIT License. 4 */ 5 6 7 #include "Test.h" 8 9 #include "TestVisitor.h" 10 11 12 // #pragma mark - Test 13 14 15 Test::Test(const char* name) 16 : 17 fName(name), 18 fSuite(NULL) 19 { 20 } 21 22 23 Test::~Test() 24 { 25 } 26 27 28 void 29 Test::SetSuite(TestSuite* suite) 30 { 31 fSuite = suite; 32 } 33 34 35 bool 36 Test::IsLeafTest() const 37 { 38 return true; 39 } 40 41 42 status_t 43 Test::Setup(TestContext& context) 44 { 45 return B_OK; 46 } 47 48 49 bool 50 Test::Run(TestContext& context, const char* name) 51 { 52 // TODO: Report error! 53 return false; 54 } 55 56 57 void 58 Test::Cleanup(TestContext& context, bool setupOK) 59 { 60 } 61 62 63 Test* 64 Test::Visit(TestVisitor& visitor) 65 { 66 return visitor.VisitTest(this) ? this : NULL; 67 } 68 69 70 // #pragma mark - StandardTestDelegate 71 72 73 StandardTestDelegate::StandardTestDelegate() 74 { 75 } 76 77 78 StandardTestDelegate::~StandardTestDelegate() 79 { 80 } 81 82 83 status_t 84 StandardTestDelegate::Setup(TestContext& context) 85 { 86 return B_OK; 87 } 88 89 90 void 91 StandardTestDelegate::Cleanup(TestContext& context, bool setupOK) 92 { 93 } 94