Debian Codegraph @

t/t12.t

raw symbols ◀ ▶ SCIP
1 Debian patch touch this file
1 use strict; use warnings;
2 use Test::More;
3 use Config;
4 # Stop f77-linking causing spurious undefined symbols (alpha)
5 $ENV{'PERL_DL_NONLAZY'}=0 if $Config{'osname'} eq "dec_osf";
6 require PGPLOT;
7
8 my $dev = $ENV{PGPLOT_DEV} || '/NULL';
9
10 $ENV{PGPLOT_XW_WIDTH}=0.3;
11
12 note "Testing some new PGPLOT 5.2.0 routines";
13
14 PGPLOT::pgqinf("VERSION", my $val, my $len);
15 # Accept real PGPLOT >= 5.2.0, or giza >= 1.3 (pgaxis/pgtick added in 1.3.1);
16 # giza reports a version string like "giza-1.5.0" which is not numeric.
17 my $new_enough;
18 if ($val =~ /^giza-?v?(\d+)\.(\d+)/i) {
19 $new_enough = ($1 > 1 || ($1 == 1 && $2 >= 3));
20 } else {
21 (my $numver = $val) =~ s/\.//g; $numver =~ s/v//;
22 $new_enough = ($numver =~ /^\d+$/ && $numver >= 520);
23 }
24
25 # Read in image (int*2)
26
27 my $img="";
28 open(my $fh,"test.img") || die "Data file test.img not found";
29 if($^O =~ /mswin32/i) {binmode($fh)}
30 read($fh, $img, 32768);
31 close($fh) or die "can't close test.img: $!";
32
33 note length($img)," bytes read";
34
35 my @image = unpack("n*",$img);
36
37 note $#image+1," element image stored";
38
39 PGPLOT::pgbegin(0,$dev,1,1);
40
41 note "Plotting";
42
43 PGPLOT::pgsci(3);
44 PGPLOT::pgwnad(12000,13000,13000,12000);
45
46 my @tr=(12000,8,0,12000,0,8);
47 PGPLOT::pglabel("\\ga","\\gd","Galaxy");
48 PGPLOT::pgtbox("ZYHBCNST",0,0,"ZYDBCNST",0,0);
49
50 PGPLOT::pgsci(4); PGPLOT::pgconf(\@image, 128, 128, 1,128,1,128, 1000,2000, \@tr);
51 PGPLOT::pgsci(2); PGPLOT::pgconf(\@image, 128, 128, 1,128,1,128, 2000,3000, \@tr);
52
53 my @cont = (-1,1000,2000,3000,4000,5000);
54 PGPLOT::pgsci(7);
55 PGPLOT::pgcons(\@image, 128, 128, 1,128,1,128, \@cont, 6, \@tr);
56
57 PGPLOT::pgsci(1);
58 PGPLOT::pgaxis('LN2',12500,12800,12900,12100,1,4,0,0, 1,2,0.5, -2,30);
59
60 PGPLOT::pgtick(12500,12800,12900,12100, 0.35, 3,5, 6,90,'pgperl!');
61
62 PGPLOT::pgqndt(my $ndrivers);
63
64 note "Testing pgqdt() - $ndrivers drivers found";
65 for my $n (1..$ndrivers) {
66 PGPLOT::pgqdt($n,my $type,my $tlen,my $descr,my $dlen,my $inter);
67 note "$n: $type $tlen $descr $dlen $inter";
68 }
69
70 PGPLOT::pgend();
71
72 pass;
73 done_testing;