]>
git.ipfire.org Git - thirdparty/gcc.git/blob - libstdc++-v3/testsuite/ext/enc_filebuf/char/13598.cc
1 // Before Solaris 11, iconv -f ISO-8859-1 -t ISO-8859-1 fails with
2 // Not supported ISO-8859-1 to ISO-8859-1
4 // { dg-do run { xfail *-*-solaris2.9 *-*-solaris2.10 } }
5 // { dg-require-iconv "ISO-8859-1" }
7 // Copyright (C) 2004-2014 Free Software Foundation, Inc.
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)
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/>.
27 #include <testsuite_hooks.h>
28 #include <ext/enc_filebuf.h>
32 bool test
__attribute__((unused
)) = true;
33 typedef char char_type
;
34 typedef __gnu_cxx::enc_filebuf
<char_type
> filebuf_type
;
35 typedef filebuf_type::state_type state_type
;
37 const char* str
= "Hello, world!\n";
38 std::locale
loc(std::locale::classic(),
39 new std::codecvt
<char, char, __gnu_cxx::encoding_state
>());
40 state_type
st("ISO-8859-1", "ISO-8859-1");
44 fb
.open("tmp_13598", std::ios_base::out
);
45 std::streamsize n
= fb
.sputn(str
, std::strlen(str
));
49 VERIFY( std::size_t(n
) == std::strlen(str
) );