re PR libstdc++/37624 (22_locale/num_get/get/char/10.cc)
authorPaolo Carlini <paolo.carlini@oracle.com>
Tue, 23 Sep 2008 17:12:26 +0000 (17:12 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Tue, 23 Sep 2008 17:12:26 +0000 (17:12 +0000)
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

libstdc++-v3/ChangeLog
libstdc++-v3/testsuite/22_locale/num_get/get/char/10.cc
libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/10.cc

index 5bca65c..bdf354b 100644 (file)
@@ -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.
index 03e4a8e..4f80d86 100644 (file)
@@ -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()
index 425eba5..51d4a12 100644 (file)
@@ -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()