diff --git a/src/twtest/blockfile_t.cpp b/src/twtest/blockfile_t.cpp index 11a657c..9fb8712 100644 --- a/src/twtest/blockfile_t.cpp +++ b/src/twtest/blockfile_t.cpp @@ -41,11 +41,11 @@ void TestBlockFile() { cDebug d( "TestBlockFile" ); - static const TCHAR fileName[] = _T("test.bf"); + std::string fileName = TwTestPath("test.bf"); // truncate the file I am going to use... // cFileArchive a; - a.OpenReadWrite( fileName ); + a.OpenReadWrite( fileName.c_str() ); a.Close(); // // open up the block file... diff --git a/src/twtest/blockrecordarray_t.cpp b/src/twtest/blockrecordarray_t.cpp index b3aab08..4242f98 100644 --- a/src/twtest/blockrecordarray_t.cpp +++ b/src/twtest/blockrecordarray_t.cpp @@ -41,7 +41,7 @@ void TestBlockRecordArray() { cDebug d( "TestBlockRecordArray" ); - static const TCHAR fileName[] = _T("test.bf"); + std::string fileName = TwTestPath("test2.bf"); cBlockFile bf; bf.Open( fileName, 2, true ); // opened up with two pages diff --git a/src/twtest/configfile_t.cpp b/src/twtest/configfile_t.cpp index 840f550..2e7b479 100644 --- a/src/twtest/configfile_t.cpp +++ b/src/twtest/configfile_t.cpp @@ -128,9 +128,6 @@ void TestConfigFile2(void) //Define some test values for pairs to be //stored in a test config. module. I'm going to use the //values specified in the install doc. -DA - TSTRING currpath; - pFSServices->GetCurrentDir(currpath); - const TSTRING testTWROOT = currpath; //TODO maybe also test read failure when mandatory config values aren't set @@ -145,7 +142,7 @@ void TestConfigFile2(void) write_cfgmod.Insert( _T("LOCALKEYFILE"), "local.key"); //Filename for writing/reading some value pairs: - const TSTRING testfile = testTWROOT + _T("/tripwire.cfg"); + const TSTRING testfile = TwTestPath("tripwire.cfg"); //Store these values on disk. TSTRING configText; diff --git a/src/twtest/dbdatasource_t.cpp b/src/twtest/dbdatasource_t.cpp index 65fd696..52680f9 100644 --- a/src/twtest/dbdatasource_t.cpp +++ b/src/twtest/dbdatasource_t.cpp @@ -173,7 +173,8 @@ static void AssertChildren(cDbDataSourceIter& iter, const TSTRING& filename, boo void TestDbDataSourceBasic() { cHierDatabase db; - db.Open( _T("test.db"), 5, true); + std::string dbpath = TwTestPath("test.db"); + db.Open( dbpath, 5, true); cDbDataSourceIter iter(&db); AddFile(iter, "file1", true); diff --git a/src/twtest/fcoreport_t.cpp b/src/twtest/fcoreport_t.cpp index 7a8e855..8dfea82 100644 --- a/src/twtest/fcoreport_t.cpp +++ b/src/twtest/fcoreport_t.cpp @@ -130,8 +130,9 @@ void TestFCOReport() d.TraceDebug("Before serializing report:\n"); TraceReport(report, d); { + std::string filepath = TwTestPath("tmp.twr"); cFileArchive outFile; - outFile.OpenReadWrite(_T("tmp.twr")); + outFile.OpenReadWrite(filepath.c_str()); cSerializerImpl outSer(outFile, cSerializerImpl::S_WRITE); outSer.Init(); @@ -141,7 +142,7 @@ void TestFCOReport() outFile.Close(); cFileArchive inFile; - inFile.OpenRead(_T("tmp.twr")); + inFile.OpenRead(filepath.c_str()); cSerializerImpl inSer(inFile, cSerializerImpl::S_READ); cFCOReport inReport;