From 343642bcd20450cacb534d6ea403a1ff6e420806 Mon Sep 17 00:00:00 2001 From: zoulasc Date: Tue, 21 Jan 2020 13:34:18 -0500 Subject: Add printf attributes to the printflike functions used in tests and fix the format errors. Closes #1318 --- tar/test/test_basic.c | 2 +- tar/test/test_copy.c | 4 ++-- tar/test/test_option_C_upper.c | 2 +- tar/test/test_option_s.c | 6 ++---- 4 files changed, 6 insertions(+), 8 deletions(-) (limited to 'tar') 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"); -- cgit v1.2.1