diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2017-06-05 15:37:27 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2017-06-05 15:37:27 +0000 |
commit | 86714524b4ff9ed0eec9807e046722a601c39cea (patch) | |
tree | 4b41c9bf707395265a017ad57df0b62f637884e6 /test | |
parent | 1d4814ce637f9d81b477ebc4c0c490e185f50c4e (diff) | |
download | netpbm-mirror-86714524b4ff9ed0eec9807e046722a601c39cea.tar.gz netpbm-mirror-86714524b4ff9ed0eec9807e046722a601c39cea.tar.xz netpbm-mirror-86714524b4ff9ed0eec9807e046722a601c39cea.zip |
Updates from Akira
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@2987 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'test')
-rw-r--r-- | test/Test-Order | 3 | ||||
-rw-r--r-- | test/all-in-place.ok | 1 | ||||
-rwxr-xr-x | test/all-in-place.test | 1 | ||||
-rw-r--r-- | test/g3-roundtrip.ok | 7 | ||||
-rwxr-xr-x | test/g3-roundtrip.test | 38 | ||||
-rw-r--r-- | test/pamgauss.ok (renamed from test/ppmgauss.ok) | 72 | ||||
-rwxr-xr-x | test/pamgauss.test (renamed from test/ppmgauss.test) | 2 | ||||
-rw-r--r-- | test/pamtable.ok | 66 | ||||
-rwxr-xr-x | test/pamtable.test | 20 | ||||
-rw-r--r-- | test/pbmtog3.ok | 1 | ||||
-rwxr-xr-x | test/pbmtog3.test | 10 | ||||
-rw-r--r-- | test/symmetry.ok | 6 | ||||
-rwxr-xr-x | test/symmetry.test | 8 |
13 files changed, 187 insertions, 48 deletions
diff --git a/test/Test-Order b/test/Test-Order index 767d7f76..d67c7f29 100644 --- a/test/Test-Order +++ b/test/Test-Order @@ -14,7 +14,7 @@ pbmpage.test pbmtext.test pbmupc.test pgmramp.test -ppmgauss.test +pamgauss.test ppmcie.test ppmwheel.test pamcrater.test @@ -30,6 +30,7 @@ ppmrough.test # Analyzer tests pamfile.test +pamtable.test pgmhist.test ppmhist.test pamsumm.test diff --git a/test/all-in-place.ok b/test/all-in-place.ok index 2fe1ed52..b9db6ee1 100644 --- a/test/all-in-place.ok +++ b/test/all-in-place.ok @@ -82,6 +82,7 @@ pamstretch: ok pamstretch-gen: ok pamsumm: ok pamsummcol: ok +pamtable: ok pamthreshold: ok pamtilt: ok pamtoavs: ok diff --git a/test/all-in-place.test b/test/all-in-place.test index 7c17efc7..52d38bcf 100755 --- a/test/all-in-place.test +++ b/test/all-in-place.test @@ -124,6 +124,7 @@ ordinary_testprogs="\ pamstretch-gen \ pamsumm \ pamsummcol \ + pamtable \ pamthreshold \ pamtilt \ pamtoavs \ diff --git a/test/g3-roundtrip.ok b/test/g3-roundtrip.ok index bb0b1cf6..4521d575 100644 --- a/test/g3-roundtrip.ok +++ b/test/g3-roundtrip.ok @@ -1,3 +1,10 @@ 0 0 0 +0 +0 +0 +0 +0 +0 +0 diff --git a/test/g3-roundtrip.test b/test/g3-roundtrip.test index 47e20e1d..baa6ac31 100755 --- a/test/g3-roundtrip.test +++ b/test/g3-roundtrip.test @@ -2,6 +2,10 @@ # This script tests: g3topbm pbmtog3 # Also requires: pnmcrop +tmpdir=${tmpdir:-/tmp} +complete256_pbm=${tmpdir}/complete256.pbm +widew_pbm=${tmpdir}/widew.pbm +wideb_pbm=${tmpdir}/wideb.pbm pbmtog3 -nofixedwidth testgrid.pbm | \ g3topbm -width=14 | cmp -s - testgrid.pbm @@ -14,3 +18,37 @@ echo $? 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} + +pbmtog3 -nofixedwidth ${complete256_pbm} | g3topbm -width=8 | tee /tmp/z1 | \ + cmp -s - ${complete256_pbm} ; echo $? + +pbmtog3 -reverse -nofixedwidth ${complete256_pbm} | \ +g3topbm -reversebits -width=8 | \ + cmp -s - ${complete256_pbm} ; echo $? + +pbmtog3 -align8 ${complete256_pbm} | \ +g3topbm -width=1728 | pnmcrop -white -right | \ + cmp -s - ${complete256_pbm} ; echo $? + +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 | \ + 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 | \ + cmp -s - ${wideb_pbm} ; echo $? + +rm ${complete256_pbm} ${wideb_pbm} ${widew_pbm} diff --git a/test/ppmgauss.ok b/test/pamgauss.ok index cf708d64..153d4f6e 100644 --- a/test/ppmgauss.ok +++ b/test/pamgauss.ok @@ -7,15 +7,15 @@ 171732531 55 448293386 55 3030522957 55 -757204806 62 -757204806 62 -2890088558 62 -4276668903 62 -1462902064 62 -4161772187 62 -2741154810 62 -417660035 62 -1026188683 62 +1912396937 62 +1912396937 62 +1912396937 62 +1912396937 62 +924437833 62 +2403224870 62 +1828243243 62 +3189486374 62 +3077695768 62 1236982144 71 1236982144 71 2668915323 71 @@ -25,15 +25,15 @@ 1741784255 71 2975827721 71 185899480 71 -1890880170 82 -1890880170 82 -2007282168 82 -2290578407 82 -3295586348 82 -3202728672 82 -3794283497 82 -1136760947 82 -2659761303 82 +685596179 82 +685596179 82 +685596179 82 +685596179 82 +3959781759 82 +3753883586 82 +3706474367 82 +2091709635 82 +651233877 82 3268058875 95 3268058875 95 4112134785 95 @@ -43,15 +43,15 @@ 3042873446 95 299128630 95 1852505233 95 -3614879265 110 -3614879265 110 -3727088180 110 -3861671574 110 -952180714 110 -1393452065 110 -1551903756 110 -2198775655 110 -3231547603 110 +2257309933 110 +2257309933 110 +2257309933 110 +2257309933 110 +3861656488 110 +130820705 110 +1706835660 110 +4285051006 110 +285426992 110 3184597171 127 3184597171 127 406519147 127 @@ -61,15 +61,15 @@ 1852779549 127 1734420920 127 2400421918 127 -3252995941 148 -3252995941 148 -2022176119 148 -473753498 148 -3178129210 148 -2278608777 148 -3169785704 148 -85136480 148 -2396646133 148 +3247957822 148 +3247957822 148 +3247957822 148 +3247957822 148 +3407897457 148 +1176192530 148 +3551192353 148 +557209968 148 +2437783856 148 1871459418 169 1871459418 169 639002491 169 diff --git a/test/ppmgauss.test b/test/pamgauss.test index 213810c7..b48517c4 100755 --- a/test/ppmgauss.test +++ b/test/pamgauss.test @@ -7,6 +7,6 @@ for i in `seq 3 11` do for s in `seq 1 9` do -pamgauss $i $i -sigma=.$s | cksum +pamgauss $i $i -oversample=1 -sigma=.$s | cksum done done diff --git a/test/pamtable.ok b/test/pamtable.ok new file mode 100644 index 00000000..c8db6002 --- /dev/null +++ b/test/pamtable.ok @@ -0,0 +1,66 @@ +0 1 0 1 0 1 0 1 0 1 0 1 0 1 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 1 0 1 0 1 0 1 0 1 0 1 0 1 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 1 0 1 0 1 0 1 0 1 0 1 0 1 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 1 0 1 0 1 0 1 0 1 0 1 0 1 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 1 0 1 0 1 0 1 0 1 0 1 0 1 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 1 0 1 0 1 0 1 0 1 0 1 0 1 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 1 0 1 0 1 0 1 0 1 0 1 0 1 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 1 0 1 0 1 0 1 0 1 0 1 0 1 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 + +0 0 0|0 0 1|0 0 2|0 1 0|0 1 1|0 1 2|0 2 0|0 2 1|0 2 2|1 0 0|1 0 1|1 0 2|1 1 0|1 1 1|1 1 2|1 2 0|1 2 1|1 2 2|2 0 0|2 0 1|2 0 2|2 1 0|2 1 1|2 1 2|2 2 0|2 2 1|2 2 2 + +0 0 0 0|0 0 0 1|0 0 1 0|0 0 1 1|0 1 0 0|0 1 0 1|0 1 1 0|0 1 1 1|1 0 0 0|1 0 0 1|1 0 1 0|1 0 1 1|1 1 0 0|1 1 0 1|1 1 1 0|1 1 1 1 + +9 0 +0 9 + +0 0 0|4 4 4|9 9 9 +0 0 0|4 4 4|9 9 9 + +9 0 0|0 0 9|0 0 9|0 9 0 +9 0 0|0 0 9|0 0 9|0 9 0 + +10 0 + 0 10 + + 0 0 0| 5 5 5|10 10 10 + 0 0 0| 5 5 5|10 10 10 + +10 0 0| 0 0 10| 0 0 10| 0 10 0 +10 0 0| 0 0 10| 0 0 10| 0 10 0 + +9999 0 + 0 9999 + + 0 0 0|4980 4980 4980|9999 9999 9999 + 0 0 0|4980 4980 4980|9999 9999 9999 + +9999 0 0| 0 0 9999| 0 0 9999| 0 9999 0 +9999 0 0| 0 0 9999| 0 0 9999| 0 9999 0 + +10000 0 + 0 10000 + + 0 0 0| 4980 4980 4980|10000 10000 10000 + 0 0 0| 4980 4980 4980|10000 10000 10000 + +10000 0 0| 0 0 10000| 0 0 10000| 0 10000 0 +10000 0 0| 0 0 10000| 0 0 10000| 0 10000 0 + +65535 0 + 0 65535 + + 0 0 0|32639 32639 32639|65535 65535 65535 + 0 0 0|32639 32639 32639|65535 65535 65535 + +65535 0 0| 0 0 65535| 0 0 65535| 0 65535 0 +65535 0 0| 0 0 65535| 0 0 65535| 0 65535 0 + diff --git a/test/pamtable.test b/test/pamtable.test new file mode 100755 index 00000000..5c66b7ae --- /dev/null +++ b/test/pamtable.test @@ -0,0 +1,20 @@ +#! /bin/bash +# This script tests: pamtable +# Also requires: pamgradient pamseq pamdepth + +pamtable testgrid.pbm +echo +pamseq 3 2 -tupletype=RGB | pamtable +echo +pamseq 4 1 -tupletype=RGBA | pamtable +echo +for maxval in 9 10 9999 10000 65535 + do pbmmake -g 2 2 | pamdepth $maxval | pamtable + echo + ppmrainbow -width=3 -height=2 -norepeat black white | \ + pamdepth $maxval | pamtable + echo + ppmrainbow -width=4 -height=2 -norepeat red blue green | \ + pamdepth $maxval | pamtable + echo + done diff --git a/test/pbmtog3.ok b/test/pbmtog3.ok index a0768f95..cef9e3f9 100644 --- a/test/pbmtog3.ok +++ b/test/pbmtog3.ok @@ -5,7 +5,6 @@ 28792587 47 277456854 32 28792587 47 -871281767 162 3736247115 62 2820255307 2191856 4159089282 2226575 diff --git a/test/pbmtog3.test b/test/pbmtog3.test index 15c0cdf9..c5dc3357 100755 --- a/test/pbmtog3.test +++ b/test/pbmtog3.test @@ -2,7 +2,6 @@ # This script tests: pbmtog3 # Also requires: pbmmake - # Test 1. Should print 3697098186 144 pbmtog3 testgrid.pbm | cksum # Test 2. Should print 1248301383 122 @@ -18,12 +17,9 @@ pbmmake -w 10 10 | \ pbmtog3 -nofixedwidth | cksum # Test 7. Should print 28792587 47 pbmmake -w 10000 10 | pbmtog3 | cksum -# Test 8. Should print 871281767 162 -pbmmake -w 10000 10 | \ - pbmtog3 -nofixedwidth | cksum -# Test 9. Should print 3736247115 62 +# Test 8. Should print 3736247115 62 pbmmake -b 10 10 | pbmtog3 | cksum -# Test 10. Should print 2820255307 2191856 +# Test 9. Should print 2820255307 2191856 pbmmake -g 1700 2286 | pbmtog3 | cksum -# Test 11. Should print 4159089282 2226575 +# Test 10. Should print 4159089282 2226575 pbmmake -g 1800 2286 | pbmtog3 | cksum diff --git a/test/symmetry.ok b/test/symmetry.ok index 23129684..a5945014 100644 --- a/test/symmetry.ok +++ b/test/symmetry.ok @@ -10,3 +10,9 @@ ok ok ok ok +ok +ok +ok +ok +ok +ok diff --git a/test/symmetry.test b/test/symmetry.test index e6a6b654..52ba6388 100755 --- a/test/symmetry.test +++ b/test/symmetry.test @@ -48,9 +48,11 @@ pgmramp -ell 63 63 > ${circle_pgm} rm ${circle_pgm} -# Test 3. +# Test 3. Should print "ok" 7 times gauss_pgm=${tmpdir}/gauss.pgm -pamgauss -sigma=0.1 -tupletype=GRAYSCALE 25 25 > ${gauss_pgm} +for size in 3 4 5 8 13 21 25 +do +pamgauss -sigma=0.1 -tupletype=GRAYSCALE $size $size > ${gauss_pgm} ( for op in -null -tb -lr -r90 do pamflip $op ${gauss_pgm} | cksum @@ -58,6 +60,8 @@ pamgauss -sigma=0.1 -tupletype=GRAYSCALE 25 25 > ${gauss_pgm} awk '$1==4 && $3>0 { print "ok"; exit }; { print }' rm ${gauss_pgm} +done + # Test 4. kernel_pgm=${tmpdir}/kernel.pgm |