]>
git.ipfire.org Git - thirdparty/gcc.git/blob - libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/wchar_t/12868.cc
1 // { dg-require-namedlocale "" }
3 // Copyright (C) 2003, 2005, 2009 Free Software Foundation, Inc.
5 // This file is part of the GNU ISO C++ Library. This library is free
6 // software; you can redistribute it and/or modify it under the
7 // terms of the GNU General Public License as published by the
8 // Free Software Foundation; either version 3, or (at your option)
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License along
17 // with this library; see the file COPYING3. If not see
18 // <http://www.gnu.org/licenses/>.
20 // 27.8.1.4 Overridden virtual functions
26 #include <testsuite_hooks.h>
32 bool test
__attribute__((unused
)) = true;
34 locale
loc_is(locale("is_IS.UTF-8"));
37 wofstream
out("tmp_12868");
38 out
<< L
"<? xml version=\"1.0\" encoding=\"UTF-8\" ?>\n";
40 VERIFY( out
.rdbuf()->getloc() == loc_is
);
41 out
<< L
"<greeting>Hall\u00f3 heimur</greeting>\n";
45 wifstream
in("tmp_12868");
48 if (str
.find(L
"encoding=\"UTF-8\"") != wstring::npos
)
51 VERIFY( in
.rdbuf()->getloc() == loc_is
);
54 VERIFY( str
== L
"<greeting>Hall\u00f3 heimur</greeting>" );