From 1304d5813db7e623b4e64757bf95dc919d36c891 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Tue, 23 Sep 2008 17:12:26 +0000 Subject: [PATCH] re PR libstdc++/37624 (22_locale/num_get/get/char/10.cc) 2008-09-23 Paolo Carlini PR libstdc++/37624 * testsuite/22_locale/num_get/get/char/10.cc: Skip long double case when strtold is not available. * testsuite/22_locale/num_get/get/wchar_t/10.cc: Likewise. From-SVN: r140602 --- libstdc++-v3/ChangeLog | 7 +++++++ .../testsuite/22_locale/num_get/get/char/10.cc | 18 ++++++++++-------- .../22_locale/num_get/get/wchar_t/10.cc | 16 +++++++++------- 3 files changed, 26 insertions(+), 15 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 5bca65c19eb..bdf354b4fa8 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,10 @@ +2008-09-23 Paolo Carlini + + PR libstdc++/37624 + * testsuite/22_locale/num_get/get/char/10.cc: Skip long double case + when strtold is not available. + * testsuite/22_locale/num_get/get/wchar_t/10.cc: Likewise. + 2008-09-23 Benjamin Kosnik PR libstdc++/37391 continued. diff --git a/libstdc++-v3/testsuite/22_locale/num_get/get/char/10.cc b/libstdc++-v3/testsuite/22_locale/num_get/get/char/10.cc index 03e4a8ed7ae..4f80d86e6ab 100644 --- a/libstdc++-v3/testsuite/22_locale/num_get/get/char/10.cc +++ b/libstdc++-v3/testsuite/22_locale/num_get/get/char/10.cc @@ -35,13 +35,10 @@ void test01() const num_get& ng = use_facet >(iss.getloc()); ios_base::iostate err = ios_base::goodbit; iterator_type end; - float f = 0.0f; - double d = 0.0; - long double ld = 0.0l; - float f1 = 1.0f; - double d1 = 3.0; - long double ld1 = 6.0l; - + float f = 1.0f; + double d = 1.0; + long double ld = 1.0l; + iss.str("1e."); err = ios_base::goodbit; end = ng.get(iss.rdbuf(), 0, iss, err, f); @@ -60,9 +57,14 @@ void test01() iss.clear(); err = ios_base::goodbit; end = ng.get(iss.rdbuf(), 0, iss, err, ld); - VERIFY( err == ios_base::failbit ); VERIFY( *end == ' ' ); + + // libstdc++/37624. We can't always obtain the required behavior + // when sscanf is involved, because of, e.g., glibc/1765. +#if defined(_GLIBCXX_HAVE_STRTOLD) && !defined(_GLIBCXX_HAVE_BROKEN_STRTOLD) + VERIFY( err == ios_base::failbit ); VERIFY( ld == 0.0l ); +#endif } int main() diff --git a/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/10.cc b/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/10.cc index 425eba5051e..51d4a127c8f 100644 --- a/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/10.cc +++ b/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/10.cc @@ -35,12 +35,9 @@ void test01() const num_get& ng = use_facet >(iss.getloc()); ios_base::iostate err = ios_base::goodbit; iterator_type end; - float f = 0.0f; - double d = 0.0; - long double ld = 0.0l; - float f1 = 1.0f; - double d1 = 3.0; - long double ld1 = 6.0l; + float f = 1.0f; + double d = 1.0; + long double ld = 1.0l; iss.str(L"1e."); err = ios_base::goodbit; @@ -60,9 +57,14 @@ void test01() iss.clear(); err = ios_base::goodbit; end = ng.get(iss.rdbuf(), 0, iss, err, ld); - VERIFY( err == ios_base::failbit ); VERIFY( *end == L' ' ); + + // libstdc++/37624. We can't always obtain the required behavior + // when sscanf is involved, because of, e.g., glibc/1765. +#if defined(_GLIBCXX_HAVE_STRTOLD) && !defined(_GLIBCXX_HAVE_BROKEN_STRTOLD) + VERIFY( err == ios_base::failbit ); VERIFY( ld == 0.0l ); +#endif } int main()