• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

testRbu.h

Go to the documentation of this file.
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 _TESTRBU_H
00020 #define _TESTRBU_H
00021 
00022 #include "smbios/compat.h"
00023 
00024 #include <cppunit/extensions/HelperMacros.h>
00025 #include <string>
00026 
00027 #include "smbios/DellRbu.h"
00028 #include "XmlUtils.h"
00029 
00030 #include "outputctl.h"
00031 
00032 extern int global_argc;
00033 extern char ** global_argv;
00034 
00035 class testRbu  : public CppUnit::TestFixture
00036 {
00037 protected:
00038     virtual std::string getCppunitTopDirectory()
00039     {
00040         //return TEST_DIR;
00041         return global_argv[1];
00042     }
00043     virtual std::string getWritableDirectory()
00044     {
00045         //return DEFAULT_TEST_DIR;
00046         return global_argv[2];
00047     };
00048     virtual std::string getTestName()
00049     {
00050         //return TEST_DIR;
00051         return global_argv[3];
00052     }
00053     virtual std::string getTestDirectory()
00054     {
00055         //return DEFAULT_TEST_DIR;
00056         return global_argv[4];
00057     };
00058 
00059     std::string getTestInputString( std::string toFind, std::string section="systemInfo" );
00060 
00061     // parser owns all XML entities. When it is deleted, everything
00062     // goes with it.
00063     XML_NAMESPACE DOMBuilder *parser;
00064 
00065     // The doc is owned by the parser. We do not have to clean it up
00066     // it is deleted when the parser is released. We keep a ref
00067     // here for speed purposes
00068     XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc;
00069 
00070 
00071 public:
00072     virtual void setUp();
00073     virtual void tearDown();
00074 
00075     // helper functions
00076     std::auto_ptr<rbu::IRbuHdr> checkHdrInfo(std::string name);
00077 
00078     // table tests
00079     void testRbuBasic();
00080     void testRbuBadData();
00081     void testRbuOldVerCompare();
00082     void testRbuNewVerCompare();
00083     void testRbuNewVerSplit();
00084     void testRbuOutput();
00085 
00086     // make sure to put this at the end...
00087     CPPUNIT_TEST_SUITE (testRbu);
00088 
00089     CPPUNIT_TEST (testRbuBasic);
00090     CPPUNIT_TEST (testRbuBadData);
00091     CPPUNIT_TEST (testRbuOldVerCompare);
00092     CPPUNIT_TEST (testRbuNewVerCompare);
00093     CPPUNIT_TEST (testRbuNewVerSplit);
00094     CPPUNIT_TEST (testRbuOutput);
00095 
00096     CPPUNIT_TEST_SUITE_END ();
00097 };
00098 
00099 #endif

Generated on Sun Aug 22 2010 14:38:31 for SMBIOS Library by  doxygen 1.7.1