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 Test(const char * name)15Test::Test(const char* name) 16 : 17 fName(name), 18 fSuite(NULL) 19 { 20 } 21 22 ~Test()23Test::~Test() 24 { 25 } 26 27 28 void SetSuite(TestSuite * suite)29Test::SetSuite(TestSuite* suite) 30 { 31 fSuite = suite; 32 } 33 34 35 bool IsLeafTest() const36Test::IsLeafTest() const 37 { 38 return true; 39 } 40 41 42 status_t Setup(TestContext & context)43Test::Setup(TestContext& context) 44 { 45 return B_OK; 46 } 47 48 49 bool Run(TestContext & context,const char * name)50Test::Run(TestContext& context, const char* name) 51 { 52 // TODO: Report error! 53 return false; 54 } 55 56 57 void Cleanup(TestContext & context,bool setupOK)58Test::Cleanup(TestContext& context, bool setupOK) 59 { 60 } 61 62 63 Test* Visit(TestVisitor & visitor)64Test::Visit(TestVisitor& visitor) 65 { 66 return visitor.VisitTest(this) ? this : NULL; 67 } 68 69 70 // #pragma mark - StandardTestDelegate 71 72 StandardTestDelegate()73StandardTestDelegate::StandardTestDelegate() 74 { 75 } 76 77 ~StandardTestDelegate()78StandardTestDelegate::~StandardTestDelegate() 79 { 80 } 81 82 83 status_t Setup(TestContext & context)84StandardTestDelegate::Setup(TestContext& context) 85 { 86 return B_OK; 87 } 88 89 90 void Cleanup(TestContext & context,bool setupOK)91StandardTestDelegate::Cleanup(TestContext& context, bool setupOK) 92 { 93 } 94