|
Packit |
78deda |
#! /bin/bash
|
|
Packit |
78deda |
# This script tests: pnmtile
|
|
Packit |
78deda |
# Also requires: pnmcat
|
|
Packit |
78deda |
|
|
Packit |
78deda |
|
|
Packit |
78deda |
# Test 1. Should print 4228632379 259
|
|
Packit |
78deda |
pnmtile 40 50 testgrid.pbm | cksum
|
|
Packit |
78deda |
|
|
Packit |
78deda |
tmpdir=${tmpdir:-/tmp}
|
|
Packit |
78deda |
|
|
Packit |
78deda |
# Test 2. Compare 2x2 tile images produced by pnmtile and pnmcat
|
|
Packit |
78deda |
# Should print 0
|
|
Packit |
78deda |
testimg2_ppm=${tmpdir}/testimg2.ppm
|
|
Packit |
78deda |
testimg4_ppm=${tmpdir}/testimg4.ppm
|
|
Packit |
78deda |
|
|
Packit |
78deda |
pnmtile 454 298 testimg.ppm > ${testimg4_ppm} &&
|
|
Packit |
78deda |
pnmcat -lr testimg.ppm testimg.ppm > ${testimg2_ppm} &&
|
|
Packit |
78deda |
pnmcat -tb ${testimg2_ppm} ${testimg2_ppm} | \
|
|
Packit |
78deda |
cmp -s - ${testimg4_ppm}
|
|
Packit |
78deda |
echo $?
|
|
Packit |
78deda |
|
|
Packit |
78deda |
rm ${testimg2_ppm} ${testimg4_ppm}
|