summaryrefslogtreecommitdiff
path: root/tar
diff options
context:
space:
mode:
authorzoulasc <christos@zoulas.com>2020-01-21 13:34:18 -0500
committerMartin Matuska <martin@matuska.org>2020-01-23 00:19:32 +0100
commit343642bcd20450cacb534d6ea403a1ff6e420806 (patch)
tree1c2a6445898230483befa01f14b7554d82d287e5 /tar
parent849740bac9788af44b0e2ae6403ee743b27b628f (diff)
downloadlibarchive-343642bcd20450cacb534d6ea403a1ff6e420806.tar.gz
Add printf attributes to the printflike functions used in tests and fix
the format errors. Closes #1318
Diffstat (limited to 'tar')
-rw-r--r--tar/test/test_basic.c2
-rw-r--r--tar/test/test_copy.c4
-rw-r--r--tar/test/test_option_C_upper.c2
-rw-r--r--tar/test/test_option_s.c6
4 files changed, 6 insertions, 8 deletions
diff --git a/tar/test/test_basic.c b/tar/test/test_basic.c
index 9bb966a0..b1c49834 100644
--- a/tar/test/test_basic.c
+++ b/tar/test/test_basic.c
@@ -96,7 +96,7 @@ run_tar(const char *target, const char *pack_options,
/* Use the tar program to create an archive. */
r = systemf("%s cf - %s %s >%s/archive 2>%s/pack.err", testprog, pack_options, flist, target, target);
- failure("Error invoking %s cf -", testprog, pack_options);
+ failure("Error invoking %s cf -%s", testprog, pack_options);
assertEqualInt(r, 0);
assertChdir(target);
diff --git a/tar/test/test_copy.c b/tar/test/test_copy.c
index b828666b..d618e45c 100644
--- a/tar/test/test_copy.c
+++ b/tar/test/test_copy.c
@@ -256,13 +256,13 @@ verify_tree(size_t limit)
continue;
switch(dp[0]) {
case 'l': case 'm': case 'd':
- failure("strlen(p)=%d", strlen(p));
+ failure("strlen(p)=%zu", strlen(p));
assert(strlen(p) < limit);
assertEqualString(p,
filenames[strlen(p)]);
break;
case 'f': case 's':
- failure("strlen(p)=%d", strlen(p));
+ failure("strlen(p)=%zu", strlen(p));
assert(strlen(p) < limit + 1);
assertEqualString(p,
filenames[strlen(p)]);
diff --git a/tar/test/test_option_C_upper.c b/tar/test/test_option_C_upper.c
index dae98544..538890f5 100644
--- a/tar/test/test_option_C_upper.c
+++ b/tar/test/test_option_C_upper.c
@@ -117,7 +117,7 @@ DEFINE_TEST(test_option_C_upper)
assertMakeDir("test6", 0755);
assertChdir("test6");
r = systemf("%s -cf archive.tar -C XXX -C ../d1 file1 2>write.err",
- testprog, testworkdir);
+ testprog);
assert(r != 0);
assertNonEmptyFile("write.err");
assertEqualInt(0,
diff --git a/tar/test/test_option_s.c b/tar/test/test_option_s.c
index 09c72ee7..fa799a29 100644
--- a/tar/test/test_option_s.c
+++ b/tar/test/test_option_s.c
@@ -92,10 +92,8 @@ DEFINE_TEST(test_option_s)
* Test 5: Name-switching substitutions when extracting archive.
*/
assertMakeDir("test5", 0755);
- systemf("%s -cf test5.tar in/d1/foo in/d1/bar",
- testprog, testprog);
- systemf("%s -xf test5.tar -s /foo/bar/ -s }bar}foo} -C test5",
- testprog, testprog);
+ systemf("%s -cf test5.tar in/d1/foo in/d1/bar", testprog);
+ systemf("%s -xf test5.tar -s /foo/bar/ -s }bar}foo} -C test5", testprog);
assertFileContents("foo", 3, "test5/in/d1/bar");
assertFileContents("bar", 3, "test5/in/d1/foo");