aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite/27_io/stringbuf_virtuals.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libstdc++-v3/testsuite/27_io/stringbuf_virtuals.cc')
-rw-r--r--libstdc++-v3/testsuite/27_io/stringbuf_virtuals.cc25
1 files changed, 24 insertions, 1 deletions
diff --git a/libstdc++-v3/testsuite/27_io/stringbuf_virtuals.cc b/libstdc++-v3/testsuite/27_io/stringbuf_virtuals.cc
index 318bb72fa8a..8a6add9dfc5 100644
--- a/libstdc++-v3/testsuite/27_io/stringbuf_virtuals.cc
+++ b/libstdc++-v3/testsuite/27_io/stringbuf_virtuals.cc
@@ -1,6 +1,6 @@
// 2001-05-21 Benjamin Kosnik <bkoz@redhat.com>
-// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
//
// 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
@@ -70,6 +70,28 @@ void test02(std::stringbuf& in, bool pass)
VERIFY( p == bad );
}
+// libstdc++/9322
+void test08()
+{
+ using std::locale;
+ bool test = true;
+
+ locale loc;
+ std::stringbuf ob;
+ VERIFY( ob.getloc() == loc );
+
+ locale::global(locale("en_US"));
+ VERIFY( ob.getloc() == loc );
+
+ locale loc_de ("de_DE");
+ locale ret = ob.pubimbue(loc_de);
+ VERIFY( ob.getloc() == loc_de );
+ VERIFY( ret == loc );
+
+ locale::global(loc);
+ VERIFY( ob.getloc() == loc_de );
+}
+
int main()
{
using namespace std;
@@ -83,5 +105,6 @@ int main()
test02(in2, false);
test02(in3, false);
+ test08();
return 0;
}