]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Skip symlink tests on Windows.
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>
Mon, 16 Feb 2009 07:56:21 +0000 (02:56 -0500)
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>
Mon, 16 Feb 2009 07:56:21 +0000 (02:56 -0500)
Now, all bsdtar tests passed on Windows.
Results are:
0 of 13 tests reported failures
 Total of 84126 assertions checked.
 Total of 0 assertions failed.
 Total of 9 assertions skipped.

Still needs more improvement.

SVN-Revision: 644

tar/test/test_copy.c
tar/test/test_strip_components.c
tar/test/test_symlink_dir.c

index 349651c39e3a66dcd4a5c43c69cdd4d5437af9d7..af77cf601c5c41b53926536de9760947b0eed6c9 100644 (file)
@@ -64,6 +64,7 @@ create_tree(void)
                buff2[0] = 'm';
                assertEqualInt(0, link(buff, buff2));
 
+#ifndef _WIN32
                /* Create a symlink named "s/abcdef..." to the above. */
                strcpy(buff2 + 3, buff);
                buff[0] = 's';
@@ -71,7 +72,9 @@ create_tree(void)
                buff2[1] = '.';
                buff2[2] = '/';
                assertEqualInt(0, symlink(buff2, buff));
-
+#else
+               skipping("create a symlink to the above");
+#endif
                /* Create a dir named "d/abcdef...". */
                buff[0] = 'd';
                assertEqualInt(0, mkdir(buff, 0775));
@@ -153,6 +156,7 @@ verify_tree(int limit)
                        }
                }
 
+#ifndef _WIN32
                /*
                 * Symlink text doesn't include the 'original/' prefix,
                 * so the limit here is 100 characters.
@@ -174,7 +178,9 @@ verify_tree(int limit)
                                }
                        }
                }
-
+#else
+               skipping("verify symlink");
+#endif
                /* Verify dir "d/abcdef...". */
                strcpy(name1, "d/");
                strcat(name1, filename);
index 9bade16de7580661bcfd2cb5cd385d78ceddc739..8ecf29a44fc4507efa88f00aa7e7ba86caa3e8c0 100644 (file)
@@ -64,7 +64,11 @@ DEFINE_TEST(test_strip_components)
        failure("d0/d1/ is too short and should not get restored");
        assertEqualInt(-1, lstat("target/d1", &st));
        failure("d0/d1/s2 is a symlink to something that won't be extracted");
+#ifndef _WIN32
        assertEqualInt(-1, stat("target/s2", &st));
+#
+       skipping("symlink with stat()");
+#endif
        assertEqualInt(0, lstat("target/s2", &st));
        failure("d0/d1/d2 should be extracted");
        assertEqualInt(0, lstat("target/d2", &st));
index 569da65a55101620640e02ebc93515ec576f34eb..c60e42901fd2e771a85cec0d3f2a9f57e389083a 100644 (file)
@@ -75,18 +75,25 @@ DEFINE_TEST(test_symlink_dir)
        assertEqualInt(0, mkdir("dest1", 0755));
        /* "dir" is a symlink to an existing "real_dir" */
        assertEqualInt(0, mkdir("dest1/real_dir", 0755));
+#ifndef _WIN32
        assertEqualInt(0, symlink("real_dir", "dest1/dir"));
        /* "dir2" is a symlink to a non-existing "real_dir2" */
        assertEqualInt(0, symlink("real_dir2", "dest1/dir2"));
+#else
+       skipping("symlink does not work on this platform");
+#endif
        /* "dir3" is a symlink to an existing "non_dir3" */
        assertEqualInt(0, mkfile("dest1/non_dir3", 0755, "abcdef", 6));
        assertEqualInt(0, symlink("non_dir3", "dest1/dir3"));
        /* "file" is a symlink to existing "real_file" */
        assertEqualInt(0, mkfile("dest1/real_file", 0755, "abcdefg", 7));
        assertEqualInt(0, symlink("real_file", "dest1/file"));
+#ifndef _WIN32
        /* "file2" is a symlink to non-existing "real_file2" */
        assertEqualInt(0, symlink("real_file2", "dest1/file2"));
-
+#else
+       skipping("symlink does not work on this platform");
+#endif
        assertEqualInt(0, systemf("%s -xf test.tar -C dest1", testprog));
 
        /* dest1/dir symlink should be removed */
@@ -116,23 +123,31 @@ DEFINE_TEST(test_symlink_dir)
        assertEqualInt(0, mkdir("dest2", 0755));
        /* "dir" is a symlink to existing "real_dir" */
        assertEqualInt(0, mkdir("dest2/real_dir", 0755));
+#ifndef _WIN32
        assertEqualInt(0, symlink("real_dir", "dest2/dir"));
        /* "dir2" is a symlink to a non-existing "real_dir2" */
        assertEqualInt(0, symlink("real_dir2", "dest2/dir2"));
+#else
+       skipping("symlink does not work on this platform");
+#endif
        /* "dir3" is a symlink to an existing "non_dir3" */
        assertEqualInt(0, mkfile("dest2/non_dir3", 0755, "abcdefgh", 8));
        assertEqualInt(0, symlink("non_dir3", "dest2/dir3"));
        /* "file" is a symlink to existing "real_file" */
        assertEqualInt(0, mkfile("dest2/real_file", 0755, "abcdefghi", 9));
        assertEqualInt(0, symlink("real_file", "dest2/file"));
+#ifndef _WIN32
        /* "file2" is a symlink to non-existing "real_file2" */
        assertEqualInt(0, symlink("real_file2", "dest2/file2"));
-
+#else
+       skipping("symlink does not work on this platform");
+#endif
        assertEqualInt(0, systemf("%s -xPf test.tar -C dest2", testprog));
 
        /* dest2/dir symlink should be followed */
        assertEqualInt(0, lstat("dest2/dir", &st));
        failure("tar -xP removed symlink instead of following it");
+#ifndef _WIN32
        if (assert(S_ISLNK(st.st_mode))) {
                /* Only verify what the symlink points to if it
                 * really is a symlink. */
@@ -146,6 +161,9 @@ DEFINE_TEST(test_symlink_dir)
                failure("symlink should still point to the existing directory");
                assertEqualInt(st.st_ino, st2.st_ino);
        }
+#else
+       skipping("symlink does not work on this platform");
+#endif
        /* Contents of 'dir' should be restored */
        assertEqualInt(0, lstat("dest2/dir/d", &st));
        assert(S_ISDIR(st.st_mode));