diff options
-rw-r--r-- | test/g3-roundtrip.ok | 3 | ||||
-rwxr-xr-x | test/g3-roundtrip.test | 25 |
2 files changed, 19 insertions, 9 deletions
diff --git a/test/g3-roundtrip.ok b/test/g3-roundtrip.ok index 4521d575..853d06d2 100644 --- a/test/g3-roundtrip.ok +++ b/test/g3-roundtrip.ok @@ -8,3 +8,6 @@ 0 0 0 +1777627284 265 +2985378006 3135 +3651878552 3135 diff --git a/test/g3-roundtrip.test b/test/g3-roundtrip.test index baa6ac31..10174733 100755 --- a/test/g3-roundtrip.test +++ b/test/g3-roundtrip.test @@ -19,12 +19,15 @@ pbmtog3 testgrid.pbm | \ g3topbm | pnmcrop -white -right -bottom | \ cmp -s - testgrid.pbm ; echo $? -awk 'BEGIN { print "P4"; # header - print "8 256"; - for (i=0;i<256;++i) # raster - printf("%c",i) }' > ${complete256_pbm} +# works with gawk and mawk +# produce all possible 8-bit patterns -pbmtog3 -nofixedwidth ${complete256_pbm} | g3topbm -width=8 | tee /tmp/z1 | \ +LC_ALL=C awk 'BEGIN { print "P4"; # header + print "8 256"; + for (i=0;i<256;++i) # raster + printf("%c",i) }' > ${complete256_pbm} + +pbmtog3 -nofixedwidth ${complete256_pbm} | g3topbm -width=8 | \ cmp -s - ${complete256_pbm} ; echo $? pbmtog3 -reverse -nofixedwidth ${complete256_pbm} | \ @@ -39,16 +42,20 @@ pbmtog3 -align16 ${complete256_pbm} | \ g3topbm -width=1728 | pnmcrop -white -right | \ cmp -s - ${complete256_pbm} ; echo $? -pbmmake -w 5000 5 | tee ${widew_pbm} | pbmtog3 -nofixedwidth | \ -g3topbm | \ +pbmmake -w 5000 5 > ${widew_pbm} +pbmtog3 -nofixedwidth ${widew_pbm} | g3topbm | \ cmp -s - ${widew_pbm} ; echo $? pbmtog3 -nofixedwidth ${widew_pbm} | \ g3topbm -width=5000 | \ cmp -s - ${widew_pbm} ; echo $? -pbmmake -b 5000 5 | tee ${wideb_pbm} | pbmtog3 -nofixedwidth | \ -g3topbm | \ +pbmmake -b 5000 5 > ${wideb_pbm} +pbmtog3 -nofixedwidth ${wideb_pbm} | g3topbm | \ cmp -s - ${wideb_pbm} ; echo $? +cat ${complete256_pbm} | cksum +cat ${wideb_pbm} | cksum +cat ${widew_pbm} | cksum + rm ${complete256_pbm} ${wideb_pbm} ${widew_pbm} |