X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flib%2Fsyslfs.t;h=2bdb69d7e01ce9cd4291a68951a04f66de6d1fdd;hb=569bd3158af2276a406770e3d68e76b7da59b730;hp=cd82dfb5306d478ce0ff83b2559e7dc04da108e7;hpb=326fd4b6c63d624f86be55b75291c6fa7368b680;p=p5sagit%2Fp5-mst-13.2.git diff --git a/t/lib/syslfs.t b/t/lib/syslfs.t index cd82dfb..2bdb69d 100644 --- a/t/lib/syslfs.t +++ b/t/lib/syslfs.t @@ -15,6 +15,7 @@ BEGIN { } use strict; + our @s; our $fail; @@ -173,18 +174,25 @@ sub offset ($$) { my $offset_is = eval $offset_will_be; unless ($offset_is == $offset_want) { print "# bad offset $offset_is, want $offset_want\n"; + my ($offset_func) = ($offset_will_be =~ /^(\w+)/); if (unpack("L", pack("L", $offset_want)) == $offset_is) { - my $offset_func = ($offset_will_be =~ /^(\w+)/); print "# 32-bit wraparound suspected in $offset_func() since\n"; - print "# $offset_want cast into 32 bits is $offset_is.\n"; - } + print "# $offset_want cast into 32 bits equals $offset_is.\n"; + } elsif ($offset_want - unpack("L", pack("L", $offset_want)) - 1 + == $offset_is) { + print "# 32-bit wraparound suspected in $offset_func() since\n"; + printf "# %s - unpack('L', pack('L', %s)) - 1 equals %s.\n", + $offset_want, + $offset_want, + $offset_is; + } fail; } } print "1..17\n"; -my $fail = 0; +$fail = 0; fail unless $s[7] == 5_000_000_003; # exercizes pp_stat print "ok 1\n";