Re: [ID 20001229.001] Not OK: perl v5.7.0 +DEVEL8221 on i686-linux 2.4.0-test13pre4...
[p5sagit/p5-mst-13.2.git] / t / lib / syslfs.t
index cd82dfb..f04b115 100644 (file)
@@ -174,10 +174,18 @@ sub offset ($$) {
     unless ($offset_is == $offset_want) {
         print "# bad offset $offset_is, want $offset_want\n";
        if (unpack("L", pack("L", $offset_want)) == $offset_is) {
-           my $offset_func = ($offset_will_be =~ /^(\w+)/);
+           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";
-       }
+       } elsif ($offset_want - unpack("L", pack("L", $offset_want)) - 1
+                == $offset_is){
+           my($offset_func) = ($offset_will_be =~ /^(\w+)/);
+           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;
     }
 }