about summary refs log tree commit diff
path: root/test
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2019-02-03 04:07:38 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2019-02-03 04:07:38 +0000
commit8761a51d5f789792addbffb4013908ebadf9a442 (patch)
treec617e5386d93ee34ae300c3d6163be813c113fa6 /test
parentc46450499a9960fd380b341c3a439ee37aa7c88e (diff)
downloadnetpbm-mirror-8761a51d5f789792addbffb4013908ebadf9a442.tar.gz
netpbm-mirror-8761a51d5f789792addbffb4013908ebadf9a442.tar.xz
netpbm-mirror-8761a51d5f789792addbffb4013908ebadf9a442.zip
Add tests for pamenlarge, pamscale, pamstretch, pamfile
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@3529 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'test')
-rw-r--r--test/Test-Order12
-rw-r--r--test/pamenlarge-pamscale-point.ok9
-rwxr-xr-xtest/pamenlarge-pamscale-point.test36
-rw-r--r--test/pamenlarge-pbm.ok85
-rwxr-xr-xtest/pamenlarge-pbm.test31
-rw-r--r--test/pamfile.ok7
-rwxr-xr-xtest/pamfile.test7
-rw-r--r--test/pamscale-filters1.ok15
-rwxr-xr-xtest/pamscale-filters1.test64
-rw-r--r--test/pamscale-filters2.ok24
-rwxr-xr-xtest/pamscale-filters2.test97
-rw-r--r--test/pamscale-filters3.ok7
-rwxr-xr-xtest/pamscale-filters3.test32
-rw-r--r--test/pamscale-reportonly.ok18
-rwxr-xr-xtest/pamscale-reportonly.test35
-rw-r--r--test/pamstretch.ok20
-rwxr-xr-xtest/pamstretch.test48
17 files changed, 546 insertions, 1 deletions
diff --git a/test/Test-Order b/test/Test-Order
index 8bda73a4..83fd8059 100644
--- a/test/Test-Order
+++ b/test/Test-Order
@@ -58,7 +58,6 @@ pamcut.test
 pnmcat.test
 pamflip1.test
 pamflip2.test
-pamenlarge.test
 pnminvert.test
 pamchannel.test
 ppmchange.test
@@ -78,6 +77,17 @@ ppmdim.test
 pnmshear.test
 pgmbentley.test
 
+pamenlarge.test
+pamenlarge-pbm.test
+
+pamscale-reportonly.test
+pamscale-filters1.test
+pamscale-filters2.test
+pamscale-filters3.test
+pamenlarge-pamscale-point.test
+
+pamstretch.test
+
 ppmmix.test
 pammixmulti-identity.test
 
