Remove the "malloc wrappage" tests, due to their unportability
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Wed, 9 Jun 2004 18:40:45 +0000 (18:40 +0000)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Wed, 9 Jun 2004 18:40:45 +0000 (18:40 +0000)
(as suggested by Jarkko.)

p4raw-id: //depot/perl@22922

t/op/array.t
t/op/repeat.t

index d7c1ee9..77ea646 100755 (executable)
@@ -5,9 +5,7 @@ BEGIN {
     @INC = '../lib';
 }
 
-print "1..84\n";
-
-use Config;
+print "1..82\n";
 
 #
 # @foo, @bar, and @ary are also used from tie-stdarray after tie-ing them
@@ -299,22 +297,3 @@ sub kindalike { # TODO: test.pl-ize the array.t.
     eval '$a[-1] = 0';
     kindalike($@, qr/Modification of non-creatable array value attempted, subscript -1/, "\$a[-1] = 0", 82);
 }
-
-# Test the "malloc wrappage" guard introduced in Perl 5.8.4.
-
-if ($Config{ptrsize} == 4) {
-    eval '$a[0x7fffffff]=0';
-    kindalike($@, qr/Out of memory during array extend/,   "array extend", 83);
-
-    eval '$a[0x80000000]=0';
-    kindalike($@, qr/Out of memory during array extend/,   "array extend", 84);
-} elsif ($Config{ptrsize} == 8) {
-    eval '$a[0x7fffffffffffffff]=0';
-    kindalike($@, qr/Out of memory during array extend/,   "array extend", 83);
-
-    eval '$a[0x8000000000000000]=0';
-    kindalike($@, qr/Out of memory during array extend/,   "array extend", 84);
-} else {
-    die "\$Config{ptrsize} == $Config{ptrsize}?";
-}
-
index f33022e..e728413 100755 (executable)
@@ -6,9 +6,7 @@ BEGIN {
 }
 
 require './test.pl';
-plan(tests => 45);
-
-use Config;
+plan(tests => 41);
 
 # compile time
 
@@ -153,38 +151,3 @@ is(77, scalar ((1,7)x2),    'stack truncation');
     }
     is($y, 'abcdabcd');
 }
-
-# Test the "malloc wrappage" guards introduced in Perl 5.8.4.
-
-# Note that the guards do not catch everything: for example
-# "0"x0x7f...f is fine because it will attempt to allocate
-# "only" 0x7f...f+1 bytes: no wrappage there.
-
-if ($Config{ptrsize} == 4) {
-    eval '@a=(0)x0x7fffffff';
-    like($@, qr/Out of memory during list extend/,   "list extend");
-
-    eval '@a=(0)x0x80000000';
-    like($@, qr/Out of memory during list extend/,   "list extend");
-
-    eval '$a="012"x0x7fffffff';
-    like($@, qr/Out of memory during string extend/, "string extend");
-
-    eval '$a="012"x0x80000000';
-    like($@, qr/Out of memory during string extend/, "string extend");
-} elsif ($Config{ptrsize} == 8) {
-    eval '@a=(0)x0x7fffffffffffffff';
-    like($@, qr/Out of memory during list extend/,   "list extend");
-
-    eval '@a=(0)x0x8000000000000000';
-    like($@, qr/Out of memory during list extend/,   "list extend");
-
-    eval '$a="012"x0x7fffffffffffffff';
-    like($@, qr/Out of memory during string extend/, "string extend");
-
-    eval '$a="012"x0x8000000000000000';
-    like($@, qr/Out of memory during string extend/, "string extend");
-} else {
-    die "\$Config{ptrsize} == $Config{ptrsize}?";
-}
-