diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2008-09-23 17:12:26 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2008-09-23 17:12:26 +0000 |
commit | 1304d5813db7e623b4e64757bf95dc919d36c891 (patch) | |
tree | 00fb18f4fe5f2b18adb4b8b91956551e31bf7006 | |
parent | e5f21110e033125e949c7858a44c3b28e0d9a4c0 (diff) | |
download | gcc-1304d5813db7e623b4e64757bf95dc919d36c891.zip gcc-1304d5813db7e623b4e64757bf95dc919d36c891.tar.gz gcc-1304d5813db7e623b4e64757bf95dc919d36c891.tar.bz2 |
re PR libstdc++/37624 (22_locale/num_get/get/char/10.cc)
2008-09-23 Paolo Carlini <paolo.carlini@oracle.com>
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
-rw-r--r-- | libstdc++-v3/ChangeLog | 7 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/22_locale/num_get/get/char/10.cc | 18 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/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 5bca65c..bdf354b 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,10 @@ +2008-09-23 Paolo Carlini <paolo.carlini@oracle.com> + + 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 <bkoz@redhat.com> 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 03e4a8e..4f80d86 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<char>& ng = use_facet<num_get<char> >(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 425eba5..51d4a12 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<wchar_t>& ng = use_facet<num_get<wchar_t> >(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() |