Merge from mainline (163495:164578).
[official-gcc/graphite-test-results.git] / libstdc++-v3 / testsuite / 27_io / basic_streambuf / imbue / wchar_t / 9322.cc
blob1d4d494c415347e6ba051df0fe86dc2b270c59ec
1 // { dg-require-namedlocale "en_US" }
2 // { dg-require-namedlocale "de_DE" }
4 // 1999-10-11 bkoz
6 // Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2009
7 // Free Software Foundation, Inc.
8 //
9 // This file is part of the GNU ISO C++ Library. This library is free
10 // software; you can redistribute it and/or modify it under the
11 // terms of the GNU General Public License as published by the
12 // Free Software Foundation; either version 3, or (at your option)
13 // any later version.
15 // This library is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU General Public License for more details.
20 // You should have received a copy of the GNU General Public License along
21 // with this library; see the file COPYING3. If not see
22 // <http://www.gnu.org/licenses/>.
25 // 27.5.2 template class basic_streambuf
27 #include <streambuf>
28 #include <locale>
29 #include <testsuite_hooks.h>
31 class testbuf : public std::wstreambuf
33 public:
34 typedef std::wstreambuf::traits_type traits_type;
36 testbuf() : std::wstreambuf() { }
39 // libstdc++/9322
40 void test08()
42 using std::locale;
43 bool test __attribute__((unused)) = true;
45 locale loc;
46 testbuf ob;
47 VERIFY( ob.getloc() == loc );
49 locale::global(locale("en_US"));
50 VERIFY( ob.getloc() == loc );
52 locale loc_de = locale("de_DE");
53 locale ret = ob.pubimbue(loc_de);
54 VERIFY( ob.getloc() == loc_de );
55 VERIFY( ret == loc );
57 locale::global(loc);
58 VERIFY( ob.getloc() == loc_de );
61 int main()
63 test08();
64 return 0;