diff options
Diffstat (limited to 'usr.bin/cpio/test/test_option_f.c')
-rw-r--r-- | usr.bin/cpio/test/test_option_f.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/usr.bin/cpio/test/test_option_f.c b/usr.bin/cpio/test/test_option_f.c index 54e07ac..784e085 100644 --- a/usr.bin/cpio/test/test_option_f.c +++ b/usr.bin/cpio/test/test_option_f.c @@ -33,44 +33,44 @@ unpack(const char *dirname, const char *option) { int r; - assertEqualInt(0, mkdir(dirname, 0755)); - assertEqualInt(0, chdir(dirname)); + assertMakeDir(dirname, 0755); + assertChdir(dirname); extract_reference_file("test_option_f.cpio"); r = systemf("%s -i %s < test_option_f.cpio > copy-no-a.out 2>copy-no-a.err", testprog, option); assertEqualInt(0, r); - assertEqualInt(0, chdir("..")); + assertChdir(".."); } DEFINE_TEST(test_option_f) { /* Calibrate: No -f option, so everything should be extracted. */ - unpack("t0", ""); - assertEqualInt(0, access("t0/a123", F_OK)); - assertEqualInt(0, access("t0/a234", F_OK)); - assertEqualInt(0, access("t0/b123", F_OK)); - assertEqualInt(0, access("t0/b234", F_OK)); + unpack("t0", "--no-preserve-owner"); + assertFileExists("t0/a123"); + assertFileExists("t0/a234"); + assertFileExists("t0/b123"); + assertFileExists("t0/b234"); /* Don't extract 'a*' files. */ #if defined(_WIN32) && !defined(__CYGWIN__) /* Single quotes isn't used by command.exe. */ - unpack("t1", "-f a*"); + unpack("t1", "--no-preserve-owner -f a*"); #else - unpack("t1", "-f 'a*'"); + unpack("t1", "--no-preserve-owner -f 'a*'"); #endif - assert(0 != access("t1/a123", F_OK)); - assert(0 != access("t1/a234", F_OK)); - assertEqualInt(0, access("t1/b123", F_OK)); - assertEqualInt(0, access("t1/b234", F_OK)); + assertFileNotExists("t1/a123"); + assertFileNotExists("t1/a234"); + assertFileExists("t1/b123"); + assertFileExists("t1/b234"); /* Don't extract 'b*' files. */ #if defined(_WIN32) && !defined(__CYGWIN__) /* Single quotes isn't used by command.exe. */ - unpack("t2", "-f b*"); + unpack("t2", "--no-preserve-owner -f b*"); #else - unpack("t2", "-f 'b*'"); + unpack("t2", "--no-preserve-owner -f 'b*'"); #endif - assertEqualInt(0, access("t2/a123", F_OK)); - assertEqualInt(0, access("t2/a234", F_OK)); - assert(0 != access("t2/b123", F_OK)); - assert(0 != access("t2/b234", F_OK)); + assertFileExists("t2/a123"); + assertFileExists("t2/a234"); + assertFileNotExists("t2/b123"); + assertFileNotExists("t2/b234"); } |