SMBIOS Library
testStandalone.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 _TESTSTANDALONE_H
20 #define _TESTSTANDALONE_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 testStandalone : 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 
55  virtual std::string getTestName()
56  {
57  //return TEST_DIR;
58  return global_argv[3];
59  }
60  virtual std::string getTestDirectory()
61  {
62  //return DEFAULT_TEST_DIR;
63  return global_argv[4];
64  };
65 
66 public:
67  virtual void setUp();
68  virtual void tearDown();
69 
70  // base smbios test
71  void testSmbiosTableBase();
75 
76  // table tests
77  void testTable_Subscript();
78  void testEntryCount ();
79  void testConstIterator ();
80  void testSubscriptOperator1 ();
81  void testSubscriptOperator2 ();
82  void testSubscriptOperator3 ();
83  void testSmbiosXml();
84 
85  // item tests
86  void testStreamify();
87  void testEachItemAccessors();
88  void testItemIdentity();
89  void testGetBoundaries();
90 
91  // memory tests
92  void testMemoryBadFiles();
93  void testMemoryFuncs();
94 
95  // cmos token tests
96  void testCmosConstructor();
97 
98  // smi tests
101 
102  // testInput.xml tests
103  void testServiceTagWriting();
104  void testLibraryVersion();
105 
106  // other
107  void testStateBytes();
108 
109  // Exception Tests
110  void testException();
111 
112  // Exception Tests
113  void testNonXml();
114 
115 
116  // make sure to put this at the end...
118 
123 
131 
136 
137 
140 
142 
145 
148 
150 
152 };
153 
154 #endif