about summary refs log tree commit diff
path: root/test/atari-roundtrip.test
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2014-09-26 16:03:01 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2014-09-26 16:03:01 +0000
commit67e1689f9d7e6b8dfffe393f2d318e3e374c7a36 (patch)
tree5943a3e98e1f12ed80d92e2cb8c5623d8af9fcd3 /test/atari-roundtrip.test
parentfd6e24ededb4ee1e92e101ea50fe21d88630c17f (diff)
downloadnetpbm-mirror-67e1689f9d7e6b8dfffe393f2d318e3e374c7a36.tar.gz
netpbm-mirror-67e1689f9d7e6b8dfffe393f2d318e3e374c7a36.tar.xz
netpbm-mirror-67e1689f9d7e6b8dfffe393f2d318e3e374c7a36.zip
Promote current development as Release 10.68
git-svn-id: http://svn.code.sf.net/p/netpbm/code/advanced@2294 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'test/atari-roundtrip.test')
-rwxr-xr-xtest/atari-roundtrip.test40
1 files changed, 40 insertions, 0 deletions
diff --git a/test/atari-roundtrip.test b/test/atari-roundtrip.test
new file mode 100755
index 00000000..85929a8b
--- /dev/null
+++ b/test/atari-roundtrip.test
@@ -0,0 +1,40 @@
+# This script tests: ppmtopi1 pi1toppm ppmtoneo neotoppm
+# Also requires: pgmramp pamscale pbmmake rgb3toppm
+
+  alias ppmtopi1="${PBM_TESTPREFIX}ppmtopi1"
+  alias pi1toppm="${PBM_TESTPREFIX}pi1toppm"
+  alias ppmtoneo="${PBM_TESTPREFIX}ppmtoneo"
+  alias neotoppm="${PBM_TESTPREFIX}neotoppm"
+  alias pgmramp="${PBM_BINPREFIX}pgmramp"
+  alias pamscale="${PBM_BINPREFIX}pamscale"
+  alias pbmmake="${PBM_BINPREFIX}pbmmake"
+  alias rgb3toppm="${PBM_BINPREFIX}rgb3toppm"
+  shopt -s expand_aliases
+
+# Atari pi1 and neo files have the following characteristics:
+# Size: 320x200
+# Maxval: 7
+# Color palette: at most 16 entries
+
+tmpdir=${tmpdir:-/tmp}
+t_red=${tmpdir}/t.red
+t_grn=${tmpdir}/t.grn
+t_blu=${tmpdir}/t.blu
+t_ppm=${tmpdir}/t.ppm
+
+pgmramp -lr -maxval=3 4 1 | \
+  pamscale -xscale=80 -yscale=200 -nomix  > ${t_red}
+pbmmake -g 16 10 | pamenlarge 20  > ${t_grn}
+pbmmake -g  8  5 | pamenlarge 40  > ${t_blu}
+rgb3toppm ${t_red} ${t_grn} ${t_blu} | pamdepth 7 > ${t_ppm}
+
+#Test 0.  Should print: 3583332118 192013
+cksum < ${t_ppm}
+
+#Test 1.  Should print: 3583332118 192013
+ppmtopi1 ${t_ppm} | pi1toppm | cksum
+
+#Test 2.  Should print: 3583332118 192013
+ppmtoneo ${t_ppm} | neotoppm | cksum
+
+rm ${t_red} ${t_grn} ${t_blu} ${t_ppm}