summaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite/22_locale/time_get/get_year
diff options
context:
space:
mode:
authorPaolo Carlini <pcarlini@suse.de>2003-12-03 09:18:28 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2003-12-03 09:18:28 +0000
commit3259561c4c46afb921e593baeebdc0a955063473 (patch)
tree6b2133520095c88dcebbddb70318a43ff390faa1 /libstdc++-v3/testsuite/22_locale/time_get/get_year
parentc6a25d3a3dff96bf920d34b31faba6fdb5ff9323 (diff)
downloadgcc-3259561c4c46afb921e593baeebdc0a955063473.tar.gz
re PR libstdc++/12791 (_M_extract_num returns a wrong __beg in case of error)
2003-12-03 Paolo Carlini <pcarlini@suse.de> PR libstdc++/12791 * include/bits/locale_facets.tcc (time_get::_M_extract_num): Rewrite, stop the parsing as soon as a digit cannot possibly lead to a final number within the bounds; otherwise, simplify, avoiding __ctype.is() and atoi(). * testsuite/22_locale/time_get/get_date/char/12791.cc: New. * testsuite/22_locale/time_get/get_date/wchar_t/12791.cc: New. * include/bits/locale_facets.tcc (time_get::_M_extract_via_format): Minor tweak: a 4-digit integer cannot be bigger than 9999. * testsuite/22_locale/time_get/get_date/wchar_t/1.cc: Use type-correct wchar_t string literals. * testsuite/22_locale/time_get/get_monthname/wchar_t/1.cc: Ditto. * testsuite/22_locale/time_get/get_time/wchar_t/1.cc: Ditto. * testsuite/22_locale/time_get/get_weekday/wchar_t/1.cc: Ditto. * testsuite/22_locale/time_get/get_year/wchar_t/1.cc: Ditto. From-SVN: r74220
Diffstat (limited to 'libstdc++-v3/testsuite/22_locale/time_get/get_year')
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_get/get_year/wchar_t/1.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get_year/wchar_t/1.cc b/libstdc++-v3/testsuite/22_locale/time_get/get_year/wchar_t/1.cc
index 5aa77c9519f..578d18f7e04 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/get_year/wchar_t/1.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/get_year/wchar_t/1.cc
@@ -76,7 +76,7 @@ void test01()
tim_get.get_year(is_it02, end, iss, errorstate, &time02);
VERIFY( time02.tm_year == time_bday.tm_year );
VERIFY( errorstate == good );
- VERIFY( *is_it02 == ' ');
+ VERIFY( *is_it02 == L' ' );
iss.str(L"197d1 ");
iterator_type is_it03(iss);
@@ -86,7 +86,7 @@ void test01()
tim_get.get_year(is_it03, end, iss, errorstate, &time03);
VERIFY( time03.tm_year == 3 );
VERIFY( errorstate == ios_base::failbit );
- VERIFY( *is_it03 == 'd');
+ VERIFY( *is_it03 == L'd' );
iss.str(L"71d71");
iterator_type is_it04(iss);
@@ -95,7 +95,7 @@ void test01()
tim_get.get_year(is_it04, end, iss, errorstate, &time04);
VERIFY( time04.tm_year == time_bday.tm_year );
VERIFY( errorstate == good );
- VERIFY( *is_it03 == 'd');
+ VERIFY( *is_it03 == L'd' );
iss.str(L"71");
iterator_type is_it05(iss);