about summary refs log tree commit diff
path: root/test/mda-roundtrip.test
blob: c47d433e6837907f213ed9270cd3f74c54d03745 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#! /bin/sh
# This script tests: pbmtomda mdatopbm
# Also requires: pbmmake pnmpad pamcut pamfile


# Pbmtomda requires input width and height to be multiples of 8.

echo "Test 1.  Should print 1757803444 169 twice"
pbmmake -g 32 40 | cksum
pbmmake -g 32 40 | pbmtomda | mdatopbm | cksum

echo "Test 2.  Should print 281226646 481"
size=$(pamfile -size maze.pbm | awk '{print "-width="$1,"-height="$2}')
pnmpad -mwidth=8 -halign=0 -mheight=8 -valign=0 ${size} maze.pbm | \
    pbmtomda | mdatopbm | pamcut -left=0 -top=0 ${size} | cksum