File: main.cc

package info (click to toggle)
steghide 0.5.1-15
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 3,440 kB
  • sloc: cpp: 13,302; ansic: 6,184; sh: 3,960; makefile: 384; yacc: 316; perl: 228; sed: 16
file content (163 lines) | stat: -rw-r--r-- 3,780 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
/*
 * 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.
 *
 */

#include <cstdlib>

#include "common.h"

#include "TestSuite.h"
#include "AudioSampleValueTest.h"
#include "AuFileTest.h"
#include "AUtilsTest.h"
#include "BFSAPHeuristicTest.h"
#include "BitStringTest.h"
#include "BmpFileTest.h"
#include "BmpRGBSampleValueTest.h"
#include "BmpPaletteSampleValueTest.h"
#include "BmpOS2FileTest.h"
#include "BmpWinFileTest.h"
#include "DFSAPHeuristicTest.h"
#include "EdgeIteratorTest.h"
#include "EmbDataTest.h"
#include "WKSConstructionHeuristicTest.h"
#include "GraphTest.h"
#include "JpegFileTest.h"
#include "JpegSampleValueTest.h"
#include "MatchingTest.h"
#include "MCryptPPTest.h"
#include "MHashKeyGenTest.h"
#include "MHashPPTest.h"
#include "SampleValueAdjacencyListTest.h"
#include "SelectorTest.h"
#include "WavFileTest.h"
#include "WavPCMSampleValueTest.h"

bool ArgVerbose ;

int main (int argc, char *argv[])
{
	ArgVerbose = false ;

	unsigned short argi = 1 ;
	while (argi < argc) {
		if (std::string(argv[argi]) == "-v" || std::string(argv[argi]) == "--verbose") {
			ArgVerbose = true ;
		}
#ifdef DEBUG
		else if (std::string(argv[argi]) == "--debuglevel") {
			argi++ ;
			unsigned int tmp = 0 ;
			sscanf (argv[argi], "%u", &tmp) ;
			Args.DebugLevel.setValue (tmp) ;
		}
#endif
		else {
			std::cerr << "unknown argument: " << argv[argi] << std::endl ;
			exit (EXIT_FAILURE) ;
		}
		argi++ ;
	}

	TestSuite ts ;

	// basic classes
	AUtilsTest at (&ts) ;
	ts.addUnitTest (&at) ;

	BitStringTest bst (&ts) ;
	ts.addUnitTest (&bst) ;

	SelectorTest st (&ts) ;
	ts.addUnitTest (&st) ;

	EmbDataTest edt (&ts) ;
	ts.addUnitTest (&edt) ;

	// mlibs
	MHashPPTest mht (&ts) ;
	ts.addUnitTest (&mht) ;

	MHashKeyGenTest mhkgt (&ts) ;
	ts.addUnitTest (&mhkgt) ;

	MCryptPPTest mct (&ts) ;
	ts.addUnitTest (&mct) ;

	// SampleValues
	AudioSampleValueTest asvt (&ts) ;
	ts.addUnitTest (&asvt) ;

	BmpRGBSampleValueTest rgbsvt (&ts) ;
	ts.addUnitTest (&rgbsvt) ;

	BmpPaletteSampleValueTest palsvt (&ts) ;
	ts.addUnitTest (&palsvt) ;

	JpegSampleValueTest jsvt (&ts) ;
	ts.addUnitTest (&jsvt) ;

	WavPCMSampleValueTest wavsvt (&ts) ;
	ts.addUnitTest (&wavsvt) ;

	// CvrStgFiles
	AuFileTest aut (&ts) ;
	ts.addUnitTest (&aut) ;

	BmpFileTest bmpt (&ts) ;
	ts.addUnitTest (&bmpt) ;

	BmpOS2FileTest bmpot (&ts) ;
	ts.addUnitTest (&bmpot) ;

	BmpWinFileTest bmpwt (&ts) ;
	ts.addUnitTest (&bmpwt) ;

	JpegFileTest jft (&ts) ;
	ts.addUnitTest (&jft) ;

	WavFileTest wt (&ts) ;
	ts.addUnitTest (&wt) ;

	// graph-theoretic stuff
	SampleValueAdjacencyListTest svalt (&ts) ;
	ts.addUnitTest (&svalt) ;

	GraphTest gt (&ts) ;
	ts.addUnitTest (&gt) ;

	EdgeIteratorTest eitt (&ts) ;
	ts.addUnitTest (&eitt) ;

	MatchingTest mt (&ts) ;
	ts.addUnitTest (&mt) ;

	WKSConstructionHeuristicTest cht (&ts) ;
	ts.addUnitTest (&cht) ;

	BFSAPHeuristicTest bfsapht (&ts) ;
	ts.addUnitTest (&bfsapht) ;

	DFSAPHeuristicTest dfsapht (&ts) ;
	ts.addUnitTest (&dfsapht) ;

	ts.run() ;

	return (ts.getResult() ? 0 : -1) ;
}