This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix the new "C" switch tests wrt localedata


Hi,

the below is meant to solve the problems affecting the new temporary "C" 
switch tests, reported by David Edelsohn (and implicitly many others on 
testresults).

I have tested it on i686-pc-linux-gnu, both configuring  
--enable-clocale=generic and gnu.

I believe that this kind of refinement is good anyway and robustifies 
the tests in the same spirit of the tests for libstdc++/5280.

Ok?

Ciao,
Paolo.

//////////

2002-05-08  Paolo Carlini  <pcarlini@unitus.it>

    * testsuite/22_locale/codecvt_members_char_char.cc
    (test03): Robustify wrt localedata.
    * testsuite/22_locale/codecvt_members_wchar_t_char.cc (test03): 
Likewise.
    * testsuite/22_locale/collate_members_char.cc (test04): Likewise.
    * testsuite/22_locale/collate_members_wchar_t.cc (test04): Likewise.
    * testsuite/22_locale/ctype_members_char.cc (test05): Likewise.
    * testsuite/22_locale/ctype_members_wchar_t.cc (test04): Likewise.
    * testsuite/22_locale/messages_members_char.cc (test03): Likewise.
    * testsuite/22_locale/money_get_members_char.cc (test08): Likewise.
    * testsuite/22_locale/money_get_members_wchar_t.cc (test08): Likewise.
    * testsuite/22_locale/money_put_members_char.cc (test07): Likewise.
    * testsuite/22_locale/money_put_members_wchar_t.cc (test07): Likewise.
    * testsuite/22_locale/moneypunct_members_char.cc (test03): Likewise.
    * testsuite/22_locale/moneypunct_members_wchar_t.cc (test03): Likewise.
    * testsuite/22_locale/num_get_members_char.cc (test06): Likewise.
    * testsuite/22_locale/num_get_members_wchar_t.cc (test06): Likewise.
    * testsuite/22_locale/num_put_members_char.cc (test04): Add comment.
    * testsuite/22_locale/num_put_members_wchar_t.cc (test04): Likewise.
    * testsuite/22_locale/numpunct_members_char.cc (test03): Likewise.
    * testsuite/22_locale/numpunct_members_wchar_t.cc (test03): Likewise.
    * testsuite/22_locale/time_get_members_char.cc (test08): Likewise.
    * testsuite/22_locale/time_get_members_wchar_t.cc (test08): Likewise.
    * testsuite/22_locale/time_put_members_char.cc (test04): Likewise.
    * testsuite/22_locale/time_put_members_wchar_t.cc (test04): Likewise.

diff -urN 
libstdc++-v3-orig/testsuite/22_locale/codecvt_members_char_char.cc 
libstdc++-v3/testsuite/22_locale/codecvt_members_char_char.cc
--- 
libstdc++-v3-orig/testsuite/22_locale/codecvt_members_char_char.cc    
2002-05-06 23:12:14.000000000 +0200
+++ libstdc++-v3/testsuite/22_locale/codecvt_members_char_char.cc    
2002-05-08 22:27:46.000000000 +0200
@@ -102,10 +102,14 @@
 {
   bool test = true;
 
-  std::string loc1 = setlocale(LC_ALL, "ja_JP.eucjp");
-  test01();
-  std::string loc2 = setlocale(LC_ALL, NULL);
-  VERIFY( loc1 == loc2 );
+  const char* tentLANG = setlocale(LC_ALL, "ja_JP.eucjp");
+  if (tentLANG != NULL)
+    {
+      std::string preLANG = tentLANG;
+      test01();
+      std::string postLANG = setlocale(LC_ALL, NULL);
+      VERIFY( preLANG == postLANG );
+    }
 }
 
 int main ()