diff --git a/test/pamenlarge-pamscale-point.ok b/test/pamenlarge-pamscale-point.ok
new file mode 100644
index 00000000..dea0a3a9
--- /dev/null
+++ b/test/pamenlarge-pamscale-point.ok
@@ -0,0 +1,9 @@
+1 0 0 : 0
+2 -filter=point 0 0 : 0
+3 -linear 0 0 : 0
+4 -nomix 0 0 : 0
+5 0 0 : 0
+7 0 0 : 0
+6 -nomix 0 0 : 0
+15 -nomix -linear 0 0 : 0
+24 -nomix 0 0 : 0
diff --git a/test/pamenlarge-pamscale-point.test b/test/pamenlarge-pamscale-point.test
new file mode 100755
index 00000000..08b34bb7
--- /dev/null
+++ b/test/pamenlarge-pamscale-point.test
@@ -0,0 +1,36 @@
+#! /bin/bash
+# This script tests: pamenlarge pamscale
+# Also requires:
+
+tmpdir=${tmpdir:-/tmp}
+enlarge_ppm=${tmpdir}/enlarge.ppm
+
+# When scale factor is an integer and the pamscale filter is point (default)
+# pamenlarge and pamscale should produce identical output
+
+for option in 1 "2 -filter=point" "3 -linear" "4 -nomix" 5
+  do
+  scale=${option% *}
+  pamenlarge $scale testimg.ppm > ${enlarge_ppm}
+  pamscale   $option testimg.ppm | cmp -s - ${enlarge_ppm}  
+  echo $option ${PIPESTATUS[@]} ":" $?
+  rm  ${enlarge_ppm}  
+  done
+
+
+pamenlarge -xscale=7 -yscale=7 testimg.ppm > ${enlarge_ppm}
+pamscale   -xscale=7 -yscale=7 testimg.ppm | cmp -s - ${enlarge_ppm}  
+echo 7 ${PIPESTATUS[@]} ":" $?
+rm  ${enlarge_ppm}
+
+
+enlarge_pbm=${tmpdir}/enlarge.pbm
+
+for option in "6 -nomix" "15 -nomix -linear" "24 -nomix"
+  do
+  scale=${option%% *}
+  pamenlarge $scale testgrid.pbm > ${enlarge_pbm}
+  pamscale   $option testgrid.pbm | cmp -s - ${enlarge_pbm}  
+  echo $option ${PIPESTATUS[@]} ":" $?
+  rm  ${enlarge_pbm}
+  done
diff --git a/test/pamenlarge-pbm.ok b/test/pamenlarge-pbm.ok
new file mode 100644
index 00000000..f0025bb4
--- /dev/null
+++ b/test/pamenlarge-pbm.ok
@@ -0,0 +1,85 @@
+test 1
+1777627284 265
+2806322261 522
+1951888658 778
+3502911227 1034
+3041987260 1290
+2012524746 1546
+4279863183 1802
+3672763467 2058
+3994368242 2314
+4119105059 2570
+1760702195 2826
+2751077869 3082
+262508159 3339
+743430575 3595
+94950162 3851
+2113456870 4107
+1143977004 4363
+2167141643 4619
+1816864555 4875
+2848735506 5131
+600474914 5387
+3831078134 5643
+1848221383 5899
+test 2
+2848735506 5131
+2848735506 5131
+2848735506 5131
+1983020436 9739
+1983020436 9739
+1983020436 9739
+732326811 13835
+732326811 13835
+732326811 13835
+1072342346 17419
+1072342346 17419
+1072342346 17419
+981152079 20491
+981152079 20491
+981152079 20491
+3766223324 23051
+3766223324 23051
+3766223324 23051
+209139519 25099
+209139519 25099
+209139519 25099
+141252239 26635
+141252239 26635
+141252239 26635
+1241842059 27659
+1241842059 27659
+1241842059 27659
+4173230574 28171
+4173230574 28171
+4173230574 28171
+4173230574 28171
+4173230574 28171
+4173230574 28171
+1241842059 27659
+1241842059 27659
+1241842059 27659
+141252239 26635
+141252239 26635
+141252239 26635
+209139519 25099
+209139519 25099
+209139519 25099
+3766223324 23051
+3766223324 23051
+3766223324 23051
+981152079 20491
+981152079 20491
+981152079 20491
+1072342346 17419
+1072342346 17419
+1072342346 17419
+732326811 13835
+732326811 13835
+732326811 13835
+1983020436 9739
+1983020436 9739
+1983020436 9739
+2848735506 5131
+2848735506 5131
+2848735506 5131
diff --git a/test/pamenlarge-pbm.test b/test/pamenlarge-pbm.test
new file mode 100755
index 00000000..41f0e57d
--- /dev/null
+++ b/test/pamenlarge-pbm.test
@@ -0,0 +1,31 @@
+#! /bin/bash
+# This script tests: pamenlarge
+# Also requires:
+
+tmpdir=${tmpdir:-/tmp}
+complete256_pbm=${tmpdir}/complete256.pbm
+
+# works with gawk and mawk
+# produce all possible 8-bit patterns
+
+LC_ALL=C awk 'BEGIN { print "P4";         # header
+                      print "8 256";
+                      for (i=0;i<256;++i) # raster
+                           printf("%c",i) }' > ${complete256_pbm}
+
+# Test 1.
+echo "test 1"
+ 
+for xs in `seq 23`
+  do
+  pamenlarge -xscale=$xs ${complete256_pbm} | cksum
+  done
+
+echo "test 2"
+for xs1 in `seq 20`
+  do
+  xs2=$((21-$xs1))
+  pamenlarge -xscale=$xs1 ${complete256_pbm} | pamenlarge -xscale=$xs2 | cksum
+  pamenlarge -xscale=$xs2 ${complete256_pbm} | pamenlarge -xscale=$xs1 | cksum
+  pamenlarge -xscale=$(($xs1 * $xs2)) ${complete256_pbm} | cksum
+  done
diff --git a/test/pamfile.ok b/test/pamfile.ok
index 57cc8cfd..c0d80c28 100644
--- a/test/pamfile.ok
+++ b/test/pamfile.ok
@@ -3,3 +3,10 @@ testgrid.pbm:	PBM raw, 14 by 16
 stdin:	PGM raw, 227 by 149  maxval 255
 stdin:	PAM, 227 by 149 by 1 maxval 255
     Tuple type: GRAYSCALE
