2 # Copyright (C) 2001-2005, The Perl Foundation.
7 use lib qw( . lib ../lib ../../lib );
9 use Parrot::Test skip_all => 'ongoing PBC format changes';
16 t/native_pbc/header.t - PBC header format
20 % prove t/native_pbc/header.t
24 Tests the layout of the PBC header.
28 # idea stolen from t/pmc/sub.t
29 my $tmppasm = File::Temp->new( UNLINK => 1, SUFFIX => '.pasm' );
34 my $tmppbc = File::Temp->new( UNLINK => 1, SUFFIX => '.pbc' );
35 system(".$PConfig{slash}parrot$PConfig{exe} -o $tmppbc $tmppasm");
36 my $pbc = slurp_file($tmppbc);
51 @h{@fields} = unpack "a8CCCCCCa10a8", $pbc;
53 is( $h{magic}, "\xfe\x50\x42\x43\x0a\x1a\x0a\cD", "magic string" );
54 ok( $h{wordsize} < 2, "wordsize" );
55 ok( $h{byteorder} < 2, "byteorder" );
56 is( $h{major}, $PConfig{MAJOR}, "major version" );
57 is( $h{minor}, $PConfig{MINOR}, "minor version" );
58 ok( $h{intval} == 3 || $h{intval} == 4 || $h{intval} == 8, "intval" );
59 ok( $h{floattype} < 4, "floattype" );
60 is( $h{padding}, pack("x7")."\cA", "NULL padding" );
64 # cperl-indent-level: 4
67 # vim: expandtab shiftwidth=4: