From 32dadb586a7e389046e85b06504c2246ddb4fb58 Mon Sep 17 00:00:00 2001 From: giraffedata Date: Sat, 28 Sep 2024 17:00:46 +0000 Subject: new tests for facesaver and pgmtofs and fstopgm git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@4948 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- test/facesaver-roundtrip.ok | 19 +++++++++++++ test/facesaver-roundtrip.test | 65 ++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 80 insertions(+), 4 deletions(-) (limited to 'test') diff --git a/test/facesaver-roundtrip.ok b/test/facesaver-roundtrip.ok index 430f3f5f..62112240 100644 --- a/test/facesaver-roundtrip.ok +++ b/test/facesaver-roundtrip.ok @@ -1 +1,20 @@ +Test 1. Should produce 1571496937 33838 1571496937 33838 +Test 2. Should produce 2582999797 3376 +2582999797 3376 +Test 3. Should produce 493599905 16 +493599905 16 +Test 4.1. Should produce 3735757243 10 +3735757243 10 +Test 4.2. Should produce 1655769442 10 +1655769442 10 +Test 4.3. Should produce 3428680891 10 +3428680891 10 +Test 4.4. Should produce 1663150238 11 +1663150238 11 +Test invalid +Expected failure 1 (no output) +Expected failure 2 (no output) +Expected failure 3 (no output) +Expected failure 4 (no output) +Expected failure 5 (no output) diff --git a/test/facesaver-roundtrip.test b/test/facesaver-roundtrip.test index 75fcf662..4c710e06 100755 --- a/test/facesaver-roundtrip.test +++ b/test/facesaver-roundtrip.test @@ -1,9 +1,66 @@ #! /bin/sh # This script tests: pgmtofs fstopgm -# Also requires: pamchannel pamtopnm +# Also requires: pamchannel pamtopnm pgmramp pgmmake +echo "Test 1. Should produce 1571496937 33838" +# cksum of testimg.red -# Should produce 1571496937 33838, cksum of testimg.red +pamchannel -infile=testimg.ppm -tupletype="GRAYSCALE" 0 |\ + pamtopnm | pgmtofs | fstopgm | cksum + +echo "Test 2. Should produce 2582999797 3376" +# pamdepth 255 maze.pbm | cksum + +pgmtofs maze.pbm | fstopgm | cksum + +echo "Test 3. Should produce 493599905 16" +# pgmramp -lr 5 1 | cksum + +pgmramp -lr 5 1 | pgmtofs | fstopgm | cksum + +tmpdir=${tmpdir:-/tmp} +test1_pgm=${tmpdir}/test1.pgm +test3_pgm=${tmpdir}/test3.pgm +test7_pgm=${tmpdir}/test7.pgm +test15_pgm=${tmpdir}/test15.pgm + +echo "Test 4.1. Should produce 3735757243 10" +pgmmake -maxval=1 0.1 1 1 | tee ${test1_pgm} | cksum + +echo "Test 4.2. Should produce 1655769442 10" +pgmmake -maxval=3 0.1 1 1 | tee ${test3_pgm} | cksum + +echo "Test 4.3. Should produce 3428680891 10" +pgmmake -maxval=7 0.1 1 1 | tee ${test7_pgm} | cksum + +echo "Test 4.4. Should produce 1663150238 11" +pgmmake -maxval=15 0.1 1 1 | tee ${test15_pgm} | cksum + + +echo "Test invalid" + +. ./test-invalid.inc + +test256_pgm=${tmpdir}/test256.pgm +test_fs=${tmpdir}/test.fs + +pgmmake -maxval=256 0.1 1 1 > ${test256_pgm} +invCmd "pgmtofs ${test256_pgm}" +rm ${test256_pgm} + +pgmtofs ${test1_pgm} > ${test_fs} +invCmd "fstopgm ${test_fs}" +rm ${test1_pgm} ${test_fs} + +pgmtofs ${test3_pgm} > ${test_fs} +invCmd "fstopgm ${test_fs}" +rm ${test3_pgm} ${test_fs} + +pgmtofs ${test7_pgm} > ${test_fs} +invCmd "fstopgm ${test_fs}" +rm ${test7_pgm} ${test_fs} + +pgmtofs ${test15_pgm} > ${test_fs} +invCmd "fstopgm ${test_fs}" +rm ${test15_pgm} ${test_fs} -pamchannel -infile=testimg.ppm -tupletype="GRAYSCALE" 0 | pamtopnm | \ - pgmtofs | fstopgm | cksum -- cgit 1.4.1