X-Git-Url: http://git.localhorst.tv/?p=blobs.git;a=blobdiff_plain;f=tst%2Fio%2FFilesystemTest.cpp;h=d19cfd1a92ad318941bce7c2e57cd1106f32c767;hp=a098c2bf30cfa8841d03503fa39f9e1992252701;hb=23f1f41fbff03520bb291e42b0407e0ca0bd4cc9;hpb=01cc65097f27ad657130fb58a10813e8d5c09fe7 diff --git a/tst/io/FilesystemTest.cpp b/tst/io/FilesystemTest.cpp index a098c2b..d19cfd1 100644 --- a/tst/io/FilesystemTest.cpp +++ b/tst/io/FilesystemTest.cpp @@ -82,8 +82,8 @@ void FilesystemTest::testDirectory() { const string test_file = test_subsubdir + "\\c.txt"; #else const string test_subdir = test_dir + "/a"; - const string test_subsubdir = test_subdir + "/b"; - const string test_file = test_subsubdir + "/c"; + const string test_subsubdir = test_subdir + "/b/"; + const string test_file = test_subsubdir + "c"; #endif CPPUNIT_ASSERT_MESSAGE( @@ -116,6 +116,9 @@ void FilesystemTest::testDirectory() { CPPUNIT_ASSERT_MESSAGE( "failed to create test subdirs", make_dirs(test_subsubdir)); + CPPUNIT_ASSERT_MESSAGE( + "creating an existing dir should silently succeed", + make_dirs(test_subsubdir)); CPPUNIT_ASSERT_MESSAGE( "created directory is a file", !is_file(test_subdir)); @@ -136,10 +139,13 @@ void FilesystemTest::testDirectory() { CPPUNIT_ASSERT_MESSAGE( "failed to create test file", is_file(test_file)); + CPPUNIT_ASSERT_MESSAGE( + "creating a dir where a regular file is should fail", + !make_dirs(test_file)); CPPUNIT_ASSERT_MESSAGE( - "failed to remove test subdir", - remove_dir(test_subdir)); + "failed to remove test dir", + remove_dir(test_dir)); CPPUNIT_ASSERT_MESSAGE( "removed directory became a file", !is_file(test_subdir));