summaryrefslogtreecommitdiff
path: root/archivers/libarchive/files/cpio/test/test_option_L_upper.c
diff options
context:
space:
mode:
Diffstat (limited to 'archivers/libarchive/files/cpio/test/test_option_L_upper.c')
-rw-r--r--archivers/libarchive/files/cpio/test/test_option_L_upper.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/archivers/libarchive/files/cpio/test/test_option_L_upper.c b/archivers/libarchive/files/cpio/test/test_option_L_upper.c
index 1774343f673..cab41b61d74 100644
--- a/archivers/libarchive/files/cpio/test/test_option_L_upper.c
+++ b/archivers/libarchive/files/cpio/test/test_option_L_upper.c
@@ -30,8 +30,10 @@ __FBSDID("$FreeBSD: src/usr.bin/cpio/test/test_option_L.c,v 1.2 2008/08/24 06:21
* tests won't run on Windows. */
#if defined(_WIN32) && !defined(__CYGWIN__)
#define CAT "type"
+#define SEP "\\"
#else
#define CAT "cat"
+#define SEP "/"
#endif
DEFINE_TEST(test_option_L_upper)
@@ -51,7 +53,7 @@ DEFINE_TEST(test_option_L_upper)
fprintf(filelist, "file\n");
/* Symlink to above file. */
- assertMakeSymlink("symlink", "file");
+ assertMakeSymlink("symlink", "file", 0);
fprintf(filelist, "symlink\n");
fclose(filelist);
@@ -61,7 +63,7 @@ DEFINE_TEST(test_option_L_upper)
assertTextFileContents("1 block\n", "copy.err");
failure("Regular -p without -L should preserve symlinks.");
- assertIsSymlink("copy/symlink", NULL);
+ assertIsSymlink("copy/symlink", NULL, 0);
r = systemf(CAT " filelist | %s -pd -L copy-L >copy-L.out 2>copy-L.err", testprog);
assertEqualInt(r, 0);
@@ -77,13 +79,14 @@ DEFINE_TEST(test_option_L_upper)
assertMakeDir("unpack", 0755);
assertChdir("unpack");
- r = systemf(CAT " ../archive.out | %s -i >unpack.out 2>unpack.err", testprog);
+ r = systemf(CAT " .." SEP "archive.out | %s -i >unpack.out 2>unpack.err", testprog);
+
failure("Error invoking %s -i", testprog);
assertEqualInt(r, 0);
assertTextFileContents("1 block\n", "unpack.err");
assertChdir("..");
- assertIsSymlink("unpack/symlink", NULL);
+ assertIsSymlink("unpack/symlink", NULL, 0);
r = systemf(CAT " filelist | %s -oL >archive-L.out 2>archive-L.err", testprog);
failure("Error invoking %s -oL", testprog);
@@ -92,7 +95,8 @@ DEFINE_TEST(test_option_L_upper)
assertMakeDir("unpack-L", 0755);
assertChdir("unpack-L");
- r = systemf(CAT " ../archive-L.out | %s -i >unpack-L.out 2>unpack-L.err", testprog);
+ r = systemf(CAT " .." SEP "archive-L.out | %s -i >unpack-L.out 2>unpack-L.err", testprog);
+
failure("Error invoking %s -i < archive-L.out", testprog);
assertEqualInt(r, 0);
assertTextFileContents("1 block\n", "unpack-L.err");