From ccfc548cc8507b16397f674cbb0a8911781e27b4 Mon Sep 17 00:00:00 2001 From: giraffedata Date: Wed, 12 Dec 2012 03:43:47 +0000 Subject: various changes to test facility git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@1806 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- test/ppmcie.test | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) (limited to 'test/ppmcie.test') diff --git a/test/ppmcie.test b/test/ppmcie.test index cd84536a..1e60c848 100755 --- a/test/ppmcie.test +++ b/test/ppmcie.test @@ -1,6 +1,6 @@ #! /bin/bash # This script tests: ppmcie -# Also requires: +# Also requires: pamsumm pamsharpness # Test 1. Should print 955840041 786447 # Without -nolabel -noaxes -nowpoint -noblack older versions of @@ -8,13 +8,35 @@ # Output from "ppmcie | cksum" : # v. 10.35.86: 288356530 786447 # v. 10.59.2 : 2292601420 786447 -# -# This test fails when ppmcie is compiled with SSE features are turned on. + +${PBM_TESTPREFIX}ppmcie -nolabel -noaxes -nowpoint -noblack \ + > ${tmpdir}/ppmcie.ppm + +# There is a slight difference in the output depending on whether ppmcie +# is compiled with SSE features are turned on or off. # Note that Gcc turns on SSE,SSE2 on by default for x86-64. +# Output from "cksum ppmcie.ppm": # v. 10.59.2 # x86 32 bit: 955840041 786447 # x86 64 bit: 4208660683 786447 -${PBM_TESTPREFIX}ppmcie -nolabel -noaxes -nowpoint -noblack | cksum +# Test 1. Measure mean value +# v. 10.59.2 +# x86 32 bit: 38.660173 +# x86 64 bit: 38.681432 + +${PBM_BINPREFIX}pamsumm --mean --brief ${tmpdir}/ppmcie.ppm | \ + awk '{ if(38.65 < $1 && $1 <38.69) print "ok"; else print $1}' + +# Test 2. Measure image sharpness +# v. 10.59.2 +# x86 32 bit: 0.002476 +# x86 64 bit: 0.002478 + +${PBM_BINPREFIX}pamsharpness ${tmpdir}/ppmcie.ppm 2>&1 | \ + awk 'NF==4 && $2=="Sharpness" \ + {if (0.002475 < $4 && $4 < 0.002479) print "ok"; else print $4} + NF>0 && NF!=4 {print "error"}' +rm ${tmpdir}/ppmcie.ppm -- cgit 1.4.1