steghide 0.5.1
UnitTest.h
Go to the documentation of this file.
1/*
2 * steghide 0.5.1 - a steganography program
3 * Copyright (C) 1999-2003 Stefan Hetzl <shetzl@chello.at>
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 *
19 */
20
21#ifndef SH_UNITTEST_H
22#define SH_UNITTEST_H
23
24#include <string>
25#include <vector>
26
27#include "common.h"
28
29#include "Test.h"
30#include "TestCategoryCaller.h"
31// declared here to avoid circulating includes
32class TestCategory ;
33class TestSuite ;
34
35#define ADDTESTCATEGORY(UTCLASS,CMETHOD) \
36 addTestCategory (new TestCategoryCaller<UTCLASS> (strip_test(#CMETHOD), getSuite(), this, &UTCLASS::CMETHOD))
37
38class UnitTest : public Test {
39 public:
43 UnitTest (std::string n, TestSuite* s) : Test(n,s), GlobsBackup(NULL) {} ;
44
45 ~UnitTest (void) ;
46
54 virtual void setup (void) ;
55
56 void run (void) ;
57
61 virtual void cleanup (void) ;
62
63 protected:
64 void addTestCategory (TestCategory *tc) ;
65
66 void addTestResult (bool r) ;
67
68 char *strip_test (char* s)
69 { return (s + 4) ; } ;
70
71 private:
72 std::vector<TestCategory*> TestCategories ;
73
76} ;
77
78#endif // ndef SH_UNITTEST_H
some useful pointers that should be global
Definition: Globals.h:52
Definition: TestCategory.h:26
Definition: TestSuite.h:31
Definition: Test.h:28
Definition: UnitTest.h:38
void run(void)
Definition: UnitTest.cc:39
std::vector< TestCategory * > TestCategories
Definition: UnitTest.h:72
UnitTest(std::string n, TestSuite *s)
Definition: UnitTest.h:43
void addTestCategory(TestCategory *tc)
Definition: UnitTest.cc:64
char * strip_test(char *s)
Definition: UnitTest.h:68
void addTestResult(bool r)
Definition: UnitTest.cc:69
Globals GlobsBackup
servers as a backup for the Globals object stored in Globs
Definition: UnitTest.h:75
virtual void setup(void)
Definition: UnitTest.cc:34
virtual void cleanup(void)
Definition: UnitTest.cc:59
~UnitTest(void)
Definition: UnitTest.cc:27