about summary refs log tree commit diff
path: root/test/macp-roundtrip.test
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2021-12-27 17:33:56 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2021-12-27 17:33:56 +0000
commit6e629f983aa205c3eaa5f339f1c71bb5e7938049 (patch)
treea89f594443ac2330138f0bd0f19ee59135c2213f /test/macp-roundtrip.test
parentec52f41aabc9de9aac203c2f462252e403c7374a (diff)
downloadnetpbm-mirror-6e629f983aa205c3eaa5f339f1c71bb5e7938049.tar.gz
netpbm-mirror-6e629f983aa205c3eaa5f339f1c71bb5e7938049.tar.xz
netpbm-mirror-6e629f983aa205c3eaa5f339f1c71bb5e7938049.zip
Promote Development to Advanced to make Release 10.97.00
git-svn-id: http://svn.code.sf.net/p/netpbm/code/advanced@4222 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'test/macp-roundtrip.test')
-rwxr-xr-xtest/macp-roundtrip.test44
1 files changed, 32 insertions, 12 deletions
diff --git a/test/macp-roundtrip.test b/test/macp-roundtrip.test
index 4774a2c2..b264e3d1 100755
--- a/test/macp-roundtrip.test
+++ b/test/macp-roundtrip.test
@@ -1,31 +1,51 @@
 #! /bin/bash
 # This script tests: pbmtomacp macptopbm
-# Also requires: pnmcrop pbmpage pbmupc pnmpad
+# Also requires: pnmcrop pbmpage pbmupc pnmpad pbmmake
 
 tmpdir=${tmpdir:-/tmp}
-temp1_pbm=${tmpdir}/temp1.ppm
-temp2_pbm=${tmpdir}/temp2.ppm
+temp1_pbm=${tmpdir}/temp1.pbm
+temp2_pbm=${tmpdir}/temp2.pbm
+tempupc_pbm=${tmpdir}/tempupc.pbm
+temp3_pbm=${tmpdir}/temp3.pbm
+temp3_macp=${tmpdir}/temp3.macp
 
-
-# Test 1. Should produce 2425386270 41 twice
-# Because Macpaint files are fixed size (576 x 720 pixels)
+# Macpaint files are fixed size (576 x 720 pixels)
 # pbmtomacp automatically adds padding when input is smaller.
 
-pbmtomacp testgrid.pbm | macptopbm | tee ${temp1_pbm} | \
+echo "Test 1. Should produce 281226646 481 twice"
+pbmtomacp maze.pbm | macptopbm | tee ${temp1_pbm} | \
     pnmcrop | cksum
 
 pbmtomacp ${temp1_pbm} | macptopbm | pnmcrop | cksum
 
+rm ${temp1_pbm}
 
-#Test 2. Should produce 2329957971 51851
+echo "Test 2. Should produce 2329957971 51851"
 pbmpage 1 | pbmtomacp | macptopbm | cksum
 
-
-#Test 3. Should produce 2907103393 5086 twice
-pbmupc 0 12345 67890 | pnmpad -black -t 44 -b 20 -l 100 -r 251 | pbmtomacp | macptopbm | \
+echo "Test 3. Should produce 2907103393 5086 three times"
+pbmupc 0 12345 67890 | tee ${tempupc_pbm} | \
+    pnmpad -black -t 44 -b 20 -l 100 -r 251 | \
+    pbmtomacp | macptopbm | \
     tee ${temp2_pbm} | \
     pnmcrop | pnmcrop | cksum
 
+pnmpad -black -t 44 -l 100 ${tempupc_pbm} | \
+    pbmtomacp|  macptopbm | pnmcrop -white | pnmcrop | cksum
+
 pbmtomacp ${temp2_pbm} | macptopbm | pnmcrop | pnmcrop | cksum
 
-rm ${temp1_pbm} ${temp2_pbm}
+rm ${temp2_pbm} ${tempupc_pbm}
+
+
+echo "Test 4. Should produce 3432623660 51851 four times"
+pbmmake -b 576 720 | tee ${temp3_pbm} | cksum
+
+pbmtomacp ${temp3_pbm} | tee ${temp3_macp} | macptopbm | cksum
+
+pbmtomacp -norle ${temp3_pbm} | macptopbm | cksum
+
+( head -c 128 /dev/zero ; cat ${temp3_macp} ) | \
+    macptopbm -extraskip 128 | cksum
+
+rm ${temp3_pbm} ${temp3_macp}