diff options
Diffstat (limited to 'tar')
-rw-r--r-- | tar/test/test_option_C_mtree.c | 17 | ||||
-rw-r--r-- | tar/test/test_strip_components.c | 3 |
2 files changed, 18 insertions, 2 deletions
diff --git a/tar/test/test_option_C_mtree.c b/tar/test/test_option_C_mtree.c index caf8044b..f0903066 100644 --- a/tar/test/test_option_C_mtree.c +++ b/tar/test/test_option_C_mtree.c @@ -36,6 +36,9 @@ DEFINE_TEST(test_option_C_mtree) p0 = NULL; char *content = "./foo type=file uname=root gname=root mode=0755\n"; char *filename = "output.tar"; +#if defined(_WIN32) && !defined(CYGWIN) + char *p; +#endif /* an absolute path to mtree file */ char *mtree_file = "/METALOG.mtree"; @@ -48,9 +51,21 @@ DEFINE_TEST(test_option_C_mtree) assertMakeDir("bar", 0775); assertMakeFile("bar/foo", 0777, "abc"); - r = systemf("%s -cf %s -C bar \"@%s\" >step1.out 2>step1.err", testprog, filename, absolute_path); +#if defined(_WIN32) && !defined(CYGWIN) + p = absolute_path; + while(*p != '\0') { + if (*p == '/') + *p = '\\'; + p++; + } + r = systemf("%s -cf %s -C bar @%s >step1.out 2>step1.err", testprog, filename, absolute_path); failure("Error invoking %s -cf %s -C bar @%s", testprog, filename, absolute_path); +#else + r = systemf("%s -cf %s -C bar \"@%s\" >step1.out 2>step1.err", testprog, filename, absolute_path); + failure("Error invoking %s -cf %s -C bar \"@%s\"", testprog, filename, absolute_path); +#endif + assertEqualInt(r, 0); assertEmptyFile("step1.out"); assertEmptyFile("step1.err"); diff --git a/tar/test/test_strip_components.c b/tar/test/test_strip_components.c index e1d71ddc..caf45a3e 100644 --- a/tar/test/test_strip_components.c +++ b/tar/test/test_strip_components.c @@ -64,9 +64,10 @@ DEFINE_TEST(test_strip_components) failure("d0/d1/s2 is a symlink to something that won't be extracted"); /* If platform supports symlinks, target/s2 is a broken symlink. */ /* If platform does not support symlink, target/s2 doesn't exist. */ - assertFileNotExists("target/s2"); if (canSymlink()) assertIsSymlink("target/s2", "d2/f1"); + else + assertFileNotExists("target/s2"); failure("d0/d1/d2 should be extracted"); assertIsDir("target/d2", -1); |