Revive the old unit test suite. Needs autoconf/buildsys work, and tests don't all pass yet.

This commit is contained in:
Brian Cox 2016-04-16 19:16:32 -07:00
parent 7b183eab5e
commit 677162cc6e
69 changed files with 304 additions and 217 deletions

View File

@ -431,5 +431,6 @@ src/twprint/Makefile
src/twadmin/Makefile src/twadmin/Makefile
src/siggen/Makefile src/siggen/Makefile
src/tripwire/Makefile src/tripwire/Makefile
src/twtest/Makefile
]) ])
AC_OUTPUT AC_OUTPUT

View File

@ -1,2 +1,3 @@
SUBDIRS = cryptlib core db fco fs tw twcrypto twparser util SUBDIRS = cryptlib core db fco fs tw twcrypto twparser util
SUBDIRS+= twprint twadmin siggen tripwire SUBDIRS+= twprint twadmin siggen tripwire twtest

View File

@ -5,7 +5,7 @@ INCLUDES = -I..
noinst_LIBRARIES = libcore.a noinst_LIBRARIES = libcore.a
libcore_a_SOURCES = \ libcore_a_SOURCES = \
file_unix.cpp unixfsservices.cpp \ file_unix.cpp unixfsservices.cpp \
charutil_t.cpp displayencoder_t.cpp archive.cpp charutil.cpp \ archive.cpp charutil.cpp \
cmdlineparser.cpp codeconvert.cpp core.cpp coreerrors.cpp \ cmdlineparser.cpp codeconvert.cpp core.cpp coreerrors.cpp \
corestrings.cpp crc32.cpp debug.cpp displayencoder.cpp \ corestrings.cpp crc32.cpp debug.cpp displayencoder.cpp \
displayutil.cpp error.cpp errorbucketimpl.cpp errortable.cpp \ displayutil.cpp error.cpp errorbucketimpl.cpp errortable.cpp \

80
src/twtest/Makefile.am Normal file
View File

@ -0,0 +1,80 @@
AUTOMAKE_OPTIONS = foreign no-dependencies
AM_INSTALL_PROGRAM_FLAGS = -m 755
INCLUDES = -I..
LIBS = -ltripwire -lcryptlib @LIBS@
LDFLAGS = @LDFLAGS@ -L../../lib
LN_S = @LN@
sbin_PROGRAMS = twtest
twtest_SOURCES = \
archive_t.cpp \
charutil_t.cpp \
cmdlineparser_t.cpp \
codeconvert_t.cpp \
configfile_t.cpp \
cryptoarchive_t.cpp \
crytpo_t.cpp \
dbdatasource_t.cpp \
debug_t.cpp \
displayencoder_t.cpp \
error_t.cpp \
errorbucketimpl_t.cpp \
fcocompare_t.cpp \
fcodatabasefile_t.cpp \
fconame_t.cpp \
fconametbl_t.cpp \
fconametranslator_t.cpp \
fcopropimpl_t.cpp \
fcopropvector_t.cpp \
fcoreport_t.cpp \
fcosetimpl_t.cpp \
fcospec_t.cpp \
fcospecattr_t.cpp \
fcospechelper_t.cpp \
fcospeclist_t.cpp \
fcospecutil_t.cpp \
file_t.cpp \
fileheader_t.cpp \
fileutil_t.cpp \
fsdatasourceiter_t.cpp \
fsobject_t.cpp \
fspropcalc_t.cpp \
fspropdisplayer_t.cpp \
fspropset_t.cpp \
fsspec_t.cpp \
genre_t.cpp \
genrespeclist_t.cpp \
genreswitcher_t.cpp \
growheap_t.cpp \
hashtable_t.cpp \
keyfile_t.cpp \
objectpool_t.cpp \
platform_t.cpp \
policyparser_t.cpp \
refcountobj_t.cpp \
resources_t.cpp \
serializer_t.cpp \
serializerimpl_t.cpp \
signature_t.cpp \
srefcountobj_t.cpp \
stdtest.cpp \
stdtest.h \
stringencoder_t.cpp \
tasktimer_t.cpp \
tchar_t.cpp \
test.cpp \
test.h \
textreportviewer_t.cpp \
twlocale_t.cpp \
twutil_t.cpp \
types_t.cpp \
unixfsservices_t.cpp \
usernotifystdout_t.cpp \
wchar16_t.cpp
DEFS = @DEFS@ # This gets rid of the -I. so INCLUDES must be more explicit
CLEANFILES = ../../bin/twtest
all: $(sbin_PROGRAMS)
@test -d ../../bin && $(LN) -f $(sbin_PROGRAMS) ../../bin

View File

@ -34,10 +34,10 @@
// //
// test the archive component // test the archive component
#include "stdcore.h" #include "core/stdcore.h"
#include "archive.h" #include "core/archive.h"
#include "test/test.h" #include "twtest/test.h"
#include "error.h" #include "core/error.h"
#include <stdio.h> #include <stdio.h>
TSS_EXCEPTION(eTestArchiveError, eError); TSS_EXCEPTION(eTestArchiveError, eError);

View File

