diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2014-11-16 19:53:37 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2014-11-16 19:53:37 +0000 |
commit | 525bfc8c52ea88c15207de0f83941b3fc515c20b (patch) | |
tree | b7b0f226c88276fb49152bbe271180b74e9a50fb /test/pambackground.test | |
parent | 1a543185d9f1fcf85598eeeb3fd2325f81af3d7b (diff) | |
download | netpbm-mirror-525bfc8c52ea88c15207de0f83941b3fc515c20b.tar.gz netpbm-mirror-525bfc8c52ea88c15207de0f83941b3fc515c20b.tar.xz netpbm-mirror-525bfc8c52ea88c15207de0f83941b3fc515c20b.zip |
Add tests for Ppmchange, Pambackground miscellaneous other refinements
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@2314 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'test/pambackground.test')
-rwxr-xr-x | test/pambackground.test | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/test/pambackground.test b/test/pambackground.test new file mode 100755 index 00000000..58526fdd --- /dev/null +++ b/test/pambackground.test @@ -0,0 +1,42 @@ +#! /bin/bash +# This script tests: pambackground +# Also requires: pamgradient pamseq pbmmake pnmmargin pnmremap pnmtile + + alias pambackground="${PBM_TESTPREFIX}pambackground" + alias pamgradient="${PBM_BINPREFIX}pamgradient" + alias pamseq="${PBM_BINPREFIX}pamseq" + alias pbmmake="${PBM_BINPREFIX}pbmmake" + alias pnmmargin="${PBM_BINPREFIX}pnmmargin" + alias pnmremap="${PBM_BINPREFIX}pnmremap" + alias pnmtile="${PBM_BINPREFIX}pnmtile" + shopt -s expand_aliases + +tmpdir=${tmpdir:-/tmp} + +# Test 1. +# Should produce: 2155020792 451 +pbmmake -g 23 11 | pnmmargin -black 2 | pambackground | cksum + + +# Test 2. +# Should produce: 2514682516 33871 +ibmttl_pam=${tmpdir}/ibmttl.pam + +pamseq 3 1 > ${ibmttl_pam} && \ +pnmremap -quiet -mapfile ${ibmttl_pam} testimg.ppm | pambackground | cksum +rm ${ibmttl_pam} + + +# Test 3. +# Should produce: 2667595257 17328 +pamgradient rgb:01/01/01 rgb:ff/7f/00 rgb:00/ff/7f rgb:fe/fe/fe 10 10 | \ +pnmmargin -white 2 | pnmtile 144 120 | pambackground | cksum + + +# pamgradient rgb:01/01/01 rgb:ff/7f/00 rgb:00/ff/7f rgb:fe/fe/fe 10 10 | \ +# pnmmargin -white 2 | pnmtile 144 120 | cksum +# should produce: 3147800256 51855 +# Above input image is a "wall" with 12x10 "windows". + +# pnmremap -mapfile ${ibmttl_pam} testimg.ppm | cksum +# should produce : 452672747 101517 |