00001 // vim:expandtab:autoindent:tabstop=4:shiftwidth=4:filetype=c: 00002 /* 00003 * Copyright (C) 2005 Dell Inc. 00004 * by Michael Brown <Michael_E_Brown@dell.com> 00005 * Licensed under the Open Software License version 2.1 00006 * 00007 * Alternatively, you can redistribute it and/or modify 00008 * it under the terms of the GNU General Public License as published 00009 * by the Free Software Foundation; either version 2 of the License, 00010 * or (at your option) any later version. 00011 00012 * This program is distributed in the hope that it will be useful, but 00013 * WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00015 * See the GNU General Public License for more details. 00016 */ 00017 00018 00019 #ifndef _TESTSTANDALONE_H 00020 #define _TESTSTANDALONE_H 00021 00022 #include "smbios/compat.h" 00023 00024 #include <cppunit/extensions/HelperMacros.h> 00025 #include <typeinfo> 00026 #include <string> 00027 00028 #include "smbios/ISmbios.h" 00029 #include "smbios/ICmosRW.h" 00030 #include "smbios/IToken.h" 00031 #include "smbios/SystemInfo.h" 00032 00033 #include "XmlUtils.h" 00034 00035 #include "outputctl.h" 00036 00037 extern int global_argc; 00038 extern char ** global_argv; 00039 00040 class testStandalone : public CppUnit::TestFixture 00041 { 00042 protected: 00043 virtual std::string getCppunitTopDirectory() 00044 { 00045 //return TEST_DIR; 00046 return global_argv[1]; 00047 } 00048 virtual std::string getWritableDirectory() 00049 { 00050 //return DEFAULT_TEST_DIR; 00051 return global_argv[2]; 00052 }; 00053 00054 00055 virtual std::string getTestName() 00056 { 00057 //return TEST_DIR; 00058 return global_argv[3]; 00059 } 00060 virtual std::string getTestDirectory() 00061 { 00062 //return DEFAULT_TEST_DIR; 00063 return global_argv[4]; 00064 }; 00065 00066 public: 00067 virtual void setUp(); 00068 virtual void tearDown(); 00069 00070 // base smbios test 00071 void testSmbiosTableBase(); 00072 void testSmbiosTableBase_iterNextItem(); 00073 void testSmbiosTableBase_findItemByType(); 00074 void testSmbiosTableBase_findItemByHandle(); 00075 00076 // table tests 00077 void testTable_Subscript(); 00078 void testEntryCount (); 00079 void testConstIterator (); 00080 void testSubscriptOperator1 (); 00081 void testSubscriptOperator2 (); 00082 void testSubscriptOperator3 (); 00083 void testSmbiosXml(); 00084 00085 // item tests 00086 void testStreamify(); 00087 void testEachItemAccessors(); 00088 void testItemIdentity(); 00089 void testGetBoundaries(); 00090 00091 // memory tests 00092 void testMemoryBadFiles(); 00093 void testMemoryFuncs(); 00094 00095 // cmos token tests 00096 void testCmosConstructor(); 00097 00098 // smi tests 00099 void testSmi_callingInterface(); 00100 void testSmi_callingInterface_physaddr(); 00101 00102 // testInput.xml tests 00103 void testServiceTagWriting(); 00104 void testLibraryVersion(); 00105 00106 // other 00107 void testStateBytes(); 00108 00109 // Exception Tests 00110 void testException(); 00111 00112 // Exception Tests 00113 void testNonXml(); 00114 00115 00116 // make sure to put this at the end... 00117 CPPUNIT_TEST_SUITE (testStandalone); 00118 00119 CPPUNIT_TEST (testSmbiosTableBase); 00120 CPPUNIT_TEST (testSmbiosTableBase_iterNextItem); 00121 CPPUNIT_TEST (testSmbiosTableBase_findItemByType); 00122 CPPUNIT_TEST (testSmbiosTableBase_findItemByHandle); 00123 00124 CPPUNIT_TEST (testTable_Subscript); 00125 CPPUNIT_TEST (testEntryCount); 00126 CPPUNIT_TEST (testConstIterator); 00127 CPPUNIT_TEST (testSubscriptOperator1); 00128 CPPUNIT_TEST (testSubscriptOperator2); 00129 CPPUNIT_TEST (testSubscriptOperator3); 00130 CPPUNIT_TEST (testSmbiosXml); 00131 00132 CPPUNIT_TEST (testStreamify); 00133 CPPUNIT_TEST (testItemIdentity); 00134 CPPUNIT_TEST (testEachItemAccessors); 00135 CPPUNIT_TEST (testGetBoundaries); 00136 00137 00138 CPPUNIT_TEST (testMemoryBadFiles); 00139 CPPUNIT_TEST (testMemoryFuncs); 00140 00141 CPPUNIT_TEST (testCmosConstructor); 00142 00143 CPPUNIT_TEST (testSmi_callingInterface); 00144 CPPUNIT_TEST (testSmi_callingInterface_physaddr); 00145 00146 CPPUNIT_TEST (testLibraryVersion); 00147 CPPUNIT_TEST (testException); 00148 00149 CPPUNIT_TEST (testNonXml); 00150 00151 CPPUNIT_TEST_SUITE_END (); 00152 }; 00153 00154 #endif