diff -urN 
libstdc++-v3-orig/testsuite/22_locale/codecvt_members_wchar_t_char.cc 
libstdc++-v3/testsuite/22_locale/codecvt_members_wchar_t_char.cc
--- 
libstdc++-v3-orig/testsuite/22_locale/codecvt_members_wchar_t_char.cc    
2002-05-06 23:12:14.000000000 +0200
+++ libstdc++-v3/testsuite/22_locale/codecvt_members_wchar_t_char.cc    
2002-05-08 22:28:01.000000000 +0200
@@ -134,10 +134,14 @@
 {
   bool test = true;
 
-  std::string loc1 = setlocale(LC_ALL, "ja_JP.eucjp");
-  test01();
-  std::string loc2 = setlocale(LC_ALL, NULL);
-  VERIFY( loc1 == loc2 );
+  const char* tentLANG = setlocale(LC_ALL, "ja_JP.eucjp");
+  if (tentLANG != NULL)
+    {
+      std::string preLANG = tentLANG;
+      test01();
+      std::string postLANG = setlocale(LC_ALL, NULL);
+      VERIFY( preLANG == postLANG );
+    }
 }
 #endif /* !defined(_GLIBCPP_USE_WCHAR_T) */
 
diff -urN libstdc++-v3-orig/testsuite/22_locale/collate_members_char.cc 
libstdc++-v3/testsuite/22_locale/collate_members_char.cc
--- libstdc++-v3-orig/testsuite/22_locale/collate_members_char.cc    
2002-05-06 23:12:14.000000000 +0200
+++ libstdc++-v3/testsuite/22_locale/collate_members_char.cc    
2002-05-08 22:28:14.000000000 +0200
@@ -166,11 +166,15 @@
 {
   bool test = true;
 
-  std::string loc1 = setlocale(LC_ALL, "ja_JP.eucjp");
-  test01();
-  test03();
-  std::string loc2 = setlocale(LC_ALL, NULL);
-  VERIFY( loc1 == loc2 );
+  const char* tentLANG = setlocale(LC_ALL, "ja_JP.eucjp");
+  if (tentLANG != NULL)
+    {
+      std::string preLANG = tentLANG;
+      test01();
+      test03();
+      std::string postLANG = setlocale(LC_ALL, NULL);
+      VERIFY( preLANG == postLANG );
+    }
 }
 
 int main()
diff -urN 
libstdc++-v3-orig/testsuite/22_locale/collate_members_wchar_t.cc 
libstdc++-v3/testsuite/22_locale/collate_members_wchar_t.cc
--- libstdc++-v3-orig/testsuite/22_locale/collate_members_wchar_t.cc    
2002-05-06 23:12:14.000000000 +0200
+++ libstdc++-v3/testsuite/22_locale/collate_members_wchar_t.cc    
2002-05-08 22:28:23.000000000 +0200
@@ -166,11 +166,15 @@
 {
   bool test = true;
 
-  std::string loc1 = setlocale(LC_ALL, "ja_JP.eucjp");
-  test01();
-  test03();
-  std::string loc2 = setlocale(LC_ALL, NULL);
-  VERIFY( loc1 == loc2 );
+  const char* tentLANG = setlocale(LC_ALL, "ja_JP.eucjp");
+  if (tentLANG != NULL)
+    {
+      std::string preLANG = tentLANG;
+      test01();
+      test03();
+      std::string postLANG = setlocale(LC_ALL, NULL);
+      VERIFY( preLANG == postLANG );
+    }
 }
 #endif
 
diff -urN libstdc++-v3-orig/testsuite/22_locale/ctype_members_char.cc 
libstdc++-v3/testsuite/22_locale/ctype_members_char.cc
--- libstdc++-v3-orig/testsuite/22_locale/ctype_members_char.cc    
2002-05-06 23:12:14.000000000 +0200
+++ libstdc++-v3/testsuite/22_locale/ctype_members_char.cc    2002-05-08 
22:28:33.000000000 +0200
@@ -285,12 +285,16 @@
 {
   bool test = true;
 
-  std::string loc1 = setlocale(LC_ALL, "ja_JP.eucjp");
-  test01();
-  test02();
-  test03();
-  std::string loc2 = setlocale(LC_ALL, NULL);
-  VERIFY( loc1 == loc2 );
+  const char* tentLANG = setlocale(LC_ALL, "ja_JP.eucjp");
+  if (tentLANG != NULL)
+    {
+      std::string preLANG = tentLANG;
+      test01();
+      test02();
+      test03();
+      std::string postLANG = setlocale(LC_ALL, NULL);
+      VERIFY( preLANG == postLANG );
+    }
 }
 
 int main()
