From: Tim Kientzle Date: Sun, 5 Apr 2009 05:18:03 +0000 (-0400) Subject: Any pair of -i, -o, -p should be rejected. X-Git-Tag: v2.7.0~17 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9caf94fa88270cb4f7d826dda78cccf24a2f7978;p=thirdparty%2Flibarchive.git Any pair of -i, -o, -p should be rejected. SVN-Revision: 925 --- diff --git a/cpio/test/test_cmdline.c b/cpio/test/test_cmdline.c index ab116824f..46f1c79d0 100644 --- a/cpio/test/test_cmdline.c +++ b/cpio/test/test_cmdline.c @@ -69,4 +69,35 @@ DEFINE_TEST(test_cmdline) failure("--create forbids an argument"); assert(0 != systemf("%s --create=arg 8.out 2>8.err", testprog)); assertEmptyFile("8.out"); + + failure("-i with empty input should succeed"); + assert(0 == systemf("%s -i 9.out 2>9.err", testprog)); + assertEmptyFile("9.out"); + + failure("-o with empty input should succeed"); + assert(0 == systemf("%s -o 10.out 2>10.err", testprog)); + + failure("-i -p is nonsense"); + assert(0 != systemf("%s -i -p 11.out 2>11.err", testprog)); + assertEmptyFile("11.out"); + + failure("-p -i is nonsense"); + assert(0 != systemf("%s -p -i 12.out 2>12.err", testprog)); + assertEmptyFile("12.out"); + + failure("-i -o is nonsense"); + assert(0 != systemf("%s -i -o 13.out 2>13.err", testprog)); + assertEmptyFile("13.out"); + + failure("-o -i is nonsense"); + assert(0 != systemf("%s -o -i 14.out 2>14.err", testprog)); + assertEmptyFile("14.out"); + + failure("-o -p is nonsense"); + assert(0 != systemf("%s -o -p 15.out 2>15.err", testprog)); + assertEmptyFile("15.out"); + + failure("-p -o is nonsense"); + assert(0 != systemf("%s -p -o 16.out 2>16.err", testprog)); + assertEmptyFile("16.out"); }