From 6cf0b5678c6f2ad5dad993e844b20fde2f63bb83 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Sun, 15 Jan 2012 11:21:25 -0700 Subject: locale.t: Remove hard-coded test number The subroutine with the hard-coded value used to forward reference the number of tests is no longer needed, as this and previous commits move the place where the number is needed to afterwards. --- lib/locale.t | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/locale.t b/lib/locale.t index 89a87ab923..d181f256a6 100644 --- a/lib/locale.t +++ b/lib/locale.t @@ -56,7 +56,6 @@ $have_setlocale = 0 if ((($^O eq 'MSWin32' && !$winxp) || $^O eq 'NetWare') && # UWIN seems to loop after taint tests, just skip for now $have_setlocale = 0 if ($^O =~ /^uwin/); -my $last_locales = $have_setlocale ? &last_locales : &last_without_setlocale; sub LC_ALL (); $a = 'abc %'; @@ -249,8 +248,6 @@ check_taint_not $2; check_taint_not $a; -sub last_without_setlocale { 98 } - # I think we've seen quite enough of taint. # Let us do some *real* locale work now, # unless setlocale() is missing (i.e. minitest). @@ -260,6 +257,9 @@ unless ($have_setlocale) { exit; } +# The test number before our first setlocale() +my $last_without_setlocale = $test_num; + # Find locales. debug "# Scanning for locales...\n"; @@ -834,9 +834,11 @@ foreach $Locale (@Locale) { } } +my $last_locales = $have_setlocale ? &last_locales : $last_without_setlocale; + # Recount the errors. -foreach (&last_without_setlocale()+1..$last_locales) { +foreach ($last_without_setlocale+1..$last_locales) { if ($Problem{$_} || !defined $Okay{$_} || !@{$Okay{$_}}) { if ($_ == 102) { print "# The failure of test 102 is not necessarily fatal.\n"; -- cgit v1.2.1