#! /bin/sh
# This script tests: ppmbrighten
# 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

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 "Test Invalid"

. ./test-invalid.inc

invCmd "pambrighten -v -120 testimg.ppm"
invCmd "pambrighten -s -120 testimg.ppm"

