From: Jarkko Hietaniemi Date: Tue, 23 Apr 2002 01:43:42 +0000 (+0000) Subject: *size tweaks from Sarathy. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=96ef006171e2a38e3cf527a9cd662456e7c12aee;p=p5sagit%2Fp5-mst-13.2.git *size tweaks from Sarathy. p4raw-id: //depot/perl@16094 --- diff --git a/ext/Storable/t/malice.t b/ext/Storable/t/malice.t index 7f23b62..15871b9 100644 --- a/ext/Storable/t/malice.t +++ b/ext/Storable/t/malice.t @@ -32,17 +32,13 @@ sub BEGIN { use strict; use vars qw($file_magic_str $other_magic $network_magic $major $minor $C_visible_byteorder); -$file_magic_str = 'pst0'; -$other_magic = 7 + $Config{longsize}; -$network_magic = 2; -$major = 2; -$minor = 5; +BEGIN { # Config.pm does games to figure out byteorder dynamically. In the process # it creates an 8 digit entry on long long builds on 32 bit long systems. # config.sh, config.h and therefore Storable.xs have a 4 digit entry. $C_visible_byteorder = $Config{byteorder}; -if ($Config{longsize} != $Config{ivsize}) { +if ($^O ne 'MSWin32' and $Config{longsize} != $Config{ivsize}) { if ($C_visible_byteorder =~ /^1234/) { # Little endian substr ($C_visible_byteorder, $Config{longsize}) = ''; @@ -53,9 +49,17 @@ if ($Config{longsize} != $Config{ivsize}) { die "longs are $Config{longsize} bytes, IVs are $Config{ivsize}, byte order $C_visible_byteorder not regonised"; } } +} + +# header size depends on the size of the byteorder string +$file_magic_str = 'pst0'; +$other_magic = 7 + length($C_visible_byteorder); +$network_magic = 2; +$major = 2; +$minor = 5; use Test; -BEGIN { plan tests => 334 + $Config{longsize} * 4} +BEGIN { plan tests => 334 + length($C_visible_byteorder) * 4} use Storable qw (store retrieve freeze thaw nstore nfreeze);