OSDN Git Service

2002-01-22 Benjamin Kosnik <bkoz@redhat.com>
[pf3gnuchains/gcc-fork.git] / libstdc++-v3 / testsuite / 22_locale / collate_members_wchar_t.cc
index 445096c..d94dca4 100644 (file)
@@ -1,6 +1,6 @@
 // 2001-08-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
@@ -128,12 +128,29 @@ void test01()
   i2 = coll_de.compare(strlit3, strlit3 + size3, strlit4, strlit4 + size4);
   VERIFY(i1 == i2);
 }
+
+// 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);
+    }
+}
 #endif
 
 int main()
 {
 #if _GLIBCPP_USE_WCHAR_T
   test01();
+  test02();
 #endif
   return 0;
 }