]> git.ipfire.org Git - thirdparty/gcc.git/blame - libstdc++-v3/testsuite/27_io/basic_istream/readsome/char/8258.cc
Fix defintion of TRAMPOLINE_SIZE
[thirdparty/gcc.git] / libstdc++-v3 / testsuite / 27_io / basic_istream / readsome / char / 8258.cc
CommitLineData
23cac885 1// 1999-08-11 bkoz
b2dad0e3 2
23cac885 3// Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation
b2dad0e3
BK
4//
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)
9// any later version.
10
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.
15
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,
23cac885
BK
19// USA.
20
21// 27.6.1.3 unformatted input functions
22// @require@ %-*.tst %-*.txt
23// @diff@ %-*.tst %-*.txt
b2dad0e3 24
23cac885
BK
25#include <cstring> // for strncmp,...
26#include <istream>
b2dad0e3 27#include <sstream>
23cac885 28#include <fstream>
fe413112 29#include <testsuite_hooks.h>
b2dad0e3 30
23cac885
BK
31// libstdc++/8258
32class mybuf : public std::basic_streambuf<char>
33{ };
b2dad0e3 34
23cac885 35void test11()
b2dad0e3 36{
11f10e6b 37 bool test __attribute__((unused)) = true;
23cac885
BK
38 using namespace std;
39 char arr[10];
40 mybuf sbuf;
41 basic_istream<char, char_traits<char> > istr(&sbuf);
42
43 VERIFY(istr.rdstate() == ios_base::goodbit);
44 VERIFY(istr.readsome(arr, 10) == 0);
45 VERIFY(istr.rdstate() == ios_base::goodbit);
46}
47
48int
49main()
b2dad0e3 50{
23cac885 51 test11();
04d930e6 52 return 0;
b2dad0e3 53}