]>
git.ipfire.org Git - thirdparty/gcc.git/blob - libstdc++-v3/testsuite/27_io/basic_istringstream/str/wchar_t/1.cc
1 // Copyright (C) 2004-2020 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 3, 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 COPYING3. If not see
16 // <http://www.gnu.org/licenses/>.
18 // 27.7.2.2 member functions (istringstream_members)
21 #include <testsuite_hooks.h>
25 std::wistringstream is01
;
26 const std::wstring str00
;
27 const std::wstring str01
= L
"123";
32 std::ios_base::iostate state1
, state2
, stateeof
;
33 stateeof
= std::ios_base::eofbit
;
37 VERIFY( str00
== str02
);
39 // void str(const basic_string&)
42 VERIFY( str01
== str02
);
43 state1
= is01
.rdstate();
45 state2
= is01
.rdstate();
47 // 22.2.2.1.2 num_get virtual functions
49 // in any case, if stage 2 processing was terminated by the test for
50 // in == end then err != ios_base::eofbit is performed.
51 VERIFY( state1
!= state2
);
52 VERIFY( state2
== stateeof
);
57 // as is01.good() is false, istream::sentry blocks extraction.
60 state1
= is01
.rdstate();
62 state2
= is01
.rdstate();
64 VERIFY( state1
!= state2
);
65 VERIFY( state2
== stateeof
);