From 2b398bac6127e1512be09eca1e1d67559c32c7c6 Mon Sep 17 00:00:00 2001 From: giraffedata Date: Fri, 17 Apr 2015 15:20:06 +0000 Subject: Add round-trip tests for 'xv', 'ppmtoarbtxt'; better cover compression scheme in macptoppm test git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@2464 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- test/ppmtoarbtxt-roundtrip.test | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 test/ppmtoarbtxt-roundtrip.test (limited to 'test/ppmtoarbtxt-roundtrip.test') diff --git a/test/ppmtoarbtxt-roundtrip.test b/test/ppmtoarbtxt-roundtrip.test new file mode 100755 index 00000000..dff78250 --- /dev/null +++ b/test/ppmtoarbtxt-roundtrip.test @@ -0,0 +1,34 @@ +#! /bin/bash +# This script tests: ppmtoarbtxt +# Also requires: pnminvert pamtopnm + +# Test. Invert colors. +# Should print 1926073387 101484 + +tmpdir=${tmpdir:-/tmp} +headskl=${tmpdir}/headskl +bodyskl=${tmpdir}/bodyskl +inv_ppm=${tmpdir}/inv.ppm + +cat > ${headskl} << EOF +P3 +#(width) #(height) +255 + +EOF + +cat > ${bodyskl} << EOF +#(ired %d 255 0) #(igreen %d 255 0) #(iblue %d 255 0) + +EOF + +ppmtoarbtxt ${bodyskl} -hd ${headskl} testimg.ppm | tee ${inv_ppm} | + pnminvert | cksum + + +# Test 2. + +cat ${inv_ppm} | ppmtoarbtxt ${bodyskl} -hd ${headskl} | pamtopnm | cksum + + +rm ${bodyskl} ${headskl} -- cgit 1.4.1