@ -35,7 +35,7 @@
// Creator.: Brian McFeely (bmcfeely) // Creator.: Brian McFeely (bmcfeely)
// //
#include "stdcore.h" #include "core/stdcore.h"
#ifdef TSS_TEST #ifdef TSS_TEST

View File

@ -32,9 +32,9 @@
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// cmdlineparser_t.cpp // cmdlineparser_t.cpp
#include "stdcore.h" #include "core/stdcore.h"
#include "cmdlineparser.h" #include "core/cmdlineparser.h"
#include "test/test.h" #include "twtest/test.h"
//#include "tw/twutil.h" //#include "tw/twutil.h"
//#include "tw/twstrings.h" //#include "tw/twstrings.h"
@ -172,7 +172,7 @@ void TestCmdLineParser()
{ {
TCERR << _T("Command line error: "); TCERR << _T("Command line error: ");
TCERR << e.GetMsg() << std::endl; TCERR << e.GetMsg() << std::endl;
TEST(false); //TODO... TEST(false);
} }
} }

View File

@ -36,10 +36,10 @@
// //
// [Description] // [Description]
#include "stdcore.h" #include "core/stdcore.h"
#include "codeconvert.h" #include "core/codeconvert.h"
#include "core/wchar16.h" #include "core/wchar16.h"
#include "test/test.h" #include "twtest/test.h"
#include <iomanip> #include <iomanip>

View File

@ -35,10 +35,10 @@
//Don't see a test driver for this module in source safe - //Don't see a test driver for this module in source safe -
//hopefully this hasn't been implemented already! -DA //hopefully this hasn't been implemented already! -DA
#include "stdtw.h" #include "tw/stdtw.h"
#include "configfile.h" #include "tw/configfile.h"
#include "core/errorbucketimpl.h" #include "core/errorbucketimpl.h"
#include "test/test.h" #include "twtest/test.h"
#include "core/debug.h" #include "core/debug.h"
#include <string> #include <string>
#include "core/fsservices.h" #include "core/fsservices.h"

View File

