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