X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=tst%2Fio%2FFilesystemTest.cpp;h=106ff71c81d334da90458d139cdd993d29af27ee;hb=ce10bfbe252d5598bbb559c6ce55aed1b9393227;hp=cd4e0ab0e882810915911abadddef860fe1dd0d2;hpb=ab5d0b96a74b0d8fb33a89c097ff9c7021349f56;p=blank.git diff --git a/tst/io/FilesystemTest.cpp b/tst/io/FilesystemTest.cpp index cd4e0ab..106ff71 100644 --- a/tst/io/FilesystemTest.cpp +++ b/tst/io/FilesystemTest.cpp @@ -13,24 +13,19 @@ namespace blank { namespace test { void FilesystemTest::setUp() { - test_dir = "test-dir"; - CPPUNIT_ASSERT_MESSAGE( - "failed to create test dir", - make_dir(test_dir)); + test_dir.reset(new TempDir()); } void FilesystemTest::tearDown() { - CPPUNIT_ASSERT_MESSAGE( - "failed to remove test dir", - remove_dir(test_dir)); + test_dir.reset(); } void FilesystemTest::testFile() { #ifdef _WIN32 - const string test_file = test_dir + "\\test-file.txt"; + const string test_file = test_dir->Path() + "\\test-file.txt"; #else - const string test_file = test_dir + "/test-file"; + const string test_file = test_dir->Path() + "/test-file"; #endif CPPUNIT_ASSERT_MESSAGE( @@ -76,11 +71,11 @@ void FilesystemTest::testFile() { void FilesystemTest::testDirectory() { #ifdef _WIN32 - const string test_subdir = test_dir + "\\a"; + const string test_subdir = test_dir->Path() + "\\a"; const string test_subsubdir = test_subdir + "\\b"; const string test_file = test_subsubdir + "\\c.txt"; #else - const string test_subdir = test_dir + "/a"; + const string test_subdir = test_dir->Path() + "/a"; const string test_subsubdir = test_subdir + "/b"; const string test_file = test_subsubdir + "/c"; #endif