SMBIOS Library
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
cppunit
interface
testPlatform.h
Go to the documentation of this file.
1
// vim:expandtab:autoindent:tabstop=4:shiftwidth=4:filetype=c:
2
/*
3
* Copyright (C) 2005 Dell Inc.
4
* by Michael Brown <Michael_E_Brown@dell.com>
5
* Licensed under the Open Software License version 2.1
6
*
7
* Alternatively, you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published
9
* by the Free Software Foundation; either version 2 of the License,
10
* or (at your option) any later version.
11
12
* This program is distributed in the hope that it will be useful, but
13
* WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15
* See the GNU General Public License for more details.
16
*/
17
18
19
#ifndef _TESTPLATFORM_H
20
#define _TESTPLATFORM_H
21
22
#include "
smbios/compat.h
"
23
24
#include <cppunit/extensions/HelperMacros.h>
25
#include <typeinfo>
26
#include <string>
27
28
#include "
smbios/ISmbios.h
"
29
#include "
smbios/ICmosRW.h
"
30
#include "
smbios/IToken.h
"
31
#include "
smbios/SystemInfo.h
"
32
33
#include "
XmlUtils.h
"
34
35
#include "
outputctl.h
"
36
37
extern
int
global_argc
;
38
extern
char
**
global_argv
;
39
40
class
testPlatform
:
public
CppUnit::TestFixture
41
{
42
protected
:
43
virtual
std::string
getCppunitTopDirectory
()
44
{
45
//return TEST_DIR;
46
return
global_argv
[1];
47
}
48
virtual
std::string
getWritableDirectory
()
49
{
50
//return DEFAULT_TEST_DIR;
51
return
global_argv
[2];
52
};
53
54
virtual
std::string
getTestName
()
55
{
56
//return TEST_DIR;
57
return
global_argv
[3];
58
}
59
virtual
std::string
getTestDirectory
()
60
{
61
//return DEFAULT_TEST_DIR;
62
return
global_argv
[4];
63
};
64
65
std::string
getTestInputString
( std::string toFind, std::string section=
"systemInfo"
);
66
67
void
checkSkipTest
( std::string testName);
68
69
// parser owns all XML entities. When it is deleted, everything
70
// goes with it.
71
XML_NAMESPACE
DOMBuilder
*
parser
;
72
73
// The doc is owned by the parser. We do not have to clean it up
74
// it is deleted when the parser is released. We keep a ref
75
// here for speed purposes
76
XML_NAMESPACE
DOMDocument
*
doc
;
77
78
public
:
79
virtual
void
setUp
();
80
virtual
void
tearDown
();
81
82
// item tests
83
void
testGetBoundaries
();
84
85
// cmos token tests
86
void
testCmosChecksum
();
87
void
testCmosWriting
();
88
89
// systeminfo tests
90
void
testSystemInfo
();
91
92
// testInput.xml tests
93
void
testIdByte
();
94
void
testServiceTag
();
95
void
testServiceTagWriting
();
96
void
testAssetTag
();
97
void
testSystemName
();
98
void
testBiosVersion
();
99
void
testIsDell
();
100
void
testVariousAccessors
();
101
void
testOutOfBounds
();
102
void
testConstructionOffset1
();
103
void
testConstructionOffset2
();
104
105
// other
106
void
testStateBytes
();
107
void
testUpBoot
();
108
109
// make sure to put this at the end...
110
CPPUNIT_TEST_SUITE
(
testPlatform
);
111
112
CPPUNIT_TEST
(
testCmosChecksum
);
113
CPPUNIT_TEST
(
testCmosWriting
);
114
115
CPPUNIT_TEST
(
testSystemInfo
);
116
117
CPPUNIT_TEST
(
testIdByte
);
118
CPPUNIT_TEST
(
testServiceTag
);
119
CPPUNIT_TEST
(
testServiceTagWriting
);
120
CPPUNIT_TEST
(
testAssetTag
);
121
CPPUNIT_TEST
(
testSystemName
);
122
123
124
125
CPPUNIT_TEST
(
testBiosVersion
);
126
CPPUNIT_TEST
(
testIsDell
);
127
CPPUNIT_TEST
(
testVariousAccessors
);
128
CPPUNIT_TEST
(
testOutOfBounds
);
129
CPPUNIT_TEST
(
testConstructionOffset1
);
130
CPPUNIT_TEST
(
testConstructionOffset2
);
131
132
CPPUNIT_TEST
(
testStateBytes
);
133
CPPUNIT_TEST
(
testUpBoot
);
134
135
CPPUNIT_TEST_SUITE_END
();
136
};
137
138
#endif
Generated on Thu Mar 27 2014 09:27:18 for SMBIOS Library by
1.8.1.2