diff -urN libstdc++-v3-orig/testsuite/22_locale/ctype_members_wchar_t.cc 
libstdc++-v3/testsuite/22_locale/ctype_members_wchar_t.cc
--- libstdc++-v3-orig/testsuite/22_locale/ctype_members_wchar_t.cc    
2002-05-06 23:12:14.000000000 +0200
+++ libstdc++-v3/testsuite/22_locale/ctype_members_wchar_t.cc    
2002-05-08 22:28:42.000000000 +0200
@@ -120,10 +120,14 @@
 {
   bool test = true;
 
-  std::string loc1 = setlocale(LC_ALL, "ja_JP.eucjp");
-  test01();
-  std::string loc2 = setlocale(LC_ALL, NULL);
-  VERIFY( loc1 == loc2 );
+  const char* tentLANG = setlocale(LC_ALL, "ja_JP.eucjp");
+  if (tentLANG != NULL)
+    {
+      std::string preLANG = tentLANG;
+      test01();
+      std::string postLANG = setlocale(LC_ALL, NULL);
+      VERIFY( preLANG == postLANG );
+    }
 }
 #endif /* !defined(_GLIBCPP_USE_WCHAR_T) */
 
diff -urN libstdc++-v3-orig/testsuite/22_locale/messages_members_char.cc 
libstdc++-v3/testsuite/22_locale/messages_members_char.cc
--- libstdc++-v3-orig/testsuite/22_locale/messages_members_char.cc    
2002-05-06 23:12:14.000000000 +0200
+++ libstdc++-v3/testsuite/22_locale/messages_members_char.cc    
2002-05-08 22:28:55.000000000 +0200
@@ -104,10 +104,14 @@
 {
   bool test = true;
 
-  std::string loc1 = setlocale(LC_ALL, "ja_JP.eucjp");
-  test01();
-  std::string loc2 = setlocale(LC_ALL, NULL);
-  VERIFY( loc1 == loc2 );
+  const char* tentLANG = setlocale(LC_ALL, "ja_JP.eucjp");
+  if (tentLANG != NULL)
+    {
+      std::string preLANG = tentLANG;
+      test01();
+      std::string postLANG = setlocale(LC_ALL, NULL);
+      VERIFY( preLANG == postLANG );
+    }
 }
 
 int main()
diff -urN 
libstdc++-v3-orig/testsuite/22_locale/money_get_members_char.cc 
libstdc++-v3/testsuite/22_locale/money_get_members_char.cc
--- libstdc++-v3-orig/testsuite/22_locale/money_get_members_char.cc    
2002-05-06 23:12:15.000000000 +0200
+++ libstdc++-v3/testsuite/22_locale/money_get_members_char.cc    
2002-05-08 22:29:07.000000000 +0200
@@ -551,15 +551,19 @@
 {
   bool test = true;
 
-  std::string loc1 = setlocale(LC_ALL, "ja_JP.eucjp");
-  test01();
-  test02();
-  test03();
-  test05();
-  test06();
-  test07();
-  std::string loc2 = setlocale(LC_ALL, NULL);
-  VERIFY( loc1 == loc2 );
+  const char* tentLANG = setlocale(LC_ALL, "ja_JP.eucjp");
+  if (tentLANG != NULL)
+    {
+      std::string preLANG = tentLANG;
+      test01();
+      test02();
+      test03();
+      test05();
+      test06();
+      test07();
+      std::string postLANG = setlocale(LC_ALL, NULL);
+      VERIFY( preLANG == postLANG );
+    }
 }
 
 int main()
diff -urN 
libstdc++-v3-orig/testsuite/22_locale/money_get_members_wchar_t.cc 
libstdc++-v3/testsuite/22_locale/money_get_members_wchar_t.cc
--- 
libstdc++-v3-orig/testsuite/22_locale/money_get_members_wchar_t.cc    
2002-05-06 23:12:15.000000000 +0200
+++ libstdc++-v3/testsuite/22_locale/money_get_members_wchar_t.cc    
2002-05-08 22:29:22.000000000 +0200
@@ -552,15 +552,19 @@
 {
   bool test = true;
 
-  std::string loc1 = setlocale(LC_ALL, "ja_JP.eucjp");
-  test01();
-  test02();
-  test03();
-  test05();
-  test06();
-  test07();
-  std::string loc2 = setlocale(LC_ALL, NULL);
-  VERIFY( loc1 == loc2 );
+  const char* tentLANG = setlocale(LC_ALL, "ja_JP.eucjp");
+  if (tentLANG != NULL)
+    {
+      std::string preLANG = tentLANG;
+      test01();
+      test02();
+      test03();
+      test05();
+      test06();
+      test07();
+      std::string postLANG = setlocale(LC_ALL, NULL);
+      VERIFY( preLANG == postLANG );
+    }
 }
 #endif
 
