summaryrefslogtreecommitdiff
path: root/cpio
diff options
context:
space:
mode:
authorMartin Matuska <martin@matuska.org>2019-04-07 01:54:42 +0200
committerMartin Matuska <martin@matuska.org>2019-04-07 02:38:54 +0200
commit9e1923e84d0803b27ae07e46f0d177cfbc52e0cb (patch)
tree7041c95f63341a5d0e0fc109feeac912e8bd0fd5 /cpio
parenta221e3445b6a369dc7342ce7a44649e11a1619f0 (diff)
downloadlibarchive-9e1923e84d0803b27ae07e46f0d177cfbc52e0cb.tar.gz
Fix remaining MinGW tests
Enable tests on MinGW CI builds
Diffstat (limited to 'cpio')
-rw-r--r--cpio/test/test_format_newc.c5
-rw-r--r--cpio/test/test_option_L_upper.c8
-rw-r--r--cpio/test/test_option_a.c5
3 files changed, 16 insertions, 2 deletions
diff --git a/cpio/test/test_format_newc.c b/cpio/test/test_format_newc.c
index 2c669426..6c981f6a 100644
--- a/cpio/test/test_format_newc.c
+++ b/cpio/test/test_format_newc.c
@@ -233,7 +233,12 @@ DEFINE_TEST(test_format_newc)
assert(is_hex(e, 110));
assertEqualMem(e + 0, "070701", 6); /* Magic */
assert(is_hex(e + 6, 8)); /* ino */
+#if defined(_WIN32) && !defined(CYGWIN)
+ /* Mode: Group members bits and others bits do not work. */
+ assertEqualInt(0xa180, from_hex(e + 14, 8) & 0xffc0);
+#else
assertEqualInt(0xa1ff, from_hex(e + 14, 8)); /* Mode */
+#endif
assertEqualInt(from_hex(e + 22, 8), uid); /* uid */
assertEqualInt(gid, from_hex(e + 30, 8)); /* gid */
assertEqualMem(e + 38, "00000001", 8); /* nlink */
diff --git a/cpio/test/test_option_L_upper.c b/cpio/test/test_option_L_upper.c
index 7fd10cef..bf3a9c43 100644
--- a/cpio/test/test_option_L_upper.c
+++ b/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)
@@ -77,7 +79,8 @@ 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");
@@ -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");
diff --git a/cpio/test/test_option_a.c b/cpio/test/test_option_a.c
index 29638777..e96bdf3c 100644
--- a/cpio/test/test_option_a.c
+++ b/cpio/test/test_option_a.c
@@ -71,8 +71,13 @@ test_create(void)
* #ifdef this section out. Most of the test below is
* still valid. */
memset(&times, 0, sizeof(times));
+#if defined(_WIN32) && !defined(CYGWIN)
+ times.actime = 86400;
+ times.modtime = 86400;
+#else
times.actime = 1;
times.modtime = 3;
+#endif
assertEqualInt(0, utime(files[i].name, &times));
/* Record whatever atime the file ended up with. */