about summary refs log tree commit diff
path: root/test/ppmforge-parameters.test
diff options
context:
space:
mode:
Diffstat (limited to 'test/ppmforge-parameters.test')
-rwxr-xr-xtest/ppmforge-parameters.test52
1 files changed, 11 insertions, 41 deletions
diff --git a/test/ppmforge-parameters.test b/test/ppmforge-parameters.test
index ba436bf0..0525e7af 100755
--- a/test/ppmforge-parameters.test
+++ b/test/ppmforge-parameters.test
@@ -5,61 +5,31 @@
 echo "Test 1: Should print 256 256"
 
 # Default size is 256 256
-ppmforge -night | pamfile -size
+ppmforge -night -seed=1 | pamfile -size
 
 echo "Test 2: Should print 40 30"
 
 # Width is adjusted if not even
 # becomes 40 in this case
-ppmforge -night -width=39 -height=30 | pamfile -size
+ppmforge -night -seed=1 -width=39 -height=30 | pamfile -size
 
 echo "Test 3: Should print 90 90"
 
 # Width is adjusted if smaller than height
 # brought up to 90 in this case
-ppmforge -night -width=80 -height=90 | pamfile -size
+ppmforge -night -seed=1 -width=80 -height=90 | pamfile -size
 
 echo "Test Invalid"
 
 tmpdir=${tmpdir:-/tmp}
 test_out=${tmpdir}/test_out
 
-echo 1>&2
-echo "Invalid command-line arguments." 1>&2
-echo "Error messages should appear below the line." 1>&2
-echo "-----------------------------------------------------------" 1>&2
+. ${srcdir}/test-invalid.inc
 
-ppmforge -night  -dimension=0  > ${test_out} || \
-  printf "Expected failure 1 "
-  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
-  rm -f ${test_out}
-
-ppmforge  -dimension=10  > ${test_out} || \
-  printf "Expected failure 2 "
-  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
-  rm -f ${test_out}
-
-ppmforge  -dimension=-1  > ${test_out} || \
-  printf "Expected failure 3 "
-  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
-  rm -f ${test_out}
-
-ppmforge -clouds -mesh=1.99    > ${test_out} || \
-  printf "Expected failure 4 "
-  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
-  rm -f ${test_out}
-
-ppmforge -clouds -power=0      > ${test_out} || \
-  printf "Expected failure 5 "
-  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
-  rm -f ${test_out}
-
-ppmforge         -ice=-1       > ${test_out} || \
-  printf "Expected failure 6 "
-  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
-  rm -f ${test_out}
-
-ppmforge         -glaciers=-1  > ${test_out} || \
-  printf "Expected failure 7 "
-  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
-  rm -f ${test_out}
+invCmd "ppmforge -seed=0 -night -dimension=0"
+invCmd "ppmforge -seed=0 -dimension=10"
+invCmd "ppmforge -seed=0 -dimension=-1"
+invCmd "ppmforge -seed=0 -clouds -mesh=1.99"
+invCmd "ppmforge -seed=0 -clouds -power=0"
+invCmd "ppmforge -seed=0 -ice=-1"
+invCmd "ppmforge -seed=0 -glaciers=-1"