From: Tim Kientzle Date: Sun, 5 Apr 2009 06:09:30 +0000 (-0400) Subject: Verify that -ot and -in (without -t) are considered errors. X-Git-Tag: v2.7.0~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=06c7bc68a0eb0346322e2c375d989257259ed6c1;p=thirdparty%2Flibarchive.git Verify that -ot and -in (without -t) are considered errors. SVN-Revision: 929 --- diff --git a/cpio/test/test_option_t.c b/cpio/test/test_option_t.c index f08ff4e8f..cffa1f23d 100644 --- a/cpio/test/test_option_t.c +++ b/cpio/test/test_option_t.c @@ -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"); }