diff -urN 
libstdc++-v3-orig/testsuite/22_locale/money_put_members_char.cc 
libstdc++-v3/testsuite/22_locale/money_put_members_char.cc
--- libstdc++-v3-orig/testsuite/22_locale/money_put_members_char.cc    
2002-05-06 23:12:15.000000000 +0200
+++ libstdc++-v3/testsuite/22_locale/money_put_members_char.cc    
2002-05-08 22:29:33.000000000 +0200
@@ -373,14 +373,18 @@
 {
   bool test = true;
 
-  std::string loc1 = setlocale(LC_ALL, "ja_JP.eucjp");
-  test01();
-  test02();
-  test03();
-  test05();
-  test06();
-  std::string loc2 = setlocale(LC_ALL, NULL);
-  VERIFY( loc1 == loc2 );
+  const char* tentLANG = setlocale(LC_ALL, "ja_JP.eucjp");
+  if (tentLANG != NULL)
+    {
+      std::string preLANG = tentLANG;
+      test01();
+      test02();
+      test03();
+      test05();
+      test06();
+      std::string postLANG = setlocale(LC_ALL, NULL);
+      VERIFY( preLANG == postLANG );
+    }
 }
 
 int main()
diff -urN 
libstdc++-v3-orig/testsuite/22_locale/money_put_members_wchar_t.cc 
libstdc++-v3/testsuite/22_locale/money_put_members_wchar_t.cc
--- 
libstdc++-v3-orig/testsuite/22_locale/money_put_members_wchar_t.cc    
2002-05-06 23:12:15.000000000 +0200
+++ libstdc++-v3/testsuite/22_locale/money_put_members_wchar_t.cc    
2002-05-08 22:29:42.000000000 +0200
@@ -373,14 +373,18 @@
 {
   bool test = true;
 
-  std::string loc1 = setlocale(LC_ALL, "ja_JP.eucjp");
-  test01();
-  test02();
-  test03();
-  test05();
-  test06();
-  std::string loc2 = setlocale(LC_ALL, NULL);
-  VERIFY( loc1 == loc2 );
+  const char* tentLANG = setlocale(LC_ALL, "ja_JP.eucjp");
+  if (tentLANG != NULL)
+    {
+      std::string preLANG = tentLANG;
+      test01();
+      test02();
+      test03();
+      test05();
+      test06();
+      std::string postLANG = setlocale(LC_ALL, NULL);
+      VERIFY( preLANG == postLANG );
+    }
 }
 #endif
 
diff -urN 
libstdc++-v3-orig/testsuite/22_locale/moneypunct_members_char.cc 
libstdc++-v3/testsuite/22_locale/moneypunct_members_char.cc
--- libstdc++-v3-orig/testsuite/22_locale/moneypunct_members_char.cc    
2002-05-06 23:12:15.000000000 +0200
+++ libstdc++-v3/testsuite/22_locale/moneypunct_members_char.cc    
2002-05-08 22:29:53.000000000 +0200
@@ -128,10 +128,14 @@
 {
   bool test = true;
 
-  std::string loc1 = setlocale(LC_ALL, "ja_JP.eucjp");
-  test01();
-  std::string loc2 = setlocale(LC_ALL, NULL);
-  VERIFY( loc1 == loc2 );
+  const char* tentLANG = setlocale(LC_ALL, "ja_JP.eucjp");
+  if (tentLANG != NULL)
+    {
+      std::string preLANG = tentLANG;
+      test01();
+      std::string postLANG = setlocale(LC_ALL, NULL);
+      VERIFY( preLANG == postLANG );
+    }
 }
 
 int main()
