1 // Copyright (C) 2004 Free Software Foundation, Inc.
3 // This file is part of the GNU ISO C++ Library. This library is free
4 // software; you can redistribute it and/or modify it under the
5 // terms of the GNU General Public License as published by the
6 // Free Software Foundation; either version 2, or (at your option)
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // You should have received a copy of the GNU General Public License along
15 // with this library; see the file COPYING. If not, write to the Free
16 // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
19 // 27.6.1.4 standard basic_istream manipulators
24 #include <testsuite_hooks.h>
28 bool test
__attribute__((unused
)) = true;
30 const wchar_t str_lit01
[] = L
" venice ";
31 const std::wstring
str01(L
" santa barbara ");
32 std::wstring
str02(str_lit01
);
35 std::ios_base::iostate flag3
, flag4
, flag5
;
37 // template<_CharT, _Traits>
38 // basic_istream<_CharT, _Traits>& ws(basic_istream<_Char, _Traits>& is)
39 std::wistringstream
iss01(str01
);
40 std::wistringstream
iss02(str01
);
43 VERIFY( str04
.size() != str01
.size() );
44 VERIFY( str04
== L
"santa" );
48 VERIFY( str05
.size() != str01
.size() );
49 VERIFY( str05
== L
"santa" );
50 VERIFY( str05
== str04
);
53 VERIFY( str04
.size() != str01
.size() );
54 VERIFY( str04
== L
"barbara" );
58 VERIFY( str05
.size() != str01
.size() );
59 VERIFY( str05
== L
"barbara" );
60 VERIFY( str05
== str04
);
62 flag3
= std::ios_base::eofbit
;
63 flag4
= std::ios_base::badbit
;
64 flag5
= std::ios_base::failbit
;
65 VERIFY( !iss01
.fail() );
66 VERIFY( !iss02
.fail() );
67 VERIFY( !iss01
.eof() );
68 VERIFY( !iss02
.eof() );
71 VERIFY( !iss01
.fail() );
72 VERIFY( iss01
.eof() );