+stdin:	3 images
+stdin:	Image 0:	PBM raw, 14 by 16
+stdin:	Image 1:	PBM raw, 14 by 16
+stdin:	Image 2:	PBM raw, 14 by 16
+227 149
+testimg.ppm: PPM RAW 227 149 3 255 RGB
+stdin: PBM RAW 14 16 1 1 BLACKANDWHITE
diff --git a/test/pamfile.test b/test/pamfile.test
index ac927172..545a2289 100755
--- a/test/pamfile.test
+++ b/test/pamfile.test
@@ -7,3 +7,10 @@ pamfile testimg.ppm
 pamfile testgrid.pbm
 pamchannel -infile=testimg.ppm -tupletype="GRAYSCALE" 0 | pamtopnm | pamfile
 pamchannel -tupletype="GRAYSCALE" -infile=testimg.ppm 0 | pamfile
+
+cat testgrid.pbm testgrid.pbm testgrid.pbm | pamfile -count
+cat testgrid.pbm testgrid.pbm testgrid.pbm | pamfile -allimages
+
+pamfile -size testimg.ppm
+pamfile -machine testimg.ppm
+cat testgrid.pbm testimg.ppm testgrid.pbm | pamfile -machine
diff --git a/test/pamscale-filters1.ok b/test/pamscale-filters1.ok
new file mode 100644
index 00000000..083505ee
--- /dev/null
+++ b/test/pamscale-filters1.ok
@@ -0,0 +1,15 @@
+4 box:
+match
+match
+9 triangle:
+match
+match
+4 quadratic:
+match
+match
+10 cubic:
+match
+match
+4 catrom:
+match
+match
diff --git a/test/pamscale-filters1.test b/test/pamscale-filters1.test
new file mode 100755
index 00000000..63e0d012
--- /dev/null
+++ b/test/pamscale-filters1.test
@@ -0,0 +1,64 @@
+#! /bin/bash
+# This script tests: pamscale pamenlarge
+# Also requires: pamvalidate pnmpsnr
+
+tmpdir=${tmpdir:-/tmp}
+enlarge_ppm=${tmpdir}/enlarge.ppm
+
+width_height=`pamfile -size testimg.ppm | \
+                awk '{print "-width="$1, "-height="$2}'`
+
+# The target values here were determined by running the test on a
+# 32-bit GNU/Linux system and subtracting 2.5 (dB) from observed
+# values.
+
+pamenlarge  4 testimg.ppm | pamvalidate > ${enlarge_ppm}
+echo  4 box:  
+pamscale  4 -filter=box testimg.ppm | \
+  pnmpsnr -target1=35.67 -target2=49.25 -target3=43.28 - ${enlarge_ppm} || \
+  echo failure ${PIPESTATUS[@]} ":" $?
+ 
+pamscale ${width_height} -filter=point ${enlarge_ppm} | \
+  pnmpsnr -target1=1000 -target2=1000 -target3=1000 testimg.ppm - || \
+  echo failure ${PIPESTATUS[@]} ":" $?
+rm ${enlarge_ppm}
+
+pamenlarge  9 testimg.ppm | pamvalidate > ${enlarge_ppm}
+echo  9 triangle:  
+pamscale  9 -filter=triangle testimg.ppm | \
+  pnmpsnr -target1=35.27 -target2=49.06 -target3=43.11 - ${enlarge_ppm} || \
+  echo failure ${PIPESTATUS[@]} ":" $?
+pamscale ${width_height} -filter=triangle ${enlarge_ppm} | \
+  pnmpsnr -target1=41.52 -target2=56.96 -target3=52.68 testimg.ppm - || \
+  echo failure ${PIPESTATUS[@]} ":" $?
+rm ${enlarge_ppm}
+
+pamenlarge  4 testimg.ppm | pamvalidate > ${enlarge_ppm}
+echo  4 quadratic:  
+pamscale  4 -filter=quadratic testimg.ppm | \
+  pnmpsnr -target1=35.39 -target2=49.36 -target3=43.46 - ${enlarge_ppm} || \
+  echo failure ${PIPESTATUS[@]} ":" $?
+pamscale ${width_height} -filter=quadratic ${enlarge_ppm} | \
+  pnmpsnr -target1=39.34 -target2=55.24 -target3=50.65 testimg.ppm - || \
+  echo failure ${PIPESTATUS[@]} ":" $?
+rm ${enlarge_ppm}
+
+pamenlarge 10 testimg.ppm | pamvalidate > ${enlarge_ppm}
+echo 10 cubic:  
+pamscale 10 -filter=cubic testimg.ppm | \
+  pnmpsnr -target1=34.39 -target2=48.45 -target3=42.52 - ${enlarge_ppm} || \
+  echo failure ${PIPESTATUS[@]} ":" $?
+pamscale ${width_height} -filter=cubic ${enlarge_ppm} | \
+  pnmpsnr -target1=37.7 -target2=53.84 -target3=48.96 testimg.ppm - || \
+  echo failure ${PIPESTATUS[@]} ":" $?
+rm ${enlarge_ppm}
+
+pamenlarge  4 testimg.ppm | pamvalidate > ${enlarge_ppm}
+echo  4 catrom:  
+pamscale  4 -filter=catrom testimg.ppm | \
+  pnmpsnr -target1=36.05 -target2=49.51 -target3=43.49 - ${enlarge_ppm} || \
+  echo failure ${PIPESTATUS[@]} ":" $?
+pamscale ${width_height} -filter=catrom ${enlarge_ppm} | \
+  pnmpsnr -target1=46.5 -target2=60.68 -target3=57.8 testimg.ppm - || \
+  echo failure ${PIPESTATUS[@]} ":" $?
+rm ${enlarge_ppm}
diff --git a/test/pamscale-filters2.ok b/test/pamscale-filters2.ok
new file mode 100644
index 00000000..b8d51d37
--- /dev/null
+++ b/test/pamscale-filters2.ok
@@ -0,0 +1,24 @@
+-xscale=4 -yscale=3 mitchell:
+match
+match
+-xscale=3 -yscale=4 gauss:
+match
+match
+-xscale=2 -yscale=2 sinc:
+match
+match
+-xscale=2 -yscale=4 bessel:
+match
+match
+-xscale=3 -yscale=3 hanning:
+match
+match
+-xscale=5 -yscale=5 hamming:
+match
+match
+5.85 blackman:
+match
+match
+5.10 kaiser:
+match
+match
diff --git a/test/pamscale-filters2.test b/test/pamscale-filters2.test
new file mode 100755
index 00000000..9e097495
--- /dev/null
+++ b/test/pamscale-filters2.test
@@ -0,0 +1,97 @@
+#! /bin/bash
+# This script tests: pamscale pamstretch
+# Also requires: pamvalidate pnmpsnr
+
+tmpdir=${tmpdir:-/tmp}
+stretch_ppm=${tmpdir}/stretch.ppm
+
+width_height=`pamfile -size testimg.ppm | \
+                awk '{print "-width="$1, "-height="$2}'`
+
+pamstretch -xscale=4 -yscale=3 testimg.ppm | pamvalidate > ${stretch_ppm}
+echo -xscale=4 -yscale=3 mitchell:  
+pamscale -xscale=4 -yscale=3 -filter=mitchell testimg.ppm | \
+  pnmpsnr -target1=34.15 -target2=46.95 -target3=41.02 - ${stretch_ppm} || \
+  echo failure ${PIPESTATUS[@]} ":" $?
+
+pamscale ${width_height} -filter=mitchell ${stretch_ppm} | \
+  pnmpsnr -target1=33.36 -target2=46.74 -target3=40.79 testimg.ppm - || \
+  echo failure ${PIPESTATUS[@]} ":" $?
+rm ${stretch_ppm}
+
+pamstretch -xscale=3 -yscale=4 testimg.ppm | pamvalidate > ${stretch_ppm}
+echo -xscale=3 -yscale=4 gauss:  
+pamscale -xscale=3 -yscale=4 -filter=gauss testimg.ppm | \
+  pnmpsnr -target1=34.4 -target2=46.98 -target3=41.07 - ${stretch_ppm} || \
+  echo failure ${PIPESTATUS[@]} ":" $?
+
+pamscale ${width_height} -filter=gauss ${stretch_ppm} | \
+  pnmpsnr -target1=33.1 -target2=46.61 -target3=40.64 testimg.ppm - || \
+  echo failure ${PIPESTATUS[@]} ":" $?
+rm ${stretch_ppm}
+
+pamstretch -xscale=2 -yscale=2 testimg.ppm | pamvalidate > ${stretch_ppm}
+echo -xscale=2 -yscale=2 sinc:  
+pamscale -xscale=2 -yscale=2 -filter=sinc testimg.ppm | \
+  pnmpsnr -target1=36.27 -target2=49.39 -target3=43.62 - ${stretch_ppm} || \
+  echo failure ${PIPESTATUS[@]} ":" $?
+
+pamscale ${width_height} -filter=sinc ${stretch_ppm} | \
+  pnmpsnr -target1=36.23 -target2=49.47 -target3=43.69 testimg.ppm - || \
+  echo failure ${PIPESTATUS[@]} ":" $?
+rm ${stretch_ppm}
+
+pamstretch -xscale=2 -yscale=4 testimg.ppm | pamvalidate > ${stretch_ppm}
+echo -xscale=2 -yscale=4 bessel:  
+pamscale -xscale=2 -yscale=4 -filter=bessel testimg.ppm | \
+  pnmpsnr -target1=35.09 -target2=47.77 -target3=41.88 - ${stretch_ppm} || \
+  echo failure ${PIPESTATUS[@]} ":" $?
+
+pamscale ${width_height} -filter=bessel ${stretch_ppm} | \
+  pnmpsnr -target1=33.99 -target2=47.47 -target3=41.55 testimg.ppm - || \
+  echo failure ${PIPESTATUS[@]} ":" $?
+rm ${stretch_ppm}
+
+pamstretch -xscale=3 -yscale=3 testimg.ppm | pamvalidate > ${stretch_ppm}
+echo -xscale=3 -yscale=3 hanning:  
+pamscale -xscale=3 -yscale=3 -filter=hanning testimg.ppm | \
+  pnmpsnr -target1=34.73 -target2=47.42 -target3=41.54 - ${stretch_ppm} || \
+  echo failure ${PIPESTATUS[@]} ":" $?
+
+pamscale ${width_height} -filter=hanning ${stretch_ppm} | \
+  pnmpsnr -target1=33.86 -target2=47.24 -target3=41.29 testimg.ppm - || \
+  echo failure ${PIPESTATUS[@]} ":" $?
+rm ${stretch_ppm}
+
+pamstretch -xscale=5 -yscale=5 testimg.ppm | pamvalidate > ${stretch_ppm}
+echo -xscale=5 -yscale=5 hamming:  
+pamscale -xscale=5 -yscale=5 -filter=hamming testimg.ppm | \
+  pnmpsnr -target1=33.4 -target2=46.02 -target3=40.07 - ${stretch_ppm} || \
+  echo failure ${PIPESTATUS[@]} ":" $?
+
+pamscale ${width_height} -filter=hamming ${stretch_ppm} | \
+  pnmpsnr -target1=32.49 -target2=45.81 -target3=39.8 testimg.ppm - || \
+  echo failure ${PIPESTATUS[@]} ":" $?
+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} || \
+  echo failure ${PIPESTATUS[@]} ":" $?
+
+pamscale ${width_height} -filter=blackman ${stretch_ppm} | \
+  pnmpsnr -target1=47.07 -target2=61.04 -target3=57.59 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} || \
+  echo failure ${PIPESTATUS[@]} ":" $?
+
+pamscale ${width_height} -filter=blackman ${stretch_ppm} | \
+  pnmpsnr -target1=47.07 -target2=61.04 -target3=57.59 testimg.ppm - || \
+  echo failure ${PIPESTATUS[@]} ":" $?
+rm ${stretch_ppm}
diff --git a/test/pamscale-filters3.ok b/test/pamscale-filters3.ok
new file mode 100644
index 00000000..94d4ae96
--- /dev/null
+++ b/test/pamscale-filters3.ok
@@ -0,0 +1,7 @@
+failure : 0
+3.96 hermite:
+match
+match
+2.75 lanczos:
+match
+match
diff --git a/test/pamscale-filters3.test b/test/pamscale-filters3.test
new file mode 100755
index 00000000..ee2ac117
--- /dev/null
+++ b/test/pamscale-filters3.test
@@ -0,0 +1,32 @@
+#! /bin/bash
+# This script tests: pamscale pamstretch pamstretch-gen 
+ # Also requires: pamvalidate pnmpsnr || \
+  echo failure ${PIPESTATUS[@]} ":" $?
+
+tmpdir=${tmpdir:-/tmp}
+stretch_ppm=${tmpdir}/stretch.ppm
+
+width_height=`pamfile -size testimg.ppm | \
+                awk '{print "-width="$1, "-height="$2}'`
+
+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} || \
+  echo failure ${PIPESTATUS[@]} ":" $?
+
+pamscale ${width_height} -filter=hermite ${stretch_ppm} | \
+  pnmpsnr -target1=43.38 -target2=58.22 -target3=54.36 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} || \
+  echo failure ${PIPESTATUS[@]} ":" $?
+
+pamscale ${width_height} -filter=lanczos ${stretch_ppm} | \
+  pnmpsnr -target1=46.86 -target2=60.27 -target3=57.46 testimg.ppm - || \
+  echo failure ${PIPESTATUS[@]} ":" $?
+rm ${stretch_ppm}
diff --git a/test/pamscale-reportonly.ok b/test/pamscale-reportonly.ok
new file mode 100644
index 00000000..00152411
--- /dev/null
+++ b/test/pamscale-reportonly.ok
@@ -0,0 +1,18 @@
+227 149 3.000000 3.000000 681 447
+227 149 5.000000 5.000000 1135 745
+227 149 2.682819 2.684564 609 400
+227 149 2.819383 2.818792 640 420
+227 149 0.440529 0.442953 100 66
+227 149 0.167401 0.167785 38 25
+227 149 0.101322 0.100671 23 15
+227 149 2.819383 2.684564 640 400
+227 149 2.819383 2.684564 640 400
+227 149 2.819383 2.000000 640 298
+227 149 1.400881 2.684564 318 400
+227 149 1.000000 1.000000 227 149
+expected error
+expected error
+expected error
+expected error
+expected error
+expected error
diff --git a/test/pamscale-reportonly.test b/test/pamscale-reportonly.test
new file mode 100755
index 00000000..7205be2f
--- /dev/null
+++ b/test/pamscale-reportonly.test
@@ -0,0 +1,35 @@
+#! /bin/bash
+# This script tests: pamscale
+# Also requires:
+
+pamscale -reportonly 3 testimg.ppm
+pamscale -reportonly 5 testimg.ppm
+pamscale -reportonly -xysize 640 400 testimg.ppm
+pamscale -reportonly -xyfill 640 400 testimg.ppm
+pamscale -reportonly -xyfit  100 100 testimg.ppm
+pamscale -reportonly -reduce 6 testimg.ppm
+pamscale -reportonly -reduce 10 testimg.ppm
+pamscale -reportonly -xsize=640 -ysize=400 testimg.ppm
+pamscale -reportonly -width=640 -height=400 testimg.ppm
+pamscale -reportonly -width=640 -yscale=2 testimg.ppm
+pamscale -reportonly -xscale=1.4 -height=400 testimg.ppm
+pamscale -reportonly -pixels=45000 testimg.ppm
+
+# expected error cases
+echo 1>&2
+echo "Invalid command-line argument combinations." 1>&2
+echo "Error messages should appear below the line." 1>&2
+echo "-----------------------------------------------------------" 1>&2
+pamscale -reportonly -xsize=640 -ysize=400 -xscale=2 testimg.ppm || \
+  echo expected error
+pamscale -reportonly -xsize=640 -xscale=2 -yscale=3 testimg.ppm || \
+  echo expected error
+pamscale -reportonly -xsize=640 -ysize=400 -pixels=200000 testimg.ppm || \
+  echo expected error
+pamscale -reportonly -xsize=640 -ysize=400 -xysize 640 400 testimg.ppm || \
+  echo expected error
+pamscale -reportonly -xsize=640 -ysize=400 -xyfit  640 400 testimg.ppm || \
+  echo expected error
+pamscale -reportonly -xsize=640 -ysize=400 -xyfill 640 400 testimg.ppm || \
+  echo expected error
+
diff --git a/test/pamstretch.ok b/test/pamstretch.ok
new file mode 100644
index 00000000..3253cfd6
--- /dev/null
+++ b/test/pamstretch.ok
@@ -0,0 +1,20 @@
+test 1
+211995824 12277766
+test 2
+1361899 202953
+test 3
+2735552884 302379
+test 4
+3681010585 802767
+test 5
+1926073387 101484
+1926073387 101484
+1926073387 101484
+1926073387 101484
+test 6
+3638965616 913236
+598302847 913236
+220708621 903111
+3948746482 903111
+3948746482 903111
+220708621 903111
diff --git a/test/pamstretch.test b/test/pamstretch.test
new file mode 100755
index 00000000..55dd4e9c
--- /dev/null
+++ b/test/pamstretch.test
@@ -0,0 +1,48 @@
+#! /bin/bash
+# This script tests: pamstretch
+# Also requires: pamcut pamfile
+
+# Test 1.  Should print 211995824 12277766
+echo test 1
+pamstretch 11 testimg.ppm | cksum
+
+# Test 2.  Should print 1361899 202953
+echo test 2
+
+pamstretch -xscale=2 -blackedge testimg.ppm | cksum
+
+# Test 3.  Should print 3427416462 301047
+echo test 3
+dropedge1_ppm=${tmpdir}/drop1.ppm
+pamstretch -yscale=3 -dropedge testimg.ppm | tee ${dropedge1_ppm} | cksum
+
+# Test 4. Should print 3681010585 802767
+echo test 4
+pamstretch -xscale=2 -yscale=4 -dropedge testimg.ppm | cksum
+
+# Test 5.  Should print 1926073387 101484 four times
+echo test 5
+pamstretch 1 testimg.ppm | cksum
+pamstretch -xscale=1 -yscale=1 testimg.ppm | cksum
+pamstretch 1 -dropedge testimg.ppm | cksum
+pamstretch 1 -blackedge testimg.ppm | cksum
+
+# Test 6.
+# Should print 3638965616 913236 , 598302847 913236 
+# followed by 3948746482 903111 four times and finally
+# -width=678 -height=444"
+
+echo test 6
+stretch_ppm=${tmpdir}/stretch.ppm
+dropedge_ppm=${tmpdir}/drop.ppm
+blackedge_ppm=${tmpdir}/black.ppm
+pamstretch 3 testimg.ppm | tee ${stretch_ppm} | cksum
+pamstretch 3 -blackedge testimg.ppm | tee ${blackedge_ppm} | cksum
+pamstretch -xscale=3 -dropedge ${dropedge1_ppm} | tee ${dropedge_ppm} | cksum
+width_height=`pamfile -size ${dropedge_ppm} | \
+              awk '{print "-width="$1, "-height="$2}'`
+pamcut -left=0 -top=0 ${width_height} ${stretch_ppm} | cksum
+pamcut -left=0 -top=0 ${width_height} ${blackedge_ppm} | cksum
+pamcut -left=0 -top=0 ${width_height} ${dropedge_ppm} | cksum
+
+rm ${stretch_ppm} ${dropedge_ppm} ${dropedge1_ppm} ${blackedge_ppm}
\ No newline at end of file