about summary refs log tree commit diff
path: root/test/ppmpat.test
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2013-06-29 19:02:18 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2013-06-29 19:02:18 +0000
commit9602cdc10e7e2321ced1f30053a0b7b22edd433d (patch)
tree9a947bdd3cb43d45a8bfa3fc4288cac44ae4835e /test/ppmpat.test
parentfe835f6d3d19026dc3316de80062b44cfa78f7f9 (diff)
downloadnetpbm-mirror-9602cdc10e7e2321ced1f30053a0b7b22edd433d.tar.gz
netpbm-mirror-9602cdc10e7e2321ced1f30053a0b7b22edd433d.tar.xz
netpbm-mirror-9602cdc10e7e2321ced1f30053a0b7b22edd433d.zip
New tests
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@1964 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'test/ppmpat.test')
-rwxr-xr-xtest/ppmpat.test39
1 files changed, 23 insertions, 16 deletions
diff --git a/test/ppmpat.test b/test/ppmpat.test
index 0fe9f25a..669cf17c 100755
--- a/test/ppmpat.test
+++ b/test/ppmpat.test
@@ -1,28 +1,35 @@
 #! /bin/bash
 # This script tests: ppmpat
-# Also requires:
+# Also requires: pgmnoise
 
-# TODO 1: Write tests for squig and poles.  It appears that they are
+# TODO: Write tests for squig and poles.  It appears that they are
 # sensitive to differences in floating point math.
 
-# TODO 2: Skip this test if the pseudo-random number generator is
-# not glibc's rand().
+${PBM_BINPREFIX}pgmnoise --testrandom --quiet
+case $? in
+   81)
+       # Test 1. Should print: 4008533639 781
+       ${PBM_TESTPREFIX}ppmpat --randomseed=0 -g2 16 16 | cksum
 
+       # Test 2. Should print: 2448908863 9613
+       ${PBM_TESTPREFIX}ppmpat --randomseed=0 -g2 64 50 | cksum
 
-# Test 1. Should print: 4008533639 781
-${PBM_TESTPREFIX}ppmpat --randomseed=0 -g2 16 16 | cksum
+       # Test 3. Should print: 2698433077 1549
+       ${PBM_TESTPREFIX}ppmpat --randomseed=0 -madras 32 16 | cksum
 
-# Test 2. Should print: 2448908863 9613
-${PBM_TESTPREFIX}ppmpat --randomseed=0 -g2 64 50 | cksum
+       # Test 4. Should print: 3705929501 781
+       ${PBM_TESTPREFIX}ppmpat --randomseed=0 -tartan 16 16 | cksum
 
-# Test 3. Should print: 2698433077 1549
-${PBM_TESTPREFIX}ppmpat --randomseed=0 -madras 32 16 | cksum
+       # Test 5. Should print: 2219119109 36015
+       ${PBM_TESTPREFIX}ppmpat --randomseed=0 -camo 100 120 | cksum
 
-# Test 4. Should print: 3705929501 781
-${PBM_TESTPREFIX}ppmpat --randomseed=0 -tartan 16 16 | cksum
+       # Test 6. Should print: 3436846137 16813
+       ${PBM_TESTPREFIX}ppmpat --randomseed=0 -anticamo 80 70 | cksum
+       ;;
 
-# Test 5. Should print: 2219119109 36015
-${PBM_TESTPREFIX}ppmpat --randomseed=0 -camo 100 120 | cksum
+   8[02-9] | 90)
+       echo "Skipping: random number generator is not glibc." 1>&2
+       exit 80;;
 
-# Test 6. Should print: 3436846137 16813
-${PBM_TESTPREFIX}ppmpat --randomseed=0 -anticamo 80 70 | cksum
+   *)  exit 1;;  # pgmnoise --testrandom failed
+esac