summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authorkientzle <kientzle@FreeBSD.org>2008-08-22 01:26:55 +0000
committerkientzle <kientzle@FreeBSD.org>2008-08-22 01:26:55 +0000
commit44b73660eefa2555b33c85eb07d62a4c5b03e6d8 (patch)
tree22621fd57101cdbca581512d1b6cc4301826e20c /usr.bin
parentdff2aaea3aec1df55ca1900b34d2d2410884d25e (diff)
downloadFreeBSD-src-44b73660eefa2555b33c85eb07d62a4c5b03e6d8.zip
FreeBSD-src-44b73660eefa2555b33c85eb07d62a4c5b03e6d8.tar.gz
Explain how the test_option_q test works.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/tar/test/test_option_q.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/usr.bin/tar/test/test_option_q.c b/usr.bin/tar/test/test_option_q.c
index 7ce75e6..d165119 100644
--- a/usr.bin/tar/test/test_option_q.c
+++ b/usr.bin/tar/test/test_option_q.c
@@ -29,6 +29,16 @@ DEFINE_TEST(test_option_q)
{
int fd;
+ /*
+ * Create an archive with several different versions of the
+ * same files. By default, the last version will overwrite
+ * any earlier versions. The -q/--fast-read option will
+ * stop early, so we can verify -q/--fast-read by seeing
+ * which version of each file actually ended up being
+ * extracted. This also exercises -r mode, since that's
+ * what we use to build up the test archive.
+ */
+
fd = open("foo", O_CREAT | O_WRONLY, 0644);
assert(fd >= 0);
assertEqualInt(4, write(fd, "foo1", 4));
@@ -64,6 +74,11 @@ DEFINE_TEST(test_option_q)
assertEqualInt(0, systemf("%s -rf archive.tar bar", testprog));
+ /*
+ * Now, try extracting from the test archive with various
+ * combinations of -q.
+ */
+
/* Test 1: -q foo should only extract the first foo. */
assertEqualInt(0, mkdir("test1", 0755));
assertEqualInt(0, chdir("test1"));
OpenPOWER on IntegriCloud