]> git.localhorst.tv Git - blobs.git/blobdiff - tst/io/FilesystemTest.cpp
extended filesystem test
[blobs.git] / tst / io / FilesystemTest.cpp
index a098c2bf30cfa8841d03503fa39f9e1992252701..d19cfd1a92ad318941bce7c2e57cd1106f32c767 100644 (file)
@@ -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));