Explain how the test_option_q test works.

This commit is contained in:
Tim Kientzle 2008-08-22 01:26:55 +00:00
parent 3873424684
commit ba1a633912

View File

@ -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"));