UnitTest.h
Go to the documentation of this file.
/*
* steghide 0.5.1 - a steganography program
* Copyright (C) 1999-2003 Stefan Hetzl <shetzl@chello.at>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
#ifndef SH_UNITTEST_H
#define SH_UNITTEST_H
#include <string>
#include <vector>
#include "common.h"
#include "Test.h"
#include "TestCategoryCaller.h"
// declared here to avoid circulating includes
class TestCategory ;
class TestSuite ;
#define ADDTESTCATEGORY(UTCLASS,CMETHOD) \
addTestCategory (new TestCategoryCaller<UTCLASS> (strip_test(#CMETHOD), getSuite(), this, &UTCLASS::CMETHOD))
class UnitTest : public Test {
public:
UnitTest (std::string n, TestSuite* s) : Test(n,s), GlobsBackup(NULL) {} ;
~UnitTest (void) ;
virtual void setup (void) ;
void run (void) ;
virtual void cleanup (void) ;
protected:
void addTestCategory (TestCategory *tc) ;
void addTestResult (bool r) ;
char *strip_test (char* s)
{ return (s + 4) ; } ;
private:
std::vector<TestCategory*> TestCategories ;
Globals GlobsBackup ;
} ;
#endif // ndef SH_UNITTEST_H
UnitTest::~UnitTest
~UnitTest(void)
Definition: UnitTest.cc:27
TestCategory
Definition: TestCategory.h:26
UnitTest::setup
virtual void setup(void)
Definition: UnitTest.cc:34
UnitTest::GlobsBackup
Globals GlobsBackup
servers as a backup for the Globals object stored in Globs
Definition: UnitTest.h:75
Test
Definition: Test.h:28
UnitTest::addTestCategory
void addTestCategory(TestCategory *tc)
Definition: UnitTest.cc:64
UnitTest::strip_test
char * strip_test(char *s)
Definition: UnitTest.h:68
Globals
some useful pointers that should be global
Definition: Globals.h:52
Test.h
UnitTest::UnitTest
UnitTest(std::string n, TestSuite *s)
Definition: UnitTest.h:43
UnitTest::cleanup
virtual void cleanup(void)
Definition: UnitTest.cc:59
UnitTest
Definition: UnitTest.h:38
TestSuite
Definition: TestSuite.h:31
UnitTest::addTestResult
void addTestResult(bool r)
Definition: UnitTest.cc:69
common.h
UnitTest::TestCategories
std::vector< TestCategory * > TestCategories
Definition: UnitTest.h:69
TestCategoryCaller.h
UnitTest::run
void run(void)
Definition: UnitTest.cc:39