about summary refs log tree commit diff
path: root/test/pgmcrater.test
blob: ffba435f7c9e1dac8378f122e1972b31aabdfb46 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#! /bin/bash
# This script tests: pgmcrater

  alias pgmcrater="${PBM_TESTPREFIX}pgmcrater"
  shopt -s expand_aliases

# This test is sensitive to differences in floating point math.
# With GCC slight results start to appear with -number 75 in
# the following test.  Compiler type (GCC, Clang, etc.),
# SSE math (by default off with x86 32 bit on with x86 64 bit)
# and --ffast-math are factors.

# We hope that by keeping the number of craters small the
# difference will not show up.
#
# The slight differences in the image file are not discernable by
# the naked eye.

testrandom -q
case $? in
   81)
      # Should print: 3828822912 65551
      pgmcrater -quiet -number 25 -randomseed 1 | cksum
      ;;

   8[02-9] | 90)
       echo "Skipping: random number generator is not glibc." 1>&2
       exit 80;;

   *)  exit 1;;  # testrandom failed
esac