]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Verify that -ot and -in (without -t) are considered errors.
authorTim Kientzle <kientzle@gmail.com>
Sun, 5 Apr 2009 06:09:30 +0000 (02:09 -0400)
committerTim Kientzle <kientzle@gmail.com>
Sun, 5 Apr 2009 06:09:30 +0000 (02:09 -0400)
SVN-Revision: 929

cpio/test/test_option_t.c

index f08ff4e8f5e644e6d739d4b7e2a15fac16a6fd8b..cffa1f23d9740761d6e4ea115685bb7eeff8a7b2 100644 (file)
@@ -50,6 +50,11 @@ DEFINE_TEST(test_option_t)
        assertTextFileContents(p, "t.out");
        free(p);
 
+       /* But "-ot" is an error. */
+       assert(0 != systemf("%s -ot < test_option_t.cpio >ot.out 2>ot.err",
+                           testprog));
+       assertEmptyFile("ot.out");
+
        /* List reference archive verbosely, make sure the TOC is correct. */
        r = systemf("%s -itv < test_option_t.cpio >tv.out 2>tv.err", testprog);
        assertEqualInt(r, 0);
@@ -61,7 +66,7 @@ DEFINE_TEST(test_option_t)
         * the local system. */
        /* assertEqualFile("tv.out", "test_option_tv.stdout"); */
 
-       /* List reference archive verbosely, make sure the TOC is correct. */
+       /* List reference archive with numeric IDs, verify TOC is correct. */
        r = systemf("%s -itnv < test_option_t.cpio >itnv.out 2>itnv.err",
                    testprog);
        assertEqualInt(r, 0);
@@ -69,4 +74,9 @@ DEFINE_TEST(test_option_t)
        extract_reference_file("test_option_tnv.stdout");
        /* This does work because numeric IDs come from archive. */
        assertEqualFile("itnv.out", "test_option_tnv.stdout");
+
+       /* But "-n" without "-t" is an error. */
+       assert(0 != systemf("%s -in < test_option_t.cpio >in.out 2>in.err",
+                           testprog));
+       assertEmptyFile("in.out");
 }