diff options
author | Andy Lester <andy@petdance.com> | 2005-04-07 12:44:42 -0500 |
---|---|---|
committer | H.Merijn Brand <h.m.brand@xs4all.nl> | 2005-04-08 12:18:42 +0000 |
commit | 2db3864ffcaccbf832bbb3814303b4f6beef8963 (patch) | |
tree | afec42c61fea1276efdac7452e1ec685c6676c57 /t | |
parent | 45977657b0fa2c29b268b817f40e6b295a501d39 (diff) | |
download | perl-2db3864ffcaccbf832bbb3814303b4f6beef8963.tar.gz |
Removing Y2K warnings
Message-ID: <20050407224442.GA23895@petdance.com>
p4raw-id: //depot/perl@24205
Diffstat (limited to 't')
-rw-r--r-- | t/lib/warnings/pp_hot | 29 | ||||
-rw-r--r-- | t/lib/warnings/sv | 36 | ||||
-rw-r--r-- | t/op/caller.t | 16 |
3 files changed, 9 insertions, 72 deletions
diff --git a/t/lib/warnings/pp_hot b/t/lib/warnings/pp_hot index f5a580337c..070aaf0aa5 100644 --- a/t/lib/warnings/pp_hot +++ b/t/lib/warnings/pp_hot @@ -44,9 +44,6 @@ Deep recursion on anonymous subroutine [Perl_sub_crush_depth] $a = sub { &$a if $a++ < 200} &$a - Possible Y2K bug: about to append an integer to '19' [pp_concat] - $x = "19$yy\n"; - Use of reference "%s" as array index [pp_aelem] $x[\1] @@ -275,32 +272,6 @@ Use of uninitialized value $x in concatenation (.) or string at - line 6. Use of uninitialized value $y in concatenation (.) or string at - line 7. Use of uninitialized value $y in concatenation (.) or string at - line 8. ######## -# pp_hot.c [pp_concat] -use warnings 'y2k'; -use Config; -BEGIN { - unless ($Config{ccflags} =~ /Y2KWARN/) { - print "SKIPPED\n# perl not built with -DPERL_Y2KWARN"; - exit 0; - } -} -my $x; -my $yy = 78; -$x = "19$yy\n"; -$x = "19" . $yy . "\n"; -$x = "319$yy\n"; -$x = "319" . $yy . "\n"; -$yy = 19; -$x = "ok $yy\n"; -$yy = 9; -$x = 1 . $yy; -no warnings 'y2k'; -$x = "19$yy\n"; -$x = "19" . $yy . "\n"; -EXPECT -Possible Y2K bug: about to append an integer to '19' at - line 12. -Possible Y2K bug: about to append an integer to '19' at - line 13. -######## # pp_hot.c [pp_aelem] { use warnings 'misc'; diff --git a/t/lib/warnings/sv b/t/lib/warnings/sv index 1276ee056e..a9636e0cf7 100644 --- a/t/lib/warnings/sv +++ b/t/lib/warnings/sv @@ -32,8 +32,6 @@ Undefined value assigned to typeglob - Possible Y2K bug: %d format string following '19' - Reference is already weak [Perl_sv_rvweaken] <<TODO Mandatory Warnings @@ -317,40 +315,6 @@ EXPECT Undefined value assigned to typeglob at - line 3. ######## # sv.c -use warnings 'y2k'; -use Config; -BEGIN { - unless ($Config{ccflags} =~ /Y2KWARN/) { - print "SKIPPED\n# perl not built with -DPERL_Y2KWARN"; - exit 0; - } - $|=1; -} -my $x; -my $yy = 78; -$x = printf "19%02d\n", $yy; -$x = sprintf "#19%02d\n", $yy; -$x = printf " 19%02d\n", 78; -$x = sprintf "19%02d\n", 78; -$x = printf "319%02d\n", $yy; -$x = sprintf "319%02d\n", $yy; -no warnings 'y2k'; -$x = printf "19%02d\n", $yy; -$x = sprintf "19%02d\n", $yy; -$x = printf "19%02d\n", 78; -$x = sprintf "19%02d\n", 78; -EXPECT -Possible Y2K bug: %d format string following '19' at - line 16. -Possible Y2K bug: %d format string following '19' at - line 13. -1978 -Possible Y2K bug: %d format string following '19' at - line 14. -Possible Y2K bug: %d format string following '19' at - line 15. - 1978 -31978 -1978 -1978 -######## -# sv.c use warnings 'numeric' ; $a = "\x{100}\x{200}" * 42; no warnings 'numeric' ; diff --git a/t/op/caller.t b/t/op/caller.t index c97191b14a..4d90aeafd3 100644 --- a/t/op/caller.t +++ b/t/op/caller.t @@ -67,21 +67,23 @@ ok( $c[4], "hasargs true with unknown sub" ); sub testwarn { my $w = shift; - is( (caller(0))[9], $w, "warnings"); + is( (caller(0))[9], $w, "warnings match caller"); } # NB : extend the warning mask values below when new warnings are added { no warnings; - BEGIN { is( ${^WARNING_BITS}, "\0" x 12, 'warning bits' ) } + BEGIN { is( ${^WARNING_BITS}, "\0" x 12, 'all bits off via "no warnings"' ) } testwarn("\0" x 12); + use warnings; - BEGIN { is( ${^WARNING_BITS}, "U" x 12, 'warning bits' ) } - BEGIN { testwarn("U" x 12); } + BEGIN { is( ${^WARNING_BITS}, "UUUUUUUUUUU\025", 'default bits on via "use warnings"' ); } + BEGIN { testwarn("UUUUUUUUUUU\025", "#1"); } # run-time : # the warning mask has been extended by warnings::register - testwarn("UUUUUUUUUUUU\001"); + testwarn("UUUUUUUUUUUU"); + use warnings::register; - BEGIN { is( ${^WARNING_BITS}, "UUUUUUUUUUUU\001", 'warning bits' ) } - testwarn("UUUUUUUUUUUU\001"); + BEGIN { is( ${^WARNING_BITS}, "UUUUUUUUUUUU", 'warning bits on via "use warnings::register"' ) } + testwarn("UUUUUUUUUUUU","#3"); } |