File: howbig.t

package info (click to toggle)
pdl 1%3A2.4.7%2Bdfsg-2
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 10,128 kB
  • ctags: 5,821
  • sloc: perl: 26,328; fortran: 13,113; ansic: 9,378; makefile: 71; sh: 50; sed: 6
file content (21 lines) | stat: -rw-r--r-- 482 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Test datatype sizes in bytes are correct

use PDL::LiteF;
use PDL::Core ':Internal'; # For howbig()

sub ok {
	my $no = shift ;
	my $result = shift ;
	print "not " unless $result ;
	print "ok $no\n" ;
}

print "1..6\n";

ok(1, howbig(byte(42)->get_datatype)==1);
ok(2, howbig(short(42)->get_datatype)==2);
ok(3, howbig(ushort(42)->get_datatype)==2);
ok(4, howbig(long(42)->get_datatype)==4);
ok(5, howbig(float(42)->get_datatype)==4);
ok(6, howbig(double(42)->get_datatype)==8);