From 4c412e9fea1674f2da0cd862983f3a031028a7e4 Mon Sep 17 00:00:00 2001 From: giraffedata Date: Sun, 10 Feb 2019 00:34:42 +0000 Subject: update tests for change to pamstretch-gen, some changes to anticipate future update to Pamenlarge git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@3544 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- test/pamenlarge-pbm.ok | 17 +++++++++++++++++ test/pamenlarge-pbm.test | 28 +++++++++++++++++++++++++++- test/pamscale-filters2.test | 10 +++++----- test/pamscale-filters3.test | 8 ++++---- 4 files changed, 53 insertions(+), 10 deletions(-) (limited to 'test') diff --git a/test/pamenlarge-pbm.ok b/test/pamenlarge-pbm.ok index f0025bb4..e9ebd78d 100644 --- a/test/pamenlarge-pbm.ok +++ b/test/pamenlarge-pbm.ok @@ -83,3 +83,20 @@ test 2 2848735506 5131 2848735506 5131 2848735506 5131 +test 3 +1 2285363768 191 +2 1302033680 244 +3 75147399 299 +4 4190327792 342 +5 56011966 403 +6 2787548071 451 +7 118558957 507 +8 3846542782 539 +9 2953363021 612 +10 3114645435 663 +11 2545145402 717 +12 3028643071 760 +13 678005060 821 +14 1666212289 869 +15 3907271797 924 +16 2957561834 954 diff --git a/test/pamenlarge-pbm.test b/test/pamenlarge-pbm.test index 41f0e57d..a8096f11 100755 --- a/test/pamenlarge-pbm.test +++ b/test/pamenlarge-pbm.test @@ -1,6 +1,6 @@ #! /bin/bash # This script tests: pamenlarge -# Also requires: +# Also requires: pbmmake pnmpad tmpdir=${tmpdir:-/tmp} complete256_pbm=${tmpdir}/complete256.pbm @@ -21,7 +21,9 @@ for xs in `seq 23` pamenlarge -xscale=$xs ${complete256_pbm} | cksum done +# Test 2. echo "test 2" + for xs1 in `seq 20` do xs2=$((21-$xs1)) @@ -29,3 +31,27 @@ for xs1 in `seq 20` pamenlarge -xscale=$xs2 ${complete256_pbm} | pamenlarge -xscale=$xs1 | cksum pamenlarge -xscale=$(($xs1 * $xs2)) ${complete256_pbm} | cksum done + +rm ${complete256_pbm} + +# Test 3. +echo "test 3" + +test3_pbm=${tmpdir}/test3.pbm + +for width in `seq 16` + do + pbmmake ${width} 1 | pnmpad -top=1 -white | \ + pnmpad -bottom=1 -black > ${test3_pbm}.${width} + done + + for xscale in `seq 16` + do echo -n ${xscale} " " + for width in `seq 16` + do pamenlarge -xscale=${xscale} ${test3_pbm}.${width} ; done | cksum + # + # unlike most other tests we take the cksum of a composite PBM file + # + done + +rm ${test3_pbm}.[1-9] ${test3_pbm}.1[1-6] \ No newline at end of file diff --git a/test/pamscale-filters2.test b/test/pamscale-filters2.test index 9e097495..f7370020 100755 --- a/test/pamscale-filters2.test +++ b/test/pamscale-filters2.test @@ -1,5 +1,5 @@ #! /bin/bash -# This script tests: pamscale pamstretch +# This script tests: pamscale pamstretch pamstretch-gen # Also requires: pamvalidate pnmpsnr tmpdir=${tmpdir:-/tmp} @@ -77,21 +77,21 @@ rm ${stretch_ppm} pamstretch-gen 5.85 testimg.ppm | pamvalidate > ${stretch_ppm} echo 5.85 blackman: pamscale 5.85 -filter=blackman testimg.ppm | \ - pnmpsnr -target1=40 -target2=53.19 -target3=47.67 - ${stretch_ppm} || \ + pnmpsnr -target1=34.29 -target2=48.78 -target3=42.75 - ${stretch_ppm} || \ echo failure ${PIPESTATUS[@]} ":" $? pamscale ${width_height} -filter=blackman ${stretch_ppm} | \ - pnmpsnr -target1=47.07 -target2=61.04 -target3=57.59 testimg.ppm - || \ + pnmpsnr -target1=33.69 -target2=48.83 -target3=42.72 testimg.ppm - || \ echo failure ${PIPESTATUS[@]} ":" $? rm ${stretch_ppm} pamstretch-gen 5.10 testimg.ppm | pamvalidate > ${stretch_ppm} echo 5.10 kaiser: pamscale 5.10 -filter=kaiser testimg.ppm | \ - pnmpsnr -target1=38.72 -target2=52.11 -target3=46.58 - ${stretch_ppm} || \ + pnmpsnr -target1=34.58 -target2=49.03 -target3=43.01 - ${stretch_ppm} || \ echo failure ${PIPESTATUS[@]} ":" $? pamscale ${width_height} -filter=blackman ${stretch_ppm} | \ - pnmpsnr -target1=47.07 -target2=61.04 -target3=57.59 testimg.ppm - || \ + pnmpsnr -target1=33.69 -target2=48.83 -target3=42.72 testimg.ppm - || \ echo failure ${PIPESTATUS[@]} ":" $? rm ${stretch_ppm} diff --git a/test/pamscale-filters3.test b/test/pamscale-filters3.test index ee2ac117..83198e2b 100755 --- a/test/pamscale-filters3.test +++ b/test/pamscale-filters3.test @@ -12,21 +12,21 @@ width_height=`pamfile -size testimg.ppm | \ pamstretch-gen 3.96 testimg.ppm | pamvalidate > ${stretch_ppm} echo 3.96 hermite: pamscale 3.96 -filter=hermite testimg.ppm | \ - pnmpsnr -target1=38.84 -target2=52 -target3=46.28 - ${stretch_ppm} || \ + pnmpsnr -target1=34.13 -target2=48.95 -target3=42.73 - ${stretch_ppm} || \ echo failure ${PIPESTATUS[@]} ":" $? pamscale ${width_height} -filter=hermite ${stretch_ppm} | \ - pnmpsnr -target1=43.38 -target2=58.22 -target3=54.36 testimg.ppm - || \ + pnmpsnr -target1=33.12 -target2=48.59 -target3=42.3 testimg.ppm - || \ echo failure ${PIPESTATUS[@]} ":" $? rm ${stretch_ppm} pamstretch-gen 2.75 testimg.ppm | pamvalidate > ${stretch_ppm} echo 2.75 lanczos: pamscale 2.75 -filter=lanczos testimg.ppm | \ - pnmpsnr -target1=38.74 -target2=51.91 -target3=46.47 - ${stretch_ppm} || \ + pnmpsnr -target1=32.93 -target2=48.28 -target3=41.89 - ${stretch_ppm} || \ echo failure ${PIPESTATUS[@]} ":" $? pamscale ${width_height} -filter=lanczos ${stretch_ppm} | \ - pnmpsnr -target1=46.86 -target2=60.27 -target3=57.46 testimg.ppm - || \ + pnmpsnr -target1=32.81 -target2=48.43 -target3=41.94 testimg.ppm - || \ echo failure ${PIPESTATUS[@]} ":" $? rm ${stretch_ppm} -- cgit 1.4.1