]> git.ipfire.org Git - thirdparty/gcc.git/blame - libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/wchar_t/26181.cc
Update copyright years.
[thirdparty/gcc.git] / libstdc++-v3 / testsuite / 27_io / basic_istream / extractors_other / wchar_t / 26181.cc
CommitLineData
a5544970 1// Copyright (C) 2006-2019 Free Software Foundation, Inc.
6f4d3d86
PC
2//
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
748086b7 6// Free Software Foundation; either version 3, or (at your option)
6f4d3d86
PC
7// any later version.
8
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.
13
14// You should have received a copy of the GNU General Public License along
748086b7
JJ
15// with this library; see the file COPYING3. If not see
16// <http://www.gnu.org/licenses/>.
6f4d3d86
PC
17
18#include <istream>
19#include <sstream>
20#include <testsuite_hooks.h>
21
22// libstdc++/26181
23void test01()
24{
25 using namespace std;
6f4d3d86
PC
26
27 typedef wistringstream::pos_type pos_type;
28
29 wistringstream iss(L"Territoires de l'Oubli");
30 wostringstream oss;
31
32 VERIFY( iss.tellg() == pos_type(0) );
33
34 iss >> oss.rdbuf();
35 VERIFY( iss.rdstate() == iss.eofbit );
36
37 iss.clear();
38 VERIFY( iss.tellg() == pos_type(22) );
39
40 iss.get();
41 VERIFY( iss.tellg() == pos_type(-1) );
42}
43
44int main()
45{
46 test01();
47 return 0;
48}