about summary refs log tree commit diff
path: root/test/pamfile.test
diff options
context:
space:
mode:
Diffstat (limited to 'test/pamfile.test')
-rwxr-xr-xtest/pamfile.test32
1 files changed, 10 insertions, 22 deletions
diff --git a/test/pamfile.test b/test/pamfile.test
index 7be061ef..d605326d 100755
--- a/test/pamfile.test
+++ b/test/pamfile.test
@@ -22,25 +22,13 @@ cat testgrid.pbm testimg.ppm testgrid.pbm | pamfile -machine
 
 echo "Test Invalid"
 
-tmpdir=${tmpdir:-/tmp}
-test_out=${tmpdir}/test_out
-
-echo 1>&2
-echo "Invalid command-line argument combinations." 1>&2
-echo "Error messages should appear below the line." 1>&2
-echo "-----------------------------------------------------------" 1>&2
-
-pamfile -size -machine  testimg.ppm > ${test_out} || \
-  printf "Expected failure 1 "
-  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
-  rm -f ${test_out}
-
-pamfile -count -machine testimg.ppm > ${test_out} || \
-  printf "Expected failure 2 "
-  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
-  rm -f ${test_out}
-
-head -n1 testimg.ppm | pamfile > ${test_out} || \
-  printf "Expected failure 3 "
-  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
-  rm -f ${test_out}
+. ${srcdir}/test-invalid.inc
+
+invCmd "pamfile -size -machine  testimg.ppm"
+invCmd "pamfile -count -machine testimg.ppm"
+
+head1_ppm=${tmpdir}/head1.ppm
+
+head -n1 testimg.ppm > ${head1_ppm}
+invCmd "pamfile  ${head1_ppm}"
+rm ${head1_ppm}