gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/pbackfail/char/9761.cc

58 lines
1.5 KiB
C++
Raw Normal View History

// 2003-06-02 Paolo Carlini <pcarlini@unitus.it>
// Copyright (C) 2003 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 27.8.1.4 Overridden virtual functions
libstdc++.exp (check_v3_target_fileio, [...]): New. * testsuite/lib/libstdc++.exp (check_v3_target_fileio, check_v3_target_time): New. * testsuite/lib/dg-options.exp (dg-require-fileio, dg-require-time): New. * testsuite/ext/stdio_sync_filebuf/char/12048-1.cc: Use it. * testsuite/ext/stdio_sync_filebuf/char/12048-2.cc: Use it. * testsuite/ext/stdio_sync_filebuf/char/12048-3.cc: Use it. * testsuite/ext/stdio_sync_filebuf/char/12048-4.cc: Use it. * testsuite/ext/stdio_sync_filebuf/char/1.cc: Use it. * testsuite/ext/stdio_filebuf/char/2.cc: Use it. * testsuite/ext/stdio_filebuf/char/10063-1.cc: Use it. * testsuite/ext/stdio_filebuf/char/10063-2.cc: Use it. * testsuite/ext/stdio_filebuf/char/10063-3.cc: Use it. * testsuite/22_locale/time_put/put/char/12439_1.cc: Use it. * testsuite/22_locale/time_put/put/char/12439_3.cc: Use it. * testsuite/27_io/basic_ofstream/open/char/1.cc: Use it. * testsuite/27_io/basic_ofstream/cons/char/2.cc: Use it. * testsuite/27_io/objects/char/12048-2.cc: Use it. * testsuite/27_io/objects/char/12048-4.cc: Use it. * testsuite/27_io/objects/char/12048-1.cc: Use it. * testsuite/27_io/objects/char/12048-3.cc: Use it. * testsuite/27_io/objects/char/10.cc: Use it. * testsuite/27_io/objects/char/12048-5.cc: Use it. * testsuite/27_io/basic_istream/get/char/2.cc: Use it. * testsuite/27_io/basic_istream/ignore/char/2.cc: Use it. * testsuite/27_io/basic_istream/ignore/char/3.cc: Use it. * testsuite/27_io/basic_istream/getline/char/5.cc: Use it. * testsuite/27_io/basic_istream/seekg/char/sstream.cc: Use it. * testsuite/27_io/basic_istream/seekg/char/fstream.cc: Use it. * testsuite/27_io/basic_istream/readsome/char/6746-2.cc: Use it. * testsuite/27_io/basic_istream/extractors_other/char/2.cc: Use it. * testsuite/27_io/basic_istream/tellg/char/sstream.cc: Use it. * testsuite/27_io/basic_istream/tellg/char/1.cc: Use it. * testsuite/27_io/basic_istream/tellg/char/fstream.cc: Use it. * testsuite/27_io/basic_istream/extractors_character/char/4.cc: Use it. * testsuite/27_io/basic_ostream/inserters_other/char/1.cc: Use it. * testsuite/27_io/basic_ostream/tellp/char/1.cc: Use it. * testsuite/27_io/basic_ostream/seekp/char/2346-fstream.cc: Use it. * testsuite/27_io/basic_ifstream/open/char/1.cc: Use it. * testsuite/27_io/basic_ifstream/cons/char/1.cc: Use it. * testsuite/27_io/basic_filebuf/sputbackc/char/1-in.cc: Use it. * testsuite/27_io/basic_filebuf/sputbackc/char/1-io.cc: Use it. * testsuite/27_io/basic_filebuf/sputbackc/char/2-in.cc: Use it. * testsuite/27_io/basic_filebuf/sputbackc/char/2-io.cc: Use it. * testsuite/27_io/basic_filebuf/sgetn/char/3.cc: Use it. * testsuite/27_io/basic_filebuf/sgetn/char/1-in.cc: Use it. * testsuite/27_io/basic_filebuf/sgetn/char/1-io.cc: Use it. * testsuite/27_io/basic_filebuf/sgetn/char/2-in.cc: Use it. * testsuite/27_io/basic_filebuf/sgetn/char/2-io.cc: Use it. * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc: Use it. * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc: Use it. * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc: Use it. * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc: Use it. * testsuite/27_io/basic_filebuf/seekoff/char/1-in.cc: Use it. * testsuite/27_io/basic_filebuf/seekoff/char/1-io.cc: Use it. * testsuite/27_io/basic_filebuf/seekoff/char/1-out.cc: Use it. * testsuite/27_io/basic_filebuf/seekoff/char/2-in.cc: Use it. * testsuite/27_io/basic_filebuf/seekoff/char/2-io.cc: Use it. * testsuite/27_io/basic_filebuf/seekoff/char/2-out.cc: Use it. * testsuite/27_io/basic_filebuf/seekoff/char/3-in.cc: Use it. * testsuite/27_io/basic_filebuf/seekoff/char/3-io.cc: Use it. * testsuite/27_io/basic_filebuf/seekoff/char/3-out.cc: Use it. * testsuite/27_io/basic_filebuf/seekoff/char/11543.cc: Use it. * testsuite/27_io/basic_filebuf/seekoff/char/12790-1.cc: Use it. * testsuite/27_io/basic_filebuf/seekoff/char/12790-2.cc: Use it. * testsuite/27_io/basic_filebuf/seekoff/char/12790-3.cc: Use it. * testsuite/27_io/basic_filebuf/seekoff/char/12790-4.cc: Use it. * testsuite/27_io/basic_filebuf/in_avail/char/1.cc: Use it. * testsuite/27_io/basic_filebuf/in_avail/char/9701-3.cc: Use it. * testsuite/27_io/basic_filebuf/setbuf/char/1.cc: Use it. * testsuite/27_io/basic_filebuf/setbuf/char/2.cc: Use it. * testsuite/27_io/basic_filebuf/setbuf/char/3.cc: Use it. * testsuite/27_io/basic_filebuf/setbuf/char/12875-1.cc: Use it. * testsuite/27_io/basic_filebuf/setbuf/char/12875-2.cc: Use it. * testsuite/27_io/basic_filebuf/sbumpc/char/1-in.cc: Use it. * testsuite/27_io/basic_filebuf/sbumpc/char/1-io.cc: Use it. * testsuite/27_io/basic_filebuf/sbumpc/char/2-in.cc: Use it. * testsuite/27_io/basic_filebuf/sbumpc/char/2-io.cc: Use it. * testsuite/27_io/basic_filebuf/sbumpc/char/9825.cc: Use it. * testsuite/27_io/basic_filebuf/is_open/char/1.cc: Use it. * testsuite/27_io/basic_filebuf/sputc/char/1-io.cc: Use it. * testsuite/27_io/basic_filebuf/sputc/char/1-out.cc: Use it. * testsuite/27_io/basic_filebuf/sputc/char/2-io.cc: Use it. * testsuite/27_io/basic_filebuf/sputc/char/2-out.cc: Use it. * testsuite/27_io/basic_filebuf/open/12790-1.cc: Use it. * testsuite/27_io/basic_filebuf/open/char/1.cc: Use it. * testsuite/27_io/basic_filebuf/open/char/2.cc: Use it. * testsuite/27_io/basic_filebuf/open/char/3.cc: Use it. * testsuite/27_io/basic_filebuf/overflow/char/2-unbuf.cc: Use it. * testsuite/27_io/basic_filebuf/overflow/char/2.cc: Use it. * testsuite/27_io/basic_filebuf/overflow/char/9988.cc: Use it. * testsuite/27_io/basic_filebuf/overflow/char/9182-2.cc: Use it. * testsuite/27_io/basic_filebuf/overflow/char/9169.cc: Use it. * testsuite/27_io/basic_filebuf/snextc/char/1-in.cc: Use it. * testsuite/27_io/basic_filebuf/snextc/char/1-io.cc: Use it. * testsuite/27_io/basic_filebuf/snextc/char/2-in.cc: Use it. * testsuite/27_io/basic_filebuf/snextc/char/2-io.cc: Use it. * testsuite/27_io/basic_filebuf/sgetc/char/1-in.cc: Use it. * testsuite/27_io/basic_filebuf/sgetc/char/1-io.cc: Use it. * testsuite/27_io/basic_filebuf/sgetc/char/1-out.cc: Use it. * testsuite/27_io/basic_filebuf/sgetc/char/2-in.cc: Use it. * testsuite/27_io/basic_filebuf/sgetc/char/2-io.cc: Use it. * testsuite/27_io/basic_filebuf/close/12790-1.cc: Use it. * testsuite/27_io/basic_filebuf/close/char/1.cc: Use it. * testsuite/27_io/basic_filebuf/close/char/12790-1.cc: Use it. * testsuite/27_io/basic_filebuf/close/char/12790-2.cc: Use it. * testsuite/27_io/basic_filebuf/close/char/2.cc: Use it. * testsuite/27_io/basic_filebuf/close/char/12790-3.cc: Use it. * testsuite/27_io/basic_filebuf/close/char/12790-4.cc: Use it. * testsuite/27_io/basic_filebuf/close/char/4.cc: Use it. * testsuite/27_io/basic_filebuf/underflow/10096.cc: Use it. * testsuite/27_io/basic_filebuf/underflow/char/2.cc: Use it. * testsuite/27_io/basic_filebuf/sungetc/char/1-in.cc: Use it. * testsuite/27_io/basic_filebuf/sungetc/char/1-io.cc: Use it. * testsuite/27_io/basic_filebuf/sungetc/char/2-in.cc: Use it. * testsuite/27_io/basic_filebuf/sungetc/char/2-io.cc: Use it. * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc: Use it. * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc: Use it. * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc: Use it. * testsuite/27_io/basic_filebuf/seekpos/char/12790-1.cc: Use it. * testsuite/27_io/basic_filebuf/seekpos/char/12790-2.cc: Use it. * testsuite/27_io/basic_filebuf/seekpos/char/12790-4.cc: Use it. * testsuite/27_io/basic_filebuf/seekpos/char/1-in.cc: Use it. * testsuite/27_io/basic_filebuf/seekpos/char/1-io.cc: Use it. * testsuite/27_io/basic_filebuf/seekpos/char/1-out.cc: Use it. * testsuite/27_io/basic_filebuf/seekpos/char/2-in.cc: Use it. * testsuite/27_io/basic_filebuf/seekpos/char/2-io.cc: Use it. * testsuite/27_io/basic_filebuf/seekpos/char/2-out.cc: Use it. * testsuite/27_io/basic_filebuf/seekpos/char/3-in.cc: Use it. * testsuite/27_io/basic_filebuf/seekpos/char/3-io.cc: Use it. * testsuite/27_io/basic_filebuf/seekpos/char/3-out.cc: Use it. * testsuite/27_io/basic_filebuf/sputn/char/1-io.cc: Use it. * testsuite/27_io/basic_filebuf/sputn/char/1-out.cc: Use it. * testsuite/27_io/basic_filebuf/sputn/char/2-io.cc: Use it. * testsuite/27_io/basic_filebuf/sputn/char/2-out.cc: Use it. * testsuite/27_io/basic_filebuf/sputn/char/9339.cc: Use it. * testsuite/27_io/basic_filebuf/pbackfail/char/9761.cc: Use it. * testsuite/27_io/basic_filebuf/sync/char/9182-1.cc: Use it. * testsuite/21_strings/basic_string/inserters_extractors/char/10.cc: Use it. * testsuite/21_strings/basic_string/inserters_extractors/char/11.cc: Use it. * testsuite/21_strings/basic_string/inserters_extractors/char/5.cc: Use it. From-SVN: r122913
2007-03-14 12:37:55 +01:00
// { dg-require-fileio "" }
#include <fstream>
#include <testsuite_hooks.h>
const char name_01[] = "filebuf_virtuals-1.txt"; // file with data in it
// libstdc++/9761
void test01()
{
using namespace std;
bool test __attribute__((unused)) = true;
filebuf fbuf;
filebuf::int_type r1, r2;
fbuf.open(name_01, ios_base::in);
fbuf.sbumpc();
fbuf.sbumpc();
r1 = fbuf.sputbackc('a');
r2 = fbuf.sputbackc('b');
fbuf.close();
VERIFY( r1 != filebuf::traits_type::eof() );
VERIFY( r2 == filebuf::traits_type::eof() );
}
int main()
{
test01();
return 0;
}