Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

UnitTest.h

Go to the documentation of this file.
00001 /* 00002 * steghide 0.5.1 - a steganography program 00003 * Copyright (C) 1999-2003 Stefan Hetzl <shetzl@chello.at> 00004 * 00005 * This program is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU General Public License 00007 * as published by the Free Software Foundation; either version 2 00008 * of the License, or (at your option) any later version. 00009 * 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License 00016 * along with this program; if not, write to the Free Software 00017 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00018 * 00019 */ 00020 00021 #ifndef SH_UNITTEST_H 00022 #define SH_UNITTEST_H 00023 00024 #include <string> 00025 #include <vector> 00026 00027 #include "common.h" 00028 00029 #include "Test.h" 00030 #include "TestCategoryCaller.h" 00031 // declared here to avoid circulating includes 00032 class TestCategory ; 00033 class TestSuite ; 00034 00035 #define ADDTESTCATEGORY(UTCLASS,CMETHOD) \ 00036 addTestCategory (new TestCategoryCaller<UTCLASS> (strip_test(#CMETHOD), getSuite(), this, &UTCLASS::CMETHOD)) 00037 00038 class UnitTest : public Test { 00039 public: 00043 UnitTest (std::string n, TestSuite* s) : Test(n,s), GlobsBackup(NULL) {} ; 00044 00045 ~UnitTest (void) ; 00046 00054 virtual void setup (void) ; 00055 00056 void run (void) ; 00057 00061 virtual void cleanup (void) ; 00062 00063 protected: 00064 void addTestCategory (TestCategory *tc) ; 00065 00066 void addTestResult (bool r) ; 00067 00068 char *strip_test (char* s) 00069 { return (s + 4) ; } ; 00070 00071 private: 00072 std::vector<TestCategory*> TestCategories ; 00073 00075 Globals GlobsBackup ; 00076 } ; 00077 00078 #endif // ndef SH_UNITTEST_H

Generated on Fri Jul 16 19:41:21 2004 for steghide by doxygen 1.3.7