3 // Copyright (C) 1994, 1999, 2001 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 2, 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 COPYING. If not, write to the Free
18 // Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
21 // 27.6.1.4 standard basic_istream manipulators
26 #include <testsuite_hooks.h>
32 const char str_lit01
[] = " venice ";
33 const std::string
str01(" santa barbara ");
34 std::string
str02(str_lit01
);
37 std::ios_base::iostate flag1
, flag2
, flag3
, flag4
, flag5
;
39 // template<_CharT, _Traits>
40 // basic_istream<_CharT, _Traits>& ws(basic_istream<_Char, _Traits>& is)
41 std::istringstream
iss01(str01
);
42 std::istringstream
iss02(str01
);
45 VERIFY( str04
.size() != str01
.size() );
46 VERIFY( str04
== "santa" );
50 VERIFY( str05
.size() != str01
.size() );
51 VERIFY( str05
== "santa" );
52 VERIFY( str05
== str04
);
55 VERIFY( str04
.size() != str01
.size() );
56 VERIFY( str04
== "barbara" );
60 VERIFY( str05
.size() != str01
.size() );
61 VERIFY( str05
== "barbara" );
62 VERIFY( str05
== str04
);
64 flag3
= std::ios_base::eofbit
;
65 flag4
= std::ios_base::badbit
;
66 flag5
= std::ios_base::failbit
;
67 VERIFY( !iss01
.fail() );
68 VERIFY( !iss02
.fail() );
69 VERIFY( !iss01
.eof() );
70 VERIFY( !iss02
.eof() );
73 VERIFY( !iss01
.fail() );
74 VERIFY( iss01
.eof() );