From 49b0eb1a2a99dc82b81a9355bb7851db6423486a Mon Sep 17 00:00:00 2001 From: giraffedata Date: Sun, 14 Jan 2024 19:05:28 +0000 Subject: Factor out 'test invalid' checks git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@4837 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- test/pnmcolormap.test | 51 +++++++++------------------------------------------ 1 file changed, 9 insertions(+), 42 deletions(-) (limited to 'test/pnmcolormap.test') diff --git a/test/pnmcolormap.test b/test/pnmcolormap.test index b34a0360..953dece3 100755 --- a/test/pnmcolormap.test +++ b/test/pnmcolormap.test @@ -32,49 +32,16 @@ pnmcolormap -center 64 testimg.ppm | cmp -s ${map} - && echo ok || echo bad pnmcolormap -spreadbrightness 64 testimg.ppm | cmp -s ${map} - && echo ok || echo bad pnmcolormap -splitpixelct 64 testimg.ppm | cmp -s ${map} - && echo ok || echo bad rm ${map} + echo echo "Test Invalid." -echo 1>&2 -echo "Invalid command-line arguments." 1>&2 -echo "Error messages should appear below the line." 1>&2 -echo "-----------------------------------------------------------" 1>&2 - -tmpdir=${tmpdir:-/tmp} -test_out=${tmpdir}/test_out - -pnmcolormap 0 testimg.ppm > ${test_out} || \ - printf "Expected failure 1 " - test -s ${test_out} && echo "unexpected output" || echo "(no output)" - rm -f ${test_out} - -pnmcolormap -1 testimg.ppm > ${test_out} || \ - printf "Expected failure 2 " - test -s ${test_out} && echo "unexpected output" || echo "(no output)" - rm -f ${test_out} - -pnmcolormap 0.1 testimg.ppm > ${test_out} || \ - printf "Expected failure 3 " - test -s ${test_out} && echo "unexpected output" || echo "(no output)" - rm -f ${test_out} - -pnmcolormap -center -meancolor 16 testimg.ppm > ${test_out} || \ - printf "Expected failure 4 " - test -s ${test_out} && echo "unexpected output" || echo "(no output)" - rm -f ${test_out} - -pnmcolormap -center -meanpixel 16 testimg.ppm > ${test_out} || \ - printf "Expected failure 5 " - test -s ${test_out} && echo "unexpected output" || echo "(no output)" - rm -f ${test_out} - -pnmcolormap -meancolor -meanpixel 16 testimg.ppm > ${test_out} || \ - printf "Expected failure 6 " - test -s ${test_out} && echo "unexpected output" || echo "(no output)" - rm -f ${test_out} +. ${srcdir}/test-invalid.inc -pnmcolormap -spreadbrightness -spreadluminosity 16 \ - testimg.ppm > ${test_out} || \ - printf "Expected failure 7 " - test -s ${test_out} && echo "unexpected output" || echo "(no output)" - rm -f ${test_out} +invCmd "pnmcolormap 0 testimg.ppm " +invCmd "pnmcolormap -1 testimg.ppm " +invCmd "pnmcolormap 0.1 testimg.ppm" +invCmd "pnmcolormap -center -meancolor 16 testimg.ppm " +invCmd "pnmcolormap -center -meanpixel 16 testimg.ppm " +invCmd "pnmcolormap -meancolor -meanpixel 16 testimg.ppm" +invCmd "pnmcolormap -spreadbrightness -spreadluminosity 16 testimg.ppm" -- cgit 1.4.1