From 83cb61fa3a74f064045c378dac3b8a9269b30c6f Mon Sep 17 00:00:00 2001 From: Tim Kientzle Date: Fri, 22 Aug 2008 01:35:08 +0000 Subject: [PATCH] Minor cleanup of the -q test: Assert that stdout/stderr are empty for each extraction. --- usr.bin/tar/test/test_option_q.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/usr.bin/tar/test/test_option_q.c b/usr.bin/tar/test/test_option_q.c index d1651194807..1d92dd56963 100644 --- a/usr.bin/tar/test/test_option_q.c +++ b/usr.bin/tar/test/test_option_q.c @@ -94,26 +94,32 @@ DEFINE_TEST(test_option_q) assertEqualInt(0, mkdir("test2", 0755)); assertEqualInt(0, chdir("test2")); assertEqualInt(0, - systemf("%s -xf ../archive.tar -q foo bar", testprog)); + systemf("%s -xf ../archive.tar -q foo bar >test.out 2>test.err", testprog)); assertFileContents("foo2", 4, "foo"); assertFileContents("bar1", 4, "bar"); + assertEmptyFile("test.out"); + assertEmptyFile("test.err"); assertEqualInt(0, chdir("..")); /* Test 3: Same as test 2, but use --fast-read spelling. */ assertEqualInt(0, mkdir("test3", 0755)); assertEqualInt(0, chdir("test3")); assertEqualInt(0, - systemf("%s -xf ../archive.tar --fast-read foo bar", testprog)); + systemf("%s -xf ../archive.tar --fast-read foo bar >test.out 2>test.err", testprog)); assertFileContents("foo2", 4, "foo"); assertFileContents("bar1", 4, "bar"); + assertEmptyFile("test.out"); + assertEmptyFile("test.err"); assertEqualInt(0, chdir("..")); /* Test 4: Without -q, should extract everything. */ assertEqualInt(0, mkdir("test4", 0755)); assertEqualInt(0, chdir("test4")); assertEqualInt(0, - systemf("%s -xf ../archive.tar foo bar", testprog)); + systemf("%s -xf ../archive.tar foo bar >test.out 2>test.err", testprog)); assertFileContents("foo3", 4, "foo"); assertFileContents("bar2", 4, "bar"); + assertEmptyFile("test.out"); + assertEmptyFile("test.err"); assertEqualInt(0, chdir("..")); }