about summary refs log tree commit diff
path: root/test/winicon-roundtrip.test
blob: b4814feeebf480d224bd938bfcaf4d92b614c3ab (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#! /bin/bash
# This script tests: pamtowinicon ppmtowinicon winicontopam
# Also requires: pamchannel pamcut pamdepth pamtopam

tmpdir=${tmpdir:-/tmp}
test_pam=${tmpdir}/testimg.pam

echo "Test 1. Should print 4241318573 6973 four times"

pamcut --left=30 --width=48 --height=48 testimg.ppm | pamtopam | \
  tee ${test_pam} | cksum
pamtowinicon ${test_pam} | winicontopam | \
  pamchannel -tupletype="RGB" 0 1 2 | cksum
pamtowinicon -pngthreshold=300 ${test_pam} | winicontopam | \
  pamchannel -tupletype="RGB" 0 1 2 | cksum
pamtowinicon -pngthreshold=1   ${test_pam} | winicontopam | \
  pamchannel -tupletype="RGB" 0 1 2 | cksum

rm ${test_pam}

echo "Test 1. Should print 1009647580 1093 six times"

pamcut -top=0 -left=0 -width=32 -height=32 maze.pbm | pamtopam | \
  tee ${test_pam} | cksum
pamtowinicon ${test_pam} | winicontopam | \
  pamdepth 1 | pamchannel -tupletype="BLACKANDWHITE" 0 | cksum
pamtowinicon -pngthreshold=300 ${test_pam} | winicontopam | \
  pamdepth 1 | pamchannel -tupletype="BLACKANDWHITE" 0 | cksum
pamtowinicon -pngthreshold=1   ${test_pam} | winicontopam | 
  pamdepth 1 | pamchannel -tupletype="BLACKANDWHITE" 0 | cksum
pamtowinicon -pngthreshold=1   ${test_pam} | winicontopam | 
  pamchannel -tupletype="BLACKANDWHITE" 0 | cksum

rm ${test_pam}

pamcut -top=0 -left=0 -width=32 -height=32 maze.pbm | \
  ppmtowinicon | winicontopam | \
  pamdepth 1 | pamchannel -tupletype="BLACKANDWHITE" 0 | cksum