diff -urN 
libstdc++-v3-orig/testsuite/22_locale/moneypunct_members_wchar_t.cc 
libstdc++-v3/testsuite/22_locale/moneypunct_members_wchar_t.cc
--- 
libstdc++-v3-orig/testsuite/22_locale/moneypunct_members_wchar_t.cc    
2002-05-06 23:12:15.000000000 +0200
+++ libstdc++-v3/testsuite/22_locale/moneypunct_members_wchar_t.cc    
2002-05-08 22:30:03.000000000 +0200
@@ -129,10 +129,14 @@
 {
   bool test = true;
 
-  std::string loc1 = setlocale(LC_ALL, "ja_JP.eucjp");
-  test01();
-  std::string loc2 = setlocale(LC_ALL, NULL);
-  VERIFY( loc1 == loc2 );
+  const char* tentLANG = setlocale(LC_ALL, "ja_JP.eucjp");
+  if (tentLANG != NULL)
+    {
+      std::string preLANG = tentLANG;
+      test01();
+      std::string postLANG = setlocale(LC_ALL, NULL);
+      VERIFY( preLANG == postLANG );
+    }
 }
 #endif
 
diff -urN libstdc++-v3-orig/testsuite/22_locale/num_get_members_char.cc 
libstdc++-v3/testsuite/22_locale/num_get_members_char.cc
--- libstdc++-v3-orig/testsuite/22_locale/num_get_members_char.cc    
2002-05-06 23:12:15.000000000 +0200
+++ libstdc++-v3/testsuite/22_locale/num_get_members_char.cc    
2002-05-08 22:30:16.000000000 +0200
@@ -418,13 +418,17 @@
 {
   bool test = true;
 
-  std::string loc1 = setlocale(LC_ALL, "ja_JP.eucjp");
-  test01();
-  test02();
-  test04();
-  test05();
-  std::string loc2 = setlocale(LC_ALL, NULL);
-  VERIFY( loc1 == loc2 );
+  const char* tentLANG = setlocale(LC_ALL, "ja_JP.eucjp");
+  if (tentLANG != NULL)
+    {
+      std::string preLANG = tentLANG;
+      test01();
+      test02();
+      test04();
+      test05();
+      std::string postLANG = setlocale(LC_ALL, NULL);
+      VERIFY( preLANG == postLANG );
+    }
 }
 
 int main()
diff -urN 
libstdc++-v3-orig/testsuite/22_locale/num_get_members_wchar_t.cc 
libstdc++-v3/testsuite/22_locale/num_get_members_wchar_t.cc
--- libstdc++-v3-orig/testsuite/22_locale/num_get_members_wchar_t.cc    
2002-05-06 23:12:15.000000000 +0200
+++ libstdc++-v3/testsuite/22_locale/num_get_members_wchar_t.cc    
2002-05-08 22:30:27.000000000 +0200
@@ -420,13 +420,17 @@
 {
   bool test = true;
 
-  std::string loc1 = setlocale(LC_ALL, "ja_JP.eucjp");
-  test01();
-  test02();
-  test04();
-  test05();
-  std::string loc2 = setlocale(LC_ALL, NULL);
-  VERIFY( loc1 == loc2 );
+  const char* tentLANG = setlocale(LC_ALL, "ja_JP.eucjp");
+  if (tentLANG != NULL)
+    {
+      std::string preLANG = tentLANG;
+      test01();
+      test02();
+      test04();
+      test05();
+      std::string postLANG = setlocale(LC_ALL, NULL);
+      VERIFY( preLANG == postLANG );
+    }
 }
 #endif
 
diff -urN libstdc++-v3-orig/testsuite/22_locale/num_put_members_char.cc 
libstdc++-v3/testsuite/22_locale/num_put_members_char.cc
--- libstdc++-v3-orig/testsuite/22_locale/num_put_members_char.cc    
2002-05-06 23:12:15.000000000 +0200
+++ libstdc++-v3/testsuite/22_locale/num_put_members_char.cc    
2002-05-08 22:30:36.000000000 +0200
@@ -315,11 +315,15 @@
 {
   bool test = true;
 
-  std::string loc1 = setlocale(LC_ALL, "ja_JP.eucjp");
-  test01();
-  test02();
-  std::string loc2 = setlocale(LC_ALL, NULL);
-  VERIFY( loc1 == loc2 );
+  const char* tentLANG = setlocale(LC_ALL, "ja_JP.eucjp");
+  if (tentLANG != NULL)
+    {
+      std::string preLANG = tentLANG;
+      test01();
+      test02();
+      std::string postLANG = setlocale(LC_ALL, NULL);
+      VERIFY( preLANG == postLANG );
+    }
 }
 
 int main()
