#! /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
