about summary refs log tree commit diff
path: root/test/ppmbrighten.test
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2020-08-26 02:39:35 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2020-08-26 02:39:35 +0000
commit240092f6f6fa828619baee475bab885eec762446 (patch)
tree51b5b1af78d6abba2830a3f1b45531bcb47ae8d8 /test/ppmbrighten.test
parenta124845acfedf0ade1eae957988a5e8de4795bb4 (diff)
downloadnetpbm-mirror-240092f6f6fa828619baee475bab885eec762446.tar.gz
netpbm-mirror-240092f6f6fa828619baee475bab885eec762446.tar.xz
netpbm-mirror-240092f6f6fa828619baee475bab885eec762446.zip
Add tests for ppmsvgalib,pambrighten, modify ppmbrighten, reorganize slightly
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@3926 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'test/ppmbrighten.test')
-rwxr-xr-xtest/ppmbrighten.test30
1 files changed, 28 insertions, 2 deletions
diff --git a/test/ppmbrighten.test b/test/ppmbrighten.test
index 46c5cab5..40fe08f6 100755
--- a/test/ppmbrighten.test
+++ b/test/ppmbrighten.test
@@ -1,12 +1,38 @@
 #! /bin/bash
 # This script tests: ppmbrighten
-# Also requires:
+# Also requires: pnmnorm pambrighten pamsumm 
 
 # Failure message
 ## Ppmbrighten is sensitive to subtle differences in floating point math.
 ## If this test fails, please run the program and visually examine
 ## the output.
 
+echo "Test 1: Should print 1969633344 101484"
+
 ppmbrighten -v 100 testimg.ppm | cksum
-ppmbrighten -v 100 -normalize testimg.ppm | cksum
+
+echo "Test 2: Should print 295150171 101484"
+
 ppmbrighten -s 100 -v -50 testimg.ppm | cksum
+
+echo "Test 3: Should print 1"
+
+ppmbrighten -v 100 -normalize testimg.ppm | pamsumm --mean | \
+ awk '{print ($NF > 132.0) && ($NF < 132.2)}'
+
+echo "Invalid command-line argument combinations." 1>&2
+echo "Error messages should appear below the line." 1>&2
+echo "-----------------------------------------------------------" 1>&2
+
+echo "Test Error: Should print 1 four times"
+
+output_ppm=${tmpdir}/output.ppm
+
+pambrighten -v -120 testimg.ppm > ${output_ppm}
+echo $?
+test -s ${output_ppm}
+echo $?
+pambrighten -s -120 testimg.ppm > ${output_ppm}
+echo $?
+test -s ${output_ppm}
+echo $?