diff -urN 
libstdc++-v3-orig/testsuite/22_locale/num_put_members_wchar_t.cc 
libstdc++-v3/testsuite/22_locale/num_put_members_wchar_t.cc
--- libstdc++-v3-orig/testsuite/22_locale/num_put_members_wchar_t.cc    
2002-05-06 23:12:15.000000000 +0200
+++ libstdc++-v3/testsuite/22_locale/num_put_members_wchar_t.cc    
2002-05-08 22:30:47.000000000 +0200
@@ -315,11 +315,15 @@
 {
   bool test = true;
 
-  std::string loc1 = setlocale(LC_ALL, "ja_JP.eucjp");
-  test01();
-  test02();
-  std::string loc2 = setlocale(LC_ALL, NULL);
-  VERIFY( loc1 == loc2 );
+  const char* tentLANG = setlocale(LC_ALL, "ja_JP.eucjp");
+  if (tentLANG != NULL)
+    {
+      std::string preLANG = tentLANG;
+      test01();
+      test02();
+      std::string postLANG = setlocale(LC_ALL, NULL);
+      VERIFY( preLANG == postLANG );
+    }
 }
 #endif
 
diff -urN libstdc++-v3-orig/testsuite/22_locale/numpunct_members_char.cc 
libstdc++-v3/testsuite/22_locale/numpunct_members_char.cc
--- libstdc++-v3-orig/testsuite/22_locale/numpunct_members_char.cc    
2002-05-06 23:12:15.000000000 +0200
+++ libstdc++-v3/testsuite/22_locale/numpunct_members_char.cc    
2002-05-08 22:30:58.000000000 +0200
@@ -106,10 +106,14 @@
 {
   bool test = true;
 
-  std::string loc1 = setlocale(LC_ALL, "ja_JP.eucjp");
-  test01();
-  std::string loc2 = setlocale(LC_ALL, NULL);
-  VERIFY( loc1 == loc2 );
+  const char* tentLANG = setlocale(LC_ALL, "ja_JP.eucjp");
+  if (tentLANG != NULL)
+    {
+      std::string preLANG = tentLANG;
+      test01();
+      std::string postLANG = setlocale(LC_ALL, NULL);
+      VERIFY( preLANG == postLANG );
+    }
 }
 
 int main()
diff -urN 
libstdc++-v3-orig/testsuite/22_locale/numpunct_members_wchar_t.cc 
libstdc++-v3/testsuite/22_locale/numpunct_members_wchar_t.cc
--- libstdc++-v3-orig/testsuite/22_locale/numpunct_members_wchar_t.cc    
2002-05-06 23:12:15.000000000 +0200
+++ libstdc++-v3/testsuite/22_locale/numpunct_members_wchar_t.cc    
2002-05-08 22:31:08.000000000 +0200
@@ -104,10 +104,14 @@
 {
   bool test = true;
 
-  std::string loc1 = setlocale(LC_ALL, "ja_JP.eucjp");
-  test01();
-  std::string loc2 = setlocale(LC_ALL, NULL);
-  VERIFY( loc1 == loc2 );
+  const char* tentLANG = setlocale(LC_ALL, "ja_JP.eucjp");
+  if (tentLANG != NULL)
+    {
+      std::string preLANG = tentLANG;
+      test01();
+      std::string postLANG = setlocale(LC_ALL, NULL);
+      VERIFY( preLANG == postLANG );
+    }
 }
 #endif
 
