about summary refs log tree commit diff
path: root/test/gif-roundtrip.test
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2012-11-24 19:18:45 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2012-11-24 19:18:45 +0000
commit4296fe52a37736b7533b3bf447b29ad7933a3ab4 (patch)
tree87644c5b7e46fb333bcde7903f8dcf0de4964d3d /test/gif-roundtrip.test
parentb3f62ef1f3fb72b5674c4481dd25148fbe51850b (diff)
downloadnetpbm-mirror-4296fe52a37736b7533b3bf447b29ad7933a3ab4.tar.gz
netpbm-mirror-4296fe52a37736b7533b3bf447b29ad7933a3ab4.tar.xz
netpbm-mirror-4296fe52a37736b7533b3bf447b29ad7933a3ab4.zip
New test framework, lots of tests
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@1775 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'test/gif-roundtrip.test')
-rwxr-xr-xtest/gif-roundtrip.test30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/gif-roundtrip.test b/test/gif-roundtrip.test
new file mode 100755
index 00000000..73246705
--- /dev/null
+++ b/test/gif-roundtrip.test
@@ -0,0 +1,30 @@
+#! /bin/bash
+# This script tests: giftopnm pamtogif
+# Also requires: ppmtopgm ppmtorgb3 rgb3toppm
+
+# Test 1. Should produce 2871603838 33838
+# which is the result of ppmtopgm testimg.ppm | cksum
+
+${PBM_BINPREFIX}ppmtopgm testimg.ppm | \
+  ${PBM_TESTPREFIX}pamtogif | ${PBM_TESTPREFIX}giftopnm | cksum
+
+# Test 2. Break up input image into three monochrome planes,
+# maxval 255.  Transform each plane to gif and back to pgm.
+# Reassemble the planes.  Result should be identical to input.
+# Should print 1926073387 101484
+
+cp testimg.ppm ${tmpdir} &&
+${PBM_BINPREFIX}ppmtorgb3 ${tmpdir}/testimg.ppm &&
+${PBM_TESTPREFIX}pamtogif ${tmpdir}/testimg.red | \
+  ${PBM_TESTPREFIX}giftopnm > ${tmpdir}/out.red &&
+${PBM_TESTPREFIX}pamtogif ${tmpdir}/testimg.grn |
+  ${PBM_TESTPREFIX}giftopnm > ${tmpdir}/out.grn &&
+${PBM_TESTPREFIX}pamtogif ${tmpdir}/testimg.blu | \
+  ${PBM_TESTPREFIX}giftopnm | \
+  ${PBM_BINPREFIX}rgb3toppm ${tmpdir}/testimg.red ${tmpdir}/testimg.grn - | \
+  cksum
+
+rm ${tmpdir}/testimg.{ppm,red,grn,blu} ${tmpdir}/out.{red,grn}
+
+# Test 3. Should produce 2425386270 41
+${PBM_TESTPREFIX}pamtogif testgrid.pbm | ${PBM_TESTPREFIX}giftopnm | cksum