about summary refs log tree commit diff
path: root/test/xwd-roundtrip.test
blob: b5614f010b370adf308cc2fa5e97d432d920ec11 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#! /bin/bash
# This script tests: pnmtoxwd xwdtopnm
# Also requires: pamdepth ppmtopgm

  alias pnmtoxwd="${PBM_TESTPREFIX}pnmtoxwd"
  alias xwdtopnm="${PBM_TESTPREFIX}xwdtopnm"
  alias pamdepth="${PBM_BINPREFIX}pamdepth"
  alias ppmtopgm="${PBM_BINPREFIX}ppmtopgm"
  shopt -s expand_aliases

# Test 1.  Should produce 2871603838 33838
# which is the output of ppmtopgm testimg.ppm | cksum
ppmtopgm testimg.ppm | pnmtoxwd  | \
  xwdtopnm | pamdepth 255 | cksum

# Test 2.  Should produce 1926073387 101484
pnmtoxwd --quiet  testimg.ppm | \
  xwdtopnm --quiet | pamdepth 255 | cksum

# Test 3.  Should produce 2425386270 41
pnmtoxwd --quiet  testgrid.pbm | \
  xwdtopnm | cksum