diff -urN libstdc++-v3-orig/testsuite/22_locale/time_get_members_char.cc 
libstdc++-v3/testsuite/22_locale/time_get_members_char.cc
--- libstdc++-v3-orig/testsuite/22_locale/time_get_members_char.cc    
2002-05-06 23:12:15.000000000 +0200
+++ libstdc++-v3/testsuite/22_locale/time_get_members_char.cc    
2002-05-08 22:31:20.000000000 +0200
@@ -704,15 +704,19 @@
 {
   bool test = true;
 
-  std::string loc1 = setlocale(LC_ALL, "ja_JP.eucjp");
-  test01();
-  test02();
-  test03();
-  test04();
-  test05();
-  test06();
-  std::string loc2 = setlocale(LC_ALL, NULL);
-  VERIFY( loc1 == loc2 );
+  const char* tentLANG = setlocale(LC_ALL, "ja_JP.eucjp");
+  if (tentLANG != NULL)
+    {
+      std::string preLANG = tentLANG;
+      test01();
+      test02();
+      test03();
+      test04();
+      test05();
+      test06();
+      std::string postLANG = setlocale(LC_ALL, NULL);
+      VERIFY( preLANG == postLANG );
+    }
 }
 
 int main()
diff -urN 
libstdc++-v3-orig/testsuite/22_locale/time_get_members_wchar_t.cc 
libstdc++-v3/testsuite/22_locale/time_get_members_wchar_t.cc
--- libstdc++-v3-orig/testsuite/22_locale/time_get_members_wchar_t.cc    
2002-05-06 23:12:15.000000000 +0200
+++ libstdc++-v3/testsuite/22_locale/time_get_members_wchar_t.cc    
2002-05-08 22:31:30.000000000 +0200
@@ -704,15 +704,19 @@
 {
   bool test = true;
 
-  std::string loc1 = setlocale(LC_ALL, "ja_JP.eucjp");
-  test01();
-  test02();
-  test03();
-  test04();
-  test05();
-  test06();
-  std::string loc2 = setlocale(LC_ALL, NULL);
-  VERIFY( loc1 == loc2 );
+  const char* tentLANG = setlocale(LC_ALL, "ja_JP.eucjp");
+  if (tentLANG != NULL)
+    {
+      std::string preLANG = tentLANG;
+      test01();
+      test02();
+      test03();
+      test04();
+      test05();
+      test06();
+      std::string postLANG = setlocale(LC_ALL, NULL);
+      VERIFY( preLANG == postLANG );
+    }
 }
 #endif
 
diff -urN libstdc++-v3-orig/testsuite/22_locale/time_put_members_char.cc 
libstdc++-v3/testsuite/22_locale/time_put_members_char.cc
--- libstdc++-v3-orig/testsuite/22_locale/time_put_members_char.cc    
2002-05-06 23:12:15.000000000 +0200
+++ libstdc++-v3/testsuite/22_locale/time_put_members_char.cc    
2002-05-08 22:31:39.000000000 +0200
@@ -255,11 +255,15 @@
 {
   bool test = true;
 
-  std::string loc1 = setlocale(LC_ALL, "ja_JP.eucjp");
-  test01();
-  test02();
-  std::string loc2 = setlocale(LC_ALL, NULL);
-  VERIFY( loc1 == loc2 );
+  const char* tentLANG = setlocale(LC_ALL, "ja_JP.eucjp");
+  if (tentLANG != NULL)
+    {
+      std::string preLANG = tentLANG;
+      test01();
+      test02();
+      std::string postLANG = setlocale(LC_ALL, NULL);
+      VERIFY( preLANG == postLANG );
+    }
 }
 
 int main()
diff -urN 
libstdc++-v3-orig/testsuite/22_locale/time_put_members_wchar_t.cc 
libstdc++-v3/testsuite/22_locale/time_put_members_wchar_t.cc
--- libstdc++-v3-orig/testsuite/22_locale/time_put_members_wchar_t.cc    
2002-05-06 23:12:15.000000000 +0200
+++ libstdc++-v3/testsuite/22_locale/time_put_members_wchar_t.cc    
2002-05-08 22:31:50.000000000 +0200
@@ -257,11 +257,15 @@
 {
   bool test = true;
 
-  std::string loc1 = setlocale(LC_ALL, "ja_JP.eucjp");
-  test01();
-  test02();
-  std::string loc2 = setlocale(LC_ALL, NULL);
-  VERIFY( loc1 == loc2 );
+  const char* tentLANG = setlocale(LC_ALL, "ja_JP.eucjp");
+  if (tentLANG != NULL)
+    {
+      std::string preLANG = tentLANG;
+      test01();
+      test02();
+      std::string postLANG = setlocale(LC_ALL, NULL);
+      VERIFY( preLANG == postLANG );
+    }
 }
 #endif
 



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]