@ -32,10 +32,10 @@
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// cryptoarchive_t.cpp -- test classes that abstract a raw byte archive // cryptoarchive_t.cpp -- test classes that abstract a raw byte archive
#include "stdtwcrypto.h" #include "twcrypto/stdtwcrypto.h"
#include "cryptoarchive.h" #include "twcrypto/cryptoarchive.h"
#include "crypto.h" #include "twcrypto/crypto.h"
#include "test/test.h" #include "twtest/test.h"
void TestCryptoArchive() void TestCryptoArchive()
{ {

View File

@ -33,10 +33,10 @@
// crypto-t.cpp -- generic crypto implementations // crypto-t.cpp -- generic crypto implementations
// //
#include "stdtwcrypto.h" #include "twcrypto/stdtwcrypto.h"
#include "crypto.h" #include "twcrypto/crypto.h"
#include "core/archive.h" #include "core/archive.h"
#include "test/test.h" #include "twtest/test.h"
void TestCrypto() void TestCrypto()
{ {

View File

@ -30,8 +30,8 @@
// info@tripwire.org or www.tripwire.org. // info@tripwire.org or www.tripwire.org.
// //
// dbdatasource_t.cpp // dbdatasource_t.cpp
#include "stdtw.h" #include "tw/stdtw.h"
#include "dbdatasource.h" #include "tw/dbdatasource.h"
#include "db/hierdatabase.h" #include "db/hierdatabase.h"
#include "core/fsservices.h" #include "core/fsservices.h"
#include "core/debug.h" #include "core/debug.h"

View File

@ -31,9 +31,9 @@
// //
// debug_t -- debug component test driver // debug_t -- debug component test driver
#include "stdcore.h" #include "core/stdcore.h"
#include "debug.h" #include "core/debug.h"
#include "test/test.h" #include "twtest/test.h"
void TestDebug() void TestDebug()
{ {
@ -74,8 +74,11 @@ void TestDebug()
std::string str = TEMP_DIR_N; std::string str = TEMP_DIR_N;
str += "/debug.out"; str += "/debug.out";
bool bResult = false; bool bResult = false;
bResult = cDebug::SetOutputFile(str.c_str()); bResult = cDebug::SetOutputFile(str.c_str());
TEST(bResult); //TODO... TEST(bResult);
if( !bResult)
TCERR << "SetOutputFile failed!" << std::endl;
d.TraceDebug("This should be in trace and the file %s.\n", str.c_str()); d.TraceDebug("This should be in trace and the file %s.\n", str.c_str());
// restore the out source... // restore the out source...

View File

@ -35,7 +35,7 @@
// Creator.: Brian McFeely (bmcfeely) // Creator.: Brian McFeely (bmcfeely)
// //
#include "stdcore.h" #include "core/stdcore.h"
#ifdef TSS_TEST #ifdef TSS_TEST

View File

@ -32,9 +32,9 @@
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// error_t.h -- the vcc exception test driver // error_t.h -- the vcc exception test driver
#include "stdcore.h" #include "core/stdcore.h"
#include "error.h" #include "core/error.h"
#include "test/test.h" #include "twtest/test.h"
#include <iostream> #include <iostream>
void TestError() void TestError()

View File

@ -31,12 +31,12 @@
// //
// errorbucketimpl_t.cpp // errorbucketimpl_t.cpp
#include "stdcore.h" #include "core/stdcore.h"
#include "errorbucketimpl.h" #include "core/errorbucketimpl.h"
#include "test/test.h" #include "twtest/test.h"
#include "debug.h" #include "core/debug.h"
#include "archive.h" #include "core/archive.h"
#include "errorgeneral.h" #include "core/errorgeneral.h"
// test option 7 // test option 7
void TestErrorBucketImpl() void TestErrorBucketImpl()

View File

@ -30,12 +30,12 @@
// info@tripwire.org or www.tripwire.org. // info@tripwire.org or www.tripwire.org.
// //
// fcocompare_t.cpp -- the compare object's test driver // fcocompare_t.cpp -- the compare object's test driver
#include "stdfco.h" #include "fco/stdfco.h"
#include "fcocompare.h" #include "fco/fcocompare.h"
#include "core/debug.h" #include "core/debug.h"
#include "fs/fsobject.h" #include "fs/fsobject.h"
#include "fs/fspropcalc.h" #include "fs/fspropcalc.h"
#include "test/test.h" #include "twtest/test.h"
#include <fstream> #include <fstream>

View File

@ -30,8 +30,8 @@
// info@tripwire.org or www.tripwire.org. // info@tripwire.org or www.tripwire.org.
// //
// fcodatabasefile.cpp // fcodatabasefile.cpp
#include "stdtw.h" #include "tw/stdtw.h"
#include "fcodatabasefile.h" #include "tw/fcodatabasefile.h"
void TestFCODatabaseFile() void TestFCODatabaseFile()
{ {

View File

@ -33,15 +33,15 @@
// fconame_t.cpp // fconame_t.cpp
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
#include "stdfco.h" #include "fco/stdfco.h"
#include "fconame.h" #include "fco/fconame.h"
#include "test/test.h" #include "twtest/test.h"
#include "core/serializer.h" #include "core/serializer.h"
#include "core/serializerimpl.h" #include "core/serializerimpl.h"
#include "core/archive.h" #include "core/archive.h"
#include "genreswitcher.h" #include "fco/genreswitcher.h"
void TestFCOName() void TestFCOName()
{ {
@ -103,12 +103,14 @@ void TestFCOName()
cFCOName copyName(stringName); cFCOName copyName(stringName);
TEST(_tcscmp(copyName.AsString().c_str(), _T("/a/string/name")) == 0); TEST(_tcscmp(copyName.AsString().c_str(), _T("/a/string/name")) == 0);
TCERR << "Multiple TODO tests in fconame_t.cpp" << std::endl;
#if 0
cFCOName name(_T("new name")); cFCOName name(_T("new name"));
nullName = name; nullName = name;
TEST(_tcscmp(nullName.AsString().c_str(), _T("new name")) == 0); //TODO... TEST(_tcscmp(nullName.AsString().c_str(), _T("new name")) == 0);
nullName = _T("newer name"); nullName = _T("newer name");
TEST(_tcscmp(nullName.AsString().c_str(), _T("newer name")) == 0); //TODO... TEST(_tcscmp(nullName.AsString().c_str(), _T("newer name")) == 0);
cMemoryArchive memArc; cMemoryArchive memArc;
{ {
@ -135,7 +137,7 @@ void TestFCOName()
TEST(name2.GetDelimiter() == _T('\\')); TEST(name2.GetDelimiter() == _T('\\'));
TEST(name1.GetDelimiter() == _T('/')); TEST(name1.GetDelimiter() == _T('/'));
} }
#endif
} }

View File

@ -30,9 +30,9 @@
// info@tripwire.org or www.tripwire.org. // info@tripwire.org or www.tripwire.org.
// //
// fconametbl_t.cpp // fconametbl_t.cpp
#include "stdfco.h" #include "fco/stdfco.h"
#include "fconametbl.h" #include "fco/fconametbl.h"
#include "test/test.h" #include "twtest/test.h"
void TestFCONameTbl() void TestFCONameTbl()
{ {

View File

@ -35,10 +35,10 @@
// Creator.: Brian McFeely (bmcfeely) // Creator.: Brian McFeely (bmcfeely)
// //
#include "stdfco.h" #include "fco/stdfco.h"
#include "fconametranslator.h" #include "fco/fconametranslator.h"
#include "genreswitcher.h" #include "fco/genreswitcher.h"
#include "fconame.h" #include "fco/fconame.h"
void TestName( const TCHAR* pchName, const TCHAR* pchGenre ); void TestName( const TCHAR* pchName, const TCHAR* pchGenre );

View File

@ -30,8 +30,8 @@
// info@tripwire.org or www.tripwire.org. // info@tripwire.org or www.tripwire.org.
// //
// fcopropimpl_t.cpp // fcopropimpl_t.cpp
#include "stdfco.h" #include "fco/stdfco.h"
#include "fcopropimpl.h" #include "fco/fcopropimpl.h"
#include "core/debug.h" #include "core/debug.h"
void TestFCOPropImpl() void TestFCOPropImpl()

View File

@ -30,11 +30,11 @@
// info@tripwire.org or www.tripwire.org. // info@tripwire.org or www.tripwire.org.
// //
// fcopropvector_t.cpp -- class cFCOPropVector's test harness // fcopropvector_t.cpp -- class cFCOPropVector's test harness
#include "stdfco.h" #include "fco/stdfco.h"
#include "fcopropvector.h" #include "fco/fcopropvector.h"
#ifndef __TEST_H #ifndef __TEST_H
#include "test/test.h" #include "twtest/test.h"
#endif #endif
static bool init (cFCOPropVector &testV); static bool init (cFCOPropVector &testV);

View File

@ -31,14 +31,14 @@
// //
// fcoreport_t.cpp // fcoreport_t.cpp
#include "stdtw.h" #include "tw/stdtw.h"
#include "fcoreport.h" #include "tw/fcoreport.h"
#include "fco/fcospecimpl.h" #include "fco/fcospecimpl.h"
#include "fco/fcosetimpl.h" #include "fco/fcosetimpl.h"
#include "fs/fsobject.h" #include "fs/fsobject.h"
#include "core/serializerimpl.h" #include "core/serializerimpl.h"
#include "core/archive.h" #include "core/archive.h"
#include "test/test.h" #include "twtest/test.h"
#include "core/errorbucketimpl.h" #include "core/errorbucketimpl.h"
#include "fco/fcospecattr.h" #include "fco/fcospecattr.h"
#include "fco/fcospechelper.h" #include "fco/fcospechelper.h"

View File

@ -31,12 +31,12 @@
// //
// fcosetimpl_t -- FCOSetImpl test driver // fcosetimpl_t -- FCOSetImpl test driver
#include "stdfco.h" #include "fco/stdfco.h"
#include "fcosetimpl.h" #include "fco/fcosetimpl.h"
#include "fs/fsobject.h" #include "fs/fsobject.h"
#include "core/debug.h" #include "core/debug.h"
#include "test/test.h" #include "twtest/test.h"
#include "iterproxy.h" #include "fco/iterproxy.h"
#include "core/archive.h" #include "core/archive.h"
#include "core/serializerimpl.h" #include "core/serializerimpl.h"

View File

@ -31,8 +31,8 @@
// //
// fcospec_t -- the fcospec test driver // fcospec_t -- the fcospec test driver
#include "stdfco.h" #include "fco/stdfco.h"
#include "fcospec.h" #include "fco/fcospec.h"
#include "core/debug.h" #include "core/debug.h"
#include <iostream> #include <iostream>

View File

@ -31,9 +31,9 @@
// //
// fcospecattr_t // fcospecattr_t
#include "stdfco.h" #include "fco/stdfco.h"
#include "fcospecattr.h" #include "fco/fcospecattr.h"
#include "test/test.h" #include "twtest/test.h"
#include "core/archive.h" #include "core/archive.h"
#include "core/serializerimpl.h" #include "core/serializerimpl.h"

View File

@ -31,9 +31,9 @@
// //
// fcospechelper_t.cpp // fcospechelper_t.cpp
#include "stdfco.h" #include "fco/stdfco.h"
#include "fcospechelper.h" #include "fco/fcospechelper.h"
#include "test/test.h" #include "twtest/test.h"
#include "core/error.h" #include "core/error.h"
#include "core/serializerimpl.h" #include "core/serializerimpl.h"
#include "core/archive.h" #include "core/archive.h"

View File

@ -31,15 +31,15 @@
// //
// fcospeclist_t.cpp // fcospeclist_t.cpp
#include "stdfco.h" #include "fco/stdfco.h"
#include "fcospeclist.h" #include "fco/fcospeclist.h"
#include "core/debug.h" #include "core/debug.h"
#include "test/test.h" #include "twtest/test.h"
#include "fcospecimpl.h" #include "fco/fcospecimpl.h"
#include "core/archive.h" #include "core/archive.h"
#include "core/serializerimpl.h" #include "core/serializerimpl.h"
#include "fcospecutil.h" #include "fco/fcospecutil.h"
#include "fcospechelper.h" #include "fco/fcospechelper.h"
void TestFCOSpecList() void TestFCOSpecList()
{ {

View File

@ -31,13 +31,13 @@
// //
// fcospecutil_t.cpp // fcospecutil_t.cpp
#include "stdfco.h" #include "fco/stdfco.h"
#include "fcospecutil.h" #include "fco/fcospecutil.h"
#include "core/debug.h" #include "core/debug.h"
#include "test/test.h" #include "twtest/test.h"
#include "fcospecimpl.h" #include "fco/fcospecimpl.h"
#include "iterproxy.h" #include "fco/iterproxy.h"
#include "fcospechelper.h" #include "fco/fcospechelper.h"
void TestFcoSpecUtil() void TestFcoSpecUtil()
{ {

View File

@ -32,9 +32,9 @@
// file_t.cpp : A test harness for cFile, a class for abstracting // file_t.cpp : A test harness for cFile, a class for abstracting
// file operations between different platforms. // file operations between different platforms.
#include "stdcore.h" #include "core/stdcore.h"
#include "file.h" #include "core/file.h"
#include "test/test.h" #include "twtest/test.h"
#include <stdio.h> #include <stdio.h>
void TestFile() void TestFile()

View File

@ -32,11 +32,11 @@
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// fileheader_t.cpp // fileheader_t.cpp
#include "stdcore.h" #include "core/stdcore.h"
#include "fileheader.h" #include "core/fileheader.h"
#include "test/test.h" #include "twtest/test.h"
#include "serializerimpl.h" #include "core/serializerimpl.h"
#include "archive.h" #include "core/archive.h"
void TestFileHeader() void TestFileHeader()
{ {

View File

@ -35,8 +35,8 @@
// This is just to test my Copy() method. // This is just to test my Copy() method.
// Feel free to add if you want. // Feel free to add if you want.
#include "stdutil.h" #include "util/stdutil.h"
#include "fileutil.h" #include "util/fileutil.h"
#include "core/debug.h" #include "core/debug.h"
using namespace std; using namespace std;

View File

@ -30,11 +30,11 @@
// info@tripwire.org or www.tripwire.org. // info@tripwire.org or www.tripwire.org.
// //
// fsdatasourceiter_t // fsdatasourceiter_t
#include "stdfs.h" #include "fs/stdfs.h"
#include "fsdatasourceiter.h" #include "fs/fsdatasourceiter.h"
#include "core/fsservices.h" #include "core/fsservices.h"
#include "core/debug.h" #include "core/debug.h"
#include "test/test.h" #include "twtest/test.h"
#include "fco/fco.h" #include "fco/fco.h"
/* /*
@ -110,7 +110,7 @@ void TestFSDataSourceIter()
} }
catch( eError& e ) catch( eError& e )
{ {
d.TraceError( "*** Caught exception %d %s\n", e.GetID(), e.GetMsg() ); d.TraceError( "*** Caught exception %d %s\n", e.GetID(), e.GetMsg().c_str() );
TEST( false ); TEST( false );
} }
} }

View File

@ -30,8 +30,8 @@
// info@tripwire.org or www.tripwire.org. // info@tripwire.org or www.tripwire.org.
// //
// fsobject_t -- the file system object test driver // fsobject_t -- the file system object test driver
#include "stdfs.h" #include "fs/stdfs.h"
#include "fsobject.h" #include "fs/fsobject.h"
void TestFSObject() void TestFSObject()
{ {

View File

@ -30,12 +30,12 @@
// info@tripwire.org or www.tripwire.org. // info@tripwire.org or www.tripwire.org.
// //
// fspropcalc_t.cpp -- the fs property calculator test driver // fspropcalc_t.cpp -- the fs property calculator test driver
#include "stdfs.h" #include "fs/stdfs.h"
#include "fspropcalc.h" #include "fs/fspropcalc.h"
#include "core/debug.h" #include "core/debug.h"
#include "fco/fcopropset.h" #include "fco/fcopropset.h"
#include "fspropset.h" #include "fs/fspropset.h"
#include "test/test.h" #include "twtest/test.h"
#include "fco/fco.h" #include "fco/fco.h"
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////

View File

@ -32,11 +32,11 @@
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// fspropdisplayer_t -- cFSPropDisplayer test driver // fspropdisplayer_t -- cFSPropDisplayer test driver
#include "stdfs.h" #include "fs/stdfs.h"
#include "fspropdisplayer.h" #include "fs/fspropdisplayer.h"
#include "fspropcalc.h" #include "fs/fspropcalc.h"
#include "fsobject.h" #include "fs/fsobject.h"
#include "test/test.h" #include "twtest/test.h"
#include "core/serializerimpl.h" #include "core/serializerimpl.h"
class cTestFSPropDisplayer class cTestFSPropDisplayer

View File

@ -30,9 +30,9 @@
// info@tripwire.org or www.tripwire.org. // info@tripwire.org or www.tripwire.org.
// //
// fspropset_t.cpp -- FSPropSet test driver // fspropset_t.cpp -- FSPropSet test driver
#include "stdfs.h" #include "fs/stdfs.h"
#include "fspropset.h" #include "fs/fspropset.h"
#include "test/test.h" #include "twtest/test.h"
#include "core/debug.h" #include "core/debug.h"

View File

@ -31,14 +31,14 @@
// //
// fcospecimpl test driver // fcospecimpl test driver
#include "stdfco.h" #include "fco/stdfco.h"
#include "fcospecimpl.h" #include "fco/fcospecimpl.h"
#include "core/debug.h" #include "core/debug.h"
//#include "fs/fsdatasource.h" //#include "fs/fsdatasource.h"
#include "iterproxy.h" #include "fco/iterproxy.h"
#include "core/error.h" #include "core/error.h"
#include "test/test.h" #include "twtest/test.h"
#include "fcospechelper.h" #include "fco/fcospechelper.h"
#include "core/fsservices.h" #include "core/fsservices.h"
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////

View File

@ -33,9 +33,9 @@
// genre_t.cpp // genre_t.cpp
// //
#include "stdfco.h" #include "fco/stdfco.h"
#include "genreswitcher.h" #include "fco/genreswitcher.h"
#include "test/test.h" #include "twtest/test.h"
#ifdef _CPPRTTI #ifdef _CPPRTTI
#include "fs/fsfactory.h" #include "fs/fsfactory.h"

View File

@ -33,10 +33,10 @@
// genrespeclist_t.cpp // genrespeclist_t.cpp
// //
#include "stdfco.h" #include "fco/stdfco.h"
#include "genrespeclist.h" #include "fco/genrespeclist.h"
#include "test/test.h" #include "twtest/test.h"
#include "fcospecimpl.h" #include "fco/fcospecimpl.h"
void TestGenreSpecList() void TestGenreSpecList()
{ {

View File

@ -33,9 +33,9 @@
// genreswitcher_t.h // genreswitcher_t.h
// //
#include "stdfco.h" #include "fco/stdfco.h"
#include "genreswitcher.h" #include "fco/genreswitcher.h"
#include "test/test.h" #include "twtest/test.h"
void TestGenre() void TestGenre()
{ {

View File

@ -34,10 +34,10 @@
// //
// test the grow heap component // test the grow heap component
#include "stdcore.h" #include "core/stdcore.h"
#include "growheap.h" #include "core/growheap.h"
#include "test/test.h" #include "twtest/test.h"
#include "error.h" #include "core/error.h"
using namespace std; using namespace std;

View File

@ -31,12 +31,12 @@
// //
//hashtable_t.cpp : Test suite for cHashTable. //hashtable_t.cpp : Test suite for cHashTable.
#include "stdcore.h" #include "core/stdcore.h"
#include "hashtable.h" #include "core/hashtable.h"
#include <iostream> #include <iostream>
#ifndef __TEST_H #ifndef __TEST_H
#include "test/test.h" #include "twtest/test.h"
#endif #endif
//#include "dummy.h" //#include "dummy.h"

View File

@ -33,12 +33,12 @@
// keyfile_t.cpp // keyfile_t.cpp
// //
#include "stdtwcrypto.h" #include "twcrypto/stdtwcrypto.h"
#include "keyfile.h" #include "twcrypto/keyfile.h"
#include "crypto.h" #include "twcrypto/crypto.h"
#include "core/archive.h" #include "core/archive.h"
#include "core/debug.h" #include "core/debug.h"
#include "test/test.h" #include "twtest/test.h"
#include "tw/twutil.h" #include "tw/twutil.h"
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////

View File

@ -32,10 +32,10 @@
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// objectpool_t // objectpool_t
#include "stdcore.h" #include "core/stdcore.h"
#include "objectpool.h" #include "core/objectpool.h"
#include "debug.h" #include "core/debug.h"
#include "test/test.h" #include "twtest/test.h"
// this is the struct we will use for testing purposes // this is the struct we will use for testing purposes

View File

@ -34,10 +34,10 @@
// //
// test some platform assumptions // test some platform assumptions
#include "stdcore.h" #include "core/stdcore.h"
#include "platform.h" #include "core/platform.h"
#include "test/test.h" #include "twtest/test.h"
#include "error.h" #include "core/error.h"
using namespace std; using namespace std;

View File

@ -36,14 +36,14 @@
// 2. incorrect files cause errors // 2. incorrect files cause errors
// 3. slightly incorrect files cause errors // 3. slightly incorrect files cause errors
#include "stdtwparser.h" #include "twparser/stdtwparser.h"
#include "core/debug.h" #include "core/debug.h"
#include "fco/fcospecimpl.h" #include "fco/fcospecimpl.h"
#include "parserhelper.h" #include "twparser/parserhelper.h"
#include "policyparser.h" #include "twparser/policyparser.h"
#include "fs/fspropset.h" #include "fs/fspropset.h"
#include "fco/fcospeclist.h" #include "fco/fcospeclist.h"
#include "test/test.h" #include "twtest/test.h"
#include <fstream> #include <fstream>
// helper class that checks output of each fcospec // helper class that checks output of each fcospec

View File

@ -30,9 +30,9 @@
// info@tripwire.org or www.tripwire.org. // info@tripwire.org or www.tripwire.org.
// //
#include "stdcore.h" #include "core/stdcore.h"
#include "refcountobj.h" #include "core/refcountobj.h"
#include "debug.h" #include "core/debug.h"
class cRefCountTestObj : public cRefCountObj class cRefCountTestObj : public cRefCountObj
{ {

View File

@ -35,9 +35,9 @@
* Creator.: Robert DiFalco (rdifalco) * Creator.: Robert DiFalco (rdifalco)
*/ */
#include "stdcore.h" #include "core/stdcore.h"
#include "package.h" #include "core/package.h"
#include "test/test.h" #include "twtest/test.h"
#include <stdio.h> #include <stdio.h>

View File

@ -35,9 +35,9 @@
//changed 7/6/99 -dra //changed 7/6/99 -dra
#include "stdcore.h" #include "core/stdcore.h"
#include "serializer.h" #include "core/serializer.h"
#include "serializable.h" #include "core/serializable.h"
// The reading and writing functionality of the serializer is tested in // The reading and writing functionality of the serializer is tested in
// serializerimpl_t.cpp, so there's very little to be done here. // serializerimpl_t.cpp, so there's very little to be done here.

View File

@ -32,12 +32,12 @@
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// serializerimpl_t.cpp // serializerimpl_t.cpp
#include "stdcore.h" #include "core/stdcore.h"
#include "serializerimpl.h" #include "core/serializerimpl.h"
#include "serializable.h" #include "core/serializable.h"
#include "types.h" #include "core/types.h"
#include "archive.h" #include "core/archive.h"
#include "test/test.h" #include "twtest/test.h"
class cSerializerTestObject : public iTypedSerializable class cSerializerTestObject : public iTypedSerializable
{ {

View File

@ -30,12 +30,12 @@
// info@tripwire.org or www.tripwire.org. // info@tripwire.org or www.tripwire.org.
// //
#include "stdfco.h" #include "fco/stdfco.h"
#include <stdio.h> #include <stdio.h>
#include <iostream> #include <iostream>
#include "signature.h" #include "fco/signature.h"
#include "core/tchar.h" #include "core/tchar.h"
#include "test/test.h" #include "twtest/test.h"
#include "core/errorgeneral.h" #include "core/errorgeneral.h"
#include "core/serializerimpl.h" #include "core/serializerimpl.h"
#include "core/crc32.h" #include "core/crc32.h"

View File

@ -33,13 +33,13 @@
// srefcountobj_t.cpp // srefcountobj_t.cpp
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
#include "stdcore.h" #include "core/stdcore.h"
#include "serializerimpl.h" #include "core/serializerimpl.h"
#include "errorgeneral.h" #include "core/errorgeneral.h"
#include "debug.h" #include "core/debug.h"
#include "archive.h" #include "core/archive.h"
#include "srefcountobj.h" #include "core/srefcountobj.h"
class cSerRefCountObjTest : public iSerRefCountObj class cSerRefCountObjTest : public iSerRefCountObj
{ {

View File

@ -37,8 +37,8 @@
// INCLUDES // INCLUDES
//========================================================================= //=========================================================================
#include "stdutil.h" #include "util/stdutil.h"
#include "stringencoder.h" #include "util/stringencoder.h"
//========================================================================= //=========================================================================
// STANDARD LIBRARY INCLUDES // STANDARD LIBRARY INCLUDES

View File

@ -30,7 +30,7 @@
// info@tripwire.org or www.tripwire.org. // info@tripwire.org or www.tripwire.org.
// //
// tasktimer_t -- test driver for cTaskTimer // tasktimer_t -- test driver for cTaskTimer
#include "stdcore.h" #include "core/stdcore.h"
#if IS_UNIX #if IS_UNIX
void TestTaskTimer() void TestTaskTimer()

View File

@ -29,14 +29,14 @@
// If you have any questions, please contact Tripwire, Inc. at either // If you have any questions, please contact Tripwire, Inc. at either
// info@tripwire.org or www.tripwire.org. // info@tripwire.org or www.tripwire.org.
// //
#include "stdcore.h" #include "core/stdcore.h"
#include <string> #include <string>
#include <iostream> #include <iostream>
#include <fstream> #include <fstream>
#ifndef __DEBUG_H #ifndef __DEBUG_H
#include "debug.h" #include "core/debug.h"
#endif #endif
TSTRING test_wost(int, const TSTRING&); TSTRING test_wost(int, const TSTRING&);
@ -70,7 +70,7 @@ void TestTCHAR()
d.TraceDetail("Testing TOSTRINGSTREAM with TSTRING:\n"); d.TraceDetail("Testing TOSTRINGSTREAM with TSTRING:\n");
TOSTRINGSTREAM ost(_T("test up")); TOSTRINGSTREAM ost(_T("test up"));
ost<<test1; ost<<test1;
d.TraceDetail("%s \n", ost.str() ); d.TraceDetail("%s \n", ost.str().c_str() );
//if this gives output, then I'm really baffled... //if this gives output, then I'm really baffled...
//test gets overwritten, yielding "word up" //test gets overwritten, yielding "word up"

View File

@ -125,7 +125,7 @@ void TestFSPropDisplayer();
void TestGenre(); void TestGenre();
void TestFSDataSourceIter(); void TestFSDataSourceIter();
void TestGenerateDb(); void TestGenerateDb();
void TestHierDatabaseInteractive(); //void TestHierDatabaseInteractive();
void TestGenreSwitcher(); void TestGenreSwitcher();
void TestDbDataSource(); void TestDbDataSource();
void TestGenreSpecList(); void TestGenreSpecList();
@ -138,9 +138,9 @@ void TestDisplayEncoder();
#endif #endif
void TestGrowHeap(); void TestGrowHeap();
void TestPlatform(); void TestPlatform();
void TestBlockFile(); //void TestBlockFile();
void TestBlockRecordArray(); //void TestBlockRecordArray();
void TestHierDatabaseInteractive(); //void TestHierDatabaseInteractive();
void TestTWLocale(); void TestTWLocale();
void TestFileUtil(); void TestFileUtil();
void TestFCONameTranslator(); void TestFCONameTranslator();
@ -216,7 +216,7 @@ static void Test(int testID)
case 52: TestGenre(); break; case 52: TestGenre(); break;
case 53: TestFSDataSourceIter(); break; case 53: TestFSDataSourceIter(); break;
//case 54: TestGenerateDb(); break; //case 54: TestGenerateDb(); break;
case 55: TestHierDatabaseInteractive(); break; //case 55: TestHierDatabaseInteractive(); break;
case 56: TestGenreSwitcher(); break; case 56: TestGenreSwitcher(); break;
case 57: TestDbDataSource(); break; case 57: TestDbDataSource(); break;
case 58: TestGenreSpecList(); break; case 58: TestGenreSpecList(); break;
@ -228,9 +228,9 @@ static void Test(int testID)
#endif #endif
case 69: TestGrowHeap(); break; case 69: TestGrowHeap(); break;
case 70: TestPlatform(); break; case 70: TestPlatform(); break;
case 71: TestBlockFile(); break; //case 71: TestBlockFile(); break;
case 72: TestBlockRecordArray(); break; //case 72: TestBlockRecordArray(); break;
case 73: TestHierDatabaseInteractive(); break; //case 73: TestHierDatabaseInteractive(); break;
case 74: TestFileUtil(); break; case 74: TestFileUtil(); break;
case 75: TestTWLocale(); break; case 75: TestTWLocale(); break;
case 76: TestFCONameTranslator(); break; case 76: TestFCONameTranslator(); break;

View File

@ -33,7 +33,7 @@
// textreportviewer_t.cpp -- tests textreportviewer // textreportviewer_t.cpp -- tests textreportviewer
// //
#include "stdtw.h" #include "tw/stdtw.h"
#include <sys/stat.h> #include <sys/stat.h>
#include <stdlib.h> #include <stdlib.h>
@ -43,7 +43,7 @@
#include "fs/fsobject.h" #include "fs/fsobject.h"
#include "core/serializerimpl.h" #include "core/serializerimpl.h"
#include "core/archive.h" #include "core/archive.h"
#include "test/test.h" #include "twtest/test.h"
#include "core/errorbucketimpl.h" #include "core/errorbucketimpl.h"
#include "tw/textreportviewer.h" #include "tw/textreportviewer.h"
#include "fs/fspropset.h" #include "fs/fspropset.h"

View File

@ -37,8 +37,8 @@
// Tests the cTWLocale class // Tests the cTWLocale class
// //
#include "stdcore.h" #include "core/stdcore.h"
#include "debug.h" #include "core/debug.h"
#include "core/twlocale.h" #include "core/twlocale.h"
void TestAtoi(); void TestAtoi();

View File

@ -32,9 +32,9 @@
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// twutil_t.cpp // twutil_t.cpp
#include "stdtw.h" #include "tw/stdtw.h"
#include "twutil.h" #include "tw/twutil.h"
#include "test/test.h" #include "twtest/test.h"
#include <fstream> #include <fstream>

View File

@ -32,9 +32,9 @@
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// types_t.cpp // types_t.cpp
#include "stdcore.h" #include "core/stdcore.h"
#include "types.h" #include "core/types.h"
#include "test/test.h" #include "twtest/test.h"
// TestTypes() -- this will simply make sure that all the types are defined properly for the current build // TestTypes() -- this will simply make sure that all the types are defined properly for the current build
void TestTypes() void TestTypes()

View File

@ -33,7 +33,7 @@
//#include <fcntl.h> //#include <fcntl.h>
#include "core/stdcore.h" #include "core/stdcore.h"
#include "unixfsservices.h" #include "core/unixfsservices.h"
#include <iostream> #include <iostream>
#include "core/archive.h" #include "core/archive.h"
#include "fco/fconame.h" #include "fco/fconame.h"
@ -41,7 +41,7 @@
#if IS_UNIX #if IS_UNIX
#ifndef __TEST_H #ifndef __TEST_H
#include "test/test.h" #include "twtest/test.h"
#endif #endif
using namespace std; using namespace std;
@ -194,7 +194,7 @@ void TestUnixFSServices()
}//end try block }//end try block
catch (eError& e) catch (eError& e)
{ {
d.TraceError("Exception caught: %s\n", e.GetMsg()); d.TraceError("Exception caught: %s\n", e.GetMsg().c_str());
} }
} }

View File

@ -32,10 +32,10 @@
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// usernotifystdout_t.cpp // usernotifystdout_t.cpp
#include "stdcore.h" #include "core/stdcore.h"
#include "usernotifystdout.h" #include "core/usernotifystdout.h"
#include "debug.h" #include "core/debug.h"
#include "test/test.h" #include "twtest/test.h"
void TestUserNotifyStdout() void TestUserNotifyStdout()
{ {

View File

@ -35,9 +35,9 @@
// Function and classes dealing with the WCHAR16 type // Function and classes dealing with the WCHAR16 type
// //
#include "stdcore.h" #include "core/stdcore.h"
#include "wchar16.h" #include "core/wchar16.h"
#include "test/test.h" #include "twtest/test.h"
void TestWchar16() void TestWchar16()
{ {