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