diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2014-09-26 16:03:01 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2014-09-26 16:03:01 +0000 |
commit | 67e1689f9d7e6b8dfffe393f2d318e3e374c7a36 (patch) | |
tree | 5943a3e98e1f12ed80d92e2cb8c5623d8af9fcd3 /test/ps-roundtrip.test | |
parent | fd6e24ededb4ee1e92e101ea50fe21d88630c17f (diff) | |
download | netpbm-mirror-67e1689f9d7e6b8dfffe393f2d318e3e374c7a36.tar.gz netpbm-mirror-67e1689f9d7e6b8dfffe393f2d318e3e374c7a36.tar.xz netpbm-mirror-67e1689f9d7e6b8dfffe393f2d318e3e374c7a36.zip |
Promote current development as Release 10.68
git-svn-id: http://svn.code.sf.net/p/netpbm/code/advanced@2294 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'test/ps-roundtrip.test')
-rwxr-xr-x | test/ps-roundtrip.test | 53 |
1 files changed, 30 insertions, 23 deletions
diff --git a/test/ps-roundtrip.test b/test/ps-roundtrip.test index 1877724d..4773d4a6 100755 --- a/test/ps-roundtrip.test +++ b/test/ps-roundtrip.test @@ -16,46 +16,53 @@ ## (1) zlib was not linked. ## (2) ghostscript is not available. +tmpdir=${tmpdir:-/tmp} + # pstopnm does not use libnetpbm functions for output. # Output is filtered through pnmtopnm. # Test 1. Should print: 1926073387 101484 five times # *NOTE* Fifth iteration fails if pnmtops was compiled without zlib # (flate compression) support. +test1_ps=${tmpdir}/testimg1.ps + for flag in "" "-ps" "-rle" "-ps -ascii" "-ps -flate" do - pnmtops -nocenter -equalpixels -dpi 72 -noturn \ - ${flag} testimg.ppm \ - > ${tmpdir}/testimg.ps + pnmtops -nocenter -equalpixels -dpi 72 -noturn ${flag} testimg.ppm \ + > ${test1_ps} && \ xysize1=`awk '/BoundingBox/ {print "-xsize="$4,"-ysize="$5}' \ - ${tmpdir}/testimg.ps` - pstopnm -portrait -xborder=0 -yborder=0 $xysize1 -stdout \ - -quiet ${tmpdir}/testimg.ps | \ - pnmtopnm | cksum + ${test1_ps}` && \ + pstopnm -portrait -xborder=0 -yborder=0 $xysize1 -stdout -quiet \ + ${test1_ps} | pnmtopnm | cksum done - +rm ${test1_ps} # Test 2. Should print: 2918318199 62 seven times # Test image designed to detect problems with run-length compression # -pbmmake -g 2 2 > ${tmpdir}/g.pbm + +g_pbm=${tmpdir}/g.pbm +t_pbm=${tmpdir}/t.pbm +grid_ps=${tmpdir}/testgrid.ps + +pbmmake -g 2 2 > ${g_pbm} pbmmake -g 8 4 | \ pnmshear 45 -noantialias -background=black | \ pnmpad -right 60 | \ - pnmcat -tb -jright - ${tmpdir}/g.pbm > ${tmpdir}/t.pbm && + pnmcat -tb -jright - ${g_pbm} > ${t_pbm} && for flag in "" "-rle" "-ps -rle -ascii" \ "-bitspersample=2 -rle" "-ps -bitspersample=4 -rle" \ "-bitspersample=8 -rle" "-ps -bitspersample=12 -rle -dict" do - pnmtops -nocenter -equalpixels -dpi 72 -noturn \ - ${flag} ${tmpdir}/t.pbm > ${tmpdir}/testgrid.ps && + pnmtops -nocenter -equalpixels -dpi 72 -noturn ${flag} ${t_pbm} \ + > ${grid_ps} && \ xysize2=`awk '/BoundingBox/ {print "-xsize="$4,"-ysize="$5}' \ - ${tmpdir}/testgrid.ps` + ${grid_ps}` && \ pstopnm -portrait -xborder=0 -yborder=0 $xysize2 -stdout \ - -quiet ${tmpdir}/testgrid.ps -pbm | \ - pnmtopnm | cksum + -quiet ${grid_ps} -pbm | pnmtopnm | cksum done +rm ${grid_ps} ${g_pbm} ${t_pbm} #Test 3. Should print: 1386192571 507420 three times # *NOTE* Second iteration fails if pnmtops was compiled without zlib @@ -69,19 +76,19 @@ for flag in "" "-rle" "-ps -rle -ascii" \ # (3) pstopnm: input must be an ordinary file. Input from stdin # (by pipe or input redirection: "< file" ) does not work. # + +test3_ps=${tmpdir}/testimg3.ps + for flag in "" "-ps" \ "-ps -bitspersample=12 -flate -rle -vmreclaim" do cat testimg.ppm testimg.ppm testimg.ppm testgrid.pbm testgrid.pbm | \ -pnmtops -nocenter -equalpixels -dpi 72 -noturn -setpage \ - ${flag} > ${tmpdir}/testimg5.ps +pnmtops -nocenter -equalpixels -dpi 72 -noturn -setpage ${flag} \ + > ${test3_ps} && xysize3=`awk '/BoundingBox/ {print "-xsize="$4,"-ysize="$5 ; exit}' \ - ${tmpdir}/testimg5.ps` -pstopnm -portrait -xborder=0 -yborder=0 $xysize3 \ - -stdout ${tmpdir}/testimg5.ps | \ + ${test3_ps}` && +pstopnm -portrait -xborder=0 -yborder=0 $xysize3 -stdout ${test3_ps} | \ pnmtopnm | cksum done - -rm ${tmpdir}/testgrid.ps ${tmpdir}/testimg.ps ${tmpdir}/testimg5.ps \ - ${tmpdir}/t.pbm +rm ${test3_ps} |