diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2020-03-15 01:08:56 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2020-03-15 01:08:56 +0000 |
commit | 7c693525f2e51e7ac4089dd95f5d1210d86bfbc8 (patch) | |
tree | 180a9f967c24b5cd0884e0dbde9bd926f6281f1f /test/pnmcat.test | |
parent | 4d1f58c55c54071ddc85785a9da42674f7485880 (diff) | |
download | netpbm-mirror-7c693525f2e51e7ac4089dd95f5d1210d86bfbc8.tar.gz netpbm-mirror-7c693525f2e51e7ac4089dd95f5d1210d86bfbc8.tar.xz netpbm-mirror-7c693525f2e51e7ac4089dd95f5d1210d86bfbc8.zip |
New tests
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@3761 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'test/pnmcat.test')
-rwxr-xr-x | test/pnmcat.test | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/test/pnmcat.test b/test/pnmcat.test index c643320d..40c29f50 100755 --- a/test/pnmcat.test +++ b/test/pnmcat.test @@ -2,9 +2,70 @@ # This script tests: pnmcat # Also requires: +echo "Test 1." pnmcat -lr testgrid.pbm testgrid.pbm | cksum pnmcat -tb testgrid.pbm testgrid.pbm | cksum pnmcat -lr testimg.ppm testimg.ppm | cksum pnmcat -tb testimg.ppm testimg.ppm | cksum + +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 + +# direction not specified +pnmcat testgrid.pbm testimg.ppm > ${test_out} || \ + echo -n "Expected failure 1"; test -s ${test_out}; echo " "$? + +# both directions specified +pnmcat -topbottom -leftright testgrid.pbm testimg.ppm > ${test_out} || \ + echo -n "Expected failure 2"; test -s ${test_out}; echo " "$? + +# both pad colors specified +pnmcat -topbottom -white -black testgrid.pbm testimg.ppm > ${test_out} || \ + echo -n "Expected failure 3"; test -s ${test_out}; echo " "$? + +# justification parameters overspecified +pnmcat -lr -jtop -jbottom testgrid.pbm testimg.ppm > ${test_out} || \ + echo -n "Expected failure 4"; test -s ${test_out}; echo " "$? + +pnmcat -lr -jtop -jcenter testgrid.pbm testimg.ppm > ${test_out} || \ + echo -n "Expected failure 5"; test -s ${test_out}; echo " "$? + +pnmcat -lr -jcenter -jbottom testgrid.pbm testimg.ppm > ${test_out} || \ + echo -n "Expected failure 6"; test -s ${test_out}; echo " "$? + +pnmcat -tb -jleft -jright testgrid.pbm testimg.ppm > ${test_out} || \ + echo -n "Expected failure 7"; test -s ${test_out}; echo " "$? + +pnmcat -tb -jleft -jcenter testgrid.pbm testimg.ppm > ${test_out} || \ + echo -n "Expected failure 8"; test -s ${test_out}; echo " "$? + +pnmcat -tb -jcenter -jright testgrid.pbm testimg.ppm > ${test_out} || \ + echo -n "Expected failure 9"; test -s ${test_out}; echo " "$? + +# justification parameter in the wrong direction +pnmcat -lr -jleft testgrid.pbm testimg.ppm > ${test_out} || \ + echo -n "Expected failure 10"; test -s ${test_out}; echo " "$? + +pnmcat -lr -jright testgrid.pbm testimg.ppm > ${test_out} || \ + echo -n "Expected failure 11"; test -s ${test_out}; echo " "$? + +pnmcat -tb -jtop testgrid.pbm testimg.ppm > ${test_out} || \ + echo -n "Expected failure 12"; test -s ${test_out}; echo " "$? + +pnmcat -tb -jbottom testgrid.pbm testimg.ppm > ${test_out} || \ + echo -n "Expected failure 13"; test -s ${test_out}; echo " "$? + +# more than one input image from standard input +cat testgrid.pbm | pnmcat -lr - - testimg.ppm > ${test_out} || \ + echo -n "Expected failure 14"; test -s ${test_out}; echo " "$? + +rm -f ${test_out} |