diff options
Diffstat (limited to 't/op')
-rw-r--r-- | t/op/64bitint.t | 28 | ||||
-rwxr-xr-x | t/op/goto_xs.t | 20 | ||||
-rw-r--r-- | t/op/utf8decode.t | 2 |
3 files changed, 39 insertions, 11 deletions
diff --git a/t/op/64bitint.t b/t/op/64bitint.t index 88fbc55c67..47779dd058 100644 --- a/t/op/64bitint.t +++ b/t/op/64bitint.t @@ -16,7 +16,7 @@ BEGIN { # 32+ bit integers don't cause noise no warnings qw(overflow portable); -print "1..55\n"; +print "1..57\n"; my $q = 12345678901; my $r = 23456789012; @@ -294,4 +294,30 @@ $q = 18446744073709551615; print "# $q ne\n# 18446744073709551615\nnot " unless "$q" eq "18446744073709551615"; print "ok 55\n"; +# Test that sv_2nv then sv_2iv is the same as sv_2iv direct +# fails if whatever Atol is defined as can't actually cope with >32 bits. +my $num = 4294967297; +my $string = "4294967297"; +{ + use integer; + $num += 0; + $string += 0; +} +if ($num eq $string) { + print "ok 56\n"; +} else { + print "not ok 56 # \"$num\" ne \"$string\"\n"; +} + +# Test that sv_2nv then sv_2uv is the same as sv_2uv direct +$num = 4294967297; +$string = "4294967297"; +$num &= 0; +$string &= 0; +if ($num eq $string) { + print "ok 57\n"; +} else { + print "not ok 57 # \"$num\" ne \"$string\"\n"; +} + # eof diff --git a/t/op/goto_xs.t b/t/op/goto_xs.t index cf2cafd467..dc8e7d77aa 100755 --- a/t/op/goto_xs.t +++ b/t/op/goto_xs.t @@ -35,7 +35,7 @@ $VALID = 'LOCK_SH'; ### First, we check whether Fcntl::constant returns sane answers. # Fcntl::constant("LOCK_SH",0) should always succeed. -$value = Fcntl::constant($VALID,0); +$value = Fcntl::constant($VALID); print((!defined $value) ? "not ok 1\n# Sanity check broke, remaining tests will fail.\n" : "ok 1\n"); @@ -45,20 +45,20 @@ print((!defined $value) # test "goto &function_constant" sub goto_const { goto &Fcntl::constant; } -$ret = goto_const($VALID,0); +$ret = goto_const($VALID); print(($ret == $value) ? "ok 2\n" : "not ok 2\n# ($ret != $value)\n"); # test "goto &$function_package_and_name" $FNAME1 = 'Fcntl::constant'; sub goto_name1 { goto &$FNAME1; } -$ret = goto_name1($VALID,0); +$ret = goto_name1($VALID); print(($ret == $value) ? "ok 3\n" : "not ok 3\n# ($ret != $value)\n"); # test "goto &$function_package_and_name" again, with dirtier stack -$ret = goto_name1($VALID,0); +$ret = goto_name1($VALID); print(($ret == $value) ? "ok 4\n" : "not ok 4\n# ($ret != $value)\n"); -$ret = goto_name1($VALID,0); +$ret = goto_name1($VALID); print(($ret == $value) ? "ok 5\n" : "not ok 5\n# ($ret != $value)\n"); # test "goto &$function_name" from local package @@ -67,14 +67,14 @@ $FNAME2 = 'constant'; sub goto_name2 { goto &$FNAME2; } package main; -$ret = Fcntl::goto_name2($VALID,0); +$ret = Fcntl::goto_name2($VALID); print(($ret == $value) ? "ok 6\n" : "not ok 6\n# ($ret != $value)\n"); # test "goto &$function_ref" $FREF = \&Fcntl::constant; sub goto_ref { goto &$FREF; } -$ret = goto_ref($VALID,0); +$ret = goto_ref($VALID); print(($ret == $value) ? "ok 7\n" : "not ok 7\n# ($ret != $value)\n"); ### tests where the args are not on stack but in GvAV(defgv) (ie, @_) @@ -82,17 +82,17 @@ print(($ret == $value) ? "ok 7\n" : "not ok 7\n# ($ret != $value)\n"); # test "goto &function_constant" from a sub called without arglist sub call_goto_const { &goto_const; } -$ret = call_goto_const($VALID,0); +$ret = call_goto_const($VALID); print(($ret == $value) ? "ok 8\n" : "not ok 8\n# ($ret != $value)\n"); # test "goto &$function_package_and_name" from a sub called without arglist sub call_goto_name1 { &goto_name1; } -$ret = call_goto_name1($VALID,0); +$ret = call_goto_name1($VALID); print(($ret == $value) ? "ok 9\n" : "not ok 9\n# ($ret != $value)\n"); # test "goto &$function_ref" from a sub called without arglist sub call_goto_ref { &goto_ref; } -$ret = call_goto_ref($VALID,0); +$ret = call_goto_ref($VALID); print(($ret == $value) ? "ok 10\n" : "not ok 10\n# ($ret != $value)\n"); diff --git a/t/op/utf8decode.t b/t/op/utf8decode.t index ac42b85577..cd9d56a5c4 100644 --- a/t/op/utf8decode.t +++ b/t/op/utf8decode.t @@ -5,6 +5,8 @@ BEGIN { @INC = '../lib'; } +no utf8; # this test contains raw 8-bit data on purpose; don't switch to \x{} + print "1..78\n"; my $test = 1; |