From 438d4e0aff3c4829bdd93c473117d8c680480f67 Mon Sep 17 00:00:00 2001 From: giraffedata Date: Sat, 26 Dec 2015 18:31:30 +0000 Subject: Promote Development to Advanced: 10.73.00 git-svn-id: http://svn.code.sf.net/p/netpbm/code/advanced@2671 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- test/cut-paste-roundtrip.test | 49 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 47 insertions(+), 2 deletions(-) (limited to 'test/cut-paste-roundtrip.test') diff --git a/test/cut-paste-roundtrip.test b/test/cut-paste-roundtrip.test index 9f466020..1bb3a7c2 100755 --- a/test/cut-paste-roundtrip.test +++ b/test/cut-paste-roundtrip.test @@ -1,7 +1,52 @@ #! /bin/bash # This script tests: pamcut pnmpaste -# Also requires: +# Also requires: pbmmake pnmpad +base_ppm=${tmpdir}/base.ppm + +# Test 1. Should produce 2999529086 101484 +# (Make a modified base image to prevent false positives.) + +pbmmake -g 100 70 | \ +pnmpaste -replace - 50 40 testimg.ppm | tee ${base_ppm} | cksum + +# Test 2. Should produce 1926073387 101484 pamcut 50 40 100 70 testimg.ppm | \ -pnmpaste -replace - 50 40 testimg.ppm | cksum +pnmpaste -replace - 50 40 ${base_ppm} | cksum + +rm ${base_ppm} + + +basewhite_pbm=${tmpdir}/basewhite.pbm +baseblack_pbm=${tmpdir}/baseblack.pbm +part_pbm=${tmpdir}/part.pbm + +# Test 3. Should produce 514843768 41 +# (Make a modified base image to prevent false positives.) + +pbmmake -w 5 7 | +pnmpaste -replace - 7 9 testgrid.pbm | tee ${basewhite_pbm} | cksum + +# Test 4. Should produce 1880210648 41 +# (Another modified base image with target area black.) + +pbmmake -b 5 7 | +pnmpaste -replace - 7 9 ${basewhite_pbm} | tee ${baseblack_pbm} | cksum + + +# Test 5. Should produce 2425386270 41 six times. + +pamcut 7 9 5 7 testgrid.pbm > ${part_pbm} + +pnmpaste -replace ${part_pbm} 7 9 ${basewhite_pbm} | cksum +pnmpaste -and ${part_pbm} 7 9 ${basewhite_pbm} | cksum +pnmpaste -or ${part_pbm} 7 9 ${baseblack_pbm} | cksum +pnmpad -left 3 -white ${part_pbm} |\ + pnmpaste -and - 4 9 ${basewhite_pbm} | cksum +pnmpad -left 7 -right 2 -top 1 -black ${part_pbm} |\ + pnmpaste -or - 0 8 ${baseblack_pbm} | cksum +pnmpaste -xor ${part_pbm} 7 9 testgrid.pbm |\ + pnmpaste -xor ${part_pbm} 7 9 | cksum + +rm ${part_pbm} ${basewhite_pbm} ${baseblack_pbm} -- cgit 1.4.1