OSDN Git Service

2002-01-22 Benjamin Kosnik <bkoz@redhat.com>
[pf3gnuchains/gcc-fork.git] / libstdc++-v3 / testsuite / 22_locale / messages_members_char.cc
index bb34794..485c488 100644 (file)
@@ -1,6 +1,6 @@
 // 2001-07-17 Benjamin Kosnik  <bkoz@redhat.com>
 
-// Copyright (C) 2001 Free Software Foundation
+// Copyright (C) 2001, 2002 Free Software Foundation
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
@@ -79,12 +79,27 @@ void test01()
   VERIFY ( s01 == "please" );
   VERIFY ( s02 == "thank you" );
   mssg_us.close(cat_us);
+}
 
- }
+// libstdc++/5280
+void test02()
+{
+  // Set the global locale to non-"C".
+  std::locale loc_de("de_DE");
+  std::locale::global(loc_de);
+
+  // Set LANG environment variable to de_DE.
+  const char* oldLANG = getenv("LANG");
+  if (!setenv("LANG", "de_DE", 1))
+    {
+      test01();
+      setenv("LANG", oldLANG, 1);
+    }
+}
 
 int main()
 {
   test01();
-
+  test02();
   return 0;
 }