1
# we need tests with index shuffling once vaffines are fixed
6
print "not " unless $result ;
11
my($a,$b,$mdiff) = @_;
12
$mdiff = 0.01 unless defined($mdiff);
20
my $pdl = rpic($file);
30
$ENV{PATH} .= ":$ENV{HOME}/perl/netpbm/bin" if `hostname` =~ /mbcsg1/;
33
$iform = 'PNMRAW'; # change to PNMASCII to use ASCII PNM intermediate
36
# [FORMAT, extension, ushort-divisor,
37
# only RGB/no RGB/any (1/-1/0), mxdiff]
38
# no test of PCX format because seems to be severely brain damaged
39
@formats = (['PNM','pnm',1,0,0.01],['GIF','gif',256,0,1.01],
40
['TIFF','tif',1,0,0.01],['Sun Raster','rast',256,0,0.01],
41
['IFF','iff',256,1,0.01],['SGI','rgb',1,1,0.01]);
43
$ntests = 2 * @formats;
44
print("1..$ntests\n");
46
$im1 = ushort pdl [[[0,0,0],[256,65535,256],[0,0,0]],
47
[[256,256,256],[256,256,256],[256,256,256]],
48
[[2560,65535,2560],[256,2560,2560],[65535,65534,65535]]];
49
$im2 = byte ($im1/256);
57
foreach $form (@formats) {
58
print " ** testing $form->[0] format **\n";
60
wpic ($im1,"tushort.$form->[1]",{IFORM => $iform});
61
wpic ($im2,"tbyte.$form->[1]",{IFORM => $iform});
63
$in1 = rpic_unlink("tushort.$form->[1]");
64
$in2 = rpic_unlink("tbyte.$form->[1]");
66
$comp = $im1 / $form->[2];
67
ok($n++,approx($comp,$in1,$form->[4]));
68
ok($n++,approx($im2,$in2));