]> git.ipfire.org Git - thirdparty/gcc.git/blame - libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/char/26181.cc
Update copyright years.
[thirdparty/gcc.git] / libstdc++-v3 / testsuite / 27_io / basic_istream / extractors_other / char / 26181.cc
CommitLineData
fbd26352 1// Copyright (C) 2006-2019 Free Software Foundation, Inc.
c22bf199 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
6bc9506f 6// Free Software Foundation; either version 3, or (at your option)
c22bf199 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
6bc9506f 15// with this library; see the file COPYING3. If not see
16// <http://www.gnu.org/licenses/>.
c22bf199 17
18#include <istream>
19#include <sstream>
20#include <testsuite_hooks.h>
21
22// libstdc++/26181
23void test01()
24{
25 using namespace std;
c22bf199 26
27 typedef istringstream::pos_type pos_type;
28
29 istringstream iss("Territoires de l'Oubli");
30 ostringstream 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}