about summary refs log tree commit diff
path: root/test/pgmnoise.test
blob: a5c1c38060344cb7e70a6092700c2ce4378aeb75 (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
#! /bin/bash
# This script tests: pgmnoise
# Also requires: 

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

# We first check whether random number generator is glibc rand().
# If not, this test is skipped.

testrandom

case $? in
   81)
        # Should print: 1663614689 10015
        pgmnoise --randomseed=0 100 100 | cksum ;;

        # Any additional tests go here.

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

   *)   exit 1;;  # testrandom failed
esac