Reshuffle 27_io testsuite.
authorBenjamin Kosnik <bkoz@redhat.com>
Thu, 10 Apr 2003 07:15:40 +0000 (07:15 +0000)
committerBenjamin Kosnik <bkoz@gcc.gnu.org>
Thu, 10 Apr 2003 07:15:40 +0000 (07:15 +0000)
2003-04-09  Benjamin Kosnik  <bkoz@redhat.com>

Reshuffle 27_io testsuite.  * testsuite/27_io/filebuf.cc,
filebuf_members-1.tst, filebuf_members-1.txt, filebuf_members.cc,
filebuf_virtuals-1.tst, filebuf_virtuals-1.txt,
filebuf_virtuals-2.tst, filebuf_virtuals-3.tst,
filebuf_virtuals.cc, fpos.cc, fstream.cc, fstream_members.cc,
ifstream.cc, ifstream_members-1.tst, ifstream_members-1.txt,
ifstream_members.cc, instantiations.cc, ios.cc,
ios_base_callbacks.cc, ios_base_members_static-1.tst,
ios_base_members_static.cc, ios_base_storage.cc,
ios_base_types.cc, ios_ctor.cc, ios_init.cc,
ios_manip_basefield.cc, ios_manip_fmtflags.cc, ios_members.cc,
iostream.cc, iostream_members.cc, istream.cc,
istream_exception.cc, istream_extractor_char.cc,
istream_extractor_other-1.tst, istream_extractor_other-1.txt,
istream_extractor_other-2.tst, istream_extractor_other.cc,
istream_manip.cc, istream_seeks-1.tst, istream_seeks-1.txt,
istream_seeks-2.tst, istream_seeks-3.tst, istream_seeks.cc,
istream_sentry.cc, istream_unformatted-1.tst,
istream_unformatted-1.txt, istream_unformatted.cc,
istringstream.cc, istringstream_members.cc,
narrow_stream_objects.cc, ofstream.cc, ofstream_members-1.tst,
ofstream_members.cc, ostream.cc, ostream_exception.cc,
ostream_fail.cc, ostream_inserter_arith.cc,
ostream_inserter_char-1.tst, ostream_inserter_char-1.txt,
ostream_inserter_char.cc, ostream_inserter_other-1.tst,
ostream_inserter_other-2.tst, ostream_inserter_other.cc,
ostream_manip.cc, ostream_seeks-1.tst, ostream_seeks.cc,
ostream_sentry.cc, ostream_unformatted.cc, ostringstream.cc,
ostringstream_members.cc, standard_manipulators.cc, streambuf.cc,
streambuf_members.cc, stringbuf.cc, stringbuf_members.cc,
stringbuf_virtuals.cc, stringstream.cc, stringstream_members.cc,
wide_stream_objects.cc, istream_extractor_arith/01.cc,
istream_extractor_arith/02.cc, istream_extractor_arith/03.cc,
istream_extractor_arith/06.cc, istream_extractor_arith/07.cc,
istream_extractor_arith/08.cc, istream_extractor_arith/09.cc,
istream_extractor_arith/10.cc, istream_extractor_arith/11.cc,
istream_extractor_arith/12.cc, istream_extractor_arith/13.cc:
Split into...
* 27_io/basic_filebuf/1.cc: New.
* 27_io/basic_filebuf/2.cc: New.
* 27_io/basic_filebuf/3.cc: New.
* 27_io/basic_filebuf/4.cc: New.
* 27_io/basic_filebuf/close/char/1.cc: New.
* 27_io/basic_filebuf/close/char/2.cc: New.
* 27_io/basic_filebuf/close/char/3.cc: New.
* 27_io/basic_filebuf/close/char/4879.cc: New.
* 27_io/basic_filebuf/close/char/9964.cc: New.
* 27_io/basic_filebuf/imbue/char/1.cc: New.
* 27_io/basic_filebuf/imbue/char/9322.cc: New.
* 27_io/basic_filebuf/in_avail/char/1.cc: New.
* 27_io/basic_filebuf/is_open/char/1.cc: New.
* 27_io/basic_filebuf/open/char/1.cc: New.
* 27_io/basic_filebuf/open/char/2.cc: New.
* 27_io/basic_filebuf/open/char/3.cc: New.
* 27_io/basic_filebuf/open/char/9507.cc: New.
* 27_io/basic_filebuf/overflow/char/1.cc: New.
* 27_io/basic_filebuf/overflow/char/3599.cc: New.
* 27_io/basic_filebuf/overflow/char/9169.cc: New.
* 27_io/basic_filebuf/overflow/char/9182-2.cc: New.
* 27_io/basic_filebuf/overflow/char/9988.cc: New.
* 27_io/basic_filebuf/sbumpc/char/1.cc: New.
* 27_io/basic_filebuf/sbumpc/char/9825.cc: New.
* 27_io/basic_filebuf/seekoff/char/1.cc: New.
* 27_io/basic_filebuf/seekoff/char/2.cc: New.
* 27_io/basic_filebuf/seekpos/char/1.cc: New.
* 27_io/basic_filebuf/seekpos/char/2.cc: New.
* 27_io/basic_filebuf/setbuf/char/1.cc: New.
* 27_io/basic_filebuf/setbuf/char/2.cc: New.
* 27_io/basic_filebuf/setbuf/char/3.cc: New.
* 27_io/basic_filebuf/sgetc/char/1.cc: New.
* 27_io/basic_filebuf/sgetn/char/1.cc: New.
* 27_io/basic_filebuf/sgetn/char/2.cc: New.
* 27_io/basic_filebuf/snextc/char/1.cc: New.
* 27_io/basic_filebuf/sputbackc/char/1.cc: New.
* 27_io/basic_filebuf/sputbackc/char/9425.cc: New.
* 27_io/basic_filebuf/sputc/char/1.cc: New.
* 27_io/basic_filebuf/sputc/char/1057.cc: New.
* 27_io/basic_filebuf/sputc/char/9701-2.cc: New.
* 27_io/basic_filebuf/sputn/char/1.cc: New.
* 27_io/basic_filebuf/sputn/char/1057.cc: New.
* 27_io/basic_filebuf/sputn/char/9701-1.cc: New.
* 27_io/basic_filebuf/sungetc/char/1.cc: New.
* 27_io/basic_filebuf/sync/char/1057.cc: New.
* 27_io/basic_filebuf/sync/char/9182-1.cc: New.
* 27_io/basic_filebuf/underflow/char/10097.cc: New.
* 27_io/basic_fstream/1.cc: New.
* 27_io/basic_fstream/2.cc: New.
* 27_io/basic_fstream/3.cc: New.
* 27_io/basic_fstream/4.cc: New.
* 27_io/basic_fstream/rdbuf/char/2832.cc: New.
* 27_io/basic_ifstream/1.cc: New.
* 27_io/basic_ifstream/2.cc: New.
* 27_io/basic_ifstream/3.cc: New.
* 27_io/basic_ifstream/4.cc: New.
* 27_io/basic_ifstream/cons/char/1.cc: New.
* 27_io/basic_ifstream/open/char/1.cc: New.
* 27_io/basic_ifstream/rdbuf/char/2832.cc: New.
* 27_io/basic_ios/1.cc: New.
* 27_io/basic_ios/2.cc: New.
* 27_io/basic_ios/3.cc: New.
* 27_io/basic_ios/4.cc: New.
* 27_io/basic_ios/clear/char/1.cc: New.
* 27_io/basic_ios/cons/char/1.cc: New.
* 27_io/basic_ios/cons/char/2.cc: New.
* 27_io/basic_ios/cons/char/3.cc: New.
* 27_io/basic_ios/copyfmt/char/1.cc: New.
* 27_io/basic_ios/copyfmt/char/2.cc: New.
* 27_io/basic_ios/exceptions/char/1.cc: New.
* 27_io/basic_ios/locales/char/1.cc: New.
* 27_io/basic_iostream/1.cc: New.
* 27_io/basic_iostream/2.cc: New.
* 27_io/basic_iostream/3.cc: New.
* 27_io/basic_iostream/4.cc: New.
* 27_io/basic_istream/1.cc: New.
* 27_io/basic_istream/2.cc: New.
* 27_io/basic_istream/3.cc: New.
* 27_io/basic_istream/4.cc: New.
* 27_io/basic_istream/exceptions/char/9561.cc: New.
* 27_io/basic_istream/extractors_arithmetic/char/01.cc: New.
* 27_io/basic_istream/extractors_arithmetic/char/02.cc: New.
* 27_io/basic_istream/extractors_arithmetic/char/03.cc: New.
* 27_io/basic_istream/extractors_arithmetic/char/06.cc: New.
* 27_io/basic_istream/extractors_arithmetic/char/07.cc: New.
* 27_io/basic_istream/extractors_arithmetic/char/08.cc: New.
* 27_io/basic_istream/extractors_arithmetic/char/09.cc: New.
* 27_io/basic_istream/extractors_arithmetic/char/10.cc: New.
* 27_io/basic_istream/extractors_arithmetic/char/11.cc: New.
* 27_io/basic_istream/extractors_arithmetic/char/12.cc: New.
* 27_io/basic_istream/extractors_arithmetic/char/13.cc: New.
* 27_io/basic_istream/extractors_character/char/1.cc: New.
* 27_io/basic_istream/extractors_character/char/2.cc: New.
* 27_io/basic_istream/extractors_character/char/3.cc: New.
* 27_io/basic_istream/extractors_character/char/9826.cc: New.
* 27_io/basic_istream/extractors_other/char/1.cc: New.
* 27_io/basic_istream/extractors_other/char/2.cc: New.
* 27_io/basic_istream/extractors_other/char/3.cc: New.
* 27_io/basic_istream/extractors_other/char/9318-in.cc: New.
* 27_io/basic_istream/extractors_other/char/9424-in.cc: New.
* 27_io/basic_istream/get/char/1.cc: New.
* 27_io/basic_istream/get/char/2.cc: New.
* 27_io/basic_istream/getline/char/1.cc: New.
* 27_io/basic_istream/getline/char/2.cc: New.
* 27_io/basic_istream/getline/char/3.cc: New.
* 27_io/basic_istream/ignore/char/1.cc: New.
* 27_io/basic_istream/ignore/char/6360.cc: New.
* 27_io/basic_istream/ignore/char/7220.cc: New.
* 27_io/basic_istream/peek/char/1.cc: New.
* 27_io/basic_istream/peek/char/6414.cc: New.
* 27_io/basic_istream/putback/char/1.cc: New.
* 27_io/basic_istream/read/char/1.cc: New.
* 27_io/basic_istream/read/char/2.cc: New.
* 27_io/basic_istream/read/char/3.cc: New.
* 27_io/basic_istream/readsome/char/6746-1.cc: New.
* 27_io/basic_istream/readsome/char/6746-2.cc: New.
* 27_io/basic_istream/readsome/char/8258.cc: New.
* 27_io/basic_istream/seekg/char/2346-fstream.cc: New.
* 27_io/basic_istream/seekg/char/2346-sstream.cc: New.
* 27_io/basic_istream/seekg/char/8348-1.cc: New.
* 27_io/basic_istream/seekg/char/8348-2.cc: New.
* 27_io/basic_istream/seekg/char/fstream.cc: New.
* 27_io/basic_istream/seekg/char/sstream.cc: New.
* 27_io/basic_istream/sentry/char/1.cc: New.
* 27_io/basic_istream/sentry/char/2.cc: New.
* 27_io/basic_istream/sentry/char/3.cc: New.
* 27_io/basic_istream/sentry/char/3983-fstream.cc: New.
* 27_io/basic_istream/sentry/char/3983-sstream.cc: New.
* 27_io/basic_istream/tellg/char/1.cc: New.
* 27_io/basic_istream/tellg/char/8348.cc: New.
* 27_io/basic_istream/tellg/char/fstream.cc: New.
* 27_io/basic_istream/tellg/char/sstream.cc: New.
* 27_io/basic_istream/ws/char/1.cc: New.
* 27_io/basic_istringstream/1.cc: New.
* 27_io/basic_istringstream/2.cc: New.
* 27_io/basic_istringstream/3.cc: New.
* 27_io/basic_istringstream/4.cc: New.
* 27_io/basic_istringstream/rdbuf/char/2832.cc: New.
* 27_io/basic_istringstream/str/char/1.cc: New.
* 27_io/basic_ofstream/1.cc: New.
* 27_io/basic_ofstream/2.cc: New.
* 27_io/basic_ofstream/3.cc: New.
* 27_io/basic_ofstream/4.cc: New.
* 27_io/basic_ofstream/cons/char/2.cc: New.
* 27_io/basic_ofstream/open/char/1.cc: New.
* 27_io/basic_ofstream/rdbuf/char/2832.cc: New.
* 27_io/basic_ostream/1.cc: New.
* 27_io/basic_ostream/2.cc: New.
* 27_io/basic_ostream/3.cc: New.
* 27_io/basic_ostream/4.cc: New.
* 27_io/basic_ostream/cons/char/9827.cc: New.
* 27_io/basic_ostream/endl/char/1.cc: New.
* 27_io/basic_ostream/ends/char/1.cc: New.
* 27_io/basic_ostream/ends/char/2.cc: New.
* 27_io/basic_ostream/exceptions/char/9561.cc: New.
* 27_io/basic_ostream/flush/char/1.cc: New.
* 27_io/basic_ostream/inserters_arithmetic/char/1.cc: New.
* 27_io/basic_ostream/inserters_arithmetic/char/2.cc: New.
* 27_io/basic_ostream/inserters_arithmetic/char/3.cc: New.
* 27_io/basic_ostream/inserters_arithmetic/char/4.cc: New.
* 27_io/basic_ostream/inserters_arithmetic/char/4402.cc: New.
* 27_io/basic_ostream/inserters_arithmetic/char/5.cc: New.
* 27_io/basic_ostream/inserters_arithmetic/char/6.cc: New.
* 27_io/basic_ostream/inserters_arithmetic/wchar_t/1.cc: New.
* 27_io/basic_ostream/inserters_character/char/1.cc: New.
* 27_io/basic_ostream/inserters_character/char/2.cc: New.
* 27_io/basic_ostream/inserters_character/char/3.cc: New.
* 27_io/basic_ostream/inserters_character/char/4.cc: New.
* 27_io/basic_ostream/inserters_character/char/5.cc: New.
* 27_io/basic_ostream/inserters_character/char/6.cc: New.
* 27_io/basic_ostream/inserters_character/char/8.cc: New.
* 27_io/basic_ostream/inserters_character/wchar_t/7.cc: New.
* 27_io/basic_ostream/inserters_character/wchar_t/8.cc: New.
* 27_io/basic_ostream/inserters_other/char/1.cc: New.
* 27_io/basic_ostream/inserters_other/char/2.cc: New.
* 27_io/basic_ostream/inserters_other/char/3.cc: New.
* 27_io/basic_ostream/inserters_other/char/4.cc: New.
* 27_io/basic_ostream/inserters_other/char/9318-out.cc: New.
* 27_io/basic_ostream/inserters_other/char/9424-out.cc: New.
* 27_io/basic_ostream/sentry/char/1.cc: New.
* 27_io/basic_ostream/sentry/char/2.cc: New.
* 27_io/basic_ostream/sentry/char/3983-fstream.cc: New.
* 27_io/basic_ostream/sentry/char/3983-sstream.cc: New.
* 27_io/basic_ostream/tellp/char/1.cc: New.
* 27_io/basic_ostream/tellp/char/2.cc: New.
* 27_io/basic_ostringstream/1.cc: New.
* 27_io/basic_ostringstream/2.cc: New.
* 27_io/basic_ostringstream/3.cc: New.
* 27_io/basic_ostringstream/4.cc: New.
* 27_io/basic_ostringstream/cons/char/3.cc: New.
* 27_io/basic_ostringstream/rdbuf/char/2832.cc: New.
* 27_io/basic_ostringstream/str/char/1.cc: New.
* 27_io/basic_ostringstream/str/char/2.cc: New.
* 27_io/basic_streambuf/1.cc: New.
* 27_io/basic_streambuf/2.cc: New.
* 27_io/basic_streambuf/3.cc: New.
* 27_io/basic_streambuf/cons/char/1.cc: New.
* 27_io/basic_streambuf/imbue/char/1.cc: New.
* 27_io/basic_streambuf/imbue/char/9322.cc: New.
* 27_io/basic_streambuf/overflow/char/1.cc: New.
* 27_io/basic_streambuf/overflow/char/2.cc: New.
* 27_io/basic_streambuf/overflow/char/3599.cc: New.
* 27_io/basic_streambuf/sgetc/char/1.cc: New.
* 27_io/basic_streambuf/sgetn/char/1.cc: New.
* 27_io/basic_streambuf/sputbackc/char/9538.cc: New.
* 27_io/basic_streambuf/sputc/char/1057.cc: New.
* 27_io/basic_streambuf/sputn/char/1.cc: New.
* 27_io/basic_streambuf/sputn/char/1057.cc: New.
* 27_io/basic_streambuf/sync/char/1057.cc: New.
* 27_io/basic_stringbuf/1.cc: New.
* 27_io/basic_stringbuf/2.cc: New.
* 27_io/basic_stringbuf/3.cc: New.
* 27_io/basic_stringbuf/4.cc: New.
* 27_io/basic_stringbuf/5.cc: New.
* 27_io/basic_stringbuf/imbue/char/1.cc: New.
* 27_io/basic_stringbuf/imbue/char/9322.cc: New.
* 27_io/basic_stringbuf/in_avail/char/1.cc: New.
* 27_io/basic_stringbuf/overflow/char/2.cc: New.
* 27_io/basic_stringbuf/overflow/char/3599.cc: New.
* 27_io/basic_stringbuf/overflow/char/9988.cc: New.
* 27_io/basic_stringbuf/sbumpc/char/1.cc: New.
* 27_io/basic_stringbuf/sbumpc/char/9825.cc: New.
* 27_io/basic_stringbuf/seekoff/char/1.cc: New.
* 27_io/basic_stringbuf/seekoff/char/2.cc: New.
* 27_io/basic_stringbuf/seekpos/char/1.cc: New.
* 27_io/basic_stringbuf/seekpos/char/2.cc: New.
* 27_io/basic_stringbuf/setbuf/char/1.cc: New.
* 27_io/basic_stringbuf/setbuf/char/2.cc: New.
* 27_io/basic_stringbuf/setbuf/char/3.cc: New.
* 27_io/basic_stringbuf/sgetc/char/1.cc: New.
* 27_io/basic_stringbuf/sgetn/char/1.cc: New.
* 27_io/basic_stringbuf/snextc/char/1.cc: New.
* 27_io/basic_stringbuf/sputbackc/char/1.cc: New.
* 27_io/basic_stringbuf/sputbackc/char/9425.cc: New.
* 27_io/basic_stringbuf/sputc/char/1.cc: New.
* 27_io/basic_stringbuf/sputc/char/1057.cc: New.
* 27_io/basic_stringbuf/sputc/char/9404-1.cc: New.
* 27_io/basic_stringbuf/sputn/char/1.cc: New.
* 27_io/basic_stringbuf/sputn/char/1057.cc: New.
* 27_io/basic_stringbuf/sputn/char/9404-2.cc: New.
* 27_io/basic_stringbuf/str/char/1.cc: New.
* 27_io/basic_stringbuf/str/char/2.cc: New.
* 27_io/basic_stringbuf/str/char/3.cc: New.
* 27_io/basic_stringbuf/str/char/3955.cc: New.
* 27_io/basic_stringbuf/sungetc/char/1.cc: New.
* 27_io/basic_stringbuf/sync/char/1057.cc: New.
* 27_io/basic_stringstream/1.cc: New.
* 27_io/basic_stringstream/2.cc: New.
* 27_io/basic_stringstream/3.cc: New.
* 27_io/basic_stringstream/4.cc: New.
* 27_io/basic_stringstream/rdbuf/char/2832.cc: New.
* 27_io/basic_stringstream/str/char/1.cc: New.
* 27_io/basic_stringstream/str/char/2.cc: New.
* 27_io/basic_stringstream/str/char/3.cc: New.
* 27_io/basic_stringstream/str/char/4.cc: New.
* 27_io/fpos/1.cc: New.
* 27_io/fpos/2.cc: New.
* 27_io/fpos/3.cc: New.
* 27_io/ios_base/callbacks/1.cc: New.
* 27_io/ios_base/state/1.cc: New.
* 27_io/ios_base/storage/1.cc: New.
* 27_io/ios_base/storage/2.cc: New.
* 27_io/ios_base/storage/3.cc: New.
* 27_io/ios_base/sync_with_stdio/1.cc: New.
* 27_io/ios_base/sync_with_stdio/2.cc: New.
* 27_io/manipulators/adjustfield/char/1.cc: New.
* 27_io/manipulators/adjustfield/char/2.cc: New.
* 27_io/manipulators/basefield/char/1.cc: New.
* 27_io/manipulators/standard/char/1.cc: New.
* 27_io/manipulators/standard/char/2.cc: New.
* 27_io/objects/char/1.cc: New.
* 27_io/objects/char/2.cc: New.
* 27_io/objects/char/2523-1_xin.cc: New.
* 27_io/objects/char/2523-1_xin.in: New.
* 27_io/objects/char/2523-2_xin.cc: New.
* 27_io/objects/char/2523-2_xin.in: New.
* 27_io/objects/char/3045.cc: New.
* 27_io/objects/char/3647.cc: New.
* 27_io/objects/char/3_xin.cc: New.
* 27_io/objects/char/3_xin.in: New.
* 27_io/objects/char/4_xin.cc: New.
* 27_io/objects/char/4_xin.in: New.
* 27_io/objects/char/5268.cc: New.
* 27_io/objects/char/5280_xin.cc: New.
* 27_io/objects/char/5280_xin.in: New.
* 27_io/objects/char/6548_xin.cc: New.
* 27_io/objects/char/6548_xin.in: New.
* 27_io/objects/char/6648-1_xin.cc: New.
* 27_io/objects/char/6648-1_xin.in: New.
* 27_io/objects/char/6648-2_xin.cc: New.
* 27_io/objects/char/6648-2_xin.in: New.
* 27_io/objects/char/7744_xin.cc: New.
* 27_io/objects/char/7744_xin.in: New.
* 27_io/objects/wchar_t/1.cc: New.
* 27_io/types/1.cc: New.
* 27_io/types/2.cc: New.
* data/filebuf_members-1.tst: New.
* data/filebuf_members-1.txt: New.
* data/filebuf_virtuals-1.tst: New.
* data/filebuf_virtuals-1.txt: New.
* data/filebuf_virtuals-2.tst: New.
* data/filebuf_virtuals-3.tst: New.
* data/ifstream_members-1.tst: New.
* data/ifstream_members-1.txt: New.
* data/ios_base_members_static-1.tst: New.
* data/istream_extractor_other-1.tst: New.
* data/istream_extractor_other-1.txt: New.
* data/istream_extractor_other-2.tst: New.
* data/istream_seeks-1.tst: New.
* data/istream_seeks-1.txt: New.
* data/istream_seeks-2.tst: New.
* data/istream_seeks-3.tst: New.
* data/istream_unformatted-1.tst: New.
* data/istream_unformatted-1.txt: New.
* data/ofstream_members-1.tst: New.
* data/ostream_inserter_char-1.tst: New.
* data/ostream_inserter_char-1.txt: New.
* data/ostream_inserter_other-1.tst: New.
* data/ostream_inserter_other-2.tst: New.
* data/ostream_seeks-1.tst: New.

2003-04-09  Benjamin Kosnik  <bkoz@redhat.com>

* include/bits/sstream.tcc (basic_stringbuf::seekpos): Remove
requirement that __mode must be strict input or output.

* include/std/std_streambuf.h (basic_streambuf::setp): Set
_M_out_lim.

* include/std/std_sstream.h (basic_strinbuf::str): Zero length
output string shouldn't core.
(basic_stringbuf::_M_really_sync): Add base argument. Remove rturn
type.
* include/bits/sstream.tcc: Adjust _M_really_sync bits here.

* include/bits/istream.tcc (basic_istream::putback): Set gcount to
zero.

2003-04-09  Benjamin Kosnik  <bkoz@redhat.com>

* testsuite/data: New directory.
* testsuite/lib/libstdc++-v3-dg.exp (libstdc++-v3-init): Modify
to copy files from the testsuite data directory.
(libstdc++-v3-list-sourcefiles): Add another test list filter, for
testfiles containing _xin, which now means this is an interactive
test and should be run with the interactive dejagnu hooks.
* testsuite/Makefile.am: Remove testsuite_* files.
* testsuite/Makefile.in: Regenerate.

From-SVN: r65421

420 files changed:
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/istream.tcc
libstdc++-v3/include/bits/sstream.tcc
libstdc++-v3/include/std/std_fstream.h
libstdc++-v3/include/std/std_sstream.h
libstdc++-v3/include/std/std_streambuf.h
libstdc++-v3/testsuite/27_io/basic_filebuf/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_filebuf/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_filebuf/3.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_filebuf/4.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/3.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/4879.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/9964.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/char/9322.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_filebuf/in_avail/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_filebuf/is_open/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/3.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/9507.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_filebuf/overflow/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_filebuf/overflow/char/3599.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_filebuf/overflow/char/9169.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_filebuf/overflow/char/9182-2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_filebuf/overflow/char/9988.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/9825.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_filebuf/setbuf/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_filebuf/setbuf/char/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_filebuf/setbuf/char/3.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/9425.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/1057.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/9701-2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/1057.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/9701-1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_filebuf/sync/char/1057.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_filebuf/sync/char/9182-1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/char/10097.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_fstream/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_fstream/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_fstream/3.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_fstream/4.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_fstream/rdbuf/char/2832.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ifstream/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ifstream/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ifstream/3.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ifstream/4.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ifstream/cons/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ifstream/open/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ifstream/rdbuf/char/2832.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ios/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ios/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ios/3.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ios/4.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ios/clear/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ios/cons/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ios/cons/char/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ios/cons/char/3.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ios/copyfmt/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ios/copyfmt/char/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ios/exceptions/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ios/locales/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_iostream/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_iostream/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_iostream/3.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_iostream/4.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istream/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istream/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istream/3.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istream/4.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istream/exceptions/char/9561.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/01.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/02.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/03.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/06.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/07.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/08.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/09.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/10.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/11.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/12.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/13.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istream/extractors_character/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istream/extractors_character/char/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istream/extractors_character/char/3.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istream/extractors_character/char/9826.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/char/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/char/3.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/char/9318-in.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/char/9424-in.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istream/get/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istream/get/char/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istream/getline/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istream/getline/char/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istream/getline/char/3.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istream/ignore/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istream/ignore/char/6360.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istream/ignore/char/7220.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istream/peek/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istream/peek/char/6414.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istream/putback/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istream/read/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istream/read/char/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istream/read/char/3.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istream/readsome/char/6746-1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istream/readsome/char/6746-2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istream/readsome/char/8258.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istream/seekg/char/2346-fstream.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istream/seekg/char/2346-sstream.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istream/seekg/char/8348-1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istream/seekg/char/8348-2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istream/seekg/char/fstream.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istream/seekg/char/sstream.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istream/sentry/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istream/sentry/char/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istream/sentry/char/3.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istream/sentry/char/3983-fstream.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istream/sentry/char/3983-sstream.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istream/tellg/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istream/tellg/char/8348.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istream/tellg/char/fstream.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istream/tellg/char/sstream.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istream/ws/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istringstream/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istringstream/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istringstream/3.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istringstream/4.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istringstream/rdbuf/char/2832.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istringstream/str/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ofstream/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ofstream/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ofstream/3.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ofstream/4.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ofstream/cons/char/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ofstream/open/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ofstream/rdbuf/char/2832.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ostream/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ostream/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ostream/3.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ostream/4.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ostream/cons/char/9827.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ostream/endl/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ostream/ends/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ostream/ends/char/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ostream/exceptions/char/9561.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ostream/flush/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/char/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/char/3.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/char/4.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/char/4402.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/char/5.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/char/6.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/wchar_t/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/char/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/char/3.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/char/4.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/char/5.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/char/6.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/char/8.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/wchar_t/7.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/wchar_t/8.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/3.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/4.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/9318-out.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/9424-out.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ostream/sentry/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ostream/sentry/char/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ostream/sentry/char/3983-fstream.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ostream/sentry/char/3983-sstream.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ostream/tellp/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ostream/tellp/char/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ostringstream/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ostringstream/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ostringstream/3.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ostringstream/4.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ostringstream/cons/char/3.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ostringstream/rdbuf/char/2832.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ostringstream/str/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ostringstream/str/char/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_streambuf/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_streambuf/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_streambuf/3.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_streambuf/cons/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_streambuf/imbue/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_streambuf/imbue/char/9322.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_streambuf/overflow/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_streambuf/overflow/char/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_streambuf/overflow/char/3599.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_streambuf/sgetc/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_streambuf/sgetn/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_streambuf/sputbackc/char/9538.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_streambuf/sputc/char/1057.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_streambuf/sputn/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_streambuf/sputn/char/1057.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_streambuf/sync/char/1057.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_stringbuf/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_stringbuf/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_stringbuf/3.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_stringbuf/4.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_stringbuf/5.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_stringbuf/imbue/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_stringbuf/imbue/char/9322.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_stringbuf/in_avail/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_stringbuf/overflow/char/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_stringbuf/overflow/char/3599.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_stringbuf/overflow/char/9988.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_stringbuf/sbumpc/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_stringbuf/sbumpc/char/9825.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_stringbuf/seekoff/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_stringbuf/seekoff/char/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_stringbuf/seekpos/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_stringbuf/seekpos/char/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_stringbuf/setbuf/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_stringbuf/setbuf/char/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_stringbuf/setbuf/char/3.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_stringbuf/sgetc/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_stringbuf/sgetn/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_stringbuf/snextc/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_stringbuf/sputbackc/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_stringbuf/sputbackc/char/9425.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_stringbuf/sputc/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_stringbuf/sputc/char/1057.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_stringbuf/sputc/char/9404-1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_stringbuf/sputn/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_stringbuf/sputn/char/1057.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_stringbuf/sputn/char/9404-2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_stringbuf/str/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_stringbuf/str/char/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_stringbuf/str/char/3.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_stringbuf/str/char/3955.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_stringbuf/sungetc/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_stringbuf/sync/char/1057.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_stringstream/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_stringstream/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_stringstream/3.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_stringstream/4.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_stringstream/rdbuf/char/2832.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_stringstream/str/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_stringstream/str/char/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_stringstream/str/char/3.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_stringstream/str/char/4.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/filebuf.cc [deleted file]
libstdc++-v3/testsuite/27_io/filebuf_members-1.tst [deleted file]
libstdc++-v3/testsuite/27_io/filebuf_members-1.txt [deleted file]
libstdc++-v3/testsuite/27_io/filebuf_members.cc [deleted file]
libstdc++-v3/testsuite/27_io/filebuf_virtuals-1.tst [deleted file]
libstdc++-v3/testsuite/27_io/filebuf_virtuals-1.txt [deleted file]
libstdc++-v3/testsuite/27_io/filebuf_virtuals-2.tst [deleted file]
libstdc++-v3/testsuite/27_io/filebuf_virtuals-3.tst [deleted file]
libstdc++-v3/testsuite/27_io/filebuf_virtuals.cc [deleted file]
libstdc++-v3/testsuite/27_io/fpos.cc [deleted file]
libstdc++-v3/testsuite/27_io/fpos/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/fpos/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/fpos/3.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/fstream.cc [deleted file]
libstdc++-v3/testsuite/27_io/fstream_members.cc [deleted file]
libstdc++-v3/testsuite/27_io/ifstream.cc [deleted file]
libstdc++-v3/testsuite/27_io/ifstream_members-1.tst [deleted file]
libstdc++-v3/testsuite/27_io/ifstream_members-1.txt [deleted file]
libstdc++-v3/testsuite/27_io/ifstream_members.cc [deleted file]
libstdc++-v3/testsuite/27_io/instantiations.cc [deleted file]
libstdc++-v3/testsuite/27_io/ios.cc [deleted file]
libstdc++-v3/testsuite/27_io/ios_base/callbacks/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/ios_base/state/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/ios_base/storage/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/ios_base/storage/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/ios_base/storage/3.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/ios_base/sync_with_stdio/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/ios_base/sync_with_stdio/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/ios_base_callbacks.cc [deleted file]
libstdc++-v3/testsuite/27_io/ios_base_members_static-1.tst [deleted file]
libstdc++-v3/testsuite/27_io/ios_base_members_static.cc [deleted file]
libstdc++-v3/testsuite/27_io/ios_base_storage.cc [deleted file]
libstdc++-v3/testsuite/27_io/ios_base_types.cc [deleted file]
libstdc++-v3/testsuite/27_io/ios_ctor.cc [deleted file]
libstdc++-v3/testsuite/27_io/ios_init.cc [deleted file]
libstdc++-v3/testsuite/27_io/ios_manip_basefield.cc [deleted file]
libstdc++-v3/testsuite/27_io/ios_manip_fmtflags.cc [deleted file]
libstdc++-v3/testsuite/27_io/ios_members.cc [deleted file]
libstdc++-v3/testsuite/27_io/iostream.cc [deleted file]
libstdc++-v3/testsuite/27_io/iostream_members.cc [deleted file]
libstdc++-v3/testsuite/27_io/istream.cc [deleted file]
libstdc++-v3/testsuite/27_io/istream_exception.cc [deleted file]
libstdc++-v3/testsuite/27_io/istream_extractor_arith/01.cc [deleted file]
libstdc++-v3/testsuite/27_io/istream_extractor_arith/02.cc [deleted file]
libstdc++-v3/testsuite/27_io/istream_extractor_arith/03.cc [deleted file]
libstdc++-v3/testsuite/27_io/istream_extractor_arith/06.cc [deleted file]
libstdc++-v3/testsuite/27_io/istream_extractor_arith/07.cc [deleted file]
libstdc++-v3/testsuite/27_io/istream_extractor_arith/08.cc [deleted file]
libstdc++-v3/testsuite/27_io/istream_extractor_arith/09.cc [deleted file]
libstdc++-v3/testsuite/27_io/istream_extractor_arith/10.cc [deleted file]
libstdc++-v3/testsuite/27_io/istream_extractor_arith/11.cc [deleted file]
libstdc++-v3/testsuite/27_io/istream_extractor_arith/12.cc [deleted file]
libstdc++-v3/testsuite/27_io/istream_extractor_arith/13.cc [deleted file]
libstdc++-v3/testsuite/27_io/istream_extractor_char.cc [deleted file]
libstdc++-v3/testsuite/27_io/istream_extractor_other-1.tst [deleted file]
libstdc++-v3/testsuite/27_io/istream_extractor_other-1.txt [deleted file]
libstdc++-v3/testsuite/27_io/istream_extractor_other-2.tst [deleted file]
libstdc++-v3/testsuite/27_io/istream_extractor_other.cc [deleted file]
libstdc++-v3/testsuite/27_io/istream_manip.cc [deleted file]
libstdc++-v3/testsuite/27_io/istream_seeks-1.tst [deleted file]
libstdc++-v3/testsuite/27_io/istream_seeks-1.txt [deleted file]
libstdc++-v3/testsuite/27_io/istream_seeks-2.tst [deleted file]
libstdc++-v3/testsuite/27_io/istream_seeks-3.tst [deleted file]
libstdc++-v3/testsuite/27_io/istream_seeks.cc [deleted file]
libstdc++-v3/testsuite/27_io/istream_sentry.cc [deleted file]
libstdc++-v3/testsuite/27_io/istream_unformatted-1.tst [deleted file]
libstdc++-v3/testsuite/27_io/istream_unformatted-1.txt [deleted file]
libstdc++-v3/testsuite/27_io/istream_unformatted.cc [deleted file]
libstdc++-v3/testsuite/27_io/istringstream.cc [deleted file]
libstdc++-v3/testsuite/27_io/istringstream_members.cc [deleted file]
libstdc++-v3/testsuite/27_io/manipulators/adjustfield/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/manipulators/adjustfield/char/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/manipulators/basefield/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/manipulators/standard/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/manipulators/standard/char/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/narrow_stream_objects.cc [deleted file]
libstdc++-v3/testsuite/27_io/objects/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/objects/char/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/objects/char/2523-1_xin.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/objects/char/2523-1_xin.in [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/objects/char/2523-2_xin.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/objects/char/2523-2_xin.in [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/objects/char/3045.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/objects/char/3647.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/objects/char/3_xin.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/objects/char/3_xin.in [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/objects/char/4_xin.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/objects/char/4_xin.in [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/objects/char/5268.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/objects/char/5280_xin.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/objects/char/5280_xin.in [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/objects/char/6548_xin.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/objects/char/6548_xin.in [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/objects/char/6648-1_xin.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/objects/char/6648-1_xin.in [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/objects/char/6648-2_xin.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/objects/char/6648-2_xin.in [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/objects/char/7744_xin.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/objects/char/7744_xin.in [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/objects/wchar_t/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/ofstream.cc [deleted file]
libstdc++-v3/testsuite/27_io/ofstream_members-1.tst [deleted file]
libstdc++-v3/testsuite/27_io/ofstream_members.cc [deleted file]
libstdc++-v3/testsuite/27_io/ostream.cc [deleted file]
libstdc++-v3/testsuite/27_io/ostream_exception.cc [deleted file]
libstdc++-v3/testsuite/27_io/ostream_fail.cc [deleted file]
libstdc++-v3/testsuite/27_io/ostream_inserter_arith.cc [deleted file]
libstdc++-v3/testsuite/27_io/ostream_inserter_char-1.tst [deleted file]
libstdc++-v3/testsuite/27_io/ostream_inserter_char-1.txt [deleted file]
libstdc++-v3/testsuite/27_io/ostream_inserter_char.cc [deleted file]
libstdc++-v3/testsuite/27_io/ostream_inserter_other-1.tst [deleted file]
libstdc++-v3/testsuite/27_io/ostream_inserter_other-2.tst [deleted file]
libstdc++-v3/testsuite/27_io/ostream_inserter_other.cc [deleted file]
libstdc++-v3/testsuite/27_io/ostream_manip.cc [deleted file]
libstdc++-v3/testsuite/27_io/ostream_seeks-1.tst [deleted file]
libstdc++-v3/testsuite/27_io/ostream_seeks.cc [deleted file]
libstdc++-v3/testsuite/27_io/ostream_sentry.cc [deleted file]
libstdc++-v3/testsuite/27_io/ostream_unformatted.cc [deleted file]
libstdc++-v3/testsuite/27_io/ostringstream.cc [deleted file]
libstdc++-v3/testsuite/27_io/ostringstream_members.cc [deleted file]
libstdc++-v3/testsuite/27_io/standard_manipulators.cc [deleted file]
libstdc++-v3/testsuite/27_io/streambuf.cc [deleted file]
libstdc++-v3/testsuite/27_io/streambuf_members.cc [deleted file]
libstdc++-v3/testsuite/27_io/stringbuf.cc [deleted file]
libstdc++-v3/testsuite/27_io/stringbuf_members.cc [deleted file]
libstdc++-v3/testsuite/27_io/stringbuf_virtuals.cc [deleted file]
libstdc++-v3/testsuite/27_io/stringstream.cc [deleted file]
libstdc++-v3/testsuite/27_io/stringstream_members.cc [deleted file]
libstdc++-v3/testsuite/27_io/types/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/types/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/wide_stream_objects.cc [deleted file]
libstdc++-v3/testsuite/Makefile.am
libstdc++-v3/testsuite/Makefile.in
libstdc++-v3/testsuite/data/filebuf_members-1.tst [new file with mode: 0644]
libstdc++-v3/testsuite/data/filebuf_members-1.txt [new file with mode: 0644]
libstdc++-v3/testsuite/data/filebuf_virtuals-1.tst [new file with mode: 0644]
libstdc++-v3/testsuite/data/filebuf_virtuals-1.txt [new file with mode: 0644]
libstdc++-v3/testsuite/data/filebuf_virtuals-2.tst [new file with mode: 0644]
libstdc++-v3/testsuite/data/filebuf_virtuals-3.tst [new file with mode: 0644]
libstdc++-v3/testsuite/data/ifstream_members-1.tst [new file with mode: 0644]
libstdc++-v3/testsuite/data/ifstream_members-1.txt [new file with mode: 0644]
libstdc++-v3/testsuite/data/ios_base_members_static-1.tst [new file with mode: 0644]
libstdc++-v3/testsuite/data/istream_extractor_other-1.tst [new file with mode: 0644]
libstdc++-v3/testsuite/data/istream_extractor_other-1.txt [new file with mode: 0644]
libstdc++-v3/testsuite/data/istream_extractor_other-2.tst [new file with mode: 0644]
libstdc++-v3/testsuite/data/istream_seeks-1.tst [new file with mode: 0644]
libstdc++-v3/testsuite/data/istream_seeks-1.txt [new file with mode: 0644]
libstdc++-v3/testsuite/data/istream_seeks-2.tst [new file with mode: 0644]
libstdc++-v3/testsuite/data/istream_seeks-3.tst [new file with mode: 0644]
libstdc++-v3/testsuite/data/istream_unformatted-1.tst [new file with mode: 0644]
libstdc++-v3/testsuite/data/istream_unformatted-1.txt [new file with mode: 0644]
libstdc++-v3/testsuite/data/ofstream_members-1.tst [new file with mode: 0644]
libstdc++-v3/testsuite/data/ostream_inserter_char-1.tst [new file with mode: 0644]
libstdc++-v3/testsuite/data/ostream_inserter_char-1.txt [new file with mode: 0644]
libstdc++-v3/testsuite/data/ostream_inserter_other-1.tst [new file with mode: 0644]
libstdc++-v3/testsuite/data/ostream_inserter_other-2.tst [new file with mode: 0644]
libstdc++-v3/testsuite/data/ostream_seeks-1.tst [new file with mode: 0644]
libstdc++-v3/testsuite/lib/libstdc++-v3-dg.exp
libstdc++-v3/testsuite/libstdc++-v3.dg/dg.exp

index e7f51e8e8d1d3ce2ad0593e0d8b72dbe5a23e987..1f1f3c433dc8eefe58b02aca027cf37a2faaf214 100644 (file)
@@ -1,3 +1,392 @@
+2003-04-09  Benjamin Kosnik  <bkoz@redhat.com>
+
+       Reshuffle 27_io testsuite.  * testsuite/27_io/filebuf.cc,
+       filebuf_members-1.tst, filebuf_members-1.txt, filebuf_members.cc,
+       filebuf_virtuals-1.tst, filebuf_virtuals-1.txt,
+       filebuf_virtuals-2.tst, filebuf_virtuals-3.tst,
+       filebuf_virtuals.cc, fpos.cc, fstream.cc, fstream_members.cc,
+       ifstream.cc, ifstream_members-1.tst, ifstream_members-1.txt,
+       ifstream_members.cc, instantiations.cc, ios.cc,
+       ios_base_callbacks.cc, ios_base_members_static-1.tst,
+       ios_base_members_static.cc, ios_base_storage.cc,
+       ios_base_types.cc, ios_ctor.cc, ios_init.cc,
+       ios_manip_basefield.cc, ios_manip_fmtflags.cc, ios_members.cc,
+       iostream.cc, iostream_members.cc, istream.cc,
+       istream_exception.cc, istream_extractor_char.cc,
+       istream_extractor_other-1.tst, istream_extractor_other-1.txt,
+       istream_extractor_other-2.tst, istream_extractor_other.cc,
+       istream_manip.cc, istream_seeks-1.tst, istream_seeks-1.txt,
+       istream_seeks-2.tst, istream_seeks-3.tst, istream_seeks.cc,
+       istream_sentry.cc, istream_unformatted-1.tst,
+       istream_unformatted-1.txt, istream_unformatted.cc,
+       istringstream.cc, istringstream_members.cc,
+       narrow_stream_objects.cc, ofstream.cc, ofstream_members-1.tst,
+       ofstream_members.cc, ostream.cc, ostream_exception.cc,
+       ostream_fail.cc, ostream_inserter_arith.cc,
+       ostream_inserter_char-1.tst, ostream_inserter_char-1.txt,
+       ostream_inserter_char.cc, ostream_inserter_other-1.tst,
+       ostream_inserter_other-2.tst, ostream_inserter_other.cc,
+       ostream_manip.cc, ostream_seeks-1.tst, ostream_seeks.cc,
+       ostream_sentry.cc, ostream_unformatted.cc, ostringstream.cc,
+       ostringstream_members.cc, standard_manipulators.cc, streambuf.cc,
+       streambuf_members.cc, stringbuf.cc, stringbuf_members.cc,
+       stringbuf_virtuals.cc, stringstream.cc, stringstream_members.cc,
+       wide_stream_objects.cc, istream_extractor_arith/01.cc,
+       istream_extractor_arith/02.cc, istream_extractor_arith/03.cc,
+       istream_extractor_arith/06.cc, istream_extractor_arith/07.cc,
+       istream_extractor_arith/08.cc, istream_extractor_arith/09.cc,
+       istream_extractor_arith/10.cc, istream_extractor_arith/11.cc,
+       istream_extractor_arith/12.cc, istream_extractor_arith/13.cc:
+       Split into...
+       * 27_io/basic_filebuf/1.cc: New.
+       * 27_io/basic_filebuf/2.cc: New.
+       * 27_io/basic_filebuf/3.cc: New.
+       * 27_io/basic_filebuf/4.cc: New.
+       * 27_io/basic_filebuf/close/char/1.cc: New.
+       * 27_io/basic_filebuf/close/char/2.cc: New.
+       * 27_io/basic_filebuf/close/char/3.cc: New.
+       * 27_io/basic_filebuf/close/char/4879.cc: New.
+       * 27_io/basic_filebuf/close/char/9964.cc: New.
+       * 27_io/basic_filebuf/imbue/char/1.cc: New.
+       * 27_io/basic_filebuf/imbue/char/9322.cc: New.
+       * 27_io/basic_filebuf/in_avail/char/1.cc: New.
+       * 27_io/basic_filebuf/is_open/char/1.cc: New.
+       * 27_io/basic_filebuf/open/char/1.cc: New.
+       * 27_io/basic_filebuf/open/char/2.cc: New.
+       * 27_io/basic_filebuf/open/char/3.cc: New.
+       * 27_io/basic_filebuf/open/char/9507.cc: New.
+       * 27_io/basic_filebuf/overflow/char/1.cc: New.
+       * 27_io/basic_filebuf/overflow/char/3599.cc: New.
+       * 27_io/basic_filebuf/overflow/char/9169.cc: New.
+       * 27_io/basic_filebuf/overflow/char/9182-2.cc: New.
+       * 27_io/basic_filebuf/overflow/char/9988.cc: New.
+       * 27_io/basic_filebuf/sbumpc/char/1.cc: New.
+       * 27_io/basic_filebuf/sbumpc/char/9825.cc: New.
+       * 27_io/basic_filebuf/seekoff/char/1.cc: New.
+       * 27_io/basic_filebuf/seekoff/char/2.cc: New.
+       * 27_io/basic_filebuf/seekpos/char/1.cc: New.
+       * 27_io/basic_filebuf/seekpos/char/2.cc: New.
+       * 27_io/basic_filebuf/setbuf/char/1.cc: New.
+       * 27_io/basic_filebuf/setbuf/char/2.cc: New.
+       * 27_io/basic_filebuf/setbuf/char/3.cc: New.
+       * 27_io/basic_filebuf/sgetc/char/1.cc: New.
+       * 27_io/basic_filebuf/sgetn/char/1.cc: New.
+       * 27_io/basic_filebuf/sgetn/char/2.cc: New.
+       * 27_io/basic_filebuf/snextc/char/1.cc: New.
+       * 27_io/basic_filebuf/sputbackc/char/1.cc: New.
+       * 27_io/basic_filebuf/sputbackc/char/9425.cc: New.
+       * 27_io/basic_filebuf/sputc/char/1.cc: New.
+       * 27_io/basic_filebuf/sputc/char/1057.cc: New.
+       * 27_io/basic_filebuf/sputc/char/9701-2.cc: New.
+       * 27_io/basic_filebuf/sputn/char/1.cc: New.
+       * 27_io/basic_filebuf/sputn/char/1057.cc: New.
+       * 27_io/basic_filebuf/sputn/char/9701-1.cc: New.
+       * 27_io/basic_filebuf/sungetc/char/1.cc: New.
+       * 27_io/basic_filebuf/sync/char/1057.cc: New.
+       * 27_io/basic_filebuf/sync/char/9182-1.cc: New.
+       * 27_io/basic_filebuf/underflow/char/10097.cc: New.
+       * 27_io/basic_fstream/1.cc: New.
+       * 27_io/basic_fstream/2.cc: New.
+       * 27_io/basic_fstream/3.cc: New.
+       * 27_io/basic_fstream/4.cc: New.
+       * 27_io/basic_fstream/rdbuf/char/2832.cc: New.
+       * 27_io/basic_ifstream/1.cc: New.
+       * 27_io/basic_ifstream/2.cc: New.
+       * 27_io/basic_ifstream/3.cc: New.
+       * 27_io/basic_ifstream/4.cc: New.
+       * 27_io/basic_ifstream/cons/char/1.cc: New.
+       * 27_io/basic_ifstream/open/char/1.cc: New.
+       * 27_io/basic_ifstream/rdbuf/char/2832.cc: New.
+       * 27_io/basic_ios/1.cc: New.
+       * 27_io/basic_ios/2.cc: New.
+       * 27_io/basic_ios/3.cc: New.
+       * 27_io/basic_ios/4.cc: New.
+       * 27_io/basic_ios/clear/char/1.cc: New.
+       * 27_io/basic_ios/cons/char/1.cc: New.
+       * 27_io/basic_ios/cons/char/2.cc: New.
+       * 27_io/basic_ios/cons/char/3.cc: New.
+       * 27_io/basic_ios/copyfmt/char/1.cc: New.
+       * 27_io/basic_ios/copyfmt/char/2.cc: New.
+       * 27_io/basic_ios/exceptions/char/1.cc: New.
+       * 27_io/basic_ios/locales/char/1.cc: New.
+       * 27_io/basic_iostream/1.cc: New.
+       * 27_io/basic_iostream/2.cc: New.
+       * 27_io/basic_iostream/3.cc: New.
+       * 27_io/basic_iostream/4.cc: New.
+       * 27_io/basic_istream/1.cc: New.
+       * 27_io/basic_istream/2.cc: New.
+       * 27_io/basic_istream/3.cc: New.
+       * 27_io/basic_istream/4.cc: New.
+       * 27_io/basic_istream/exceptions/char/9561.cc: New.
+       * 27_io/basic_istream/extractors_arithmetic/char/01.cc: New.
+       * 27_io/basic_istream/extractors_arithmetic/char/02.cc: New.
+       * 27_io/basic_istream/extractors_arithmetic/char/03.cc: New.
+       * 27_io/basic_istream/extractors_arithmetic/char/06.cc: New.
+       * 27_io/basic_istream/extractors_arithmetic/char/07.cc: New.
+       * 27_io/basic_istream/extractors_arithmetic/char/08.cc: New.
+       * 27_io/basic_istream/extractors_arithmetic/char/09.cc: New.
+       * 27_io/basic_istream/extractors_arithmetic/char/10.cc: New.
+       * 27_io/basic_istream/extractors_arithmetic/char/11.cc: New.
+       * 27_io/basic_istream/extractors_arithmetic/char/12.cc: New.
+       * 27_io/basic_istream/extractors_arithmetic/char/13.cc: New.
+       * 27_io/basic_istream/extractors_character/char/1.cc: New.
+       * 27_io/basic_istream/extractors_character/char/2.cc: New.
+       * 27_io/basic_istream/extractors_character/char/3.cc: New.
+       * 27_io/basic_istream/extractors_character/char/9826.cc: New.
+       * 27_io/basic_istream/extractors_other/char/1.cc: New.
+       * 27_io/basic_istream/extractors_other/char/2.cc: New.
+       * 27_io/basic_istream/extractors_other/char/3.cc: New.
+       * 27_io/basic_istream/extractors_other/char/9318-in.cc: New.
+       * 27_io/basic_istream/extractors_other/char/9424-in.cc: New.
+       * 27_io/basic_istream/get/char/1.cc: New.
+       * 27_io/basic_istream/get/char/2.cc: New.
+       * 27_io/basic_istream/getline/char/1.cc: New.
+       * 27_io/basic_istream/getline/char/2.cc: New.
+       * 27_io/basic_istream/getline/char/3.cc: New.
+       * 27_io/basic_istream/ignore/char/1.cc: New.
+       * 27_io/basic_istream/ignore/char/6360.cc: New.
+       * 27_io/basic_istream/ignore/char/7220.cc: New.
+       * 27_io/basic_istream/peek/char/1.cc: New.
+       * 27_io/basic_istream/peek/char/6414.cc: New.
+       * 27_io/basic_istream/putback/char/1.cc: New.
+       * 27_io/basic_istream/read/char/1.cc: New.
+       * 27_io/basic_istream/read/char/2.cc: New.
+       * 27_io/basic_istream/read/char/3.cc: New.
+       * 27_io/basic_istream/readsome/char/6746-1.cc: New.
+       * 27_io/basic_istream/readsome/char/6746-2.cc: New.
+       * 27_io/basic_istream/readsome/char/8258.cc: New.
+       * 27_io/basic_istream/seekg/char/2346-fstream.cc: New.
+       * 27_io/basic_istream/seekg/char/2346-sstream.cc: New.
+       * 27_io/basic_istream/seekg/char/8348-1.cc: New.
+       * 27_io/basic_istream/seekg/char/8348-2.cc: New.
+       * 27_io/basic_istream/seekg/char/fstream.cc: New.
+       * 27_io/basic_istream/seekg/char/sstream.cc: New.
+       * 27_io/basic_istream/sentry/char/1.cc: New.
+       * 27_io/basic_istream/sentry/char/2.cc: New.
+       * 27_io/basic_istream/sentry/char/3.cc: New.
+       * 27_io/basic_istream/sentry/char/3983-fstream.cc: New.
+       * 27_io/basic_istream/sentry/char/3983-sstream.cc: New.
+       * 27_io/basic_istream/tellg/char/1.cc: New.
+       * 27_io/basic_istream/tellg/char/8348.cc: New.
+       * 27_io/basic_istream/tellg/char/fstream.cc: New.
+       * 27_io/basic_istream/tellg/char/sstream.cc: New.
+       * 27_io/basic_istream/ws/char/1.cc: New.
+       * 27_io/basic_istringstream/1.cc: New.
+       * 27_io/basic_istringstream/2.cc: New.
+       * 27_io/basic_istringstream/3.cc: New.
+       * 27_io/basic_istringstream/4.cc: New.
+       * 27_io/basic_istringstream/rdbuf/char/2832.cc: New.
+       * 27_io/basic_istringstream/str/char/1.cc: New.
+       * 27_io/basic_ofstream/1.cc: New.
+       * 27_io/basic_ofstream/2.cc: New.
+       * 27_io/basic_ofstream/3.cc: New.
+       * 27_io/basic_ofstream/4.cc: New.
+       * 27_io/basic_ofstream/cons/char/2.cc: New.
+       * 27_io/basic_ofstream/open/char/1.cc: New.
+       * 27_io/basic_ofstream/rdbuf/char/2832.cc: New.
+       * 27_io/basic_ostream/1.cc: New.
+       * 27_io/basic_ostream/2.cc: New.
+       * 27_io/basic_ostream/3.cc: New.
+       * 27_io/basic_ostream/4.cc: New.
+       * 27_io/basic_ostream/cons/char/9827.cc: New.
+       * 27_io/basic_ostream/endl/char/1.cc: New.
+       * 27_io/basic_ostream/ends/char/1.cc: New.
+       * 27_io/basic_ostream/ends/char/2.cc: New.
+       * 27_io/basic_ostream/exceptions/char/9561.cc: New.
+       * 27_io/basic_ostream/flush/char/1.cc: New.
+       * 27_io/basic_ostream/inserters_arithmetic/char/1.cc: New.
+       * 27_io/basic_ostream/inserters_arithmetic/char/2.cc: New.
+       * 27_io/basic_ostream/inserters_arithmetic/char/3.cc: New.
+       * 27_io/basic_ostream/inserters_arithmetic/char/4.cc: New.
+       * 27_io/basic_ostream/inserters_arithmetic/char/4402.cc: New.
+       * 27_io/basic_ostream/inserters_arithmetic/char/5.cc: New.
+       * 27_io/basic_ostream/inserters_arithmetic/char/6.cc: New.
+       * 27_io/basic_ostream/inserters_arithmetic/wchar_t/1.cc: New.
+       * 27_io/basic_ostream/inserters_character/char/1.cc: New.
+       * 27_io/basic_ostream/inserters_character/char/2.cc: New.
+       * 27_io/basic_ostream/inserters_character/char/3.cc: New.
+       * 27_io/basic_ostream/inserters_character/char/4.cc: New.
+       * 27_io/basic_ostream/inserters_character/char/5.cc: New.
+       * 27_io/basic_ostream/inserters_character/char/6.cc: New.
+       * 27_io/basic_ostream/inserters_character/char/8.cc: New.
+       * 27_io/basic_ostream/inserters_character/wchar_t/7.cc: New.
+       * 27_io/basic_ostream/inserters_character/wchar_t/8.cc: New.
+       * 27_io/basic_ostream/inserters_other/char/1.cc: New.
+       * 27_io/basic_ostream/inserters_other/char/2.cc: New.
+       * 27_io/basic_ostream/inserters_other/char/3.cc: New.
+       * 27_io/basic_ostream/inserters_other/char/4.cc: New.
+       * 27_io/basic_ostream/inserters_other/char/9318-out.cc: New.
+       * 27_io/basic_ostream/inserters_other/char/9424-out.cc: New.
+       * 27_io/basic_ostream/sentry/char/1.cc: New.
+       * 27_io/basic_ostream/sentry/char/2.cc: New.
+       * 27_io/basic_ostream/sentry/char/3983-fstream.cc: New.
+       * 27_io/basic_ostream/sentry/char/3983-sstream.cc: New.
+       * 27_io/basic_ostream/tellp/char/1.cc: New.
+       * 27_io/basic_ostream/tellp/char/2.cc: New.
+       * 27_io/basic_ostringstream/1.cc: New.
+       * 27_io/basic_ostringstream/2.cc: New.
+       * 27_io/basic_ostringstream/3.cc: New.
+       * 27_io/basic_ostringstream/4.cc: New.
+       * 27_io/basic_ostringstream/cons/char/3.cc: New.
+       * 27_io/basic_ostringstream/rdbuf/char/2832.cc: New.
+       * 27_io/basic_ostringstream/str/char/1.cc: New.
+       * 27_io/basic_ostringstream/str/char/2.cc: New.
+       * 27_io/basic_streambuf/1.cc: New.
+       * 27_io/basic_streambuf/2.cc: New.
+       * 27_io/basic_streambuf/3.cc: New.
+       * 27_io/basic_streambuf/cons/char/1.cc: New.
+       * 27_io/basic_streambuf/imbue/char/1.cc: New.
+       * 27_io/basic_streambuf/imbue/char/9322.cc: New.
+       * 27_io/basic_streambuf/overflow/char/1.cc: New.
+       * 27_io/basic_streambuf/overflow/char/2.cc: New.
+       * 27_io/basic_streambuf/overflow/char/3599.cc: New.
+       * 27_io/basic_streambuf/sgetc/char/1.cc: New.
+       * 27_io/basic_streambuf/sgetn/char/1.cc: New.
+       * 27_io/basic_streambuf/sputbackc/char/9538.cc: New.
+       * 27_io/basic_streambuf/sputc/char/1057.cc: New.
+       * 27_io/basic_streambuf/sputn/char/1.cc: New.
+       * 27_io/basic_streambuf/sputn/char/1057.cc: New.
+       * 27_io/basic_streambuf/sync/char/1057.cc: New.
+       * 27_io/basic_stringbuf/1.cc: New.
+       * 27_io/basic_stringbuf/2.cc: New.
+       * 27_io/basic_stringbuf/3.cc: New.
+       * 27_io/basic_stringbuf/4.cc: New.
+       * 27_io/basic_stringbuf/5.cc: New.
+       * 27_io/basic_stringbuf/imbue/char/1.cc: New.
+       * 27_io/basic_stringbuf/imbue/char/9322.cc: New.
+       * 27_io/basic_stringbuf/in_avail/char/1.cc: New.
+       * 27_io/basic_stringbuf/overflow/char/2.cc: New.
+       * 27_io/basic_stringbuf/overflow/char/3599.cc: New.
+       * 27_io/basic_stringbuf/overflow/char/9988.cc: New.
+       * 27_io/basic_stringbuf/sbumpc/char/1.cc: New.
+       * 27_io/basic_stringbuf/sbumpc/char/9825.cc: New.
+       * 27_io/basic_stringbuf/seekoff/char/1.cc: New.
+       * 27_io/basic_stringbuf/seekoff/char/2.cc: New.
+       * 27_io/basic_stringbuf/seekpos/char/1.cc: New.
+       * 27_io/basic_stringbuf/seekpos/char/2.cc: New.
+       * 27_io/basic_stringbuf/setbuf/char/1.cc: New.
+       * 27_io/basic_stringbuf/setbuf/char/2.cc: New.
+       * 27_io/basic_stringbuf/setbuf/char/3.cc: New.
+       * 27_io/basic_stringbuf/sgetc/char/1.cc: New.
+       * 27_io/basic_stringbuf/sgetn/char/1.cc: New.
+       * 27_io/basic_stringbuf/snextc/char/1.cc: New.
+       * 27_io/basic_stringbuf/sputbackc/char/1.cc: New.
+       * 27_io/basic_stringbuf/sputbackc/char/9425.cc: New.
+       * 27_io/basic_stringbuf/sputc/char/1.cc: New.
+       * 27_io/basic_stringbuf/sputc/char/1057.cc: New.
+       * 27_io/basic_stringbuf/sputc/char/9404-1.cc: New.
+       * 27_io/basic_stringbuf/sputn/char/1.cc: New.
+       * 27_io/basic_stringbuf/sputn/char/1057.cc: New.
+       * 27_io/basic_stringbuf/sputn/char/9404-2.cc: New.
+       * 27_io/basic_stringbuf/str/char/1.cc: New.
+       * 27_io/basic_stringbuf/str/char/2.cc: New.
+       * 27_io/basic_stringbuf/str/char/3.cc: New.
+       * 27_io/basic_stringbuf/str/char/3955.cc: New.
+       * 27_io/basic_stringbuf/sungetc/char/1.cc: New.
+       * 27_io/basic_stringbuf/sync/char/1057.cc: New.
+       * 27_io/basic_stringstream/1.cc: New.
+       * 27_io/basic_stringstream/2.cc: New.
+       * 27_io/basic_stringstream/3.cc: New.
+       * 27_io/basic_stringstream/4.cc: New.
+       * 27_io/basic_stringstream/rdbuf/char/2832.cc: New.
+       * 27_io/basic_stringstream/str/char/1.cc: New.
+       * 27_io/basic_stringstream/str/char/2.cc: New.
+       * 27_io/basic_stringstream/str/char/3.cc: New.
+       * 27_io/basic_stringstream/str/char/4.cc: New.
+       * 27_io/fpos/1.cc: New.
+       * 27_io/fpos/2.cc: New.
+       * 27_io/fpos/3.cc: New.
+       * 27_io/ios_base/callbacks/1.cc: New.
+       * 27_io/ios_base/state/1.cc: New.
+       * 27_io/ios_base/storage/1.cc: New.
+       * 27_io/ios_base/storage/2.cc: New.
+       * 27_io/ios_base/storage/3.cc: New.
+       * 27_io/ios_base/sync_with_stdio/1.cc: New.
+       * 27_io/ios_base/sync_with_stdio/2.cc: New.
+       * 27_io/manipulators/adjustfield/char/1.cc: New.
+       * 27_io/manipulators/adjustfield/char/2.cc: New.
+       * 27_io/manipulators/basefield/char/1.cc: New.
+       * 27_io/manipulators/standard/char/1.cc: New.
+       * 27_io/manipulators/standard/char/2.cc: New.
+       * 27_io/objects/char/1.cc: New.
+       * 27_io/objects/char/2.cc: New.
+       * 27_io/objects/char/2523-1_xin.cc: New.
+       * 27_io/objects/char/2523-1_xin.in: New.
+       * 27_io/objects/char/2523-2_xin.cc: New.
+       * 27_io/objects/char/2523-2_xin.in: New.
+       * 27_io/objects/char/3045.cc: New.
+       * 27_io/objects/char/3647.cc: New.
+       * 27_io/objects/char/3_xin.cc: New.
+       * 27_io/objects/char/3_xin.in: New.
+       * 27_io/objects/char/4_xin.cc: New.
+       * 27_io/objects/char/4_xin.in: New.
+       * 27_io/objects/char/5268.cc: New.
+       * 27_io/objects/char/5280_xin.cc: New.
+       * 27_io/objects/char/5280_xin.in: New.
+       * 27_io/objects/char/6548_xin.cc: New.
+       * 27_io/objects/char/6548_xin.in: New.
+       * 27_io/objects/char/6648-1_xin.cc: New.
+       * 27_io/objects/char/6648-1_xin.in: New.
+       * 27_io/objects/char/6648-2_xin.cc: New.
+       * 27_io/objects/char/6648-2_xin.in: New.
+       * 27_io/objects/char/7744_xin.cc: New.
+       * 27_io/objects/char/7744_xin.in: New.
+       * 27_io/objects/wchar_t/1.cc: New.
+       * 27_io/types/1.cc: New.
+       * 27_io/types/2.cc: New.
+       * data/filebuf_members-1.tst: New.
+       * data/filebuf_members-1.txt: New.
+       * data/filebuf_virtuals-1.tst: New.
+       * data/filebuf_virtuals-1.txt: New.
+       * data/filebuf_virtuals-2.tst: New.
+       * data/filebuf_virtuals-3.tst: New.
+       * data/ifstream_members-1.tst: New.
+       * data/ifstream_members-1.txt: New.
+       * data/ios_base_members_static-1.tst: New.
+       * data/istream_extractor_other-1.tst: New.
+       * data/istream_extractor_other-1.txt: New.
+       * data/istream_extractor_other-2.tst: New.
+       * data/istream_seeks-1.tst: New.
+       * data/istream_seeks-1.txt: New.
+       * data/istream_seeks-2.tst: New.
+       * data/istream_seeks-3.tst: New.
+       * data/istream_unformatted-1.tst: New.
+       * data/istream_unformatted-1.txt: New.
+       * data/ofstream_members-1.tst: New.
+       * data/ostream_inserter_char-1.tst: New.
+       * data/ostream_inserter_char-1.txt: New.
+       * data/ostream_inserter_other-1.tst: New.
+       * data/ostream_inserter_other-2.tst: New.
+       * data/ostream_seeks-1.tst: New.
+
+2003-04-09  Benjamin Kosnik  <bkoz@redhat.com>
+
+       * include/bits/sstream.tcc (basic_stringbuf::seekpos): Remove
+       requirement that __mode must be strict input or output.
+
+       * include/std/std_streambuf.h (basic_streambuf::setp): Set
+       _M_out_lim.
+       
+       * include/std/std_sstream.h (basic_strinbuf::str): Zero length
+       output string shouldn't core.
+       (basic_stringbuf::_M_really_sync): Add base argument. Remove rturn
+       type.
+       * include/bits/sstream.tcc: Adjust _M_really_sync bits here.
+       
+       * include/bits/istream.tcc (basic_istream::putback): Set gcount to
+       zero.
+
+2003-04-09  Benjamin Kosnik  <bkoz@redhat.com>
+
+       * testsuite/data: New directory.
+       * testsuite/lib/libstdc++-v3-dg.exp (libstdc++-v3-init): Modify
+       to copy files from the testsuite data directory.        
+       (libstdc++-v3-list-sourcefiles): Add another test list filter, for
+       testfiles containing _xin, which now means this is an interactive
+       test and should be run with the interactive dejagnu hooks.
+       * testsuite/Makefile.am: Remove testsuite_* files.
+       * testsuite/Makefile.in: Regenerate.
+       
 2003-04-09  Zack Weinberg  <zack@codesourcery.com>
 
        * docs/html/install.html: Document complete list of locales
index 68295b4c9f3ebbe11507015832fdb2a9bead42e0..89a84f59f7f10230a613fe9ee72f5581f4829efa 100644 (file)
@@ -841,6 +841,7 @@ namespace std
     basic_istream<_CharT, _Traits>::
     putback(char_type __c)
     {
+      _M_gcount = 0;
       sentry __cerb(*this, true);
       if (__cerb) 
        {
index 04b6289de8b4af189c74f780b44dd22c211fe2f3..d41b3cfeb9732dddb9a137042b2333acfcd2f600 100644 (file)
@@ -83,29 +83,30 @@ namespace std
       bool __testout = this->_M_mode & ios_base::out;
       if (__builtin_expect(!__testout, false))
        return traits_type::eof();
+
       bool __testeof = traits_type::eq_int_type(__c, traits_type::eof());
       if (__builtin_expect(__testeof, false))
        return traits_type::not_eof(__c);
 
       // In virtue of DR 169 (TC) we are allowed to grow more than
       // one char the first time and also...
-      __size_type __len =
-       std::max(__size_type(_M_string.capacity() + 1), this->_M_buf_size_opt);
-
-      bool __testwrite = this->_M_out_cur < this->_M_out_end;
-      if (__builtin_expect(!__testwrite && __len > _M_string.max_size(), false))
+      __size_type __len = std::max(__size_type(_M_string.capacity() + 1), 
+                                  this->_M_buf_size_opt);
+      bool __testput = this->_M_out_cur < this->_M_out_end;
+      if (__builtin_expect(!__testput && __len > _M_string.max_size(), false))
        return traits_type::eof();
 
       // Try to append __c into output sequence in one of two ways.
       // Order these tests done in is unspecified by the standard.
-      if (!__testwrite)
+      if (!__testput)
        {
          // Force-allocate, re-sync.
          _M_string = this->str();
-         // ... the next times. That's easy to implement thanks to the
+         // ... the next time. That's easy to implement thanks to the
          // exponential growth policy builtin into basic_string.
          _M_string.reserve(__len);
-         _M_really_sync(this->_M_in_cur - this->_M_in_beg, 
+         _M_really_sync(const_cast<char_type*>(_M_string.data()),
+                        this->_M_in_cur - this->_M_in_beg, 
                         this->_M_out_cur - this->_M_out_beg);
        }
       return this->sputc(traits_type::to_char_type(__c));
@@ -187,21 +188,18 @@ namespace std
          char_type* __end = NULL;
          bool __testin = (ios_base::in & this->_M_mode & __mode) != 0;
          bool __testout = (ios_base::out & this->_M_mode & __mode) != 0;
-         bool __testboth = __testin && __testout;
-         __testin &= !(__mode & ios_base::out);
-         __testout &= !(__mode & ios_base::in);
          
          // NB: Ordered.
          bool __testposi = false;
          bool __testposo = false;
-         if (__testin || __testboth)
+         if (__testin)
            {
              __beg = this->eback();
              __end = this->egptr();
              if (0 <= __pos && __pos <= __end - __beg)
                __testposi = true;
            }
-         if (__testout || __testboth)
+         if (__testout)
            {
              __beg = this->pbase();
              __end = this->epptr();
index c5e34808d16a8b7ee3004e44e86e3a9b88b8218c..53d28ac415bd0ab53dd73ed2a5a629e0b6009b55 100644 (file)
@@ -394,9 +394,7 @@ namespace std
       */
       void
       _M_set_indeterminate(void)
-      {
-       _M_set_determinate(off_type(0));
-      }
+      { _M_set_determinate(off_type(0)); }
 
       /**
        *  @if maint
index 6c0e139bf373aec9b906f29ac7ee58091a74bca3..96fc6f009fa736e82c35e6c04f6517fc0004f458 100644 (file)
@@ -133,20 +133,23 @@ namespace std
       __string_type
       str() const
       {
+       __string_type __ret = _M_string;
        if (this->_M_mode & ios_base::out)
          {
            // This is the deal: _M_string.size() is a value that
-           // represents the size of the initial string that makes
-           // _M_string, and may not be the correct size of the
-           // current stringbuf internal buffer.
+           // represents the size of the initial string used to
+           // created the buffer, and may not be the correct size of
+           // the current stringbuf internal buffer.
            __size_type __len = _M_string.size();
-           if (this->_M_out_lim > this->_M_out_beg)
-             __len = std::max(__size_type(this->_M_out_lim 
-                                          - this->_M_out_beg), __len);
-           return __string_type(this->_M_out_beg, this->_M_out_beg + __len);
+           __size_type __nlen = this->_M_out_lim - this->_M_out_beg;
+           if (__nlen)
+             {
+               __len = std::max(__nlen, __len);
+               __ret = __string_type(this->_M_out_beg, 
+                                     this->_M_out_beg + __len);
+             }
          }
-       else
-         return _M_string;
+       return __ret;
       }
 
       /**
@@ -180,10 +183,11 @@ namespace std
        // suit particular needs.
        this->_M_buf_size_opt = 512;
        this->_M_mode = __mode;
+       
+       __size_type __len = 0;
        if (this->_M_mode & (ios_base::ate | ios_base::app))
-         _M_really_sync(0, _M_string.size());
-       else
-         _M_really_sync(0, 0);
+         __len = _M_string.size();
+       _M_really_sync(const_cast<char_type*>(_M_string.data()), 0, __len);
       }
 
       // Overridden virtual functions:
@@ -221,8 +225,18 @@ namespace std
       {
        if (__s && __n)
          {
+           // This is implementation-defined behavior, and assumes
+           // that an external char_type array of length (__s + __n)
+           // exists and has been pre-allocated. If this is not the
+           // case, things will quickly blow up.
+           
+           // Step 1: Destroy the current internal array.
            _M_string = __string_type(__s, __n);
-           _M_really_sync(0, 0);
+           
+           // Step 2: Use the external array.
+           this->_M_buf = __s;
+           this->_M_buf_size_opt = this->_M_buf_size = __n;
+           _M_really_sync(__s, 0, 0);
          }
        return this;
       }
@@ -248,10 +262,9 @@ namespace std
        *  @doctodo
        *  @endif
       */
-      virtual int
-      _M_really_sync(__size_type __i, __size_type __o)
+      virtual void
+      _M_really_sync(char_type* __base, __size_type __i, __size_type __o)
       {
-       char_type* __base = const_cast<char_type*>(_M_string.data());
        bool __testin = this->_M_mode & ios_base::in;
        bool __testout = this->_M_mode & ios_base::out;
        __size_type __len = _M_string.size();
@@ -266,7 +279,6 @@ namespace std
            this->_M_out_lim = __base + __len;
            this->_M_out_cur += __o;
          }
-       return 0;
       }
     };
 
index 10687d2975198fb1900705f85e608a9ebd27160d..81fe656c0d403c5df1f64a70ee5170ad3c940bb3 100644 (file)
@@ -210,7 +210,7 @@ namespace std
       char_type*               _M_out_cur;    // Current put area. 
       char_type*               _M_out_end;    // End of put area.
 
-      char_type*                _M_out_lim;    // Right limit of used put area.
+      char_type*                _M_out_lim;    // End limit of used put area.
 
       //@}
 
@@ -651,7 +651,7 @@ namespace std
       setp(char_type* __pbeg, char_type* __pend)
       { 
        _M_out_beg = _M_out_cur = __pbeg; 
-       _M_out_end = __pend;
+       _M_out_end = _M_out_lim = __pend;
        if (!(_M_mode & ios_base::out) && __pbeg && __pend)
          _M_mode = _M_mode | ios_base::out;
       }
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/1.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/1.cc
new file mode 100644 (file)
index 0000000..f026728
--- /dev/null
@@ -0,0 +1,50 @@
+// 1999-01-17 bkoz test functionality of basic_filebuf for char_type == char
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.1 - Template class basic_filebuf 
+// NB: This file is for testing basic_filebuf with NO OTHER INCLUDES.
+
+#include <fstream>
+
+// { dg-do compile }
+
+// libstdc++/7216
+void test01()
+{
+  // Check for required typedefs
+  typedef std::filebuf test_type;
+  typedef test_type::char_type char_type;
+  typedef test_type::traits_type traits_type;
+  typedef test_type::int_type int_type;
+  typedef test_type::pos_type pos_type;
+  typedef test_type::off_type off_type;
+}
+
+// more surf!!!
+
+
+
+
+
+
+
+
+
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/2.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/2.cc
new file mode 100644 (file)
index 0000000..af92af0
--- /dev/null
@@ -0,0 +1,51 @@
+// 1999-01-17 bkoz test functionality of basic_filebuf for char_type == char
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.1 - Template class basic_filebuf 
+// NB: This file is for testing basic_filebuf with NO OTHER INCLUDES.
+
+#include <fstream>
+#include <testsuite_hooks.h>
+
+// { dg-do compile }
+
+// test05
+// libstdc++/1886
+// should be able to instantiate basic_filebuf for non-standard types.
+namespace test 
+{
+  using namespace std;
+  using __gnu_cxx_test::pod_char;
+  typedef short type_t;
+  template class basic_filebuf<type_t, char_traits<type_t> >;
+  template class basic_filebuf<pod_char, char_traits<pod_char> >;
+} // test
+
+// more surf!!!
+
+
+
+
+
+
+
+
+
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/3.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/3.cc
new file mode 100644 (file)
index 0000000..a67d596
--- /dev/null
@@ -0,0 +1,145 @@
+// 1999-01-17 bkoz test functionality of basic_filebuf for char_type == char
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.1 - Template class basic_filebuf 
+// NB: This file is for testing basic_filebuf with NO OTHER INCLUDES.
+
+#include <fstream>
+#include <testsuite_hooks.h>
+
+// libstdc++/2020
+// should be able to use custom char_type, custom traits type
+class gnu_char_type
+{
+  unsigned long character;
+public:
+  // operator ==
+  bool
+  operator==(const gnu_char_type& __lhs) 
+  { return character == __lhs.character; }
+
+  // operator <
+  bool
+  operator<(const gnu_char_type& __lhs) 
+  { return character < __lhs.character; }
+
+  // default ctor
+  gnu_char_type() { }
+
+  // to_char_type
+  gnu_char_type(const unsigned long& __l) : character(__l) { } 
+
+  // to_int_type
+  operator unsigned long() const { return character; }
+};
+
+// char_traits specialization
+struct gnu_char_traits
+{
+  typedef gnu_char_type        char_type;
+  typedef long                 int_type;
+  typedef long                 pos_type;
+  typedef unsigned long        off_type;
+  typedef long                 state_type;
+  
+  static void 
+  assign(char_type& __c1, const char_type& __c2) { }
+  
+  static bool 
+  eq(const char_type& __c1, const char_type& __c2) { return true; }
+  
+  static bool 
+  lt(const char_type& __c1, const char_type& __c2) { return true; }
+  
+  static int 
+  compare(const char_type* __s1, const char_type* __s2, size_t __n)
+  { return 0; }
+  
+  static size_t
+  length(const char_type* __s) { return 0; }
+  
+  static const char_type* 
+  find(const char_type* __s, size_t __n, const char_type& __a)
+  { return __s; }
+  
+  static char_type* 
+  move(char_type* __s1, const char_type* __s2, size_t __n)
+  { return __s1; }
+  
+  static char_type* 
+  copy(char_type* __s1, const char_type* __s2, size_t __n)
+  { return __s1; }
+  
+  static char_type* 
+  assign(char_type* __s, size_t __n, char_type __a)
+  { return __s; }
+  
+  static char_type 
+  to_char_type(const int_type& __c)
+  { return char_type(); }
+  
+  static int_type 
+  to_int_type(const char_type& __c)
+  { return int_type(); }
+  
+  static bool 
+  eq_int_type(const int_type& __c1, const int_type& __c2)
+  { return true; }
+  
+  static int_type 
+  eof()
+  { return int_type(); }
+  
+  static int_type 
+  not_eof(const int_type& __c)
+  { return int_type(); }
+};
+
+void test07()
+{
+  bool test = true;
+  typedef std::basic_filebuf<gnu_char_type, gnu_char_traits> gnu_filebuf;
+  
+  try
+    { gnu_filebuf obj; }
+  catch(std::exception& obj)
+    { 
+      test = false; 
+      VERIFY( test );
+    }
+}
+
+#if !__GXX_WEAK__
+// Explicitly instantiate for systems with no COMDAT or weak support.
+template 
+  std::basic_streambuf<gnu_char_type>::int_type
+  std::basic_streambuf<gnu_char_type>::_S_pback_size;
+#endif
+
+int main() 
+{
+  test07();
+  return 0;
+}
+
+
+
+// more surf!!!
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/4.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/4.cc
new file mode 100644 (file)
index 0000000..9516cb2
--- /dev/null
@@ -0,0 +1,49 @@
+// 2003-03-26 B enjamin Kosnik  <bkoz@redhat.com>
+
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.1 - Template class basic_filebuf 
+
+#include <fstream>
+
+void test01()
+{
+  // Check for required base class.
+  typedef std::filebuf test_type;
+  typedef std::streambuf base_type;
+  const test_type& obj = test_type();
+  const base_type* base = &obj;
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
+
+// more surf!!!
+
+
+
+
+
+
+
+
+
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/1.cc
new file mode 100644 (file)
index 0000000..5b2f484
--- /dev/null
@@ -0,0 +1,86 @@
+// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.3 filebuf member functions
+// @require@ %-*.tst %-*.txt
+// @diff@ %-*.tst %-*.txt
+
+// various tests for filebuf::open() and filebuf::close() including
+// the non-portable functionality in the libstdc++-v3 IO library
+
+#include <fstream>
+#include <testsuite_hooks.h>
+
+const char name_01[] = "filebuf_members-1.tst";
+const char name_02[] = "filebuf_members-1.txt";
+
+// Test member functions.
+void test_01() 
+{
+  bool                         test = true;
+  const char* name_03 = "filebuf_members-3"; // empty file, need to create
+
+  std::filebuf fb_01; // in 
+  std::filebuf fb_02; // out
+  std::filebuf fb_03; // in | out
+
+  // bool is_open()
+  VERIFY( !fb_01.is_open() );
+  VERIFY( !fb_02.is_open() );
+  VERIFY( !fb_03.is_open() );
+
+  // filebuf_type* open(const char* __s, ios_base::openmode __mode)
+  fb_01.open(name_01, std::ios_base::in | std::ios_base::ate);
+  VERIFY( fb_01.is_open() );
+
+  // Try to open two different files without closing the first:
+  // Should keep the old file attached, and disregard attempt to overthrow.
+  fb_02.open(name_02, std::ios_base::in | std::ios_base::out 
+            | std::ios_base::trunc);
+  VERIFY( fb_02.is_open() );
+
+  fb_03.open(name_03, std::ios_base::out | std::ios_base::trunc);
+  VERIFY( fb_03.is_open() );
+
+  // filebuf_type* close()
+  std::filebuf* f;
+  f = fb_01.close();
+  VERIFY( f != NULL );
+  VERIFY( !fb_01.is_open() );
+
+  f = fb_02.close();
+  VERIFY( f != NULL );
+  VERIFY( !fb_02.is_open() );
+
+  f = fb_03.close();
+  VERIFY( f != NULL );
+  VERIFY( !fb_03.is_open() );
+
+  f = fb_03.close();
+  VERIFY( f == NULL );
+  VERIFY( !fb_03.is_open() );
+}
+
+int
+main()
+{
+  test_01();
+  return 0;
+}
+
+
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/2.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/2.cc
new file mode 100644 (file)
index 0000000..b0ebd58
--- /dev/null
@@ -0,0 +1,79 @@
+// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.3 filebuf member functions
+// @require@ %-*.tst %-*.txt
+// @diff@ %-*.tst %-*.txt
+
+// various tests for filebuf::open() and filebuf::close() including
+// the non-portable functionality in the libstdc++-v3 IO library
+
+#include <fstream>
+#include <ext/stdio_filebuf.h>
+#include <testsuite_hooks.h>
+
+// Verify that std::filebuf doesn't close files that it didn't open
+// when using the following std::filebuf ctor:
+//
+//      std::filebuf(__c_file_type*  __f,
+//                   ios_base::openmode __mode,
+//                   int_type  __s);
+//
+// Thanks to "George T. Talbot" <george@moberg.com> for uncovering
+// this bug/situation. 
+
+const char name_01[] = "filebuf_virtuals-1.txt"; // file with data in it
+const char name_02[] = "filebuf_virtuals-2.txt"; // empty file, need to create
+
+void test_02()
+{
+  bool test = true;
+  int close_num;
+
+  // read (ext)
+  FILE* f2 = fopen(name_01, "r");
+  VERIFY( f2 != NULL );
+  if (f2)
+  {
+    __gnu_cxx::stdio_filebuf<char> fb(f2, std::ios_base::in, 512);
+    close_num = fclose(f2);
+  }
+  VERIFY( close_num == 0 );
+
+  // read (standard)
+  FILE* f = fopen(name_01, "r");
+  VERIFY( f != NULL );
+  if (f)
+  {
+    std::ifstream ifstream1(name_01);
+    VERIFY( ifstream1.is_open() );
+    std::ios_base::iostate st01 = ifstream1.rdstate();
+    VERIFY( st01 == std::ios_base::goodbit );
+    close_num = fclose(f);
+  }
+  VERIFY( close_num == 0 );
+}
+
+int
+main()
+{
+  test_02();
+  return 0;
+}
+
+
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/3.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/3.cc
new file mode 100644 (file)
index 0000000..d7c1286
--- /dev/null
@@ -0,0 +1,106 @@
+// 2001-05-21 Benjamin Kosnik  <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <fstream>
+#include <unistd.h>
+#include <signal.h>
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <locale>
+#include <testsuite_hooks.h>
+
+// @require@ %-*.tst %-*.txt
+// @diff@ %-*.tst %*.txt
+
+// NB: This test assumes that _M_buf_size == 40, and not the usual
+// buffer_size length of BUFSIZ (8192), so that overflow/underflow can be
+// simulated a bit more readily.
+// NRB (Nota Really Bene): setting it to 40 breaks the test, as intended.
+const int buffer_size = 8192;
+//const int buffer_size = 40;
+
+const char carray_01[] = "santa cruz or sandiego?";
+const char carray_02[] = "memphis, new orleans, and savanah";
+const char name_01[] = "filebuf_virtuals-1.txt"; // file with data in it
+const char name_02[] = "filebuf_virtuals-2.txt"; // empty file, need to create
+const char name_03[] = "filebuf_virtuals-3.txt"; // empty file, need to create
+const char name_04[] = "filebuf_virtuals-4.txt"; // empty file, need to create
+const char name_05[] = "filebuf_virtuals-5.txt"; // empty file, need to create
+const char name_06[] = "filebuf_virtuals-6.txt"; // empty file, need to create
+const char name_07[] = "filebuf_virtuals-7.txt"; // empty file, need to create
+const char name_08[] = "filebuf_virtuals-8.txt"; // empty file, need to create
+
+class derived_filebuf: public std::filebuf
+{
+ public:
+  void
+  set_size(int_type __size) { _M_buf_size_opt = __size; }
+};
+
+derived_filebuf fb_01; // in 
+derived_filebuf fb_02; // out
+derived_filebuf fb_03; // in | out
+
+// Initialize filebufs to be the same size regardless of platform.
+void test03()
+{
+  fb_01.set_size(buffer_size);
+  fb_02.set_size(buffer_size);
+  fb_03.set_size(buffer_size);
+}
+
+// Test overloaded virtual functions.
+void test05() 
+{
+  typedef std::filebuf::int_type       int_type;
+  typedef std::filebuf::traits_type    traits_type;
+  typedef std::filebuf::pos_type       pos_type;
+  typedef std::filebuf::off_type       off_type;
+  typedef size_t                       size_type;
+
+  bool                                         test = true;
+  std::filebuf                                 f_tmp;
+  std::streamsize                      strmsz_1, strmsz_2;
+  std::streamoff                       strmof_1, strmof_2;
+  int                                  i = 0, j = 0, k = 0;
+
+  fb_01.open(name_01, std::ios_base::in);
+  fb_02.open(name_02, std::ios_base::out | std::ios_base::trunc);
+  fb_03.open(name_03, std::ios_base::out | std::ios_base::in | std::ios_base::trunc);
+
+  // NB Have to close these suckers. . .
+  // filebuf_type* close()
+  fb_01.close();
+  fb_02.close();
+  fb_03.close();
+  VERIFY( !fb_01.is_open() );
+  VERIFY( !fb_02.is_open() );
+  VERIFY( !fb_03.is_open() );
+}
+
+main() 
+{
+  test03();
+  test05();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/4879.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/4879.cc
new file mode 100644 (file)
index 0000000..b72be5c
--- /dev/null
@@ -0,0 +1,97 @@
+// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.3 filebuf member functions
+// @require@ %-*.tst %-*.txt
+// @diff@ %-*.tst %-*.txt
+
+// various tests for filebuf::open() and filebuf::close() including
+// the non-portable functionality in the libstdc++-v3 IO library
+
+#include <fstream>
+#include <iostream>
+#include <unistd.h>
+#include <signal.h>
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <testsuite_hooks.h>
+
+// libstdc++/2913, libstdc++/4879
+// John Fardo  <jfardo@laurelnetworks.com>, Brad Garcia <garsh@attbi.com>
+void
+test_04()
+{
+  bool test = true;
+  const char* name = "tmp_fifo1";
+  signal(SIGPIPE, SIG_IGN);
+  
+  unlink(name);
+  if (0 != mkfifo(name, S_IRWXU))
+    {
+      std::cerr << "failed to create fifo" << std::endl;
+      exit(-1);
+    }
+  
+  int fval = fork();
+  if (fval == -1)
+    {
+      std::cerr << "failed to fork" << std::endl;
+      unlink(name);
+      exit(-1);
+    }
+  else if (fval == 0)
+    {
+      std::ifstream ifs(name);
+      sleep(1);
+      ifs.close();
+      exit(0);
+    }
+
+  std::ofstream ofs(name);
+  sleep(2);
+  ofs.put('t');
+
+  /*
+   * ISO/IED 14882:1998(E) 27.8.1.10.4
+   *
+   * void close();
+   *
+   * Effects:  Calls rdbuf()->close() and, if that function fails
+   * (returns a null pointer), calls setstate(failbit)...
+   */
+  ofs.close();
+  if (!(ofs.rdstate() & std::ios::failbit))
+    {
+      test = false;
+      VERIFY( test );
+      unlink(name);
+      exit(-1);
+    }
+
+  unlink(name);
+}
+
+int
+main()
+{
+  test_04();
+  return 0;
+}
+
+
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/9964.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/9964.cc
new file mode 100644 (file)
index 0000000..32c388d
--- /dev/null
@@ -0,0 +1,77 @@
+// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.3 filebuf member functions
+// @require@ %-*.tst %-*.txt
+// @diff@ %-*.tst %-*.txt
+
+// various tests for filebuf::open() and filebuf::close() including
+// the non-portable functionality in the libstdc++-v3 IO library
+
+#include <fstream>
+#include <unistd.h>
+#include <signal.h>
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <testsuite_hooks.h>
+
+// libstdc++/9964
+void test_07()
+{
+  using namespace std;
+  bool test = true;
+
+  const char* name = "tmp_fifo3";
+
+  signal(SIGPIPE, SIG_IGN);
+
+  unlink(name);  
+  mkfifo(name, S_IRWXU);
+  
+  int child = fork();
+  VERIFY( child != -1 );
+
+  if (child == 0)
+    {
+      filebuf fbin;
+      fbin.open(name, ios_base::in);
+      sleep(1);
+      fbin.close();
+      exit(0);
+    }
+  
+  filebuf fb;
+  filebuf* ret = fb.open(name, ios_base::out | ios_base::trunc);
+  VERIFY( ret != NULL );
+  VERIFY( fb.is_open() );
+
+  sleep(2);
+  fb.sputc('a');
+
+  ret = fb.close();
+  VERIFY( ret == NULL );
+  VERIFY( !fb.is_open() );
+}
+
+int
+main()
+{
+  test_07();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/char/1.cc
new file mode 100644 (file)
index 0000000..7893e93
--- /dev/null
@@ -0,0 +1,45 @@
+// 981208 bkoz test functionality of basic_stringbuf for char_type == char
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+#include <fstream>
+#include <testsuite_hooks.h>
+
+std::filebuf fbuf;
+
+// test the filebuf locale settings
+void test02() 
+{
+  std::locale loc_c = std::locale::classic();
+  loc_c = fbuf.getloc();
+  fbuf.pubimbue(loc_c); //This should initialize _M_init to true
+  std::locale loc_tmp = fbuf.getloc(); 
+  VERIFY( loc_tmp == loc_c );
+}
+
+int main()
+{
+  test02();
+  return 0;
+}
+
+
+
+// more candy!!!
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/char/9322.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/char/9322.cc
new file mode 100644 (file)
index 0000000..e584f46
--- /dev/null
@@ -0,0 +1,53 @@
+// 2001-05-21 Benjamin Kosnik  <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <fstream>
+#include <locale>
+#include <testsuite_hooks.h>
+
+// libstdc++/9322
+void test07()
+{
+  using std::locale;
+  bool test = true;
+
+  locale loc;
+  std::filebuf ob;
+  VERIFY( ob.getloc() == loc );
+
+  locale::global(locale("en_US"));
+  VERIFY( ob.getloc() == loc );
+
+  locale loc_de ("de_DE");
+  locale ret = ob.pubimbue(loc_de);
+  VERIFY( ob.getloc() == loc_de );
+  VERIFY( ret == loc );
+
+  locale::global(loc);
+  VERIFY( ob.getloc() == loc_de );
+}
+
+main() 
+{
+  __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test07);
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/in_avail/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/in_avail/char/1.cc
new file mode 100644 (file)
index 0000000..eca4951
--- /dev/null
@@ -0,0 +1,114 @@
+// 2001-05-21 Benjamin Kosnik  <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <fstream>
+#include <unistd.h>
+#include <signal.h>
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <locale>
+#include <testsuite_hooks.h>
+
+// @require@ %-*.tst %-*.txt
+// @diff@ %-*.tst %*.txt
+
+// NB: This test assumes that _M_buf_size == 40, and not the usual
+// buffer_size length of BUFSIZ (8192), so that overflow/underflow can be
+// simulated a bit more readily.
+// NRB (Nota Really Bene): setting it to 40 breaks the test, as intended.
+const int buffer_size = 8192;
+//const int buffer_size = 40;
+
+const char carray_01[] = "santa cruz or sandiego?";
+const char carray_02[] = "memphis, new orleans, and savanah";
+const char name_01[] = "filebuf_virtuals-1.txt"; // file with data in it
+const char name_02[] = "filebuf_virtuals-2.txt"; // empty file, need to create
+const char name_03[] = "filebuf_virtuals-3.txt"; // empty file, need to create
+const char name_04[] = "filebuf_virtuals-4.txt"; // empty file, need to create
+const char name_05[] = "filebuf_virtuals-5.txt"; // empty file, need to create
+const char name_06[] = "filebuf_virtuals-6.txt"; // empty file, need to create
+const char name_07[] = "filebuf_virtuals-7.txt"; // empty file, need to create
+const char name_08[] = "filebuf_virtuals-8.txt"; // empty file, need to create
+
+class derived_filebuf: public std::filebuf
+{
+ public:
+  void
+  set_size(int_type __size) { _M_buf_size_opt = __size; }
+};
+
+derived_filebuf fb_01; // in 
+derived_filebuf fb_02; // out
+derived_filebuf fb_03; // in | out
+
+// Initialize filebufs to be the same size regardless of platform.
+void test03()
+{
+  fb_01.set_size(buffer_size);
+  fb_02.set_size(buffer_size);
+  fb_03.set_size(buffer_size);
+}
+
+// Test overloaded virtual functions.
+void test05() 
+{
+  typedef std::filebuf::int_type       int_type;
+  typedef std::filebuf::traits_type    traits_type;
+  typedef std::filebuf::pos_type       pos_type;
+  typedef std::filebuf::off_type       off_type;
+  typedef size_t                       size_type;
+
+  bool                                         test = true;
+  std::filebuf                                 f_tmp;
+  std::streamsize                      strmsz_1, strmsz_2;
+  std::streamoff                       strmof_1, strmof_2;
+  int                                  i = 0, j = 0, k = 0;
+
+  // GET
+  // int in_avail()
+  // if a read position is available, return _M_in_end - _M_in_cur.
+  // else return showmanyc.
+  strmof_1 = fb_01.in_avail();
+  strmof_2 = fb_02.in_avail();
+  VERIFY( strmof_1 == -1 );
+  VERIFY( strmof_1 == strmof_2 ); //fail because not open
+  strmof_1 = fb_03.in_avail();
+  VERIFY( strmof_1 == strmof_2 );
+  fb_01.open(name_01, std::ios_base::in);
+  fb_02.open(name_02, std::ios_base::out | std::ios_base::trunc);
+  fb_03.open(name_03, std::ios_base::out | std::ios_base::in | std::ios_base::trunc); 
+  strmof_1 = fb_01.in_avail();
+  strmof_2 = fb_02.in_avail();
+  VERIFY( strmof_1 != strmof_2 );
+  VERIFY( strmof_1 >= 0 );
+  VERIFY( strmof_2 == -1 );  // empty file
+  strmof_1 = fb_03.in_avail(); 
+  VERIFY( strmof_1  == 0 ); // empty file
+}
+
+main() 
+{
+  test03();
+  test05();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/is_open/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/is_open/char/1.cc
new file mode 100644 (file)
index 0000000..4b4c022
--- /dev/null
@@ -0,0 +1,72 @@
+// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.3 filebuf member functions
+// @require@ %-*.tst %-*.txt
+// @diff@ %-*.tst %-*.txt
+
+// various tests for filebuf::open() and filebuf::close() including
+// the non-portable functionality in the libstdc++-v3 IO library
+
+#include <fstream>
+#include <testsuite_hooks.h>
+
+const char name_01[] = "filebuf_members-1.tst";
+const char name_02[] = "filebuf_members-1.txt";
+
+// Test member functions.
+void test_01() 
+{
+  bool                         test = true;
+  const char* name_03 = "filebuf_members-3"; // empty file, need to create
+
+  std::filebuf fb_01; // in 
+  std::filebuf fb_02; // out
+  std::filebuf fb_03; // in | out
+
+  // bool is_open()
+  VERIFY( !fb_01.is_open() );
+  VERIFY( !fb_02.is_open() );
+  VERIFY( !fb_03.is_open() );
+
+  // filebuf_type* open(const char* __s, ios_base::openmode __mode)
+  fb_01.open(name_01, std::ios_base::in | std::ios_base::ate);
+  fb_02.open(name_02, std::ios_base::in | std::ios_base::out 
+            | std::ios_base::trunc);
+  fb_03.open(name_03, std::ios_base::out | std::ios_base::trunc);
+  VERIFY( fb_01.is_open() );
+  VERIFY( fb_02.is_open() );
+  VERIFY( fb_03.is_open() );
+
+  // filebuf_type* close()
+  fb_01.close();
+  fb_02.close();
+  fb_03.close();
+  VERIFY( !fb_01.is_open() );
+  VERIFY( !fb_02.is_open() );
+  VERIFY( !fb_03.is_open() );
+}
+
+int
+main()
+{
+  test_01();
+  return 0;
+}
+
+
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/1.cc
new file mode 100644 (file)
index 0000000..424d4b6
--- /dev/null
@@ -0,0 +1,73 @@
+// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.3 filebuf member functions
+// @require@ %-*.tst %-*.txt
+// @diff@ %-*.tst %-*.txt
+
+// various tests for filebuf::open() and filebuf::close() including
+// the non-portable functionality in the libstdc++-v3 IO library
+
+#include <fstream>
+#include <testsuite_hooks.h>
+
+const char name_01[] = "filebuf_members-1.tst";
+const char name_02[] = "filebuf_members-1.txt";
+
+// Test member functions.
+void test_01() 
+{
+  bool                         test = true;
+  const char* name_03 = "filebuf_members-3"; // empty file, need to create
+
+  std::filebuf fb_01; // in 
+  std::filebuf fb_02; // out
+  std::filebuf fb_03; // in | out
+
+  // bool is_open()
+  VERIFY( !fb_01.is_open() );
+  VERIFY( !fb_02.is_open() );
+  VERIFY( !fb_03.is_open() );
+
+  // filebuf_type* open(const char* __s, ios_base::openmode __mode)
+  fb_01.open(name_01, std::ios_base::in | std::ios_base::ate);
+  VERIFY( fb_01.is_open() );
+
+  // Try to open two different files without closing the first:
+  // Should keep the old file attached, and disregard attempt to overthrow.
+  std::filebuf* f = fb_02.open(name_02, std::ios_base::in | std::ios_base::out 
+                              | std::ios_base::trunc);
+  VERIFY( f != NULL );
+  VERIFY( fb_02.is_open() );
+  
+  f = fb_02.open(name_03, std::ios_base::in | std::ios_base::out);
+  VERIFY( f == NULL );
+  VERIFY( fb_02.is_open() );
+
+  fb_03.open(name_03, std::ios_base::out | std::ios_base::trunc);
+  VERIFY( fb_03.is_open() );
+}
+
+int
+main()
+{
+  test_01();
+  return 0;
+}
+
+
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/2.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/2.cc
new file mode 100644 (file)
index 0000000..cf0ffa9
--- /dev/null
@@ -0,0 +1,58 @@
+// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.3 filebuf member functions
+// @require@ %-*.tst %-*.txt
+// @diff@ %-*.tst %-*.txt
+
+// various tests for filebuf::open() and filebuf::close() including
+// the non-portable functionality in the libstdc++-v3 IO library
+
+#include <fstream>
+#include <unistd.h>
+#include <signal.h>
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <ext/stdio_filebuf.h>
+#include <testsuite_hooks.h>
+
+const char name_01[] = "filebuf_virtuals-1.txt"; // file with data in it
+
+void test_03()
+{
+  bool test = true;
+  int first_fd = ::open(name_01, O_RDONLY);
+  VERIFY( first_fd != -1 );
+  FILE* first_file = ::fdopen(first_fd, "r");
+  VERIFY( first_file != NULL );
+  __gnu_cxx::stdio_filebuf<char> fb(first_file, std::ios_base::in);
+
+  int second_fd = fb.fd();
+
+  VERIFY( first_fd == second_fd );
+}
+
+int
+main()
+{
+  test_03();
+  return 0;
+}
+
+
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/3.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/3.cc
new file mode 100644 (file)
index 0000000..c08817f
--- /dev/null
@@ -0,0 +1,53 @@
+// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.3 filebuf member functions
+// @require@ %-*.tst %-*.txt
+// @diff@ %-*.tst %-*.txt
+
+// various tests for filebuf::open() and filebuf::close() including
+// the non-portable functionality in the libstdc++-v3 IO library
+
+#include <fstream>
+#include <testsuite_hooks.h>
+
+// Charles Leggett <CGLeggett@lbl.gov>
+void test_05()
+{
+  bool test = true;
+  const char* name = "tmp_file5";
+
+  std::fstream scratch_file;
+
+  scratch_file.open(name, std::ios::out);
+  scratch_file.close();
+
+  scratch_file.open(name, std::ios::in);
+  if (!scratch_file)
+    VERIFY( false );
+  scratch_file.close();
+}
+
+int
+main()
+{
+  test_05();
+  return 0;
+}
+
+
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/9507.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/9507.cc
new file mode 100644 (file)
index 0000000..860f369
--- /dev/null
@@ -0,0 +1,67 @@
+// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.3 filebuf member functions
+// @require@ %-*.tst %-*.txt
+// @diff@ %-*.tst %-*.txt
+
+// various tests for filebuf::open() and filebuf::close() including
+// the non-portable functionality in the libstdc++-v3 IO library
+
+#include <fstream>
+#include <unistd.h>
+#include <signal.h>
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <testsuite_hooks.h>
+
+// libstdc++/9507
+void test_06()
+{
+  bool test = true;
+  const char* name = "tmp_fifo2";
+
+  signal(SIGPIPE, SIG_IGN);
+
+  unlink(name);
+  mkfifo(name, S_IRWXU);
+       
+  if (!fork())
+    {
+      std::filebuf fbuf;
+      fbuf.open(name, std::ios_base::in);
+      fbuf.sgetc();
+      fbuf.close();
+      exit(0);
+    }
+
+  std::filebuf fbuf;
+  std::filebuf* r = fbuf.open(name, std::ios_base::out | std::ios_base::ate);
+  VERIFY( !fbuf.is_open() );
+  VERIFY( r == NULL );
+}
+
+int
+main()
+{
+  test_06();
+  return 0;
+}
+
+
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/overflow/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/overflow/char/1.cc
new file mode 100644 (file)
index 0000000..fd960e4
--- /dev/null
@@ -0,0 +1,78 @@
+// 1999-10-11 bkoz
+
+// Copyright (C) 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+#include <fstream>
+#include <ostream>
+#include <testsuite_hooks.h>
+
+// test03
+// http://gcc.gnu.org/ml/libstdc++/2000-q1/msg00151.html
+template<typename charT, typename traits = std::char_traits<charT> >
+  class basic_nullbuf : public std::basic_filebuf<charT, traits>
+  {
+  protected:
+    typedef typename
+      std::basic_filebuf<charT, traits>::int_type int_type;
+    virtual int_type 
+    overflow(int_type c) 
+    {  return traits::not_eof(c); }
+  };
+
+typedef basic_nullbuf<char> nullbuf;
+
+template<typename T>
+  char
+  print(const T& x) 
+  {
+   nullbuf ob;
+   std::ostream out(&ob); 
+   out << x << std::endl;
+   return (!out ? '0' : '1');
+ }
+
+void test03() 
+{
+  bool test = true;
+  const std::string control01("11111");
+  std::string test01;
+
+  test01 += print(true);
+  test01 += print(3.14159);
+  test01 += print(10);
+  test01 += print('x');
+  test01 += print("pipo");
+
+  VERIFY( test01 == control01 );
+}
+
+int main() 
+{
+  test03();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/overflow/char/3599.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/overflow/char/3599.cc
new file mode 100644 (file)
index 0000000..795c58c
--- /dev/null
@@ -0,0 +1,66 @@
+// 1999-10-11 bkoz
+
+// Copyright (C) 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+#include <fstream>
+#include <ostream>
+#include <testsuite_hooks.h>
+
+// libstdc++/3599
+class testbuf : public std::filebuf
+{
+public:
+  typedef std::filebuf::traits_type traits_type;
+
+  testbuf() : std::filebuf() { }
+protected:
+  int_type 
+  overflow(int_type c = traits_type::eof()) 
+  { return traits_type::not_eof(0); }
+};
+
+void
+test07()
+{
+  bool test = true;
+  testbuf ob;
+  std::ostream out(&ob); 
+
+  out << "gasp";
+  VERIFY(out.good());
+
+  out << std::endl;
+  VERIFY(out.good());
+}
+
+int main() 
+{
+  test07();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/overflow/char/9169.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/overflow/char/9169.cc
new file mode 100644 (file)
index 0000000..18ed29d
--- /dev/null
@@ -0,0 +1,72 @@
+// 2001-05-21 Benjamin Kosnik  <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <fstream>
+#include <locale>
+#include <testsuite_hooks.h>
+
+const char name_04[] = "filebuf_virtuals-4.txt"; // empty file, need to create
+
+class Cvt_to_upper : public std::codecvt<char, char, mbstate_t>
+{
+  bool do_always_noconv() const throw()
+  {
+    return false;
+  }
+};
+
+// libstdc++/9169
+// filebuf output fails if codecvt<>::out returns noconv
+void test10()
+{
+  using namespace std;
+  bool test = true;
+
+  locale c_loc = locale::classic();
+  locale loc(c_loc, new Cvt_to_upper);
+
+  string str("abcdefghijklmnopqrstuvwxyz");
+  string tmp;
+
+  {
+    ofstream out;
+    out.imbue(loc);
+    out.open(name_04);
+    copy(str.begin(), str.end(), ostreambuf_iterator<char>(out));
+  }
+
+  {
+    ifstream in;
+    in.open(name_04);
+    copy(istreambuf_iterator<char>(in), istreambuf_iterator<char>(),
+        back_inserter(tmp));
+  }
+
+  VERIFY( tmp.size() == str.size() );
+  VERIFY( tmp == str );
+}
+
+main() 
+{
+  test10();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/overflow/char/9182-2.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/overflow/char/9182-2.cc
new file mode 100644 (file)
index 0000000..b752bce
--- /dev/null
@@ -0,0 +1,72 @@
+// 2001-05-21 Benjamin Kosnik  <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <fstream>
+#include <locale>
+#include <testsuite_hooks.h>
+
+const char name_07[] = "filebuf_virtuals-7.txt"; // empty file, need to create
+
+class errorcvt : public std::codecvt<char, char, mbstate_t>
+{
+protected:
+  std::codecvt_base::result
+  do_out(mbstate_t&, const char* from, const char*,
+        const char*& from_next, char* to, char*,
+        char*& to_next) const
+  {
+    from_next = from;
+    to_next = to;
+    return std::codecvt<char, char, mbstate_t>::error;
+  }
+  
+  virtual bool do_always_noconv() const throw()
+  {
+    return false;
+  }
+};
+
+// libstdc++/9182
+// basic_filebuf<>::sync and overflow do not write out any characters
+// if codecvt<>::out returns error
+void test14()
+{
+  using namespace std;
+  bool test = true;
+  
+  locale loc =  locale::classic();
+  loc = locale(loc, new errorcvt);
+  
+  filebuf fbuf1;
+  fbuf1.pubimbue(loc);
+  fbuf1.pubsetbuf(0, 0);
+  fbuf1.open(name_07, ios_base::out | ios_base::trunc);
+  streamsize n = fbuf1.sputn("onne", 4);
+  VERIFY( n == 0 );
+  fbuf1.close();
+}
+
+main() 
+{
+  test14();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/overflow/char/9988.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/overflow/char/9988.cc
new file mode 100644 (file)
index 0000000..2c8d078
--- /dev/null
@@ -0,0 +1,69 @@
+// 2001-05-21 Benjamin Kosnik  <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <fstream>
+#include <testsuite_hooks.h>
+
+const char name_08[] = "filebuf_virtuals-8.txt"; // empty file, need to create
+
+class OverBuf : public std::filebuf
+{
+public:
+  int_type pub_overflow(int_type c = traits_type::eof())
+  { return std::filebuf::overflow(c); }
+};
+
+// libstdc++/9988
+// filebuf::overflow writes EOF to file
+void test15()
+{
+  using namespace std;
+  bool test = true;
+  
+  OverBuf fb;
+  fb.open(name_08, ios_base::out | ios_base::trunc);
+  
+  fb.sputc('a');
+  fb.pub_overflow('b');
+  fb.pub_overflow();
+  fb.sputc('c');
+  fb.close();
+
+  filebuf fbin;
+  fbin.open(name_08, ios_base::in);
+  filebuf::int_type c;
+  c = fbin.sbumpc();
+  VERIFY( c == 'a' );
+  c = fbin.sbumpc();
+  VERIFY( c == 'b' );
+  c = fbin.sbumpc();
+  VERIFY( c == 'c' );
+  c = fbin.sbumpc();
+  VERIFY( c == filebuf::traits_type::eof() );
+  fbin.close();
+}
+
+main() 
+{
+  test15();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/1.cc
new file mode 100644 (file)
index 0000000..5a27cdd
--- /dev/null
@@ -0,0 +1,106 @@
+// 2001-05-21 Benjamin Kosnik  <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <fstream>
+#include <testsuite_hooks.h>
+
+// @require@ %-*.tst %-*.txt
+// @diff@ %-*.tst %*.txt
+
+// NB: This test assumes that _M_buf_size == 40, and not the usual
+// buffer_size length of BUFSIZ (8192), so that overflow/underflow can be
+// simulated a bit more readily.
+// NRB (Nota Really Bene): setting it to 40 breaks the test, as intended.
+const int buffer_size = 8192;
+//const int buffer_size = 40;
+
+const char name_01[] = "filebuf_virtuals-1.txt"; // file with data in it
+const char name_02[] = "filebuf_virtuals-2.txt"; // empty file, need to create
+const char name_03[] = "filebuf_virtuals-3.txt"; // empty file, need to create
+
+class derived_filebuf: public std::filebuf
+{
+ public:
+  void
+  set_size(int_type __size) { _M_buf_size_opt = __size; }
+};
+
+derived_filebuf fb_01; // in 
+derived_filebuf fb_02; // out
+derived_filebuf fb_03; // in | out
+
+// Initialize filebufs to be the same size regardless of platform.
+void test03()
+{
+  fb_01.set_size(buffer_size);
+  fb_02.set_size(buffer_size);
+  fb_03.set_size(buffer_size);
+}
+
+// Test overloaded virtual functions.
+void test05() 
+{
+  using namespace std;
+  typedef filebuf::int_type    int_type;
+  typedef filebuf::traits_type         traits_type;
+  typedef filebuf::pos_type    pos_type;
+  typedef filebuf::off_type    off_type;
+  typedef size_t                       size_type;
+
+  bool                                         test = true;
+  filebuf                              f_tmp;
+  streamsize                   strmsz_1, strmsz_2;
+  streamoff                    strmof_1, strmof_2;
+  int                                  i = 0, j = 0, k = 0;
+
+  // GET
+  fb_01.open(name_01, ios_base::in);
+  fb_02.open(name_02, ios_base::out | ios_base::trunc);
+  fb_03.open(name_03, ios_base::out | ios_base::in | ios_base::trunc); 
+  strmof_1 = fb_01.in_avail();
+  strmof_2 = fb_02.in_avail();
+  strmof_1 = fb_03.in_avail(); 
+
+  // int_type sbumpc()
+  // if read_cur not avail returns uflow(), else return *read_cur & increment
+  int_type c1 = fb_01.sbumpc();
+  int_type c2 = fb_02.sbumpc();
+  VERIFY( c1 != c2 );
+  VERIFY( c1 == '/' );
+  VERIFY( c2 == -1 );
+  int_type c3 = fb_01.sbumpc();
+  int_type c4 = fb_02.sbumpc();
+  VERIFY( c3 != c4 );
+  VERIFY( c1 == c3 ); // fluke, both happen to be '/'
+  VERIFY( c2 == c4 );
+  int_type c5 = fb_03.sbumpc();
+  VERIFY( c5 == traits_type::eof() );
+  // XXX should do some kind of test to make sure that internal
+  // buffers point to the same thing, to check consistancy.
+}
+
+main() 
+{
+  test03();
+  test05();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/9825.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/9825.cc
new file mode 100644 (file)
index 0000000..8e41943
--- /dev/null
@@ -0,0 +1,55 @@
+// 2001-05-21 Benjamin Kosnik  <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <fstream>
+#include <testsuite_hooks.h>
+
+const char name_06[] = "filebuf_virtuals-6.txt"; // empty file, need to create
+
+// libstdc++/9825
+// filebuf::sputbackc breaks sbumpc
+void test12()
+{
+  using namespace std;
+  bool test = true;
+
+  filebuf fbuf;
+
+  fbuf.open(name_06, ios_base::in|ios_base::out|ios_base::trunc);
+  fbuf.sputn("crazy bees!", 11);
+  fbuf.pubseekoff(0, ios_base::beg);
+  fbuf.sbumpc();
+  fbuf.sputbackc('x');
+  filebuf::int_type c = fbuf.sbumpc();
+  VERIFY( c == 'x' );
+  c = fbuf.sbumpc();
+  VERIFY( c == 'r' );
+  c = fbuf.sbumpc();
+  VERIFY( c == 'a' );
+  fbuf.close();  
+}
+
+main() 
+{
+  test12();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/1.cc
new file mode 100644 (file)
index 0000000..cb64d10
--- /dev/null
@@ -0,0 +1,137 @@
+// 2001-05-21 Benjamin Kosnik  <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <fstream>
+#include <testsuite_hooks.h>
+
+// @require@ %-*.tst %-*.txt
+// @diff@ %-*.tst %*.txt
+
+// NB: This test assumes that _M_buf_size == 40, and not the usual
+// buffer_size length of BUFSIZ (8192), so that overflow/underflow can be
+// simulated a bit more readily.
+// NRB (Nota Really Bene): setting it to 40 breaks the test, as intended.
+const int buffer_size = 8192;
+//const int buffer_size = 40;
+
+const char name_01[] = "filebuf_virtuals-1.txt"; // empty file, need to create
+
+class derived_filebuf: public std::filebuf
+{
+ public:
+  void
+  set_size(int_type __size) { _M_buf_size_opt = __size; }
+};
+
+derived_filebuf fb_03; // in | out
+
+// Initialize filebufs to be the same size regardless of platform.
+void test03()
+{
+  fb_03.set_size(buffer_size);
+}
+
+// Test overloaded virtual functions.
+void test05() 
+{
+  using namespace std;
+  typedef filebuf::int_type    int_type;
+  typedef filebuf::traits_type         traits_type;
+  typedef filebuf::pos_type    pos_type;
+  typedef filebuf::off_type    off_type;
+  typedef size_t                       size_type;
+
+  bool                                         test = true;
+  filebuf                              f_tmp;
+  streamsize                   strmsz_1, strmsz_2;
+  streamoff                    strmof_1, strmof_2;
+  int                                  i = 0, j = 0, k = 0;
+
+  fb_03.open(name_01, ios_base::out | ios_base::in);
+
+  int_type c1;
+  int_type c2;
+  int_type c3;
+
+  // seekoff
+  // pubseekoff(off_type off, ios_base::seekdir way, ios_base::openmode which)
+  // alters the stream position to off
+  pos_type pt_1(off_type(-1));
+  pos_type pt_2(off_type(0));
+  off_type off_1 = 0;
+  off_type off_2 = 0;
+
+  //IN|OUT
+  // 27filebuf-3.txt = bd23456789:;<=>?...
+  //beg
+  strmsz_1 = fb_03.in_avail(); 
+  pt_1 = fb_03.pubseekoff(2, ios_base::beg);
+  strmsz_2 = fb_03.in_avail(); 
+  off_1 = pt_1;
+  VERIFY( off_1 > 0 );
+  c1 = fb_03.snextc(); //current in pointer +1
+  VERIFY( c1 == '9' );
+  c2 = fb_03.sputc('\n');  //current in pointer +1
+  c3 = fb_03.sgetc();
+  VERIFY( c2 != c3 ); 
+  VERIFY( c3 == '9' );
+  fb_03.pubsync(); 
+  c1 = fb_03.sgetc();
+  VERIFY( c1 == c3 );
+  //cur
+  // 27filebuf-3.txt = bd2\n456789:;<=>?...
+  pt_2 = fb_03.pubseekoff(2, ios_base::cur);
+  off_2 = pt_2;
+  VERIFY( (off_2 == (off_1 + 2 + 1 + 1)) );
+  c1 = fb_03.snextc(); //current in pointer +1
+  VERIFY( c1 == '1' );
+  c2 = fb_03.sputc('x');  //test current out pointer
+  c3 = fb_03.sputc('\n');
+  c1 = fb_03.sgetc();
+  fb_03.pubsync(); 
+  c3 = fb_03.sgetc();
+  VERIFY( c1 == c3 );
+  //end
+  // 27filebuf-3.txt = "bd2\n456x\n9" 
+  pt_2 = fb_03.pubseekoff(0, ios_base::end, ios_base::in|ios_base::out);
+  off_1 = pt_2;
+  VERIFY( off_1 > off_2 ); //weak, but don't know exactly where it ends
+  c3 = fb_03.sputc('\n');
+  strmsz_1 = fb_03.sputn("because because because. . .", 28);  
+  VERIFY( strmsz_1 == 28 );
+  c1 = fb_03.sungetc();
+  // Defect?  retval of sungetc is not necessarily the character ungotten.
+  // So re-get it.
+  c1 = fb_03.sgetc();
+  fb_03.pubsync(); 
+  c3 = fb_03.sgetc();
+  VERIFY( c1 == c3 );
+  // IN
+  // OUT
+}
+
+main() 
+{
+  test03();
+  test05();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/2.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/2.cc
new file mode 100644 (file)
index 0000000..fa18552
--- /dev/null
@@ -0,0 +1,65 @@
+// 2001-05-21 Benjamin Kosnik  <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.7.1.3 Overridden virtual functions
+
+#include <fstream>
+#include <testsuite_hooks.h>
+
+void test02(std::filebuf& in, bool pass)
+{
+  bool test = true;
+  using namespace std;
+  typedef streambuf::pos_type pos_type;
+  typedef streambuf::off_type off_type;
+  pos_type bad = pos_type(off_type(-1));
+  pos_type p = 0;
+
+  // seekoff
+  p = in.pubseekoff(0, ios_base::beg, ios_base::in);
+  if (pass)
+    VERIFY( p != bad );
+
+  p = in.pubseekoff(0, ios_base::beg, ios_base::out); 
+  VERIFY( p == bad );
+
+  p = in.pubseekoff(0, ios_base::beg); 
+  if (pass)
+    VERIFY( p != bad );
+}
+
+const char name_01[] = "filebuf_virtuals-1.tst"; // file with data in it
+const char name_03[] = "filebuf_members-1.tst"; // empty file
+
+int main() 
+{
+  using namespace std;
+
+  // movie star, submarine scientist!
+  filebuf in1;
+  in1.open(name_01, ios_base::in);
+  filebuf in2;
+  filebuf in3;
+  in3.open(name_03, ios_base::in);
+  test02(in1, true);
+  test02(in2, false);
+  test02(in3, true);
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/1.cc
new file mode 100644 (file)
index 0000000..65a91c4
--- /dev/null
@@ -0,0 +1,127 @@
+// 2001-05-21 Benjamin Kosnik  <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <fstream>
+#include <testsuite_hooks.h>
+
+// @require@ %-*.tst %-*.txt
+// @diff@ %-*.tst %*.txt
+
+// NB: This test assumes that _M_buf_size == 40, and not the usual
+// buffer_size length of BUFSIZ (8192), so that overflow/underflow can be
+// simulated a bit more readily.
+// NRB (Nota Really Bene): setting it to 40 breaks the test, as intended.
+const int buffer_size = 8192;
+//const int buffer_size = 40;
+
+const char name_01[] = "filebuf_virtuals-1.txt"; // file with data in it
+
+class derived_filebuf: public std::filebuf
+{
+ public:
+  void
+  set_size(int_type __size) { _M_buf_size_opt = __size; }
+};
+
+derived_filebuf fb_03; // in | out
+
+// Initialize filebufs to be the same size regardless of platform.
+void test03()
+{
+  fb_03.set_size(buffer_size);
+}
+
+// Test overloaded virtual functions.
+void test05() 
+{
+  using namespace std;
+  typedef filebuf::int_type    int_type;
+  typedef filebuf::traits_type         traits_type;
+  typedef filebuf::pos_type    pos_type;
+  typedef filebuf::off_type    off_type;
+  typedef size_t                       size_type;
+
+  bool                                         test = true;
+  filebuf                              f_tmp;
+  streamsize                   strmsz_1, strmsz_2;
+  streamoff                    strmof_1, strmof_2;
+  int                                  i = 0, j = 0, k = 0;
+
+  fb_03.open(name_01, ios_base::out | ios_base::in);
+
+  int_type c1;
+  int_type c2;
+  int_type c3;
+
+  // seekpos
+  // pubseekpos(pos_type sp, ios_base::openmode)
+  // alters the stream position to sp
+  pos_type pt_1(off_type(-1));
+  pos_type pt_2(off_type(0));
+  off_type off_1 = 0;
+  off_type off_2 = 0;
+  //IN|OUT
+  //beg
+  pt_1 = fb_03.pubseekoff(78, ios_base::beg);
+  off_1 = pt_1;
+  VERIFY( off_1 > 0 );
+  c1 = fb_03.snextc();                 //current in pointer +1
+  VERIFY( c1 == 't' );
+  c2 = fb_03.sputc('\n');      //test current out pointer
+  c3 = fb_03.sgetc();
+  fb_03.pubsync();             //resets pointers
+  pt_2 = fb_03.pubseekpos(pt_1);
+  off_2 = pt_2;
+  VERIFY( off_1 == off_2 );
+  c3 = fb_03.snextc();                 //current in pointer +1
+  VERIFY( c2 == c3 );
+  pt_1 = fb_03.pubseekoff(0, ios_base::end);
+  off_1 = pt_1;
+  VERIFY( off_1 > off_2 );
+  fb_03.sputn("\nof the wonderful things he does!!\nok", 37);
+  fb_03.pubsync();
+
+  // IN
+  // OUT
+
+  // VIRTUALS (indirectly tested)
+  // underflow
+  // if read position avail, returns *gptr()
+
+  // pbackfail(int_type c)
+  // put c back into input sequence
+
+  // overflow
+  // appends c to output seq
+
+  // NB Have to close these suckers. . .
+  // filebuf_type* close()
+  fb_03.close();
+  VERIFY( !fb_03.is_open() );
+}
+
+main() 
+{
+  test03();
+  test05();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/2.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/2.cc
new file mode 100644 (file)
index 0000000..d32dc4b
--- /dev/null
@@ -0,0 +1,65 @@
+// 2001-05-21 Benjamin Kosnik  <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.7.1.3 Overridden virtual functions
+
+#include <fstream>
+#include <testsuite_hooks.h>
+
+void test02(std::filebuf& in, bool pass)
+{
+  bool test = true;
+  using namespace std;
+  typedef streambuf::pos_type pos_type;
+  typedef streambuf::off_type off_type;
+  pos_type bad = pos_type(off_type(-1));
+  pos_type p = 0;
+
+  // seekpos
+  p = in.pubseekpos(0, ios_base::in);
+  if (pass)
+    VERIFY( p != bad );
+
+  p = in.pubseekpos(0, ios_base::out); 
+  VERIFY( p == bad );
+
+  p = in.pubseekpos(0); 
+  if (pass)
+    VERIFY( p != bad );
+}
+
+const char name_01[] = "filebuf_virtuals-1.tst"; // file with data in it
+const char name_03[] = "filebuf_members-1.tst"; // empty file
+
+int main() 
+{
+  using namespace std;
+
+  // movie star, submarine scientist!
+  filebuf in1;
+  in1.open(name_01, ios_base::in);
+  filebuf in2;
+  filebuf in3;
+  in3.open(name_03, ios_base::in);
+  test02(in1, true);
+  test02(in2, false);
+  test02(in3, true);
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/setbuf/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/setbuf/char/1.cc
new file mode 100644 (file)
index 0000000..d4f9e4c
--- /dev/null
@@ -0,0 +1,90 @@
+// 2001-05-21 Benjamin Kosnik  <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <fstream>
+#include <testsuite_hooks.h>
+
+class testbuf : public std::filebuf
+{
+public:
+
+  // Typedefs:
+  typedef std::filebuf base_type;
+  typedef base_type::traits_type traits_type;
+  typedef base_type::char_type char_type;
+
+  testbuf(): base_type() 
+  { _M_mode = (std::ios_base::in | std::ios_base::out); }
+
+  bool
+  check_pointers()
+  { 
+    bool test = true;
+    test = (this->pbase() == NULL);
+    test &= (this->pptr() == NULL);
+    return test;
+  }
+};
+
+const char name_01[] = "filebuf_virtuals-1.txt";
+
+// Test overloaded virtual functions.
+void test05() 
+{
+  using namespace std;
+  typedef std::filebuf::int_type       int_type;
+  typedef std::filebuf::traits_type    traits_type;
+  typedef std::filebuf::pos_type       pos_type;
+  typedef std::filebuf::off_type       off_type;
+  typedef size_t                       size_type;
+
+  bool                                         test = true;
+
+  int_type c1;
+
+  {
+    testbuf                            f_tmp;
+
+    // setbuf
+    // pubsetbuf(char_type* s, streamsize n)
+    f_tmp.pubsetbuf(0,0);
+    VERIFY( f_tmp.check_pointers() );
+  }
+
+  {
+    testbuf                            f_tmp;
+    
+    f_tmp.open(name_01, ios_base::out | ios_base::in);
+    int_type c1 = f_tmp.sbumpc();
+    
+    // setbuf
+    // pubsetbuf(char_type* s, streamsize n)
+    f_tmp.pubsetbuf(0, 0);
+    VERIFY( !f_tmp.check_pointers() );
+  }
+}
+
+main() 
+{
+  test05();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/setbuf/char/2.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/setbuf/char/2.cc
new file mode 100644 (file)
index 0000000..6261c99
--- /dev/null
@@ -0,0 +1,45 @@
+// 2001-05-21 Benjamin Kosnik  <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <fstream>
+#include <testsuite_hooks.h>
+
+void test01()
+{
+  using namespace std;
+
+  bool test = true;
+  char buf[512];
+  const char* strlit = "how to tell a story and other essays: mark twain";
+  const size_t strlitsize = std::strlen(strlit);
+  filebuf fbuf;
+  fbuf.open("tmp_setbuf2", ios_base::out);
+  fbuf.pubsetbuf(buf, 512);
+  fbuf.sputn(strlit, strlitsize);
+  VERIFY( std::strncmp(strlit, buf, strlitsize) == 0 );
+}
+
+main() 
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/setbuf/char/3.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/setbuf/char/3.cc
new file mode 100644 (file)
index 0000000..2927991
--- /dev/null
@@ -0,0 +1,46 @@
+// 2001-05-21 Benjamin Kosnik  <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <fstream>
+#include <testsuite_hooks.h>
+
+void test02()
+{
+  using namespace std;
+
+  bool test = true;
+  char buf[512];
+  const char* strlit = "how to tell a story and other essays: mark twain";
+  const size_t strlitsize = std::strlen(strlit);
+  filebuf fbuf01;
+  fbuf01.open("tmp", ios_base::out);
+
+  fbuf01.pubsetbuf(buf, strlitsize);
+  fbuf01.sputn(strlit, strlitsize);
+  VERIFY( std::strncmp(strlit, buf, strlitsize) == 0 );
+}
+
+main() 
+{
+  test02();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/1.cc
new file mode 100644 (file)
index 0000000..34f5355
--- /dev/null
@@ -0,0 +1,120 @@
+// 2001-05-21 Benjamin Kosnik  <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <fstream>
+#include <unistd.h>
+#include <signal.h>
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <locale>
+#include <testsuite_hooks.h>
+
+// @require@ %-*.tst %-*.txt
+// @diff@ %-*.tst %*.txt
+
+// NB: This test assumes that _M_buf_size == 40, and not the usual
+// buffer_size length of BUFSIZ (8192), so that overflow/underflow can be
+// simulated a bit more readily.
+// NRB (Nota Really Bene): setting it to 40 breaks the test, as intended.
+const int buffer_size = 8192;
+//const int buffer_size = 40;
+
+const char carray_01[] = "santa cruz or sandiego?";
+const char carray_02[] = "memphis, new orleans, and savanah";
+const char name_01[] = "filebuf_virtuals-1.txt"; // file with data in it
+const char name_02[] = "filebuf_virtuals-2.txt"; // empty file, need to create
+const char name_03[] = "filebuf_virtuals-3.txt"; // empty file, need to create
+const char name_04[] = "filebuf_virtuals-4.txt"; // empty file, need to create
+const char name_05[] = "filebuf_virtuals-5.txt"; // empty file, need to create
+const char name_06[] = "filebuf_virtuals-6.txt"; // empty file, need to create
+const char name_07[] = "filebuf_virtuals-7.txt"; // empty file, need to create
+const char name_08[] = "filebuf_virtuals-8.txt"; // empty file, need to create
+
+class derived_filebuf: public std::filebuf
+{
+ public:
+  void
+  set_size(int_type __size) { _M_buf_size_opt = __size; }
+};
+
+derived_filebuf fb_01; // in 
+derived_filebuf fb_02; // out
+derived_filebuf fb_03; // in | out
+
+// Initialize filebufs to be the same size regardless of platform.
+void test03()
+{
+  fb_01.set_size(buffer_size);
+  fb_02.set_size(buffer_size);
+  fb_03.set_size(buffer_size);
+}
+
+// Test overloaded virtual functions.
+void test05() 
+{
+  typedef std::filebuf::int_type       int_type;
+  typedef std::filebuf::traits_type    traits_type;
+  typedef std::filebuf::pos_type       pos_type;
+  typedef std::filebuf::off_type       off_type;
+  typedef size_t                       size_type;
+
+  bool                                         test = true;
+  std::filebuf                                 f_tmp;
+  std::streamsize                      strmsz_1, strmsz_2;
+  std::streamoff                       strmof_1, strmof_2;
+  int                                  i = 0, j = 0, k = 0;
+
+  // GET
+  fb_01.open(name_01, std::ios_base::in);
+  fb_02.open(name_02, std::ios_base::out | std::ios_base::trunc);
+  fb_03.open(name_03, std::ios_base::out | std::ios_base::in | std::ios_base::trunc); 
+  strmof_1 = fb_01.in_avail();
+  strmof_2 = fb_02.in_avail();
+  strmof_1 = fb_03.in_avail(); 
+
+  int_type c1 = fb_01.sbumpc();
+  int_type c2 = fb_02.sbumpc();
+  int_type c3 = fb_01.sbumpc();
+  int_type c4 = fb_02.sbumpc();
+  int_type c5 = fb_03.sbumpc();
+
+  // int_type sgetc()
+  // if read_cur not avail, return uflow(), else return *read_cur  
+  int_type c6 = fb_01.sgetc();
+  int_type c7 = fb_02.sgetc();
+  VERIFY( c6 != c3 );
+  VERIFY( c7 == c4 ); // both -1
+  int_type c8 = fb_01.sgetc();
+  int_type c9 = fb_02.sgetc();
+  VERIFY( c6 == c8 );
+  VERIFY( c7 == c9 );
+  c5 = fb_03.sgetc();
+  VERIFY( c5 == traits_type::eof() );
+}
+
+main() 
+{
+  test03();
+  test05();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/1.cc
new file mode 100644 (file)
index 0000000..1f0fd4c
--- /dev/null
@@ -0,0 +1,145 @@
+// 2001-05-21 Benjamin Kosnik  <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <fstream>
+#include <testsuite_hooks.h>
+
+// @require@ %-*.tst %-*.txt
+// @diff@ %-*.tst %*.txt
+
+// NB: This test assumes that _M_buf_size == 40, and not the usual
+// buffer_size length of BUFSIZ (8192), so that overflow/underflow can be
+// simulated a bit more readily.
+// NRB (Nota Really Bene): setting it to 40 breaks the test, as intended.
+const int buffer_size = 8192;
+//const int buffer_size = 40;
+
+const char name_01[] = "filebuf_virtuals-1.txt"; // file with data in it
+const char name_02[] = "filebuf_virtuals-2.txt"; // empty file, need to create
+const char name_03[] = "filebuf_virtuals-3.txt"; // empty file, need to create
+
+class derived_filebuf: public std::filebuf
+{
+ public:
+  void
+  set_size(int_type __size) { _M_buf_size_opt = __size; }
+};
+
+derived_filebuf fb_01; // in 
+derived_filebuf fb_02; // out
+derived_filebuf fb_03; // in | out
+
+// Initialize filebufs to be the same size regardless of platform.
+void test03()
+{
+  fb_01.set_size(buffer_size);
+  fb_02.set_size(buffer_size);
+  fb_03.set_size(buffer_size);
+}
+
+// Test overloaded virtual functions.
+void test05() 
+{
+  using namespace std;
+  typedef filebuf::int_type    int_type;
+  typedef filebuf::traits_type         traits_type;
+  typedef filebuf::pos_type    pos_type;
+  typedef filebuf::off_type    off_type;
+  typedef size_t                       size_type;
+
+  bool                                         test = true;
+  filebuf                              f_tmp;
+  streamsize                   strmsz_1, strmsz_2;
+  streamoff                    strmof_1, strmof_2;
+  int                                  i = 0, j = 0, k = 0;
+
+  // GET
+  fb_01.open(name_01, ios_base::in);
+  fb_02.open(name_02, ios_base::out | ios_base::trunc);
+  fb_03.open(name_03, ios_base::out | ios_base::in | ios_base::trunc); 
+  strmof_1 = fb_01.in_avail();
+  strmof_2 = fb_02.in_avail();
+  strmof_1 = fb_03.in_avail(); 
+
+  int_type c1 = fb_01.sbumpc();
+  int_type c2 = fb_02.sbumpc();
+  int_type c3 = fb_01.sbumpc();
+  int_type c4 = fb_02.sbumpc();
+  int_type c5 = fb_03.sbumpc();
+
+  int_type c6 = fb_01.sgetc();
+  int_type c7 = fb_02.sgetc();
+  int_type c8 = fb_01.sgetc();
+  int_type c9 = fb_02.sgetc();
+  c5 = fb_03.sgetc();
+
+  // int_type snextc()
+  // calls sbumpc and if sbumpc != eof, return sgetc
+  c6 = fb_01.snextc();
+  c7 = fb_02.snextc();
+  c6 = fb_01.snextc();
+  c7 = fb_02.snextc();
+  c5 = fb_03.snextc();
+
+  // streamsize sgetn(char_type *s, streamsize n)
+  // streamsize xsgetn(char_type *s, streamsize n)
+  // assign up to n chars to s from input sequence, indexing in_cur as
+  // approp and returning the number of chars assigned
+  strmsz_1 = fb_01.in_avail();
+  strmsz_2 = fb_02.in_avail();
+  test = strmsz_1 != strmsz_2;
+  char carray1[13] = "";
+  strmsz_1 = fb_01.sgetn(carray1, 10);
+  char carray2[buffer_size] = "";
+  strmsz_2 = fb_02.sgetn(carray2, 10);
+  VERIFY( strmsz_1 != strmsz_2 );
+  VERIFY( strmsz_1 == 10 );
+  VERIFY( strmsz_2 == 0 );
+  c1 = fb_01.sgetc();
+  c2 = fb_02.sgetc();
+  VERIFY( c1 == '\n' );  
+  VERIFY( c7 == c2 ); // n != i
+  strmsz_1 = fb_03.sgetn(carray1, 10);
+  VERIFY( !strmsz_1 ); //zero
+  strmsz_1 = fb_01.in_avail();
+  strmsz_2 = fb_01.sgetn(carray2, strmsz_1 + 5);
+  VERIFY( strmsz_1 == strmsz_2 - 5 ); 
+  c4 = fb_01.sgetc(); // buffer should have underflowed from above.
+  VERIFY( c4 == 'i' );
+  strmsz_1 = fb_01.in_avail();
+  VERIFY( strmsz_1 > 0 );
+  strmsz_2 = fb_01.sgetn(carray2, strmsz_1 + 5);
+  VERIFY( strmsz_1 == strmsz_2 ); //at the end of the actual file 
+  strmsz_1 = fb_02.in_avail();
+  strmsz_2 = fb_02.sgetn(carray2, strmsz_1 + 5);
+  VERIFY( strmsz_1 == -1 );
+  VERIFY( strmsz_2 == 0 );
+  c4 = fb_02.sgetc(); // should be EOF
+  VERIFY( c4 == traits_type::eof() );
+}
+
+main() 
+{
+  test03();
+  test05();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/2.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/2.cc
new file mode 100644 (file)
index 0000000..6ed1671
--- /dev/null
@@ -0,0 +1,46 @@
+// 2001-05-21 Benjamin Kosnik  <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <fstream>
+#include <testsuite_hooks.h>
+
+const char name_01[] = "filebuf_virtuals-1.tst"; // empty file, need to create
+
+void test06()
+{
+  using namespace std;
+
+  bool test = true;
+  char buffer[] = "xxxxxxxxxx";
+  typedef filebuf::int_type    int_type;
+  filebuf fbuf01;
+  fbuf01.open(name_01, ios_base::in);
+  int_type len1 = fbuf01.sgetn(buffer, sizeof(buffer));
+  VERIFY( len1 == sizeof(buffer) );
+  VERIFY( buffer[0] == '/' );
+}
+
+main() 
+{
+  test06();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/1.cc
new file mode 100644 (file)
index 0000000..9dcfcb5
--- /dev/null
@@ -0,0 +1,116 @@
+// 2001-05-21 Benjamin Kosnik  <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <fstream>
+#include <testsuite_hooks.h>
+
+// @require@ %-*.tst %-*.txt
+// @diff@ %-*.tst %*.txt
+
+// NB: This test assumes that _M_buf_size == 40, and not the usual
+// buffer_size length of BUFSIZ (8192), so that overflow/underflow can be
+// simulated a bit more readily.
+// NRB (Nota Really Bene): setting it to 40 breaks the test, as intended.
+const int buffer_size = 8192;
+//const int buffer_size = 40;
+
+const char name_01[] = "filebuf_virtuals-1.txt"; // file with data in it
+const char name_02[] = "filebuf_virtuals-2.txt"; // empty file, need to create
+const char name_03[] = "filebuf_virtuals-3.txt"; // empty file, need to create
+
+class derived_filebuf: public std::filebuf
+{
+ public:
+  void
+  set_size(int_type __size) { _M_buf_size_opt = __size; }
+};
+
+derived_filebuf fb_01; // in 
+derived_filebuf fb_02; // out
+derived_filebuf fb_03; // in | out
+
+// Initialize filebufs to be the same size regardless of platform.
+void test03()
+{
+  fb_01.set_size(buffer_size);
+  fb_02.set_size(buffer_size);
+  fb_03.set_size(buffer_size);
+}
+
+// Test overloaded virtual functions.
+void test05() 
+{
+  using namespace std;
+  typedef filebuf::int_type    int_type;
+  typedef filebuf::traits_type         traits_type;
+  typedef filebuf::pos_type    pos_type;
+  typedef filebuf::off_type    off_type;
+  typedef size_t                       size_type;
+
+  bool                                         test = true;
+  filebuf                              f_tmp;
+  streamsize                   strmsz_1, strmsz_2;
+  streamoff                    strmof_1, strmof_2;
+  int                                  i = 0, j = 0, k = 0;
+
+  // GET
+  fb_01.open(name_01, ios_base::in);
+  fb_02.open(name_02, ios_base::out | ios_base::trunc);
+  fb_03.open(name_03, ios_base::out | ios_base::in | ios_base::trunc); 
+  strmof_1 = fb_01.in_avail();
+  strmof_2 = fb_02.in_avail();
+  strmof_1 = fb_03.in_avail(); 
+
+  int_type c1 = fb_01.sbumpc();
+  int_type c2 = fb_02.sbumpc();
+  int_type c3 = fb_01.sbumpc();
+  int_type c4 = fb_02.sbumpc();
+  int_type c5 = fb_03.sbumpc();
+
+  int_type c6 = fb_01.sgetc();
+  int_type c7 = fb_02.sgetc();
+  int_type c8 = fb_01.sgetc();
+  int_type c9 = fb_02.sgetc();
+  c5 = fb_03.sgetc();
+
+  // int_type snextc()
+  // calls sbumpc and if sbumpc != eof, return sgetc
+  c6 = fb_01.snextc();
+  c7 = fb_02.snextc();
+  VERIFY( c6 != c8 );
+  VERIFY( c7 == c9 ); // -1
+  VERIFY( c6 == '\n' );
+  c6 = fb_01.snextc();
+  c7 = fb_02.snextc();
+  VERIFY( c6 != c8 );
+  VERIFY( c7 == c9 ); // -1
+  VERIFY( c6 == '9' );
+  c5 = fb_03.snextc();
+  VERIFY( c5 == traits_type::eof() );
+}
+
+main() 
+{
+  test03();
+  test05();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/1.cc
new file mode 100644 (file)
index 0000000..62dc70e
--- /dev/null
@@ -0,0 +1,168 @@
+// 2001-05-21 Benjamin Kosnik  <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <fstream>
+#include <unistd.h>
+#include <signal.h>
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <locale>
+#include <testsuite_hooks.h>
+
+// @require@ %-*.tst %-*.txt
+// @diff@ %-*.tst %*.txt
+
+// NB: This test assumes that _M_buf_size == 40, and not the usual
+// buffer_size length of BUFSIZ (8192), so that overflow/underflow can be
+// simulated a bit more readily.
+// NRB (Nota Really Bene): setting it to 40 breaks the test, as intended.
+const int buffer_size = 8192;
+//const int buffer_size = 40;
+
+const char carray_01[] = "santa cruz or sandiego?";
+const char carray_02[] = "memphis, new orleans, and savanah";
+const char name_01[] = "filebuf_virtuals-1.txt"; // file with data in it
+const char name_02[] = "filebuf_virtuals-2.txt"; // empty file, need to create
+const char name_03[] = "filebuf_virtuals-3.txt"; // empty file, need to create
+const char name_04[] = "filebuf_virtuals-4.txt"; // empty file, need to create
+const char name_05[] = "filebuf_virtuals-5.txt"; // empty file, need to create
+const char name_06[] = "filebuf_virtuals-6.txt"; // empty file, need to create
+const char name_07[] = "filebuf_virtuals-7.txt"; // empty file, need to create
+const char name_08[] = "filebuf_virtuals-8.txt"; // empty file, need to create
+
+class derived_filebuf: public std::filebuf
+{
+ public:
+  void
+  set_size(int_type __size) { _M_buf_size_opt = __size; }
+};
+
+derived_filebuf fb_01; // in 
+derived_filebuf fb_02; // out
+derived_filebuf fb_03; // in | out
+
+// Initialize filebufs to be the same size regardless of platform.
+void test03()
+{
+  fb_01.set_size(buffer_size);
+  fb_02.set_size(buffer_size);
+  fb_03.set_size(buffer_size);
+}
+
+// Test overloaded virtual functions.
+void test05() 
+{
+  typedef std::filebuf::int_type       int_type;
+  typedef std::filebuf::traits_type    traits_type;
+  typedef std::filebuf::pos_type       pos_type;
+  typedef std::filebuf::off_type       off_type;
+  typedef size_t                       size_type;
+
+  bool                                         test = true;
+  std::filebuf                                 f_tmp;
+  std::streamsize                      strmsz_1, strmsz_2;
+  std::streamoff                       strmof_1, strmof_2;
+  int                                  i = 0, j = 0, k = 0;
+
+  fb_01.open(name_01, std::ios_base::in);
+  fb_02.open(name_02, std::ios_base::out | std::ios_base::trunc);
+  fb_03.open(name_03, std::ios_base::out | std::ios_base::in | std::ios_base::trunc);
+
+  int_type c1 = fb_01.sbumpc();
+  int_type c2 = fb_02.sbumpc();
+  int_type c3 = fb_01.sbumpc();
+  int_type c4 = fb_02.sbumpc();
+  int_type c5 = fb_03.sbumpc();
+  int_type c6 = fb_01.sgetc();
+  int_type c7 = fb_02.sgetc();
+  int_type c8 = fb_01.sgetc();
+  int_type c9 = fb_02.sgetc();
+
+  // PUT
+  strmsz_1 = fb_03.sputn("racadabras", 10);//"abracadabras or what?"
+  strmsz_2 = fb_03.sputn(", i wanna reach out and", 10);
+  strmsz_1 = fb_02.sputn("racadabras", 10);
+  strmsz_1 = fb_01.sputn("racadabra", 10);
+
+  // PUTBACK
+  // int_type pbfail(int_type c)
+  // called when gptr() null, gptr() == eback(), or traits::eq(*gptr, c) false
+  // "pending sequence" is:
+  //   1) everything as defined in underflow
+  //   2) + if (traits::eq_int_type(c, traits::eof()), then input
+  //   sequence is backed up one char before the pending sequence is
+  //   determined.
+  //   3) + if (not 2) then c is prepended. Left unspecified is
+  //   whether the input sequence is backedup or modified in any way
+  // returns traits::eof() for failure, unspecified other value for success
+
+  // int_type sputbackc(char_type c)
+  // if in_cur not avail || ! traits::eq(c, gptr() [-1]), return pbfail
+  // otherwise decrements in_cur and returns *gptr()
+  c1 = fb_03.sgetc(); // -1
+  c2 = fb_03.sputbackc('z');
+  strmsz_2 = fb_03.in_avail();
+  c3 = fb_03.sgetc();
+  VERIFY( c3 == c2 );
+  VERIFY( c1 != c3 );
+  VERIFY( 1 == strmsz_2 );
+  //test for _in_cur == _in_beg
+  // fb_03._M_out_beg = "bd23456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZracada" etc
+  fb_03.pubseekoff(10, std::ios_base::beg, 
+                  std::ios_base::in | std::ios_base::out);
+  fb_03.sputc('m');
+  strmsz_1 = fb_03.in_avail(); 
+  c1 = fb_03.sgetc(); 
+  fb_03.snextc();
+  c2 = fb_03.sputbackc('z');  
+  strmsz_2 = fb_03.in_avail(); 
+  c3 = fb_03.sgetc();  
+  VERIFY( c1 != c2 );
+  VERIFY( c3 == c2 );
+  VERIFY( c1 != c3 );
+  VERIFY( c2 == 'z' );
+  //  VERIFY( strmsz_1 == strmsz_2 );
+  // test for replacing char with identical one
+  fb_03.snextc();
+  fb_03.sputc('u');
+  fb_03.sputc('v');
+  fb_03.sputc('a');
+  strmsz_1 = fb_03.in_avail();
+  c2 = fb_03.sputbackc('a');
+  strmsz_2 = fb_03.in_avail();
+  c3 = fb_03.sgetc();
+  VERIFY( c3 == c2 );
+  VERIFY( strmsz_1 + 1 == strmsz_2 );
+  //test for ios_base::out
+  c1 = fb_02.sgetc(); // undefined
+  c2 = fb_02.sputbackc('a');
+  VERIFY( c1 == c2 );
+  VERIFY( c1 == -1 );
+}
+
+main() 
+{
+  test03();
+  test05();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/9425.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/9425.cc
new file mode 100644 (file)
index 0000000..b5e470f
--- /dev/null
@@ -0,0 +1,48 @@
+// 2001-05-21 Benjamin Kosnik  <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <fstream>
+#include <testsuite_hooks.h>
+
+const char name_01[] = "filebuf_virtuals-1.txt"; // file with data in it
+
+// libstdc++/9439, libstdc++/9425
+// basic_filebuf<>::pbackfail calls basic_filebuf<>::seekoff, but
+// fails to check the return value
+void test09()
+{
+  using namespace std;
+  bool test = true;
+
+  filebuf fbuf;
+  fbuf.open(name_01, ios_base::in);
+  filebuf::int_type r = fbuf.sputbackc('a');
+  fbuf.close();
+
+  VERIFY( r == filebuf::traits_type::eof() );
+}
+
+main() 
+{
+  test09();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/1.cc
new file mode 100644 (file)
index 0000000..db386f7
--- /dev/null
@@ -0,0 +1,137 @@
+// 2001-05-21 Benjamin Kosnik  <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <fstream>
+#include <unistd.h>
+#include <signal.h>
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <locale>
+#include <testsuite_hooks.h>
+
+// @require@ %-*.tst %-*.txt
+// @diff@ %-*.tst %*.txt
+
+// NB: This test assumes that _M_buf_size == 40, and not the usual
+// buffer_size length of BUFSIZ (8192), so that overflow/underflow can be
+// simulated a bit more readily.
+// NRB (Nota Really Bene): setting it to 40 breaks the test, as intended.
+const int buffer_size = 8192;
+//const int buffer_size = 40;
+
+const char carray_01[] = "santa cruz or sandiego?";
+const char carray_02[] = "memphis, new orleans, and savanah";
+const char name_01[] = "filebuf_virtuals-1.txt"; // file with data in it
+const char name_02[] = "filebuf_virtuals-2.txt"; // empty file, need to create
+const char name_03[] = "filebuf_virtuals-3.txt"; // empty file, need to create
+const char name_04[] = "filebuf_virtuals-4.txt"; // empty file, need to create
+const char name_05[] = "filebuf_virtuals-5.txt"; // empty file, need to create
+const char name_06[] = "filebuf_virtuals-6.txt"; // empty file, need to create
+const char name_07[] = "filebuf_virtuals-7.txt"; // empty file, need to create
+const char name_08[] = "filebuf_virtuals-8.txt"; // empty file, need to create
+
+class derived_filebuf: public std::filebuf
+{
+ public:
+  void
+  set_size(int_type __size) { _M_buf_size_opt = __size; }
+};
+
+derived_filebuf fb_01; // in 
+derived_filebuf fb_02; // out
+derived_filebuf fb_03; // in | out
+
+// Initialize filebufs to be the same size regardless of platform.
+void test03()
+{
+  fb_01.set_size(buffer_size);
+  fb_02.set_size(buffer_size);
+  fb_03.set_size(buffer_size);
+}
+
+// Test overloaded virtual functions.
+void test05() 
+{
+  typedef std::filebuf::int_type       int_type;
+  typedef std::filebuf::traits_type    traits_type;
+  typedef std::filebuf::pos_type       pos_type;
+  typedef std::filebuf::off_type       off_type;
+  typedef size_t                       size_type;
+
+  bool                                         test = true;
+  std::filebuf                                 f_tmp;
+  std::streamsize                      strmsz_1, strmsz_2;
+  std::streamoff                       strmof_1, strmof_2;
+  int                                  i = 0, j = 0, k = 0;
+
+  fb_01.open(name_01, std::ios_base::in);
+  fb_02.open(name_02, std::ios_base::out | std::ios_base::trunc);
+  fb_03.open(name_03, std::ios_base::out | std::ios_base::in | std::ios_base::trunc);
+
+  int_type c1 = fb_01.sbumpc();
+  int_type c2 = fb_02.sbumpc();
+  int_type c3 = fb_01.sbumpc();
+  int_type c4 = fb_02.sbumpc();
+  int_type c5 = fb_03.sbumpc();
+  int_type c6 = fb_01.sgetc();
+  int_type c7 = fb_02.sgetc();
+  int_type c8 = fb_01.sgetc();
+  int_type c9 = fb_02.sgetc();
+
+  // PUT
+  // int_type sputc(char_type c)
+  // if out_cur not avail, return overflow(traits_type::to_int_type(c)) 
+  // else, stores c at out_cur,
+  // increments out_cur, and returns c as int_type
+  // strmsz_1 = fb_03.in_avail();  // XXX valid for in|out??
+  c1 = fb_02.sputc('a'); 
+  c2 = fb_03.sputc('b'); 
+  VERIFY( c1 != c2 );
+  c1 = fb_02.sputc('c'); 
+  c2 = fb_03.sputc('d'); 
+  VERIFY( c1 != c2 );
+  // strmsz_2 = fb_03.in_avail();
+  // VERIFY( strmsz_1 != strmsz_2 );
+  for (int i = 50; i <= 90; ++i) 
+    c2 = fb_02.sputc(char(i));
+  // 27filebuf-2.txt == ac23456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWX
+  // fb_02._M_out_cur = '2'
+  strmsz_1 = fb_03.in_avail();
+  for (int i = 50; i <= 90; ++i) 
+    c2 = fb_03.sputc(char(i));
+  strmsz_2 = fb_03.in_avail();
+  // VERIFY( strmsz_1 != strmsz_2 );
+  // VERIFY( strmsz_1 > 0 );
+  // VERIFY( strmsz_2 > 0 );
+  // 27filebuf-2.txt == bd23456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWX
+  // fb_02._M_out_cur = '2'
+  c3 = fb_01.sputc('a'); // should be EOF because this is read-only
+  VERIFY( c3 == traits_type::eof() );
+}
+
+main() 
+{
+  test03();
+  test05();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/1057.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/1057.cc
new file mode 100644 (file)
index 0000000..d794458
--- /dev/null
@@ -0,0 +1,61 @@
+// 1999-10-11 bkoz
+
+// Copyright (C) 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.5.2 template class basic_streambuf
+
+#include <string>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+class nullsetpbuf : public std::filebuf
+{
+  char foo[64];
+public:
+  nullsetpbuf()
+  {
+    setp(foo, foo + 64);
+    setp(NULL, NULL);
+  }
+};
+
+// libstdc++/1057
+void test05()
+{
+  std::string text1 = "abcdefghijklmn";
+  
+  nullsetpbuf nsp;
+  // Immediate crash as sputc writes to null pointer
+  nsp.sputc('a');
+}
+
+int main() 
+{
+  test05();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/9701-2.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/9701-2.cc
new file mode 100644 (file)
index 0000000..e0358ef
--- /dev/null
@@ -0,0 +1,71 @@
+// 2001-05-21 Benjamin Kosnik  <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <fstream>
+#include <testsuite_hooks.h>
+
+const char name_05[] = "filebuf_virtuals-5.txt"; // empty file, need to create
+
+bool over_called;
+
+class Derived_filebuf : public std::filebuf
+{
+public:
+  int_type overflow(int_type c)
+  {
+    over_called = true;
+    return std::filebuf::overflow(c);
+  }
+  
+  const char_type* pub_epptr() const
+  { return epptr(); }
+  
+  const char_type* pub_pptr() const
+  { return pptr(); }
+};
+
+// libstdc++/9701 (partial)
+void test11()
+{
+  bool test = true;
+
+  bool over_expected;
+
+  // sputc
+  Derived_filebuf dfbuf_01;
+  dfbuf_01.open(name_05, std::ios_base::out);
+  over_called = false;
+  dfbuf_01.sputc('i');
+  VERIFY( !over_called );
+  over_expected = dfbuf_01.pub_epptr() == dfbuf_01.pub_pptr();
+  over_called = false;
+  dfbuf_01.sputc('v');
+  VERIFY( (!over_expected && !over_called)
+         || (over_expected && over_called) );
+  dfbuf_01.close();
+}
+
+main() 
+{
+  test11();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/1.cc
new file mode 100644 (file)
index 0000000..38acef6
--- /dev/null
@@ -0,0 +1,125 @@
+// 2001-05-21 Benjamin Kosnik  <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <fstream>
+#include <unistd.h>
+#include <signal.h>
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <locale>
+#include <testsuite_hooks.h>
+
+// @require@ %-*.tst %-*.txt
+// @diff@ %-*.tst %*.txt
+
+// NB: This test assumes that _M_buf_size == 40, and not the usual
+// buffer_size length of BUFSIZ (8192), so that overflow/underflow can be
+// simulated a bit more readily.
+// NRB (Nota Really Bene): setting it to 40 breaks the test, as intended.
+const int buffer_size = 8192;
+//const int buffer_size = 40;
+
+const char carray_01[] = "santa cruz or sandiego?";
+const char carray_02[] = "memphis, new orleans, and savanah";
+const char name_01[] = "filebuf_virtuals-1.txt"; // file with data in it
+const char name_02[] = "filebuf_virtuals-2.txt"; // empty file, need to create
+const char name_03[] = "filebuf_virtuals-3.txt"; // empty file, need to create
+const char name_04[] = "filebuf_virtuals-4.txt"; // empty file, need to create
+const char name_05[] = "filebuf_virtuals-5.txt"; // empty file, need to create
+const char name_06[] = "filebuf_virtuals-6.txt"; // empty file, need to create
+const char name_07[] = "filebuf_virtuals-7.txt"; // empty file, need to create
+const char name_08[] = "filebuf_virtuals-8.txt"; // empty file, need to create
+
+class derived_filebuf: public std::filebuf
+{
+ public:
+  void
+  set_size(int_type __size) { _M_buf_size_opt = __size; }
+};
+
+derived_filebuf fb_01; // in 
+derived_filebuf fb_02; // out
+derived_filebuf fb_03; // in | out
+
+// Initialize filebufs to be the same size regardless of platform.
+void test03()
+{
+  fb_01.set_size(buffer_size);
+  fb_02.set_size(buffer_size);
+  fb_03.set_size(buffer_size);
+}
+
+// Test overloaded virtual functions.
+void test05() 
+{
+  typedef std::filebuf::int_type       int_type;
+  typedef std::filebuf::traits_type    traits_type;
+  typedef std::filebuf::pos_type       pos_type;
+  typedef std::filebuf::off_type       off_type;
+  typedef size_t                       size_type;
+
+  bool                                         test = true;
+  std::filebuf                                 f_tmp;
+  std::streamsize                      strmsz_1, strmsz_2;
+  std::streamoff                       strmof_1, strmof_2;
+  int                                  i = 0, j = 0, k = 0;
+
+  fb_01.open(name_01, std::ios_base::in);
+  fb_02.open(name_02, std::ios_base::out | std::ios_base::trunc);
+  fb_03.open(name_03, std::ios_base::out | std::ios_base::in | std::ios_base::trunc);
+
+  int_type c1 = fb_01.sbumpc();
+  int_type c2 = fb_02.sbumpc();
+  int_type c3 = fb_01.sbumpc();
+  int_type c4 = fb_02.sbumpc();
+  int_type c5 = fb_03.sbumpc();
+  int_type c6 = fb_01.sgetc();
+  int_type c7 = fb_02.sgetc();
+  int_type c8 = fb_01.sgetc();
+  int_type c9 = fb_02.sgetc();
+
+  // PUT
+  // streamsize sputn(const char_typs* s, streamsize n)
+  // write up to n chars to out_cur from s, returning number assigned
+  // NB *sputn will happily put '\0' into your stream if you give it a chance*
+  strmsz_1 = fb_03.sputn("racadabras", 10);//"abracadabras or what?"
+  VERIFY( strmsz_1 == 10 );
+  strmsz_2 = fb_03.sputn(", i wanna reach out and", 10);
+  VERIFY( strmsz_2 == 10 );
+  VERIFY( strmsz_1 == strmsz_2 ); 
+  // fb_03._M_out_beg = "YZracadabras, i wanna FGHIJKLMNOPQRSTUVW"
+  // fb_03._M_out_cur = "FGHIJKLMNOPQRSTUVW"
+  strmsz_1 = fb_02.sputn("racadabras", 10);
+  VERIFY( strmsz_1 == 10 );  
+  // fb_02._M_out_beg = "YZracadabras<=>?@ABCDEFGHIJKLMNOPQRSTUVW"
+  // fb_02._M_out_cur = "<=>?@ABCDEFGHIJKLMNOPQRSTUVW"
+  strmsz_1 = fb_01.sputn("racadabra", 10);
+  VERIFY( strmsz_1 == 0 );  
+}
+
+main() 
+{
+  test03();
+  test05();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/1057.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/1057.cc
new file mode 100644 (file)
index 0000000..b6cf1e7
--- /dev/null
@@ -0,0 +1,61 @@
+// 1999-10-11 bkoz
+
+// Copyright (C) 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.5.2 template class basic_streambuf
+
+#include <string>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+class nullsetpbuf : public std::filebuf
+{
+  char foo[64];
+public:
+  nullsetpbuf()
+  {
+    setp(foo, foo + 64);
+    setp(NULL, NULL);
+  }
+};
+
+// libstdc++/1057
+void test05()
+{
+  std::string text1 = "abcdefghijklmn";
+  
+  nullsetpbuf nsp;
+  // Immediate crash as xsputn writes to null pointer
+  nsp.sputn(text1.c_str(), text1.length());
+}
+
+int main() 
+{
+  test05();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/9701-1.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/9701-1.cc
new file mode 100644 (file)
index 0000000..3c350a4
--- /dev/null
@@ -0,0 +1,75 @@
+// 2001-05-21 Benjamin Kosnik  <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <fstream>
+#include <testsuite_hooks.h>
+
+const char name_05[] = "filebuf_virtuals-5.txt"; // empty file, need to create
+
+bool over_called;
+
+class Derived_filebuf : public std::filebuf
+{
+public:
+  int_type overflow(int_type c)
+  {
+    over_called = true;
+    return std::filebuf::overflow(c);
+  }
+  
+  const char_type* pub_epptr() const
+  {
+    return epptr();
+  }
+  
+  const char_type* pub_pptr() const
+  {
+    return pptr();
+  }
+};
+
+// libstdc++/9701 (partial)
+void test11()
+{
+  bool test = true;
+
+  bool over_expected;
+
+  // sputn
+  Derived_filebuf dfbuf_02;
+  dfbuf_02.open(name_05, std::ios_base::out);
+  over_called = false;
+  dfbuf_02.sputn("sonne's", 7);
+  VERIFY( !over_called );
+  over_expected = dfbuf_02.pub_epptr() == dfbuf_02.pub_pptr();
+  over_called = false;
+  dfbuf_02.sputn(" peak", 5);
+  VERIFY( (!over_expected && !over_called)
+         || (over_expected && over_called) );
+  dfbuf_02.close();
+}
+
+main() 
+{
+  test11();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/1.cc
new file mode 100644 (file)
index 0000000..92af728
--- /dev/null
@@ -0,0 +1,191 @@
+// 2001-05-21 Benjamin Kosnik  <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <fstream>
+#include <unistd.h>
+#include <signal.h>
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <locale>
+#include <testsuite_hooks.h>
+
+// @require@ %-*.tst %-*.txt
+// @diff@ %-*.tst %*.txt
+
+// NB: This test assumes that _M_buf_size == 40, and not the usual
+// buffer_size length of BUFSIZ (8192), so that overflow/underflow can be
+// simulated a bit more readily.
+// NRB (Nota Really Bene): setting it to 40 breaks the test, as intended.
+const int buffer_size = 8192;
+//const int buffer_size = 40;
+
+const char carray_01[] = "santa cruz or sandiego?";
+const char carray_02[] = "memphis, new orleans, and savanah";
+const char name_01[] = "filebuf_virtuals-1.txt"; // file with data in it
+const char name_02[] = "filebuf_virtuals-2.txt"; // empty file, need to create
+const char name_03[] = "filebuf_virtuals-3.txt"; // empty file, need to create
+const char name_04[] = "filebuf_virtuals-4.txt"; // empty file, need to create
+const char name_05[] = "filebuf_virtuals-5.txt"; // empty file, need to create
+const char name_06[] = "filebuf_virtuals-6.txt"; // empty file, need to create
+const char name_07[] = "filebuf_virtuals-7.txt"; // empty file, need to create
+const char name_08[] = "filebuf_virtuals-8.txt"; // empty file, need to create
+
+class derived_filebuf: public std::filebuf
+{
+ public:
+  void
+  set_size(int_type __size) { _M_buf_size_opt = __size; }
+};
+
+derived_filebuf fb_01; // in 
+derived_filebuf fb_02; // out
+derived_filebuf fb_03; // in | out
+
+// Initialize filebufs to be the same size regardless of platform.
+void test03()
+{
+  fb_01.set_size(buffer_size);
+  fb_02.set_size(buffer_size);
+  fb_03.set_size(buffer_size);
+}
+
+// Test overloaded virtual functions.
+void test05() 
+{
+  typedef std::filebuf::int_type       int_type;
+  typedef std::filebuf::traits_type    traits_type;
+  typedef std::filebuf::pos_type       pos_type;
+  typedef std::filebuf::off_type       off_type;
+  typedef size_t                       size_type;
+
+  bool                                         test = true;
+  std::filebuf                                 f_tmp;
+  std::streamsize                      strmsz_1, strmsz_2;
+  std::streamoff                       strmof_1, strmof_2;
+  int                                  i = 0, j = 0, k = 0;
+
+  fb_01.open(name_01, std::ios_base::in);
+  fb_02.open(name_02, std::ios_base::out | std::ios_base::trunc);
+  fb_03.open(name_03, std::ios_base::out | std::ios_base::in | std::ios_base::trunc);
+
+  int_type c1 = fb_01.sbumpc();
+  int_type c2 = fb_02.sbumpc();
+  int_type c3 = fb_01.sbumpc();
+  int_type c4 = fb_02.sbumpc();
+  int_type c5 = fb_03.sbumpc();
+  int_type c6 = fb_01.sgetc();
+  int_type c7 = fb_02.sgetc();
+  int_type c8 = fb_01.sgetc();
+  int_type c9 = fb_02.sgetc();
+
+  // PUT
+  strmsz_1 = fb_03.sputn("racadabras", 10);//"abracadabras or what?"
+  strmsz_2 = fb_03.sputn(", i wanna reach out and", 10);
+  strmsz_1 = fb_02.sputn("racadabras", 10);
+  strmsz_1 = fb_01.sputn("racadabra", 10);
+
+  // PUTBACK
+  // int_type pbfail(int_type c)
+  // called when gptr() null, gptr() == eback(), or traits::eq(*gptr, c) false
+  // "pending sequence" is:
+  //   1) everything as defined in underflow
+  //   2) + if (traits::eq_int_type(c, traits::eof()), then input
+  //   sequence is backed up one char before the pending sequence is
+  //   determined.
+  //   3) + if (not 2) then c is prepended. Left unspecified is
+  //   whether the input sequence is backedup or modified in any way
+  // returns traits::eof() for failure, unspecified other value for success
+
+  // int_type sputbackc(char_type c)
+  // if in_cur not avail || ! traits::eq(c, gptr() [-1]), return pbfail
+  // otherwise decrements in_cur and returns *gptr()
+  c1 = fb_03.sgetc(); // -1
+  c2 = fb_03.sputbackc('z');
+  strmsz_2 = fb_03.in_avail();
+  c3 = fb_03.sgetc();
+  //test for _in_cur == _in_beg
+  // fb_03._M_out_beg = "bd23456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZracada" etc
+  fb_03.pubseekoff(10, std::ios_base::beg, 
+                  std::ios_base::in | std::ios_base::out);
+  fb_03.sputc('m');
+  strmsz_1 = fb_03.in_avail(); 
+  c1 = fb_03.sgetc(); 
+  fb_03.snextc();
+  c2 = fb_03.sputbackc('z');  
+  strmsz_2 = fb_03.in_avail(); 
+  c3 = fb_03.sgetc();  
+  fb_03.snextc();
+  fb_03.sputc('u');
+  fb_03.sputc('v');
+  fb_03.sputc('a');
+  strmsz_1 = fb_03.in_avail();
+  c2 = fb_03.sputbackc('a');
+  strmsz_2 = fb_03.in_avail();
+  c3 = fb_03.sgetc();
+  //test for ios_base::out
+  c1 = fb_02.sgetc(); // undefined
+  c2 = fb_02.sputbackc('a');
+
+  // int_type sungetc()
+  // if in_cur not avail, return pbackfail(), else decrement and
+  // return to_int_type(*gptr())
+  // fb_03._M_out_beg = "uvaacadabras, i wannaZ[\\]^_`abcdefghijkl"
+  // fb_03._M_out_cur = "aacadabras, i wannaZ[\\]^_`abcdefghijkl"
+  strmsz_1 = fb_03.in_avail();
+  c2 = fb_03.sungetc(); // delete the 'a'
+  strmsz_2 = fb_03.in_avail();
+  VERIFY( c2 == 'v' ); //  VERIFY( c2 != traits_type::eof() );
+  VERIFY( strmsz_1 + 1 == strmsz_2 );
+  //test for _in_cur == _in_beg
+  for (int i = 50; i < 32 + 29; ++i)
+    fb_02.sputc(char(i));
+  fb_02.pubseekoff(0, std::ios_base::beg, std::ios_base::out);
+  c1 = fb_02.sgetc(); 
+  strmsz_1 = fb_02.in_avail();
+  c2 = fb_02.sungetc();
+  c3 = fb_02.sgetc();
+  strmsz_2 = fb_02.in_avail();
+  VERIFY( c1 == c2 );
+  VERIFY( c2 == c3 );
+  VERIFY( c1 == traits_type::eof() );
+  VERIFY( strmsz_1 == strmsz_2 );
+  //test for _in_cur == _in_end
+  fb_03.pubseekoff(0, std::ios_base::end);
+  strmsz_1 = fb_03.in_avail(); // -1 cuz at the end
+  c1 = fb_03.sgetc(); 
+  c2 = fb_03.sungetc();
+  strmsz_2 = fb_03.in_avail(); // 1
+  c3 = fb_03.sgetc();
+  VERIFY( c1 != c2 );
+  // VERIFY( c2 == c3 || c2 == traits_type::not_eof(int(c3)) );
+  VERIFY( strmsz_2 != strmsz_1 );
+  VERIFY( strmsz_2 == 1 );
+  //test for ios_base::out
+}
+
+main() 
+{
+  test03();
+  test05();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sync/char/1057.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sync/char/1057.cc
new file mode 100644 (file)
index 0000000..02feef5
--- /dev/null
@@ -0,0 +1,112 @@
+// 1999-10-11 bkoz
+
+// Copyright (C) 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.5.2 template class basic_streambuf
+
+#include <fstream>
+#include <testsuite_hooks.h>
+
+class setpbuf : public std::filebuf
+{
+  char                 buffer[4];
+  std::string  result;
+
+public:
+
+  std::string&
+  get_result()
+  { return result; }
+
+  setpbuf()
+  {
+    this->open("tmp_1057", std::ios_base::out | std::ios_base::trunc);
+    char foo [32];
+    setp(foo, foo + 32);
+    setp(buffer, buffer + 4);
+  }
+
+  ~setpbuf()
+  { 
+    sync(); 
+    close();
+  }
+
+  virtual int_type 
+  overflow(int_type n)
+  {
+    if (sync() != 0)
+      return traits_type::eof();
+    
+    result += traits_type::to_char_type(n);
+    
+    return n;
+  }
+  
+  virtual int 
+  sync()
+  {
+    result.append(pbase(), pptr());
+    setp(buffer, buffer + 4);
+    return 0;
+  }
+};
+
+// libstdc++/1057
+void test04()
+{
+  bool test = true;
+  std::string text = "abcdefghijklmn";
+  
+  // 01
+  setpbuf sp1;
+  // Here xsputn writes over sp1.result
+  sp1.sputn(text.c_str(), text.length());
+
+  // This crashes when result is accessed
+  sp1.pubsync();
+  VERIFY( sp1.get_result() == text );
+  
+  // 02
+  setpbuf sp2;
+  for (std::string::size_type i = 0; i < text.length(); ++i)
+    {
+      // sputc also writes over result
+      sp2.sputc(text[i]);
+    }
+  
+  // Crash here
+  sp2.pubsync();
+  VERIFY( sp2.get_result() == text );
+}
+
+int main() 
+{
+  test04();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sync/char/9182-1.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sync/char/9182-1.cc
new file mode 100644 (file)
index 0000000..a0411e2
--- /dev/null
@@ -0,0 +1,72 @@
+// 2001-05-21 Benjamin Kosnik  <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <fstream>
+#include <locale>
+#include <testsuite_hooks.h>
+
+const char name_07[] = "filebuf_virtuals-7.txt"; // empty file, need to create
+
+class errorcvt : public std::codecvt<char, char, mbstate_t>
+{
+protected:
+  std::codecvt_base::result
+  do_out(mbstate_t&, const char* from, const char*,
+        const char*& from_next, char* to, char*,
+        char*& to_next) const
+  {
+    from_next = from;
+    to_next = to;
+    return std::codecvt<char, char, mbstate_t>::error;
+  }
+  
+  virtual bool do_always_noconv() const throw()
+  {
+    return false;
+  }
+};
+
+// libstdc++/9182
+// basic_filebuf<>::sync and overflow do not write out any characters
+// if codecvt<>::out returns error
+void test13()
+{
+  using namespace std;
+  bool test = true;
+
+  locale loc =  locale::classic();
+  loc = locale(loc, new errorcvt);
+  
+  filebuf fbuf1;
+  fbuf1.pubimbue(loc);
+  fbuf1.open(name_07, ios_base::out | ios_base::trunc);
+  fbuf1.sputn("ison", 4); 
+  int r = fbuf1.pubsync();
+  VERIFY( r == -1 );
+  fbuf1.close();
+}
+
+main() 
+{
+  test13();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/char/10097.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/char/10097.cc
new file mode 100644 (file)
index 0000000..1b900f9
--- /dev/null
@@ -0,0 +1,101 @@
+// 2001-05-21 Benjamin Kosnik  <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <fstream>
+#include <unistd.h>
+#include <signal.h>
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <testsuite_hooks.h>
+
+class UnderBuf : public std::filebuf
+{
+public:
+  int_type
+  pub_underflow()
+  { return underflow(); }
+
+  std::streamsize
+  pub_showmanyc()
+  { return showmanyc(); }
+};
+
+// libstdc++/10097
+// filebuf::underflow drops characters.
+void test16()
+{
+  using namespace std;
+  bool test = true;
+
+  const char* name = "tmp_fifo1";
+  
+  signal(SIGPIPE, SIG_IGN);
+  unlink(name);
+  
+  if (0 != mkfifo(name, S_IRWXU))
+    {
+      VERIFY( false );
+    }
+  
+  int fval = fork();
+  if (fval == -1)
+    {
+      unlink(name);
+      VERIFY( false );
+    }
+  else if (fval == 0)
+    {
+      filebuf fbout;
+      fbout.open(name, ios_base::out);
+      fbout.sputn("0123456789", 10);
+      fbout.pubsync();
+      sleep(2);
+      fbout.close();
+      exit(0);
+    }
+
+  UnderBuf fb;
+  fb.open(name, ios_base::in);
+  sleep(1);
+  
+  fb.sgetc();
+  streamsize n = fb.pub_showmanyc();
+
+  while (n > 0)
+    {
+      --n;
+      
+      UnderBuf::int_type c = fb.pub_underflow();
+      VERIFY( c != UnderBuf::traits_type::eof() );
+      
+      fb.sbumpc();
+    }
+
+  fb.close();
+}
+
+main() 
+{
+  test16();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_fstream/1.cc b/libstdc++-v3/testsuite/27_io/basic_fstream/1.cc
new file mode 100644 (file)
index 0000000..28713fb
--- /dev/null
@@ -0,0 +1,48 @@
+// 2002-07-25 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.8.1.11 - Template class basic_fstream
+// NB: This file is for testing basic_fstream with NO OTHER INCLUDES.
+
+#include <fstream>
+#include <testsuite_hooks.h>
+
+// { dg-do compile }
+
+// libstdc++/7216
+void test01()
+{
+  // Check for required typedefs
+  typedef std::fstream test_type;
+  typedef test_type::char_type char_type;
+  typedef test_type::traits_type traits_type;
+  typedef test_type::int_type int_type;
+  typedef test_type::pos_type pos_type;
+  typedef test_type::off_type off_type;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_fstream/2.cc b/libstdc++-v3/testsuite/27_io/basic_fstream/2.cc
new file mode 100644 (file)
index 0000000..3faf03f
--- /dev/null
@@ -0,0 +1,46 @@
+// 2002-07-25 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.8.1.11 - Template class basic_fstream
+// NB: This file is for testing basic_fstream with NO OTHER INCLUDES.
+
+#include <fstream>
+#include <testsuite_hooks.h>
+
+// { dg-do compile }
+
+namespace test 
+{
+  using namespace std;
+  using __gnu_cxx_test::pod_char;
+  typedef short type_t;
+  template class basic_fstream<type_t, char_traits<type_t> >;
+  template class basic_fstream<pod_char, char_traits<pod_char> >;
+} // test
+
diff --git a/libstdc++-v3/testsuite/27_io/basic_fstream/3.cc b/libstdc++-v3/testsuite/27_io/basic_fstream/3.cc
new file mode 100644 (file)
index 0000000..a9eb113
--- /dev/null
@@ -0,0 +1,149 @@
+// 1999-01-17 bkoz test functionality of basic_filebuf for char_type == char
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.1 - Template class basic_filebuf 
+// NB: This file is for testing basic_filebuf with NO OTHER INCLUDES.
+
+#include <fstream>
+#include <testsuite_hooks.h>
+
+// { dg-do compile }
+
+// libstdc++/2020
+// should be able to use custom char_type, custom traits type
+class gnu_char_type
+{
+  unsigned long character;
+public:
+  // operator ==
+  bool
+  operator==(const gnu_char_type& __lhs) 
+  { return character == __lhs.character; }
+
+  // operator <
+  bool
+  operator<(const gnu_char_type& __lhs) 
+  { return character < __lhs.character; }
+
+  // default ctor
+  gnu_char_type() { }
+
+  // to_char_type
+  gnu_char_type(const unsigned long& __l) : character(__l) { } 
+
+  // to_int_type
+  operator unsigned long() const { return character; }
+};
+
+// char_traits specialization
+struct gnu_char_traits
+{
+  typedef gnu_char_type        char_type;
+  typedef long                 int_type;
+  typedef long                 pos_type;
+  typedef unsigned long        off_type;
+  typedef long                 state_type;
+  
+  static void 
+  assign(char_type& __c1, const char_type& __c2) { }
+  
+  static bool 
+  eq(const char_type& __c1, const char_type& __c2) { return true; }
+  
+  static bool 
+  lt(const char_type& __c1, const char_type& __c2) { return true; }
+  
+  static int 
+  compare(const char_type* __s1, const char_type* __s2, size_t __n)
+  { return 0; }
+  
+  static size_t
+  length(const char_type* __s) { return 0; }
+  
+  static const char_type* 
+  find(const char_type* __s, size_t __n, const char_type& __a)
+  { return __s; }
+  
+  static char_type* 
+  move(char_type* __s1, const char_type* __s2, size_t __n)
+  { return __s1; }
+  
+  static char_type* 
+  copy(char_type* __s1, const char_type* __s2, size_t __n)
+  { return __s1; }
+  
+  static char_type* 
+  assign(char_type* __s, size_t __n, char_type __a)
+  { return __s; }
+  
+  static char_type 
+  to_char_type(const int_type& __c)
+  { return char_type(); }
+  
+  static int_type 
+  to_int_type(const char_type& __c)
+  { return int_type(); }
+  
+  static bool 
+  eq_int_type(const int_type& __c1, const int_type& __c2)
+  { return true; }
+  
+  static int_type 
+  eof()
+  { return int_type(); }
+  
+  static int_type 
+  not_eof(const int_type& __c)
+  { return int_type(); }
+};
+
+void test07()
+{
+  bool test = true;
+  typedef std::basic_fstream<gnu_char_type, gnu_char_traits> gnu_fstr;
+
+  try
+    { 
+      gnu_fstr obj;
+    }
+  catch(std::exception& obj)
+    { 
+      test = false; 
+      VERIFY( test );
+    }
+}
+
+#if !__GXX_WEAK__
+// Explicitly instantiate for systems with no COMDAT or weak support.
+template 
+  std::basic_streambuf<gnu_char_type>::int_type
+  std::basic_streambuf<gnu_char_type>::_S_pback_size;
+#endif
+
+int main() 
+{
+  test07();
+  return 0;
+}
+
+
+
+// more surf!!!
diff --git a/libstdc++-v3/testsuite/27_io/basic_fstream/4.cc b/libstdc++-v3/testsuite/27_io/basic_fstream/4.cc
new file mode 100644 (file)
index 0000000..a7f46d6
--- /dev/null
@@ -0,0 +1,50 @@
+// 2003-03-26 B enjamin Kosnik  <bkoz@redhat.com>
+
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.1 - Template class basic_filebuf 
+
+#include <iostream>
+#include <fstream>
+
+void test01()
+{
+  // Check for required base class.
+  typedef std::fstream test_type;
+  typedef std::iostream base_type;
+  const test_type& obj = test_type();
+  const base_type* base = &obj;
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
+
+// more surf!!!
+
+
+
+
+
+
+
+
+
diff --git a/libstdc++-v3/testsuite/27_io/basic_fstream/rdbuf/char/2832.cc b/libstdc++-v3/testsuite/27_io/basic_fstream/rdbuf/char/2832.cc
new file mode 100644 (file)
index 0000000..136252b
--- /dev/null
@@ -0,0 +1,70 @@
+// 2001-05-24 Benjamin Kosnik  <bkoz@redhat.com>
+
+// Copyright (C) 2001 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.13 member functions (fstream_members)
+
+#include <fstream>
+#include <testsuite_hooks.h>
+
+void 
+redirect_buffer(std::ios& stream, std::streambuf* new_buf) 
+{ stream.rdbuf(new_buf); }
+
+std::streambuf*
+active_buffer(std::ios& stream)
+{ return stream.rdbuf(); }
+
+// libstdc++/2832
+void test02()
+{
+  bool test = true;
+  const char* strlit01 = "fuck war";
+  const char* strlit02 = "two less cars abstract riot crew, critical mass/SF";
+  const std::string str00;
+  const std::string str01(strlit01);
+  std::string str02;
+  std::filebuf fbuf;
+  std::streambuf* pbasebuf0 = &fbuf;
+
+  std::fstream sstrm1;
+  // derived rdbuf() always returns original streambuf, even though
+  // it's no longer associated with the stream.
+  std::filebuf* const buf1 = sstrm1.rdbuf();
+  // base rdbuf() returns the currently associated streambuf
+  std::streambuf* pbasebuf1 = active_buffer(sstrm1);
+  redirect_buffer(sstrm1, &fbuf);
+  std::filebuf* const buf2 = sstrm1.rdbuf();
+  std::streambuf* pbasebuf2 = active_buffer(sstrm1);
+  VERIFY( buf1 == buf2 ); 
+  VERIFY( pbasebuf1 != pbasebuf2 );
+  VERIFY( pbasebuf2 == pbasebuf0 );
+
+  // How confusing and non-intuitive is this?
+  // These semantics are a joke, a serious defect, and incredibly lame.
+}
+
+int main()
+{
+  test02();
+  return 0;
+}
+
+
+
diff --git a/libstdc++-v3/testsuite/27_io/basic_ifstream/1.cc b/libstdc++-v3/testsuite/27_io/basic_ifstream/1.cc
new file mode 100644 (file)
index 0000000..176333c
--- /dev/null
@@ -0,0 +1,47 @@
+// 2002-07-25 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2002 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.8.1.5 - Template class basic_ifstream
+// NB: This file is for testing basic_ifstream with NO OTHER INCLUDES.
+
+#include <fstream>
+
+// { dg-do compile }
+
+// libstdc++/7216
+void test01()
+{
+  // Check for required typedefs
+  typedef std::ifstream test_type;
+  typedef test_type::char_type char_type;
+  typedef test_type::traits_type traits_type;
+  typedef test_type::int_type int_type;
+  typedef test_type::pos_type pos_type;
+  typedef test_type::off_type off_type;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ifstream/2.cc b/libstdc++-v3/testsuite/27_io/basic_ifstream/2.cc
new file mode 100644 (file)
index 0000000..6fb71a5
--- /dev/null
@@ -0,0 +1,42 @@
+// 2002-07-25 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2002 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.8.1.5 - Template class basic_ifstream
+// NB: This file is for testing basic_ifstream with NO OTHER INCLUDES.
+
+#include <fstream>
+
+// { dg-do compile }
+
+namespace test 
+{
+  using namespace std;
+  typedef short type_t;
+  template class basic_ifstream<type_t, char_traits<type_t> >;
+} // test
diff --git a/libstdc++-v3/testsuite/27_io/basic_ifstream/3.cc b/libstdc++-v3/testsuite/27_io/basic_ifstream/3.cc
new file mode 100644 (file)
index 0000000..c1d2544
--- /dev/null
@@ -0,0 +1,149 @@
+// 1999-01-17 bkoz test functionality of basic_filebuf for char_type == char
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.1 - Template class basic_filebuf 
+// NB: This file is for testing basic_filebuf with NO OTHER INCLUDES.
+
+#include <fstream>
+#include <testsuite_hooks.h>
+
+// { dg-do compile }
+
+// libstdc++/2020
+// should be able to use custom char_type, custom traits type
+class gnu_char_type
+{
+  unsigned long character;
+public:
+  // operator ==
+  bool
+  operator==(const gnu_char_type& __lhs) 
+  { return character == __lhs.character; }
+
+  // operator <
+  bool
+  operator<(const gnu_char_type& __lhs) 
+  { return character < __lhs.character; }
+
+  // default ctor
+  gnu_char_type() { }
+
+  // to_char_type
+  gnu_char_type(const unsigned long& __l) : character(__l) { } 
+
+  // to_int_type
+  operator unsigned long() const { return character; }
+};
+
+// char_traits specialization
+struct gnu_char_traits
+{
+  typedef gnu_char_type        char_type;
+  typedef long                 int_type;
+  typedef long                 pos_type;
+  typedef unsigned long        off_type;
+  typedef long                 state_type;
+  
+  static void 
+  assign(char_type& __c1, const char_type& __c2) { }
+  
+  static bool 
+  eq(const char_type& __c1, const char_type& __c2) { return true; }
+  
+  static bool 
+  lt(const char_type& __c1, const char_type& __c2) { return true; }
+  
+  static int 
+  compare(const char_type* __s1, const char_type* __s2, size_t __n)
+  { return 0; }
+  
+  static size_t
+  length(const char_type* __s) { return 0; }
+  
+  static const char_type* 
+  find(const char_type* __s, size_t __n, const char_type& __a)
+  { return __s; }
+  
+  static char_type* 
+  move(char_type* __s1, const char_type* __s2, size_t __n)
+  { return __s1; }
+  
+  static char_type* 
+  copy(char_type* __s1, const char_type* __s2, size_t __n)
+  { return __s1; }
+  
+  static char_type* 
+  assign(char_type* __s, size_t __n, char_type __a)
+  { return __s; }
+  
+  static char_type 
+  to_char_type(const int_type& __c)
+  { return char_type(); }
+  
+  static int_type 
+  to_int_type(const char_type& __c)
+  { return int_type(); }
+  
+  static bool 
+  eq_int_type(const int_type& __c1, const int_type& __c2)
+  { return true; }
+  
+  static int_type 
+  eof()
+  { return int_type(); }
+  
+  static int_type 
+  not_eof(const int_type& __c)
+  { return int_type(); }
+};
+
+void test07()
+{
+  bool test = true;
+  typedef std::basic_ifstream<gnu_char_type, gnu_char_traits> gnu_ifstr;
+
+  try
+    { 
+      gnu_ifstr obj;
+    }
+  catch(std::exception& obj)
+    { 
+      test = false; 
+      VERIFY( test );
+    }
+}
+
+#if !__GXX_WEAK__
+// Explicitly instantiate for systems with no COMDAT or weak support.
+template 
+  std::basic_streambuf<gnu_char_type>::int_type
+  std::basic_streambuf<gnu_char_type>::_S_pback_size;
+#endif
+
+int main() 
+{
+  test07();
+  return 0;
+}
+
+
+
+// more surf!!!
diff --git a/libstdc++-v3/testsuite/27_io/basic_ifstream/4.cc b/libstdc++-v3/testsuite/27_io/basic_ifstream/4.cc
new file mode 100644 (file)
index 0000000..08827c3
--- /dev/null
@@ -0,0 +1,50 @@
+// 2003-03-26 B enjamin Kosnik  <bkoz@redhat.com>
+
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.1 - Template class basic_filebuf 
+
+#include <istream>
+#include <fstream>
+
+void test01()
+{
+  // Check for required base class.
+  typedef std::ifstream test_type;
+  typedef std::istream base_type;
+  const test_type& obj = test_type();
+  const base_type* base = &obj;
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
+
+// more surf!!!
+
+
+
+
+
+
+
+
+
diff --git a/libstdc++-v3/testsuite/27_io/basic_ifstream/cons/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_ifstream/cons/char/1.cc
new file mode 100644 (file)
index 0000000..e211d0c
--- /dev/null
@@ -0,0 +1,49 @@
+// Copyright (C) 2000, 2001, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.7 ifstream member functions
+// @require@ %-*.tst %-*.txt
+// @diff@ %-*.tst %-*.txt
+
+#include <istream>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+const char name_01[] = "ifstream_members-1.tst";
+
+// http://gcc.gnu.org/ml/libstdc++/2000-07/msg00004.html
+void test02()
+{
+  bool test = true;
+  const int more_than_max_open_files = 8200;
+  
+  for (int i = 0; ++i < more_than_max_open_files;)
+    {
+      std::ifstream ifs(name_01);
+      VERIFY( static_cast<bool>(ifs) );
+    }
+}
+
+int main()
+{
+  test02();
+  return 0;
+}
+
+
+
diff --git a/libstdc++-v3/testsuite/27_io/basic_ifstream/open/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_ifstream/open/char/1.cc
new file mode 100644 (file)
index 0000000..5a8b6f8
--- /dev/null
@@ -0,0 +1,57 @@
+// Copyright (C) 2000, 2001, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.7 ifstream member functions
+// @require@ %-*.tst %-*.txt
+// @diff@ %-*.tst %-*.txt
+
+#include <istream>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+const char name_01[] = "ifstream_members-1.tst";
+
+// http://gcc.gnu.org/ml/libstdc++/2000-06/msg00136.html
+void test01()
+{
+  bool test = true;
+  std::ifstream ifs1;
+  ifs1.close();
+  
+  // false as expected:
+  VERIFY( !ifs1.is_open() );
+   // this is now true:
+  VERIFY( !(ifs1) );
+  
+  ifs1.open(name_01);
+  VERIFY( ifs1.is_open() );
+  // fail bit still true
+  VERIFY( !(ifs1) );
+  VERIFY( ifs1.rdstate() == std::ios_base::failbit );
+
+  ifs1.close();
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
+
+
+
diff --git a/libstdc++-v3/testsuite/27_io/basic_ifstream/rdbuf/char/2832.cc b/libstdc++-v3/testsuite/27_io/basic_ifstream/rdbuf/char/2832.cc
new file mode 100644 (file)
index 0000000..947a77d
--- /dev/null
@@ -0,0 +1,74 @@
+// Copyright (C) 2000, 2001, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.7 ifstream member functions
+// @require@ %-*.tst %-*.txt
+// @diff@ %-*.tst %-*.txt
+
+#include <istream>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+const char name_01[] = "ifstream_members-1.tst";
+const char name_02[] = "ifstream_members-1.txt";
+
+void 
+redirect_buffer(std::ios& stream, std::streambuf* new_buf) 
+{ stream.rdbuf(new_buf); }
+
+std::streambuf*
+active_buffer(std::ios& stream)
+{ return stream.rdbuf(); }
+
+// libstdc++/2832
+void test03()
+{
+  bool test = true;
+  const char* strlit01 = "fuck war";
+  const char* strlit02 = "two less cars abstract riot crew, critical mass/SF";
+  const std::string str00;
+  const std::string str01(strlit01);
+  std::string str02;
+  std::filebuf fbuf;
+  std::streambuf* pbasebuf0 = &fbuf;
+
+  std::ifstream sstrm1;
+  // derived rdbuf() always returns original streambuf, even though
+  // it's no longer associated with the stream.
+  std::filebuf* const buf1 = sstrm1.rdbuf();
+  // base rdbuf() returns the currently associated streambuf
+  std::streambuf* pbasebuf1 = active_buffer(sstrm1);
+  redirect_buffer(sstrm1, &fbuf);
+  std::filebuf* const buf2 = sstrm1.rdbuf();
+  std::streambuf* pbasebuf2 = active_buffer(sstrm1);
+  VERIFY( buf1 == buf2 ); 
+  VERIFY( pbasebuf1 != pbasebuf2 );
+  VERIFY( pbasebuf2 == pbasebuf0 );
+
+  // How confusing and non-intuitive is this?
+  // These semantics are a joke, a serious defect, and incredibly lame.
+}
+
+int main()
+{
+  test03();
+  return 0;
+}
+
+
+
diff --git a/libstdc++-v3/testsuite/27_io/basic_ios/1.cc b/libstdc++-v3/testsuite/27_io/basic_ios/1.cc
new file mode 100644 (file)
index 0000000..1b8de87
--- /dev/null
@@ -0,0 +1,47 @@
+// 2002-07-25 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2002 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.4.4 - Template class basic_ios
+// NB: This file is for testing basic_ios with NO OTHER INCLUDES.
+
+#include <ios>
+
+// { dg-do compile }
+
+// libstdc++/7216
+void test01()
+{
+  // Check for required typedefs
+  typedef std::ios test_type;
+  typedef test_type::char_type char_type;
+  typedef test_type::traits_type traits_type;
+  typedef test_type::int_type int_type;
+  typedef test_type::pos_type pos_type;
+  typedef test_type::off_type off_type;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ios/2.cc b/libstdc++-v3/testsuite/27_io/basic_ios/2.cc
new file mode 100644 (file)
index 0000000..56e2bd8
--- /dev/null
@@ -0,0 +1,42 @@
+// 2002-07-25 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2002 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.4.4 - Template class basic_ios
+// NB: This file is for testing basic_ios with NO OTHER INCLUDES.
+
+#include <ios>
+
+// { dg-do compile }
+
+namespace test 
+{
+  using namespace std;
+  typedef short type_t;
+  template class basic_ios<type_t, char_traits<type_t> >;
+} // test
diff --git a/libstdc++-v3/testsuite/27_io/basic_ios/3.cc b/libstdc++-v3/testsuite/27_io/basic_ios/3.cc
new file mode 100644 (file)
index 0000000..fa9e8b1
--- /dev/null
@@ -0,0 +1,147 @@
+// 1999-01-17 bkoz test functionality of basic_filebuf for char_type == char
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.1 - Template class basic_filebuf 
+// NB: This file is for testing basic_filebuf with NO OTHER INCLUDES.
+
+#include <ios>
+#include <testsuite_hooks.h>
+
+// libstdc++/2020
+// should be able to use custom char_type, custom traits type
+class gnu_char_type
+{
+  unsigned long character;
+public:
+  // operator ==
+  bool
+  operator==(const gnu_char_type& __lhs) 
+  { return character == __lhs.character; }
+
+  // operator <
+  bool
+  operator<(const gnu_char_type& __lhs) 
+  { return character < __lhs.character; }
+
+  // default ctor
+  gnu_char_type() { }
+
+  // to_char_type
+  gnu_char_type(const unsigned long& __l) : character(__l) { } 
+
+  // to_int_type
+  operator unsigned long() const { return character; }
+};
+
+// char_traits specialization
+struct gnu_char_traits
+{
+  typedef gnu_char_type        char_type;
+  typedef long                 int_type;
+  typedef long                 pos_type;
+  typedef unsigned long        off_type;
+  typedef long                 state_type;
+  
+  static void 
+  assign(char_type& __c1, const char_type& __c2) { }
+  
+  static bool 
+  eq(const char_type& __c1, const char_type& __c2) { return true; }
+  
+  static bool 
+  lt(const char_type& __c1, const char_type& __c2) { return true; }
+  
+  static int 
+  compare(const char_type* __s1, const char_type* __s2, size_t __n)
+  { return 0; }
+  
+  static size_t
+  length(const char_type* __s) { return 0; }
+  
+  static const char_type* 
+  find(const char_type* __s, size_t __n, const char_type& __a)
+  { return __s; }
+  
+  static char_type* 
+  move(char_type* __s1, const char_type* __s2, size_t __n)
+  { return __s1; }
+  
+  static char_type* 
+  copy(char_type* __s1, const char_type* __s2, size_t __n)
+  { return __s1; }
+  
+  static char_type* 
+  assign(char_type* __s, size_t __n, char_type __a)
+  { return __s; }
+  
+  static char_type 
+  to_char_type(const int_type& __c)
+  { return char_type(); }
+  
+  static int_type 
+  to_int_type(const char_type& __c)
+  { return int_type(); }
+  
+  static bool 
+  eq_int_type(const int_type& __c1, const int_type& __c2)
+  { return true; }
+  
+  static int_type 
+  eof()
+  { return int_type(); }
+  
+  static int_type 
+  not_eof(const int_type& __c)
+  { return int_type(); }
+};
+
+class gnu_ios: public std::basic_ios<gnu_char_type, gnu_char_traits>
+{ };
+
+void test07()
+{
+  bool test = true;
+  
+  try
+    { gnu_ios obj; }
+  catch(std::exception& obj)
+    { 
+      test = false; 
+      VERIFY( test );
+    }
+}
+
+#if !__GXX_WEAK__
+// Explicitly instantiate for systems with no COMDAT or weak support.
+template 
+  std::basic_streambuf<gnu_char_type>::int_type
+  std::basic_streambuf<gnu_char_type>::_S_pback_size;
+#endif
+
+int main() 
+{
+  test07();
+  return 0;
+}
+
+
+
+// more surf!!!
diff --git a/libstdc++-v3/testsuite/27_io/basic_ios/4.cc b/libstdc++-v3/testsuite/27_io/basic_ios/4.cc
new file mode 100644 (file)
index 0000000..b527499
--- /dev/null
@@ -0,0 +1,52 @@
+// 2003-03-26 B enjamin Kosnik  <bkoz@redhat.com>
+
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.1 - Template class basic_filebuf 
+
+#include <ios>
+#include <sstream>
+
+void test01()
+{
+  // Check for required base class.
+  typedef std::ios test_type;
+  typedef std::ios_base base_type;
+  
+  std::stringbuf buf;
+  const test_type& obj = test_type(&buf);
+  const base_type* base = &obj;
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
+
+// more surf!!!
+
+
+
+
+
+
+
+
+
diff --git a/libstdc++-v3/testsuite/27_io/basic_ios/clear/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_ios/clear/char/1.cc
new file mode 100644 (file)
index 0000000..6629371
--- /dev/null
@@ -0,0 +1,81 @@
+// 1999-09-20 bkoz
+
+// Copyright (C) 1999, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.4.4.2 basic_ios member functions
+
+// NB: Don't include any other headers in this file.
+#include <ios>
+#include <testsuite_hooks.h>
+
+// 27.4.4.3 basic_ios iostate flags function
+void test01()
+{
+  bool test = true;
+
+  typedef std::ios_base::fmtflags fmtflags;
+  typedef std::ios_base::iostate iostate;
+  using std::ios_base;
+
+  iostate iostate02, iostate03;
+  const iostate iostate01 = std::ios_base::badbit | std::ios_base::eofbit;
+  const iostate iostate04 = std::ios_base::badbit;
+
+  std::ios ios_01(NULL);
+  std::ios::char_type ct01;
+  std::ios::char_type ct02('x');;
+
+  // bool fail() const
+  VERIFY( ios_01.fail() );
+
+  // bool operator!() const
+  VERIFY( !ios_01 );
+  
+  // iostate rdstate() const
+  iostate03 = ios_01.rdstate();
+  VERIFY( static_cast<bool>(iostate03 & std::ios_base::badbit) );
+
+  // void clear(iostate state = goodbit)
+  try {
+    ios_01.clear(std::ios_base::eofbit);
+    iostate02 = ios_01.rdstate();
+    VERIFY( static_cast<bool>(iostate02 & iostate01) );
+  }             
+  catch(std::ios_base::failure& fail) {
+    VERIFY( false );
+  }
+  catch(...) {
+    VERIFY( false );
+  }
+}
+
+int main() 
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ios/cons/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_ios/cons/char/1.cc
new file mode 100644 (file)
index 0000000..2c8993a
--- /dev/null
@@ -0,0 +1,88 @@
+// 1999-07-23 bkoz
+
+// Copyright (C) 1999, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.4.4.1 basic_ios constructors
+
+#include <ios>
+#include <sstream>
+#include <testsuite_hooks.h>
+
+void test01()
+{
+  bool test = true;
+  std::string str_01("jade cove, big sur");
+  std::string str_05;
+  std::stringbuf strb_01;
+  std::stringbuf strb_02(str_01, std::ios_base::in);
+  std::stringbuf strb_03(str_01, std::ios_base::out);
+  const std::ios_base::fmtflags flag01 = std::ios_base::skipws | 
+                                        std::ios_base::dec;
+  std::ios_base::fmtflags flag02, flag03;
+  const std::locale glocale = std::locale();
+
+  // explicit basic_ios(streambuf* sb)
+  std::ios ios_00(0);
+  std::ios ios_01(&strb_01);
+  std::ios ios_02(&strb_02);
+  std::ios ios_03(&strb_03);
+
+  // basic_ios()
+  // NB: This is protected so need to go through fstream 
+
+  // void init(sreambuf* sb)
+  // NB: This is protected so need to go through fstream/stringstream
+  // Can double-check the accuracy of the above initializations though.
+  VERIFY( ios_00.rdbuf() == 0 );
+  VERIFY( ios_00.tie() == 0 );
+  VERIFY( ios_00.rdstate() == std::ios_base::badbit );
+  VERIFY( ios_00.exceptions() == std::ios_base::goodbit );
+  flag02 = ios_00.flags();
+  VERIFY( flag02 == flag01 );
+  VERIFY( ios_00.width() == 0 );  
+  VERIFY( ios_00.precision() == 6 );  
+  VERIFY( ios_00.fill() == ios_00.widen(' ') );
+  VERIFY( ios_00.getloc() == glocale );    
+
+  VERIFY( ios_01.rdbuf() == &strb_01 );
+  VERIFY( ios_01.tie() == 0 );
+  VERIFY( ios_01.rdstate() == std::ios_base::goodbit );
+  VERIFY( ios_01.exceptions() == std::ios_base::goodbit );
+  flag02 = ios_01.flags();
+  VERIFY( flag02 == flag01 );
+  VERIFY( ios_01.width() == 0 );  
+  VERIFY( ios_01.precision() == 6 );  
+  VERIFY( ios_01.fill() == ios_01.widen(' ') );
+  VERIFY( ios_01.getloc() == glocale );    
+}
+
+int main() 
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ios/cons/char/2.cc b/libstdc++-v3/testsuite/27_io/basic_ios/cons/char/2.cc
new file mode 100644 (file)
index 0000000..84808f8
--- /dev/null
@@ -0,0 +1,61 @@
+// 2001-06-05 Benjamin Kosnik  <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.4.2.1.6 class ios_base::init
+
+#include <ios>
+#include <testsuite_hooks.h>
+
+// Non-required instantiations don't have the required facets inbued,
+// by default, into the locale object.
+// See 27.4.4.1
+class gnu_ios: public std::basic_ios<char> { };
+
+void test01() 
+{
+  bool test = true;
+
+  // 01: Doesn't call basic_ios::init, which uses ctype<char_type>..
+  // This should be unambiguously correct.
+  try
+    {
+      gnu_ios gios;
+    }
+  catch(...)
+    { 
+      test = false; 
+    }
+  VERIFY( test );
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ios/cons/char/3.cc b/libstdc++-v3/testsuite/27_io/basic_ios/cons/char/3.cc
new file mode 100644 (file)
index 0000000..a0f7afa
--- /dev/null
@@ -0,0 +1,175 @@
+// 2001-06-05 Benjamin Kosnik  <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.4.2.1.6 class ios_base::init
+
+#include <sstream>
+#include <testsuite_hooks.h>
+
+// char_traits specialization
+namespace std
+{
+  template<>
+    struct char_traits<unsigned short>
+    {
+      typedef unsigned short   char_type;
+      // Unsigned as wint_t in unsigned.
+      typedef unsigned long    int_type;
+      typedef streampos        pos_type;
+      typedef streamoff        off_type;
+      typedef mbstate_t        state_type;
+      
+      static void 
+      assign(char_type& __c1, const char_type& __c2)
+      { __c1 = __c2; }
+
+      static bool 
+      eq(const char_type& __c1, const char_type& __c2)
+      { return __c1 == __c2; }
+
+      static bool 
+      lt(const char_type& __c1, const char_type& __c2)
+      { return __c1 < __c2; }
+
+      static int 
+      compare(const char_type* __s1, const char_type* __s2, size_t __n)
+      { 
+       for (size_t __i = 0; __i < __n; ++__i)
+         if (!eq(__s1[__i], __s2[__i]))
+           return lt(__s1[__i], __s2[__i]) ? -1 : 1;
+       return 0; 
+      }
+
+      static size_t
+      length(const char_type* __s)
+      { 
+       const char_type* __p = __s; 
+       while (__p) 
+         ++__p; 
+       return (__p - __s); 
+      }
+
+      static const char_type* 
+      find(const char_type* __s, size_t __n, const char_type& __a)
+      { 
+       for (const char_type* __p = __s; size_t(__p - __s) < __n; ++__p)
+         if (*__p == __a) return __p;
+       return 0;
+      }
+
+      static char_type* 
+      move(char_type* __s1, const char_type* __s2, size_t __n)
+      { return (char_type*) memmove(__s1, __s2, __n * sizeof(char_type)); }
+
+      static char_type* 
+      copy(char_type* __s1, const char_type* __s2, size_t __n)
+      { return (char_type*) memcpy(__s1, __s2, __n * sizeof(char_type)); }
+
+      static char_type* 
+      assign(char_type* __s, size_t __n, char_type __a)
+      { 
+       for (char_type* __p = __s; __p < __s + __n; ++__p) 
+         assign(*__p, __a);
+        return __s; 
+      }
+
+      static char_type 
+      to_char_type(const int_type& __c)
+      { return char_type(); }
+
+      static int_type 
+      to_int_type(const char_type& __c) { return int_type(); }
+
+      static bool 
+      eq_int_type(const int_type& __c1, const int_type& __c2)
+      { return __c1 == __c2; }
+
+      static int_type 
+      eof() { return static_cast<int_type>(-1); }
+
+      static int_type 
+      not_eof(const int_type& __c)
+      { return eq_int_type(__c, eof()) ? int_type(0) : __c; }
+    };
+} // namespace std
+
+// Non-required instantiations don't have the required facets inbued,
+// by default, into the locale object.
+// See 27.4.4.1
+
+void test02() 
+{
+  bool test = true;
+
+  // 02: Calls basic_ios::init, which may call ctype<char_type>...
+  try
+    {
+      std::basic_string<unsigned short>                str;
+      std::basic_ostringstream<unsigned short>         oss(str);
+      
+      // Try each member functions for unformatted io.
+      // put
+      oss.put(324);
+
+      // write
+      const unsigned short us[4] = {1246, 433, 520, 0};
+      oss.write(us, 4);
+
+      // flush
+      oss.flush();
+    }
+  catch(const std::bad_cast& obj)
+    {
+      // Should be able to do the above without calling fill() and
+      // forcing a call to widen...
+      test = false;
+    }
+  catch(...)
+    {
+      test = false;
+    }
+  VERIFY( test );
+}
+
+#if !__GXX_WEAK__
+// Explicitly instantiate for systems with no COMDAT or weak support.
+template 
+  std::basic_string<unsigned short>::size_type 
+  std::basic_string<unsigned short>::_Rep::_S_max_size;
+
+template 
+  unsigned short
+  std::basic_string<unsigned short>::_Rep::_S_terminal;
+#endif
+
+int main()
+{
+  test02();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ios/copyfmt/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_ios/copyfmt/char/1.cc
new file mode 100644 (file)
index 0000000..191cbb6
--- /dev/null
@@ -0,0 +1,87 @@
+// 1999-09-20 bkoz
+
+// Copyright (C) 1999, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.4.4.2 basic_ios member functions
+
+// NB: Don't include any other headers in this file.
+#include <ios>
+#include <testsuite_hooks.h>
+
+// 27.4.4.3 basic_ios iostate flags function
+void test02()
+{
+  bool test = true;
+
+  typedef std::ios_base::fmtflags fmtflags;
+  typedef std::ios_base::iostate iostate;
+  using std::ios_base;
+
+  iostate iostate02, iostate03;
+  const iostate iostate01 = std::ios_base::badbit | std::ios_base::eofbit;
+  const iostate iostate04 = std::ios_base::badbit;
+
+  // basic_ios& copyfmt(const basic_ios& rhs)
+  {
+    std::ios ios_01(NULL);
+    std::ios ios_02(NULL);  
+    ios_01.exceptions(std::ios_base::eofbit);
+    ios_02.exceptions(std::ios_base::eofbit);
+    
+    try {
+    ios_01.copyfmt(ios_02);
+    }           
+    catch(...) {
+      VERIFY( false );
+    }
+  }
+
+  {
+    std::ios ios_01(NULL);
+    std::ios ios_02(NULL);  
+    ios_01.clear(std::ios_base::eofbit);
+    ios_02.exceptions(std::ios_base::eofbit);
+
+    try {
+      ios_01.copyfmt(ios_02);
+      VERIFY( false );
+    }           
+    catch(std::ios_base::failure& fail) {
+      VERIFY( true );
+    }
+    catch(...) {
+      VERIFY( false );
+    }
+  }
+}
+
+int main() 
+{
+  test02();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ios/copyfmt/char/2.cc b/libstdc++-v3/testsuite/27_io/basic_ios/copyfmt/char/2.cc
new file mode 100644 (file)
index 0000000..03d4515
--- /dev/null
@@ -0,0 +1,73 @@
+// 1999-09-20 bkoz
+
+// Copyright (C) 1999, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.4.4.2 basic_ios member functions
+
+// NB: Don't include any other headers in this file.
+#include <ios>
+#include <testsuite_hooks.h>
+
+// copyfmt and locales.
+void test03()
+{
+  bool test = true;
+
+  using namespace std;
+
+  typedef std::ios_base::fmtflags fmtflags;
+  typedef std::ios_base::iostate iostate;
+  locale loc_c = locale::classic();
+  locale loc_de("de_DE");
+  std::ios ios_01(NULL);
+  std::ios ios_02(NULL);
+  ios_01.imbue(loc_c);
+  ios_02.imbue(loc_de);
+  ios_02.setstate(ios_base::badbit);
+  VERIFY( loc_c == ios_01.getloc() );
+  VERIFY( loc_de == ios_02.getloc() );
+
+  iostate ios1 = ios_01.rdstate();
+  iostate ios2 = ios_02.rdstate();
+  streambuf* sb1 = ios_01.rdbuf();
+  streambuf* sb2 = ios_02.rdbuf();
+  ios_01.copyfmt(ios_02);
+
+  VERIFY( loc_de == ios_01.getloc() );
+  VERIFY( ios_01.getloc() == ios_02.getloc() );
+  VERIFY( ios1 == ios_01.rdstate() );
+  VERIFY( ios2 == ios_02.rdstate() );
+  VERIFY( sb1 == ios_01.rdbuf() );
+  VERIFY( sb2 == ios_02.rdbuf() );
+}
+
+int main() 
+{
+  __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test03);
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ios/exceptions/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_ios/exceptions/char/1.cc
new file mode 100644 (file)
index 0000000..f593b90
--- /dev/null
@@ -0,0 +1,88 @@
+// 1999-09-20 bkoz
+
+// Copyright (C) 1999, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.4.4.2 basic_ios member functions
+
+// NB: Don't include any other headers in this file.
+#include <ios>
+#include <testsuite_hooks.h>
+
+void test01()
+{
+  bool test = true;
+
+  typedef std::ios_base::fmtflags fmtflags;
+  typedef std::ios_base::iostate iostate;
+  using std::ios_base;
+
+  iostate iostate02, iostate03;
+  const iostate iostate01 = std::ios_base::badbit | std::ios_base::eofbit;
+  const iostate iostate04 = std::ios_base::badbit;
+
+  // iostate exceptions() const
+  {
+    std::ios ios_01(NULL);
+    VERIFY( ios_01.exceptions() == std::ios_base::goodbit );
+  }
+
+  // void exceptions(iostate except)
+  {
+    std::ios ios_01(NULL);
+    try {
+      ios_01.exceptions(std::ios_base::eofbit);
+    }           
+    catch(...) {
+      VERIFY( false );
+    }
+    iostate02 = ios_01.exceptions();
+    VERIFY( static_cast<bool>(iostate02 & std::ios_base::eofbit) );
+  }
+
+  {
+    std::ios ios_01(NULL);
+    ios_01.clear(std::ios_base::eofbit);
+    try {
+      ios_01.exceptions(std::ios_base::eofbit);
+      VERIFY( false );
+    }           
+    catch(std::ios_base::failure& fail) {
+      iostate02 = ios_01.exceptions();
+      VERIFY( static_cast<bool>(iostate02 & std::ios_base::eofbit) );
+    }
+    catch(...) {
+      VERIFY( false );
+    }
+  }
+}
+
+int main() 
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ios/locales/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_ios/locales/char/1.cc
new file mode 100644 (file)
index 0000000..a95bd99
--- /dev/null
@@ -0,0 +1,66 @@
+// 1999-09-20 bkoz
+
+// Copyright (C) 1999, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.4.4.2 basic_ios member functions
+
+// NB: Don't include any other headers in this file.
+#include <ios>
+#include <testsuite_hooks.h>
+
+void test01()
+{
+  bool test = true;
+
+  std::ios_base::fmtflags flag02, flag03;
+  const std::ios_base::fmtflags flag01 = std::ios_base::skipws 
+                                         | std::ios_base::dec;
+  const std::locale c_loc = std::locale::classic();
+
+  std::ios ios_01(NULL);
+  std::ios::char_type ct01;
+  std::ios::char_type ct02('x');;
+
+  // 27.4.2.3 locales
+  ios_01.imbue(c_loc);
+
+  // char narrow(char_type c, char dfault) const;
+  char c1 = ios_01.narrow(ct02, 0);
+  VERIFY( c1 == 'x' );
+
+  // char_type widen(char c) const;
+  ct01 = ios_01.widen('c');
+  VERIFY( ct01 == 'c' );
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_iostream/1.cc b/libstdc++-v3/testsuite/27_io/basic_iostream/1.cc
new file mode 100644 (file)
index 0000000..dfd9c05
--- /dev/null
@@ -0,0 +1,47 @@
+// 2002-01-08 bkoz
+
+// Copyright (C) 2002 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.6.1.5 - Template class basic_iostream
+// NB: This file is for testing iostream with NO OTHER INCLUDES.
+
+// { dg-do compile }
+
+#include <istream>
+
+// libstdc++/7216
+void test01()
+{
+  // Check for required typedefs
+  typedef std::iostream test_type;
+  typedef test_type::char_type char_type;
+  typedef test_type::traits_type traits_type;
+  typedef test_type::int_type int_type;
+  typedef test_type::pos_type pos_type;
+  typedef test_type::off_type off_type;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_iostream/2.cc b/libstdc++-v3/testsuite/27_io/basic_iostream/2.cc
new file mode 100644 (file)
index 0000000..b77ec4f
--- /dev/null
@@ -0,0 +1,42 @@
+// 2002-01-08 bkoz
+
+// Copyright (C) 2002 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.6.1.5 - Template class basic_iostream
+// NB: This file is for testing iostream with NO OTHER INCLUDES.
+
+// { dg-do compile }
+
+#include <istream>
+
+namespace test 
+{
+  using namespace std;
+  typedef short type_t;
+  template class basic_iostream<type_t, char_traits<type_t> >;
+} // test
diff --git a/libstdc++-v3/testsuite/27_io/basic_iostream/3.cc b/libstdc++-v3/testsuite/27_io/basic_iostream/3.cc
new file mode 100644 (file)
index 0000000..9cad305
--- /dev/null
@@ -0,0 +1,149 @@
+// 1999-01-17 bkoz test functionality of basic_filebuf for char_type == char
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.1 - Template class basic_filebuf 
+// NB: This file is for testing basic_filebuf with NO OTHER INCLUDES.
+
+#include <iostream>
+#include <testsuite_hooks.h>
+
+// { dg-do compile }
+
+// libstdc++/2020
+// should be able to use custom char_type, custom traits type
+class gnu_char_type
+{
+  unsigned long character;
+public:
+  // operator ==
+  bool
+  operator==(const gnu_char_type& __lhs) 
+  { return character == __lhs.character; }
+
+  // operator <
+  bool
+  operator<(const gnu_char_type& __lhs) 
+  { return character < __lhs.character; }
+
+  // default ctor
+  gnu_char_type() { }
+
+  // to_char_type
+  gnu_char_type(const unsigned long& __l) : character(__l) { } 
+
+  // to_int_type
+  operator unsigned long() const { return character; }
+};
+
+// char_traits specialization
+struct gnu_char_traits
+{
+  typedef gnu_char_type        char_type;
+  typedef long                 int_type;
+  typedef long                 pos_type;
+  typedef unsigned long        off_type;
+  typedef long                 state_type;
+  
+  static void 
+  assign(char_type& __c1, const char_type& __c2) { }
+  
+  static bool 
+  eq(const char_type& __c1, const char_type& __c2) { return true; }
+  
+  static bool 
+  lt(const char_type& __c1, const char_type& __c2) { return true; }
+  
+  static int 
+  compare(const char_type* __s1, const char_type* __s2, size_t __n)
+  { return 0; }
+  
+  static size_t
+  length(const char_type* __s) { return 0; }
+  
+  static const char_type* 
+  find(const char_type* __s, size_t __n, const char_type& __a)
+  { return __s; }
+  
+  static char_type* 
+  move(char_type* __s1, const char_type* __s2, size_t __n)
+  { return __s1; }
+  
+  static char_type* 
+  copy(char_type* __s1, const char_type* __s2, size_t __n)
+  { return __s1; }
+  
+  static char_type* 
+  assign(char_type* __s, size_t __n, char_type __a)
+  { return __s; }
+  
+  static char_type 
+  to_char_type(const int_type& __c)
+  { return char_type(); }
+  
+  static int_type 
+  to_int_type(const char_type& __c)
+  { return int_type(); }
+  
+  static bool 
+  eq_int_type(const int_type& __c1, const int_type& __c2)
+  { return true; }
+  
+  static int_type 
+  eof()
+  { return int_type(); }
+  
+  static int_type 
+  not_eof(const int_type& __c)
+  { return int_type(); }
+};
+
+void test07()
+{
+  bool test = true;
+  typedef std::basic_iostream<gnu_char_type, gnu_char_traits> gnu_iostr;
+
+  try
+    { 
+      gnu_iostr obj(NULL); 
+    }
+  catch(std::exception& obj)
+    { 
+      test = false; 
+      VERIFY( test );
+    }
+}
+
+#if !__GXX_WEAK__
+// Explicitly instantiate for systems with no COMDAT or weak support.
+template 
+  std::basic_streambuf<gnu_char_type>::int_type
+  std::basic_streambuf<gnu_char_type>::_S_pback_size;
+#endif
+
+int main() 
+{
+  test07();
+  return 0;
+}
+
+
+
+// more surf!!!
diff --git a/libstdc++-v3/testsuite/27_io/basic_iostream/4.cc b/libstdc++-v3/testsuite/27_io/basic_iostream/4.cc
new file mode 100644 (file)
index 0000000..dbcf830
--- /dev/null
@@ -0,0 +1,54 @@
+// 2003-03-26 B enjamin Kosnik  <bkoz@redhat.com>
+
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.1 - Template class basic_filebuf 
+
+#include <iostream>
+#include <sstream>
+
+void test01()
+{
+  // Check for required base class.
+  typedef std::iostream test_type;
+  typedef std::istream base_type1;
+  typedef std::ostream base_type2;
+
+  std::stringbuf buf;
+  const test_type& obj = test_type(&buf);
+  const base_type1* base1 = &obj;
+  const base_type2* base2 = &obj;
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
+
+// more surf!!!
+
+
+
+
+
+
+
+
+
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/1.cc b/libstdc++-v3/testsuite/27_io/basic_istream/1.cc
new file mode 100644 (file)
index 0000000..3338af8
--- /dev/null
@@ -0,0 +1,48 @@
+// 1999-09-20 bkoz
+
+// Copyright (C) 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.6.1.1 basic_istream
+// NB: This file is for testing istream with NO OTHER INCLUDES.
+
+#include <istream>
+#include <testsuite_hooks.h>
+
+// { dg-do compile }
+
+// libstdc++/7216
+void test01()
+{
+  // Check for required typedefs
+  typedef std::istream test_type;
+  typedef test_type::char_type char_type;
+  typedef test_type::traits_type traits_type;
+  typedef test_type::int_type int_type;
+  typedef test_type::pos_type pos_type;
+  typedef test_type::off_type off_type;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/2.cc b/libstdc++-v3/testsuite/27_io/basic_istream/2.cc
new file mode 100644 (file)
index 0000000..40ec332
--- /dev/null
@@ -0,0 +1,45 @@
+// 1999-09-20 bkoz
+
+// Copyright (C) 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.6.1.1 basic_istream
+// NB: This file is for testing istream with NO OTHER INCLUDES.
+
+#include <istream>
+#include <testsuite_hooks.h>
+
+// { dg-do compile }
+
+namespace test 
+{
+  using namespace std;
+  using __gnu_cxx_test::pod_char;
+  typedef short type_t;
+  template class basic_istream<type_t, char_traits<type_t> >;
+  template class basic_istream<pod_char, char_traits<pod_char> >;
+} // test
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/3.cc b/libstdc++-v3/testsuite/27_io/basic_istream/3.cc
new file mode 100644 (file)
index 0000000..1a7a04c
--- /dev/null
@@ -0,0 +1,147 @@
+// 1999-01-17 bkoz test functionality of basic_filebuf for char_type == char
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.1 - Template class basic_filebuf 
+// NB: This file is for testing basic_filebuf with NO OTHER INCLUDES.
+
+#include <istream>
+#include <testsuite_hooks.h>
+
+// { dg-do compile }
+
+// libstdc++/2020
+// should be able to use custom char_type, custom traits type
+class gnu_char_type
+{
+  unsigned long character;
+public:
+  // operator ==
+  bool
+  operator==(const gnu_char_type& __lhs) 
+  { return character == __lhs.character; }
+
+  // operator <
+  bool
+  operator<(const gnu_char_type& __lhs) 
+  { return character < __lhs.character; }
+
+  // default ctor
+  gnu_char_type() { }
+
+  // to_char_type
+  gnu_char_type(const unsigned long& __l) : character(__l) { } 
+
+  // to_int_type
+  operator unsigned long() const { return character; }
+};
+
+// char_traits specialization
+struct gnu_char_traits
+{
+  typedef gnu_char_type        char_type;
+  typedef long                 int_type;
+  typedef long                 pos_type;
+  typedef unsigned long        off_type;
+  typedef long                 state_type;
+  
+  static void 
+  assign(char_type& __c1, const char_type& __c2) { }
+  
+  static bool 
+  eq(const char_type& __c1, const char_type& __c2) { return true; }
+  
+  static bool 
+  lt(const char_type& __c1, const char_type& __c2) { return true; }
+  
+  static int 
+  compare(const char_type* __s1, const char_type* __s2, size_t __n)
+  { return 0; }
+  
+  static size_t
+  length(const char_type* __s) { return 0; }
+  
+  static const char_type* 
+  find(const char_type* __s, size_t __n, const char_type& __a)
+  { return __s; }
+  
+  static char_type* 
+  move(char_type* __s1, const char_type* __s2, size_t __n)
+  { return __s1; }
+  
+  static char_type* 
+  copy(char_type* __s1, const char_type* __s2, size_t __n)
+  { return __s1; }
+  
+  static char_type* 
+  assign(char_type* __s, size_t __n, char_type __a)
+  { return __s; }
+  
+  static char_type 
+  to_char_type(const int_type& __c)
+  { return char_type(); }
+  
+  static int_type 
+  to_int_type(const char_type& __c)
+  { return int_type(); }
+  
+  static bool 
+  eq_int_type(const int_type& __c1, const int_type& __c2)
+  { return true; }
+  
+  static int_type 
+  eof()
+  { return int_type(); }
+  
+  static int_type 
+  not_eof(const int_type& __c)
+  { return int_type(); }
+};
+
+void test07()
+{
+  bool test = true;
+  typedef std::basic_istream<gnu_char_type, gnu_char_traits> gnu_istr;
+
+  try
+    { gnu_istr obj(NULL); }
+  catch(std::exception& obj)
+    { 
+      test = false; 
+      VERIFY( test );
+    }
+}
+
+#if !__GXX_WEAK__
+// Explicitly instantiate for systems with no COMDAT or weak support.
+template 
+  std::basic_streambuf<gnu_char_type>::int_type
+  std::basic_streambuf<gnu_char_type>::_S_pback_size;
+#endif
+
+int main() 
+{
+  test07();
+  return 0;
+}
+
+
+
+// more surf!!!
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/4.cc b/libstdc++-v3/testsuite/27_io/basic_istream/4.cc
new file mode 100644 (file)
index 0000000..4282fef
--- /dev/null
@@ -0,0 +1,52 @@
+// 2003-03-26 B enjamin Kosnik  <bkoz@redhat.com>
+
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.1 - Template class basic_filebuf 
+
+#include <istream>
+#include <sstream>
+
+void test01()
+{
+  // Check for required base class.
+  typedef std::istream test_type;
+  typedef std::ios base_type;
+  
+  std::stringbuf buf;
+  const test_type& obj = test_type(&buf);
+  const base_type* base = &obj;
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
+
+// more surf!!!
+
+
+
+
+
+
+
+
+
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/exceptions/char/9561.cc b/libstdc++-v3/testsuite/27_io/basic_istream/exceptions/char/9561.cc
new file mode 100644 (file)
index 0000000..055c4fb
--- /dev/null
@@ -0,0 +1,69 @@
+// 2003-03-08  Jerry Quinn  <jlquinn@optonline.net>
+
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+#include <istream>
+#include <streambuf>
+#include <testsuite_hooks.h>
+
+// libstdc++/9561
+struct foobar: std::exception { };
+
+struct buf: std::streambuf
+{
+    virtual int_type underflow () {
+        throw foobar ();
+        return -1;
+    }
+    virtual int_type uflow () {
+        throw foobar ();
+        return -1;
+    }
+};
+
+void test01()
+{
+  using namespace std;
+  bool test = true;
+
+  buf b;
+  std::istream strm (&b);
+  strm.exceptions (std::ios::badbit);
+  int i = 0;
+
+  try {
+    i = strm.get();
+  }
+  catch (foobar) {
+    // strm should throw foobar and not do anything else
+    VERIFY(strm.bad());
+  }
+  catch (...) {
+    VERIFY(false);
+  }
+
+  VERIFY(i == 0);
+}
+
+
+int main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/01.cc b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/01.cc
new file mode 100644 (file)
index 0000000..b2fdd26
--- /dev/null
@@ -0,0 +1,134 @@
+// 1999-04-12 bkoz
+
+// Copyright (C) 1999, 2000, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.1.2.2 arithmetic extractors
+
+#include <cstdio> // for printf
+#include <istream>
+#include <ostream>
+#include <sstream>
+#include <locale>
+#include <testsuite_hooks.h>
+
+std::string str_01;
+std::string str_02("true false 0 1 110001");
+std::string str_03("-19999999 777777 -234234 233 -234 33 1 66300.25 .315 1.5");
+std::string str_04("0123");
+
+std::stringbuf isbuf_01(std::ios_base::in);
+std::stringbuf isbuf_02(str_02, std::ios_base::in);
+std::stringbuf isbuf_03(str_03, std::ios_base::in);
+std::stringbuf isbuf_04(str_04, std::ios_base::in);
+
+std::istream is_01(NULL);
+std::istream is_02(&isbuf_02);
+std::istream is_03(&isbuf_03);
+std::istream is_04(&isbuf_04);
+std::stringstream ss_01(str_01);
+// minimal sanity check
+bool test01() {
+
+  bool test = true;
+
+  // Integral Types:
+  bool                         b1  = false;
+  bool                         b2  = false;
+  short                s1  = 0;
+  int                  i1  = 0;
+  long                 l1  = 0;
+  unsigned short       us1 = 0;
+  unsigned int                 ui1 = 0;
+  unsigned long        ul1 = 0;
+
+  // Floating-point Types:
+  float                f1  = 0;
+  double               d1  = 0;
+  long double          ld1 = 0;
+
+  // process alphanumeric versions of bool values
+  std::ios_base::fmtflags fmt = is_02.flags();
+  bool testfmt = fmt & std::ios_base::boolalpha;
+  is_02.setf(std::ios_base::boolalpha);
+  fmt = is_02.flags();
+  testfmt = fmt & std::ios_base::boolalpha;
+  is_02 >> b1;
+  VERIFY( b1 == 1 );
+  is_02 >> b1;
+  VERIFY( b1 == 0 );
+
+  // process numeric versions of of bool values
+  is_02.unsetf(std::ios_base::boolalpha);
+  fmt = is_02.flags();
+  testfmt = fmt & std::ios_base::boolalpha;
+  is_02 >> b1;
+  VERIFY( b1 == 0 );
+  is_02 >> b1;
+  VERIFY( b1 == 1 );
+
+  // is_03 == "-19999999 777777 -234234 233 -234 33 1 66300.25 .315 1.5"
+  is_03 >> l1;
+  VERIFY( l1 == -19999999 );
+  is_03 >> ul1;
+  VERIFY( ul1 == 777777 );
+  is_03 >> i1;
+  VERIFY( i1 == -234234 );
+  is_03 >> ui1;
+  VERIFY( ui1 == 233 );
+  is_03 >> s1;
+  VERIFY( s1 == -234 );
+  is_03 >> us1;
+  VERIFY( us1 == 33 );
+  is_03 >> b1;
+  VERIFY( b1 == 1 );
+  is_03 >> ld1;
+  VERIFY( ld1 == 66300.25 );
+  is_03 >> d1;
+  VERIFY( d1 == .315 );
+  is_03 >> f1;
+  VERIFY( f1 == 1.5 );
+
+  is_04 >> std::hex >> i1;
+  std::printf ("%d %d %d\n", i1, i1 == 0x123, test);
+  VERIFY( i1 == 0x123 );
+  std::printf ("%d %d %d\n", i1, i1 == 0x123, test);
+
+  // test void pointers
+  int i = 55;
+  void* po = &i;
+  void* pi;
+
+  ss_01 << po;
+  ss_01 >> pi;
+  std::printf ("%x %x\n", pi, po);
+  VERIFY( po == pi );
+  
+#ifdef DEBUG_ASSERT
+  assert(test);
+#endif
+  return test;
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/02.cc b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/02.cc
new file mode 100644 (file)
index 0000000..374fbd8
--- /dev/null
@@ -0,0 +1,71 @@
+// 1999-04-12 bkoz
+
+// Copyright (C) 1999, 2000, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.1.2.2 arithmetic extractors
+
+#include <cstdio> // for printf
+#include <istream>
+#include <ostream>
+#include <sstream>
+#include <locale>
+#include <testsuite_hooks.h>
+
+std::string str_01;
+std::string str_02("true false 0 1 110001");
+std::string str_03("-19999999 777777 -234234 233 -234 33 1 66300.25 .315 1.5");
+std::string str_04("0123");
+
+std::stringbuf isbuf_01(std::ios_base::in);
+std::stringbuf isbuf_02(str_02, std::ios_base::in);
+std::stringbuf isbuf_03(str_03, std::ios_base::in);
+std::stringbuf isbuf_04(str_04, std::ios_base::in);
+
+std::istream is_01(NULL);
+std::istream is_02(&isbuf_02);
+std::istream is_03(&isbuf_03);
+std::istream is_04(&isbuf_04);
+std::stringstream ss_01(str_01);
+// elaborated test for ints
+bool test02() {
+
+  bool test = true;
+  const std::string str_01("20000AB");
+  std::stringbuf strb_01(str_01, std::ios_base::in);
+  std::istream is(&strb_01);
+
+  int n = 15;
+  is >> n;
+  VERIFY( n == 20000 );
+  char c = is.peek();
+  VERIFY( c == 65 );
+
+#ifdef DEBUG_ASSERT
+  assert(test);
+#endif
+  return test;
+}
+
+int main()
+{
+  test02();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/03.cc b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/03.cc
new file mode 100644 (file)
index 0000000..869d828
--- /dev/null
@@ -0,0 +1,70 @@
+// 1999-04-12 bkoz
+
+// Copyright (C) 1999, 2000, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.1.2.2 arithmetic extractors
+
+#include <cstdio> // for printf
+#include <istream>
+#include <ostream>
+#include <sstream>
+#include <locale>
+#include <testsuite_hooks.h>
+
+std::string str_01;
+std::string str_02("true false 0 1 110001");
+std::string str_03("-19999999 777777 -234234 233 -234 33 1 66300.25 .315 1.5");
+std::string str_04("0123");
+
+std::stringbuf isbuf_01(std::ios_base::in);
+std::stringbuf isbuf_02(str_02, std::ios_base::in);
+std::stringbuf isbuf_03(str_03, std::ios_base::in);
+std::stringbuf isbuf_04(str_04, std::ios_base::in);
+
+std::istream is_01(NULL);
+std::istream is_02(&isbuf_02);
+std::istream is_03(&isbuf_03);
+std::istream is_04(&isbuf_04);
+std::stringstream ss_01(str_01);
+bool test03()
+{
+  std::stringbuf sbuf;
+  std::istream istr(&sbuf);
+  std::ostream ostr(&sbuf);
+
+  bool test = true;
+  long l01;
+  ostr <<  "12220101";
+  istr >>  l01; // _M_in_end set completely incorrectly here.
+  VERIFY( l01 == 12220101 );
+  VERIFY( istr.rdstate() == std::ios_base::eofbit );
+
+#ifdef DEBUG_ASSERT
+  assert(test);
+#endif
+
+  return test;
+}
+
+int main()
+{
+  test03();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/06.cc b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/06.cc
new file mode 100644 (file)
index 0000000..de92bcd
--- /dev/null
@@ -0,0 +1,83 @@
+// 1999-04-12 bkoz
+
+// Copyright (C) 1999, 2000, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.1.2.2 arithmetic extractors
+
+#include <cstdio> // for printf
+#include <istream>
+#include <ostream>
+#include <sstream>
+#include <locale>
+#include <testsuite_hooks.h>
+
+std::string str_01;
+std::string str_02("true false 0 1 110001");
+std::string str_03("-19999999 777777 -234234 233 -234 33 1 66300.25 .315 1.5");
+std::string str_04("0123");
+
+std::stringbuf isbuf_01(std::ios_base::in);
+std::stringbuf isbuf_02(str_02, std::ios_base::in);
+std::stringbuf isbuf_03(str_03, std::ios_base::in);
+std::stringbuf isbuf_04(str_04, std::ios_base::in);
+
+std::istream is_01(NULL);
+std::istream is_02(&isbuf_02);
+std::istream is_03(&isbuf_03);
+std::istream is_04(&isbuf_04);
+std::stringstream ss_01(str_01);
+// http://gcc.gnu.org/ml/libstdc++/2000-q1/msg00081.html
+// Jim Parsons
+void test06()
+{
+  // default locale, grouping is turned off
+  bool test = true;
+  unsigned int h4, h3, h2;
+  char c;
+  std::string s("205,199,144");
+  std::istringstream is(s);
+  
+  is >> h4; // 205
+  VERIFY( h4 == 205 );
+  is >> c; // ','
+  VERIFY( c == ',' );
+
+  is >> h4; // 199
+  VERIFY( h4 == 199 );
+  is >> c; // ','
+  VERIFY( c == ',' );
+
+  is >> h4; // 144
+  VERIFY( is.rdstate() == std::ios_base::eofbit );
+  VERIFY( h4 == 144 );
+  is >> c; // EOF
+  VERIFY( c == ',' );
+  VERIFY( static_cast<bool>(is.rdstate() & std::ios_base::failbit) );
+
+#ifdef DEBUG_ASSERT
+  assert(test);
+#endif
+}
+
+int main()
+{
+  test06();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/07.cc b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/07.cc
new file mode 100644 (file)
index 0000000..118668e
--- /dev/null
@@ -0,0 +1,169 @@
+// 1999-04-12 bkoz
+
+// Copyright (C) 1999, 2000, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.1.2.2 arithmetic extractors
+
+#include <cstdio> // for printf
+#include <istream>
+#include <ostream>
+#include <sstream>
+#include <locale>
+#include <testsuite_hooks.h>
+
+std::string str_01;
+std::string str_02("true false 0 1 110001");
+std::string str_03("-19999999 777777 -234234 233 -234 33 1 66300.25 .315 1.5");
+std::string str_04("0123");
+
+std::stringbuf isbuf_01(std::ios_base::in);
+std::stringbuf isbuf_02(str_02, std::ios_base::in);
+std::stringbuf isbuf_03(str_03, std::ios_base::in);
+std::stringbuf isbuf_04(str_04, std::ios_base::in);
+
+std::istream is_01(NULL);
+std::istream is_02(&isbuf_02);
+std::istream is_03(&isbuf_03);
+std::istream is_04(&isbuf_04);
+std::stringstream ss_01(str_01);
+namespace std {
+  class test_numpunct1 : public numpunct<char>
+  {
+  protected:
+    string
+    do_grouping() const 
+    { return string(1, '\003'); }
+  };
+} // namespace std
+
+void test07()
+{
+  // manufactured locale, grouping is turned on
+  bool test = true;
+  unsigned int h4 = 0, h3 = 0, h2 = 0;
+  float f1 = 0.0;
+  const std::string s1("205,199 23,445.25 1,024,365 123,22,24");
+  std::istringstream is(s1);
+  is.imbue(std::locale(std::locale(), new std::test_numpunct1));  
+
+  // Basic operation.
+  is >> h4; 
+  VERIFY( h4 == 205199 );
+  VERIFY( is.good() );
+
+  is.clear();
+  is >> f1; 
+  VERIFY( f1 == 23445.25 );
+  VERIFY( is.good() );
+
+  is.clear();
+  is >> h3; 
+  VERIFY( h3 == 1024365 );
+  VERIFY( is.good() );
+
+  is.clear();
+  is >> h2; 
+  VERIFY( h2 == 0 );
+  VERIFY( static_cast<bool>(is.rdstate() & std::ios_base::failbit) );
+  VERIFY( static_cast<bool>(is.rdstate() & std::ios_base::eofbit) );
+
+  // Stress tests for explicit errors in grouping corner cases.  The
+  // validity of these tests and results have been hammered out in
+  // private email between bkoz and ncm between Jan 25 and Jan 27, 2000.
+  // Thanks nate -- benjamin
+  const std::string s2(",111 4,,4 0.25,345 5..25 156,, 1,000000 1000000 1234,567");
+  h3 = h4 = h2 = 0;
+  f1 = 0.0;
+  const char c_control = '?';
+  char c = c_control;
+  is.clear();
+  is.str(s2);
+
+  is >> h4; 
+  VERIFY( h4 == 0 );
+  VERIFY( static_cast<bool>(is.rdstate() & std::ios_base::failbit) );
+  is.clear();
+  is >> c;
+  VERIFY( c == ',' );
+  VERIFY( is.good() );
+
+  is.ignore(3);
+  is >> f1; 
+  VERIFY( f1 == 0.0 );
+  VERIFY( static_cast<bool>(is.rdstate() & std::ios_base::failbit) );
+  is.clear();
+  is >> c;
+  VERIFY( c == ',' );
+  is >> c;
+  VERIFY( c == '4' );
+  VERIFY( is.good() );
+
+  is >> f1; 
+  VERIFY( f1 == 0.25 );
+  VERIFY( is.good() );
+  is >> c;
+  VERIFY( c == ',' );
+  is >> h2;
+  VERIFY( h2 == 345 );
+  VERIFY( is.good() );
+  f1 = 0.0;
+  h2 = 0;
+
+  is >> f1; 
+  VERIFY( f1 == 5.0 );
+  VERIFY( is.good() );
+  is >> f1; 
+  VERIFY( f1 == .25 );
+  VERIFY( is.good() );
+
+  is >> h3; 
+  VERIFY( h3 == 0 );
+  VERIFY( static_cast<bool>(is.rdstate() & std::ios_base::failbit) );
+  is.clear();
+  is >> c;
+  VERIFY( c == ',' ); // second one
+  VERIFY( is.good() );
+
+  is >> h2; 
+  VERIFY( h2 == 0 );
+  VERIFY( static_cast<bool>(is.rdstate() & std::ios_base::failbit) );
+  is.clear();
+
+  is >> h2; 
+  VERIFY( h2 == 1000000 );
+  VERIFY( is.good() );
+  h2 = 0;
+
+  is >> h2; 
+  VERIFY( h2 == 0 );
+  VERIFY( static_cast<bool>(is.rdstate() & std::ios_base::failbit) );
+  VERIFY( static_cast<bool>(is.rdstate() & std::ios_base::eofbit) );
+  is.clear();
+
+#ifdef DEBUG_ASSERT
+  assert(test);
+#endif
+}
+
+int main()
+{
+  test07();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/08.cc b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/08.cc
new file mode 100644 (file)
index 0000000..f849161
--- /dev/null
@@ -0,0 +1,93 @@
+// 1999-04-12 bkoz
+
+// Copyright (C) 1999, 2000, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.1.2.2 arithmetic extractors
+
+#include <cstdio> // for printf
+#include <istream>
+#include <ostream>
+#include <sstream>
+#include <locale>
+#include <testsuite_hooks.h>
+
+std::string str_01;
+std::string str_02("true false 0 1 110001");
+std::string str_03("-19999999 777777 -234234 233 -234 33 1 66300.25 .315 1.5");
+std::string str_04("0123");
+
+std::stringbuf isbuf_01(std::ios_base::in);
+std::stringbuf isbuf_02(str_02, std::ios_base::in);
+std::stringbuf isbuf_03(str_03, std::ios_base::in);
+std::stringbuf isbuf_04(str_04, std::ios_base::in);
+
+std::istream is_01(NULL);
+std::istream is_02(&isbuf_02);
+std::istream is_03(&isbuf_03);
+std::istream is_04(&isbuf_04);
+std::stringstream ss_01(str_01);
+namespace std {
+  class test_numpunct2 : public numpunct<char>
+  {
+  protected:
+    string
+    do_grouping() const 
+    { return string("\002\003"); }
+  };
+} // namespace std
+
+void test08()
+{
+  // manufactured locale, grouping is turned on
+  bool test = true;
+  unsigned int h4 = 0, h3 = 0, h2 = 0;
+  float f1 = 0.0;
+  const std::string s1("1,22 205,19 22,123,22");
+  const std::string s2("1,220 2050,19 202,123,22");
+
+  std::istringstream is(s1);
+  is.imbue(std::locale(std::locale(), new std::test_numpunct2));  
+
+  // Basic operation.
+  is >> h4; 
+  VERIFY( h4 == 122 );
+  VERIFY( is.good() );
+
+  is.clear();
+  is >> h3; 
+  VERIFY( h3 == 20519 );
+  VERIFY( is.good() );
+
+  is.clear();
+  is >> h2; 
+  VERIFY( h2 == 2212322 );
+  VERIFY( static_cast<bool>(is.rdstate() & std::ios_base::eofbit) );
+
+
+#ifdef DEBUG_ASSERT
+  assert(test);
+#endif
+}
+
+int main()
+{
+  test08();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/09.cc b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/09.cc
new file mode 100644 (file)
index 0000000..37e175e
--- /dev/null
@@ -0,0 +1,72 @@
+// 1999-04-12 bkoz
+
+// Copyright (C) 1999, 2000, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.1.2.2 arithmetic extractors
+
+#include <cstdio> // for printf
+#include <istream>
+#include <ostream>
+#include <sstream>
+#include <locale>
+#include <testsuite_hooks.h>
+
+std::string str_01;
+std::string str_02("true false 0 1 110001");
+std::string str_03("-19999999 777777 -234234 233 -234 33 1 66300.25 .315 1.5");
+std::string str_04("0123");
+
+std::stringbuf isbuf_01(std::ios_base::in);
+std::stringbuf isbuf_02(str_02, std::ios_base::in);
+std::stringbuf isbuf_03(str_03, std::ios_base::in);
+std::stringbuf isbuf_04(str_04, std::ios_base::in);
+
+std::istream is_01(NULL);
+std::istream is_02(&isbuf_02);
+std::istream is_03(&isbuf_03);
+std::istream is_04(&isbuf_04);
+std::stringstream ss_01(str_01);
+bool test09()
+{
+   bool test = true;
+
+   std::string st("2.456e3-+0.567e-2");
+   std::stringbuf sb(st);
+   std::istream is(&sb);
+   double f1 = 0, f2 = 0;
+   char c;
+   (is>>std::ws) >> f1;
+   (is>>std::ws) >> c;
+   (is>>std::ws) >> f2;
+   test = f1 == 2456;
+   VERIFY( f2 == 0.00567 );
+   VERIFY( c == '-' );
+#ifdef DEBUG_ASSERT
+  assert(test);
+#endif
+  return test;
+}
+
+int main()
+{
+  test09();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/10.cc b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/10.cc
new file mode 100644 (file)
index 0000000..bc67190
--- /dev/null
@@ -0,0 +1,154 @@
+// 1999-04-12 bkoz
+
+// Copyright (C) 1999, 2000, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.1.2.2 arithmetic extractors
+
+#include <cstdio> // for printf
+#include <istream>
+#include <ostream>
+#include <sstream>
+#include <locale>
+#include <testsuite_hooks.h>
+
+std::string str_01;
+std::string str_02("true false 0 1 110001");
+std::string str_03("-19999999 777777 -234234 233 -234 33 1 66300.25 .315 1.5");
+std::string str_04("0123");
+
+std::stringbuf isbuf_01(std::ios_base::in);
+std::stringbuf isbuf_02(str_02, std::ios_base::in);
+std::stringbuf isbuf_03(str_03, std::ios_base::in);
+std::stringbuf isbuf_04(str_04, std::ios_base::in);
+
+std::istream is_01(NULL);
+std::istream is_02(&isbuf_02);
+std::istream is_03(&isbuf_03);
+std::istream is_04(&isbuf_04);
+std::stringstream ss_01(str_01);
+bool test10() {
+  std::string str_01("0 00 000 +0 +0 -0");
+  std::stringbuf isbuf_01(str_01);
+  std::istream is_01(&isbuf_01);
+
+  bool test = true;
+
+  int n = 365;
+  is_01 >> n;
+  VERIFY( n == 0 );
+  n = 364;
+  is_01 >> n;
+  VERIFY( n == 0 );
+  n = 363;
+  is_01 >> n;
+  VERIFY( n == 0 );
+  n = 362;
+  is_01 >> n;
+  VERIFY( n == 0 );
+  n = 361;
+  is_01 >> n;
+  VERIFY( n == 0 );
+  n = 360;
+  is_01 >> n;
+  VERIFY( n == 0 );
+  VERIFY( is_01.rdstate() == std::ios_base::eofbit );
+
+  std::string str_02("0x32 0X33 033 33");
+  std::stringbuf isbuf_02(str_02);
+  std::istream is_02(&isbuf_02);
+  is_02.unsetf(std::ios_base::basefield);
+  is_02 >> n;
+  VERIFY( n == 50 );
+  is_02 >> n;
+  VERIFY( n == 51 );
+  is_02 >> n;
+  VERIFY( n == 27 );
+  is_02 >> n;
+  VERIFY( n == 33 );
+  VERIFY( is_02.rdstate() == std::ios_base::eofbit );
+
+  std::stringbuf isbuf_03(str_02);
+  std::istream is_03(&isbuf_03);
+  char c;
+  int m;
+
+  is_03 >> std::dec >> n >> c >> m;
+  VERIFY( n == 0 );
+  VERIFY( c == 'x' );
+  VERIFY( m == 32 );
+
+  is_03 >> std::oct >> m >> c >> n;
+  VERIFY( m == 0 );
+  VERIFY( c == 'X' );
+  VERIFY( n == 27 );
+
+  is_03 >> std::dec >> m >> n;
+  VERIFY( m == 33 );
+  VERIFY( n == 33 );
+  VERIFY( is_03.rdstate() == std::ios_base::eofbit );
+
+  std::string str_04("3. 4.5E+2a5E-3 .6E1");
+  std::stringbuf isbuf_04(str_04);
+  std::istream is_04(&isbuf_04);
+
+  double f;
+  is_04 >> f;
+  VERIFY( f == 3.0 );
+  is_04 >> f;
+  VERIFY( f == 450.0 );
+  is_04.ignore();
+  is_04 >> f;
+  VERIFY( f == 0.005 );
+  is_04 >> f;
+  VERIFY( f == 6 );
+  VERIFY( is_03.rdstate() == std::ios_base::eofbit );
+
+  std::string str_05("0E20 5Ea E16");
+  std::stringbuf isbuf_05(str_05);
+  std::istream is_05(&isbuf_05);
+
+  is_05 >> f;
+  VERIFY( f == 0 );
+  is_05 >> f;
+  VERIFY( f == 0 );
+  VERIFY( is_05.rdstate() == std::ios_base::failbit );
+  is_05.clear();
+  is_05 >> c;
+  VERIFY( c == 'a' );
+  is_05 >> f;
+  VERIFY( f == 0 );
+  VERIFY( is_05.rdstate() == std::ios_base::failbit );
+  is_05.clear();
+  is_05.ignore();
+  is_05 >> n;
+  VERIFY( n == 16 );
+
+#ifdef DEBUG_ASSERT
+  assert(test);
+#endif
+
+  return test;
+}
+
+int main()
+{
+  test10();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/11.cc b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/11.cc
new file mode 100644 (file)
index 0000000..309875d
--- /dev/null
@@ -0,0 +1,73 @@
+// 1999-04-12 bkoz
+
+// Copyright (C) 1999, 2000, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.1.2.2 arithmetic extractors
+
+#include <cstdio> // for printf
+#include <istream>
+#include <ostream>
+#include <sstream>
+#include <locale>
+#include <testsuite_hooks.h>
+
+std::string str_01;
+std::string str_02("true false 0 1 110001");
+std::string str_03("-19999999 777777 -234234 233 -234 33 1 66300.25 .315 1.5");
+std::string str_04("0123");
+
+std::stringbuf isbuf_01(std::ios_base::in);
+std::stringbuf isbuf_02(str_02, std::ios_base::in);
+std::stringbuf isbuf_03(str_03, std::ios_base::in);
+std::stringbuf isbuf_04(str_04, std::ios_base::in);
+
+std::istream is_01(NULL);
+std::istream is_02(&isbuf_02);
+std::istream is_03(&isbuf_03);
+std::istream is_04(&isbuf_04);
+std::stringstream ss_01(str_01);
+// In the presence of no fmtflags, the input operator should behave
+// like strtol(x, y, 0)
+// libstdc++/90
+bool test11()
+{
+  bool test = true;
+  const char* cstrlit = "0x2a";
+
+  // sanity check via 'C' library call
+  char* err;
+  long l = std::strtol(cstrlit, &err, 0);
+
+  std::istringstream iss(cstrlit);
+  iss.setf(std::ios::fmtflags(0), std::ios::basefield);
+  int i;
+  iss >> i;
+
+  VERIFY (!iss.fail());
+  VERIFY (l == i);
+
+  return test;
+}
+
+int main()
+{
+  test11();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/12.cc b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/12.cc
new file mode 100644 (file)
index 0000000..64795c0
--- /dev/null
@@ -0,0 +1,94 @@
+// 1999-04-12 bkoz
+
+// Copyright (C) 1999, 2000, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.1.2.2 arithmetic extractors
+
+// XXX This test fails on sparc-solaris2 because of a bug in libc
+// XXX sscanf for very long input.  See:
+// XXX http://gcc.gnu.org/ml/gcc/2002-12/msg01422.html
+// { dg-do run { xfail sparc*-*-solaris2* } }
+
+#include <cstdio> // for printf
+#include <istream>
+#include <ostream>
+#include <sstream>
+#include <locale>
+#include <testsuite_hooks.h>
+
+std::string str_01;
+std::string str_02("true false 0 1 110001");
+std::string str_03("-19999999 777777 -234234 233 -234 33 1 66300.25 .315 1.5");
+std::string str_04("0123");
+
+std::stringbuf isbuf_01(std::ios_base::in);
+std::stringbuf isbuf_02(str_02, std::ios_base::in);
+std::stringbuf isbuf_03(str_03, std::ios_base::in);
+std::stringbuf isbuf_04(str_04, std::ios_base::in);
+
+std::istream is_01(NULL);
+std::istream is_02(&isbuf_02);
+std::istream is_03(&isbuf_03);
+std::istream is_04(&isbuf_04);
+std::stringstream ss_01(str_01);
+// libstdc++/3720
+// excess input should not cause a core dump
+template<typename T>
+bool test12_aux(bool integer_type)
+{
+  bool test = true;
+  
+  int digits_overflow;
+  if (integer_type)
+    // This many digits will overflow integer types in base 10.
+    digits_overflow = std::numeric_limits<T>::digits10 + 2;
+  else
+    // This might do it, unsure.
+    digits_overflow = std::numeric_limits<T>::max_exponent10 + 1;
+  
+  std::string st;
+  std::string part = "1234567890123456789012345678901234567890";
+  for (int i = 0; i < digits_overflow / part.size() + 1; ++i)
+    st += part;
+  std::stringbuf sb(st);
+  std::istream is(&sb);
+  T t;
+  is >> t;
+  VERIFY(is.fail());
+  return test;
+}
+
+bool test12()
+{
+  bool test = true;
+  VERIFY(test12_aux<short>(true));
+  VERIFY(test12_aux<int>(true));
+  VERIFY(test12_aux<long>(true));
+  VERIFY(test12_aux<float>(false));
+  VERIFY(test12_aux<double>(false));
+  VERIFY(test12_aux<long double>(false));
+  return test;
+}
+
+int main()
+{
+  test12();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/13.cc b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/13.cc
new file mode 100644 (file)
index 0000000..935d456
--- /dev/null
@@ -0,0 +1,88 @@
+// 1999-04-12 bkoz
+
+// Copyright (C) 1999, 2000, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.1.2.2 arithmetic extractors
+
+#include <cstdio> // for printf
+#include <istream>
+#include <ostream>
+#include <sstream>
+#include <locale>
+#include <testsuite_hooks.h>
+
+std::string str_01;
+std::string str_02("true false 0 1 110001");
+std::string str_03("-19999999 777777 -234234 233 -234 33 1 66300.25 .315 1.5");
+std::string str_04("0123");
+
+std::stringbuf isbuf_01(std::ios_base::in);
+std::stringbuf isbuf_02(str_02, std::ios_base::in);
+std::stringbuf isbuf_03(str_03, std::ios_base::in);
+std::stringbuf isbuf_04(str_04, std::ios_base::in);
+
+std::istream is_01(NULL);
+std::istream is_02(&isbuf_02);
+std::istream is_03(&isbuf_03);
+std::istream is_04(&isbuf_04);
+std::stringstream ss_01(str_01);
+// libstdc++/3720 part two
+void test13()
+{
+  using namespace std;
+  bool test = true;
+  const char* l1 = "12345678901234567890123456789012345678901234567890123456";
+  const char* l2 = "1.2345678901234567890123456789012345678901234567890123456"
+                   "  "
+                   "1246.9";
+
+  // 1 
+  // used to core.
+  double d;
+  istringstream iss1(l2);
+  iss1 >> d;
+  iss1 >> d;
+  VERIFY (d > 1246 && d < 1247);
+
+  // 2
+  // quick test for failbit on maximum length extraction.
+  int i;
+  int max_digits = numeric_limits<int>::digits10 + 1;
+  string digits;
+  for (int j = 0; j < max_digits; ++j)
+    digits += '1';
+  istringstream iss2(digits);
+  iss2 >> i;
+  VERIFY( !iss2.fail() );
+
+  digits += '1';
+  i = 0;
+  iss2.str(digits);
+  iss2.clear();
+  iss2 >> i; 
+  VERIFY( i == 0 );
+  VERIFY( iss2.fail() );
+}
+
+int main()
+{
+  test13();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_character/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_character/char/1.cc
new file mode 100644 (file)
index 0000000..0a235bb
--- /dev/null
@@ -0,0 +1,109 @@
+// 1999-07-26 bkoz
+
+// Copyright (C) 1999, 2003 Free Software Foundation
+//
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.1.2.3 character extractors
+
+#include <istream>
+#include <sstream>
+#include <testsuite_hooks.h>
+
+void test01() 
+{
+  bool test = true;
+  std::string str_01;
+  const std::string str_02("coltrane playing 'softly as a morning sunrise'");
+  const std::string str_03("coltrane");
+
+  std::stringbuf isbuf_01(std::ios_base::in);
+  std::stringbuf isbuf_02(str_02, std::ios_base::in);
+  std::istream is_01(NULL);
+  std::istream is_02(&isbuf_02);
+
+  std::ios_base::iostate state1, state2, statefail;
+  statefail = std::ios_base::failbit;
+
+  // template<_CharT, _Traits>
+  //  basic_istream& operator>>(istream&, _CharT*)
+  int n = 20;
+  char array1[n];
+  typedef std::ios::traits_type ctraits_type;
+  ctraits_type::int_type i1, i2;
+
+  state1 = is_01.rdstate();
+  i1 = ctraits_type::length(array1);
+  is_01 >> array1;   // should snake 0 characters, not alter stream state
+  i2 = ctraits_type::length(array1);
+  state2 = is_01.rdstate();
+  VERIFY( i1 == i2 );
+  VERIFY( state1 != state2 );
+  VERIFY( static_cast<bool>(state2 & statefail) );
+
+  state1 = is_02.rdstate();
+  is_02 >> array1;   // should snake "coltrane"
+  state2 = is_02.rdstate();
+  VERIFY( state1 == state2 );
+  VERIFY( !static_cast<bool>(state2 & statefail) );
+  VERIFY( array1[str_03.size() - 1] == 'e' );
+  array1[str_03.size()] = '\0';
+  VERIFY( !str_03.compare(0, str_03.size(), array1) );
+  std::istream::int_type int1 = is_02.peek(); // should be ' '
+  VERIFY( int1 == ' ' );
+
+  state1 = is_02.rdstate();
+  is_02 >> array1;   // should snake "playing" as sentry "eats" ws
+  state2 = is_02.rdstate();
+  int1 = is_02.peek(); // should be ' '
+  VERIFY( int1 == ' ' );
+  VERIFY( state1 == state2 );
+  VERIFY( !static_cast<bool>(state2 & statefail) );
+
+  // template<_CharT, _Traits>
+  //  basic_istream& operator>>(istream&, unsigned char*)
+  unsigned char array2[n];
+  state1 = is_02.rdstate();
+  is_02 >> array2;   // should snake 'softly
+  state2 = is_02.rdstate();
+  VERIFY( state1 == state2 );
+  VERIFY( !static_cast<bool>(state2 & statefail) );
+  VERIFY( array2[0] == '\'' );
+  VERIFY( array2[1] == 's' );
+  VERIFY( array2[6] == 'y' );
+  int1 = is_02.peek(); // should be ' '
+  VERIFY( int1 == ' ' );
+  
+  // template<_CharT, _Traits>
+  //  basic_istream& operator>>(istream&, signed char*)
+  signed char array3[n];
+  state1 = is_02.rdstate();
+  is_02 >> array3;   // should snake "as"
+  state2 = is_02.rdstate();
+  VERIFY( state1 == state2 );
+  VERIFY( !static_cast<bool>(state2 & statefail) );
+  VERIFY( array3[0] == 'a' );
+  VERIFY( array3[1] == 's' );
+  int1 = is_02.peek(); // should be ' '
+  VERIFY( int1 == ' ' );
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_character/char/2.cc b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_character/char/2.cc
new file mode 100644 (file)
index 0000000..d48072c
--- /dev/null
@@ -0,0 +1,92 @@
+// 1999-07-26 bkoz
+
+// Copyright (C) 1999, 2003 Free Software Foundation
+//
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.1.2.3 character extractors
+
+#include <istream>
+#include <sstream>
+#include <testsuite_hooks.h>
+
+void test02() 
+{
+  typedef std::ios::traits_type ctraits_type;
+
+  bool test = true;
+  std::string str_01;
+  const std::string str_02("or coltrane playing tunji with jimmy garrison");
+  const std::string str_03("coltrane");
+
+  std::stringbuf isbuf_01(std::ios_base::in);
+  std::stringbuf isbuf_02(str_02, std::ios_base::in);
+  std::istream is_01(NULL);
+  std::istream is_02(&isbuf_02);
+  std::ios_base::iostate state1, state2, statefail;
+  statefail = std::ios_base::failbit;
+
+  // template<_CharT, _Traits>
+  //  basic_istream& operator>>(istream&, _CharT&)
+  char c1 = 'c', c2 = 'c';
+  state1 = is_01.rdstate();
+  is_01 >> c1;   
+  state2 = is_01.rdstate();
+  VERIFY( state1 != state2 );
+  VERIFY( c1 == c2 );
+  VERIFY( static_cast<bool>(state2 & statefail) );
+
+  state1 = is_02.rdstate();
+  is_02 >> c1;   
+  state2 = is_02.rdstate();
+  VERIFY( state1 == state2 );
+  VERIFY( c1 == 'o' );
+  is_02 >> c1;   
+  is_02 >> c1;   
+  VERIFY( c1 == 'c' );
+  VERIFY( !static_cast<bool>(state2 & statefail) );
+
+  // template<_CharT, _Traits>
+  //  basic_istream& operator>>(istream&, unsigned char&)
+  unsigned char uc1 = 'c';
+  state1 = is_02.rdstate();
+  is_02 >> uc1;   
+  state2 = is_02.rdstate();
+  VERIFY( state1 == state2 );
+  VERIFY( uc1 == 'o' );
+  is_02 >> uc1;   
+  is_02 >> uc1;   
+  VERIFY( uc1 == 't' );
+
+  // template<_CharT, _Traits>
+  //  basic_istream& operator>>(istream&, signed char&)
+  signed char sc1 = 'c';
+  state1 = is_02.rdstate();
+  is_02 >> sc1;   
+  state2 = is_02.rdstate();
+  VERIFY( state1 == state2 );
+  VERIFY( sc1 == 'r' );
+  is_02 >> sc1;   
+  is_02 >> sc1;   
+  VERIFY( sc1 == 'n' );
+}
+
+int main()
+{
+  test02();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_character/char/3.cc b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_character/char/3.cc
new file mode 100644 (file)
index 0000000..1ab02a1
--- /dev/null
@@ -0,0 +1,95 @@
+// 1999-07-26 bkoz
+
+// Copyright (C) 1999, 2003 Free Software Foundation
+//
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.1.2.3 character extractors
+
+#include <istream>
+#include <sstream>
+#include <testsuite_hooks.h>
+
+void test01() 
+{
+  bool test = true;
+  std::string str_01;
+  const std::string str_02("coltrane playing 'softly as a morning sunrise'");
+  const std::string str_03("coltrane");
+
+  std::stringbuf isbuf_01(std::ios_base::in);
+  std::stringbuf isbuf_02(str_02, std::ios_base::in);
+  std::istream is_01(NULL);
+  std::istream is_02(&isbuf_02);
+
+  std::ios_base::iostate state1, state2, statefail;
+  statefail = std::ios_base::failbit;
+
+  // template<_CharT, _Traits>
+  //  basic_istream& operator>>(istream&, _CharT*)
+  int n = 20;
+  char array1[n];
+  typedef std::ios::traits_type ctraits_type;
+  ctraits_type::int_type i1, i2;
+
+  // testing with width() control enabled.
+  is_02.width(8);
+  state1 = is_02.rdstate();
+  is_02 >> array1;   // should snake "coltran"
+  state2 = is_02.rdstate();
+  VERIFY( state1 == state2 );
+  VERIFY( !ctraits_type::compare(array1, "coltran", 7) );
+
+  is_02.width(1);
+  state1 = is_02.rdstate();
+  is_02 >> array1;   // should snake nothing, set failbit
+  state2 = is_02.rdstate();
+  VERIFY( state1 != state2 );
+  VERIFY( state2 == statefail );
+  VERIFY( array1[0] == '\0' );
+
+  is_02.width(8);
+  is_02.clear();
+  state1 = is_02.rdstate();
+  VERIFY( !state1 );
+  is_02 >> array1;   // should snake "e"
+  state2 = is_02.rdstate();
+  VERIFY( state1 == state2 );
+  VERIFY( !ctraits_type::compare(array1, "e", 1) );
+
+  // testing for correct exception setting
+  const std::string str_04("   impulse!!");
+  std::stringbuf isbuf_03(str_04, std::ios_base::in);
+  std::stringbuf isbuf_04(str_04, std::ios_base::in);
+  std::istream is_03(&isbuf_03);
+  std::istream is_04(&isbuf_04);
+
+  is_03 >> array1;
+  VERIFY( !ctraits_type::compare(array1,"impulse!!", 10) );
+  VERIFY( is_03.rdstate() == std::ios_base::eofbit );
+
+  is_04.width(9);
+  is_04 >> array1;
+  VERIFY( ! std::ios::traits_type::compare(array1,"impulse!", 9) );
+  VERIFY( !is_04.rdstate() ); 
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_character/char/9826.cc b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_character/char/9826.cc
new file mode 100644 (file)
index 0000000..9d59395
--- /dev/null
@@ -0,0 +1,59 @@
+// 2002-07-25 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.7.4 - Template class basic_stringstream
+// NB: This file is for testing basic_stringstream with NO OTHER INCLUDES.
+
+#include <sstream>
+#include <testsuite_hooks.h>
+
+// { dg-do compile }
+
+// libstdc++/9826
+void test02()
+{
+  using namespace std;
+  using __gnu_cxx_test::pod_char;
+
+  basic_stringstream<pod_char, char_traits<pod_char> > sstr;
+  // 1
+  basic_string<pod_char, char_traits<pod_char> > str;
+  sstr >> str;
+  // 2
+  pod_char*  chr;
+  sstr >> chr;
+  // 3
+  sstr >> ws;
+}
+
+int main() 
+{
+  test02();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/char/1.cc
new file mode 100644 (file)
index 0000000..c2afc80
--- /dev/null
@@ -0,0 +1,143 @@
+// 1999-07-28 bkoz
+
+// Copyright (C) 1999, 2001, 2003 Free Software Foundation
+//
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.1.2.3 basic_istream::operator>>
+// @require@ %-*.tst %-*.txt
+// @diff@ %-*.tst %-*.txt
+
+#include <istream>
+#include <sstream>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+// stringbufs.
+void test01() 
+{
+  typedef std::ios::traits_type ctraits_type;
+
+  bool test = true;
+  const std::string str_01;
+  const std::string str_02("art taylor kickin it on DAKAR");
+  std::string strtmp;
+
+  std::stringbuf isbuf_00(std::ios_base::in);
+  std::stringbuf isbuf_01(std::ios_base::in | std::ios_base::out);
+  std::stringbuf isbuf_02(str_01, std::ios_base::in);
+  std::stringbuf isbuf_03(str_01, std::ios_base::in | std::ios_base::out);
+  std::stringbuf isbuf_04(str_02, std::ios_base::in);
+  std::stringbuf isbuf_05(str_02, std::ios_base::in | std::ios_base::out);
+
+  std::istream is_00(NULL);
+  std::istream is_01(&isbuf_01);
+  std::istream is_02(&isbuf_02);
+  std::istream is_03(&isbuf_03);
+  std::istream is_04(&isbuf_04);
+  std::istream is_05(&isbuf_05);
+  std::ios_base::iostate state1, state2, statefail, stateeof;
+  statefail = std::ios_base::failbit;
+  stateeof = std::ios_base::eofbit;
+
+
+  // template<_CharT, _Traits>
+  //  basic_istream& operator>>(basic_streambuf*)
+
+  // null istream to empty in_buf
+  state1 = is_00.rdstate();
+  is_00 >> &isbuf_00;   
+  state2 = is_00.rdstate();
+  VERIFY( state1 != state2 );
+  VERIFY( static_cast<bool>(state2 & statefail) );
+  VERIFY( isbuf_00.str() == str_01 ); 
+
+  // null istream to empty in_out_buf
+  is_00.clear(std::ios_base::goodbit);
+  state1 = is_00.rdstate();
+  is_00 >> &isbuf_01;   
+  state2 = is_00.rdstate();
+  VERIFY( state1 != state2 );
+  VERIFY( static_cast<bool>(state2 & statefail) );
+  VERIFY( isbuf_01.str() == str_01 ); 
+
+  // null istream to full in_buf
+  is_00.clear(std::ios_base::goodbit);
+  state1 = is_00.rdstate();
+  is_00 >> &isbuf_04;   
+  state2 = is_00.rdstate();
+  VERIFY( state1 != state2 );
+  VERIFY( static_cast<bool>(state2 & statefail) );
+  VERIFY( isbuf_04.str() == str_02 ); 
+
+  // null istream to full in_out_buf
+  is_00.clear(std::ios_base::goodbit);
+  state1 = is_00.rdstate();
+  is_00 >> &isbuf_05;   
+  state2 = is_00.rdstate();
+  VERIFY( state1 != state2 );
+  VERIFY( static_cast<bool>(state2 & statefail) );
+  VERIFY( isbuf_05.str() == str_02 ); 
+
+  // empty but non-null istream to full in_buf
+  state1 = is_02.rdstate();
+  is_02 >> &isbuf_04;   
+  state2 = is_02.rdstate();
+  VERIFY( state1 != state2 );
+  VERIFY( static_cast<bool>(state2 & statefail) );
+  VERIFY( isbuf_04.str() == str_02 ); // as only an "in" buffer
+  VERIFY( isbuf_04.sgetc() == 'a' );
+
+  // empty but non-null istream to full in_out_buf
+  is_02.clear(std::ios_base::goodbit);
+  state1 = is_02.rdstate();
+  is_02 >> &isbuf_05;   
+  state2 = is_02.rdstate();
+  VERIFY( state1 != state2 );
+  VERIFY( static_cast<bool>(state2 & statefail) );
+  VERIFY( isbuf_05.str() == str_02 ); // as only an "in" buffer
+  VERIFY( isbuf_05.sgetc() == 'a' );
+
+  // full istream to empty in_buf (need out_buf, you know?)
+  state1 = is_04.rdstate();
+  is_04 >> &isbuf_02;   
+  state2 = is_04.rdstate();
+  VERIFY( state1 != state2 );
+  VERIFY( static_cast<bool>(state2 & statefail) );
+  VERIFY( isbuf_02.str() == str_01 ); // as only an "in" buffer
+  VERIFY( isbuf_02.sgetc() == ctraits_type::eof() );
+  VERIFY( is_04.peek() == ctraits_type::eof() ); // as failed
+
+  // full istream to empty in_out_buf
+  is_04.clear(std::ios_base::goodbit);
+  state1 = is_04.rdstate();
+  is_04 >> &isbuf_03;   
+  state2 = is_04.rdstate();
+  VERIFY( state1 == state2 );
+  VERIFY( !static_cast<bool>(state2 & statefail) );
+  VERIFY( state2 != stateeof );
+  strtmp = isbuf_03.str();
+  VERIFY( strtmp == str_02 ); // as only an "in" buffer
+  VERIFY( isbuf_03.sgetc() == 'a' );
+  VERIFY( is_04.peek() == ctraits_type::eof() );
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/char/2.cc b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/char/2.cc
new file mode 100644 (file)
index 0000000..3492a1e
--- /dev/null
@@ -0,0 +1,61 @@
+// 1999-07-28 bkoz
+
+// Copyright (C) 1999, 2001, 2003 Free Software Foundation
+//
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.1.2.3 basic_istream::operator>>
+// @require@ %-*.tst %-*.txt
+// @diff@ %-*.tst %-*.txt
+
+#include <istream>
+#include <sstream>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+// filebufs.
+void test02() 
+{
+  bool test = true;
+  typedef std::ios::traits_type ctraits_type;
+  const char name_01[] = "istream_extractor_other-1.txt"; //read 
+  const char name_02[] = "istream_extractor_other-2.txt"; //write
+
+  std::filebuf fbin, fbout;
+  fbin.open(name_01, std::ios_base::in);
+  fbout.open(name_02, std::ios_base::out | std::ios_base::trunc);
+  VERIFY( fbin.is_open() );
+  VERIFY( fbout.is_open() );
+
+  if (test)
+    {
+      std::istream is(&fbin);
+      is.unsetf(std::ios_base::skipws);
+      is >> &fbout;
+    }
+
+  fbout.close();
+  fbin.close();
+  VERIFY( !fbin.is_open() );
+  VERIFY( !fbout.is_open() );
+}
+
+int main()
+{
+  test02();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/char/3.cc b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/char/3.cc
new file mode 100644 (file)
index 0000000..9182033
--- /dev/null
@@ -0,0 +1,56 @@
+// 1999-07-28 bkoz
+
+// Copyright (C) 1999, 2001, 2003 Free Software Foundation
+//
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.1.2.3 basic_istream::operator>>
+// @require@ %-*.tst %-*.txt
+// @diff@ %-*.tst %-*.txt
+
+#include <istream>
+#include <sstream>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+void test03() 
+{
+  using namespace std;  
+  bool test = true;
+
+  // template<_CharT, _Traits>
+  //  basic_istream& operator>>(ios_base& (*pf) (ios_base&))
+  {
+    int i = 0;
+    std::istringstream iss(" 43");
+    iss >> std::noskipws >> i;
+    std::ios::iostate i3 = iss.rdstate();
+    VERIFY ( !iss ); //should set failbit
+  }
+
+  // template<_CharT, _Traits>
+  //  basic_istream& operator>>(basic_ios& (*pf) (basic_ios&))
+
+  // template<_CharT, _Traits>
+  //  basic_istream& operator>>(basic_istream& (*pf) (basic_istream&))
+}
+
+int main()
+{
+  test03();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/char/9318-in.cc b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/char/9318-in.cc
new file mode 100644 (file)
index 0000000..6251a38
--- /dev/null
@@ -0,0 +1,73 @@
+// 1999-10-11 bkoz
+
+// Copyright (C) 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.5.2 template class basic_streambuf
+
+#include <cstring> // for memset, memcmp
+#include <streambuf>
+#include <sstream>
+#include <ostream>
+#include <testsuite_hooks.h>
+
+// libstdc++/9318
+class Outbuf : public std::streambuf
+{
+public:
+  typedef std::streambuf::traits_type traits_type;
+
+  std::string result() const { return str; }
+
+protected:
+  virtual int_type overflow(int_type c = traits_type::eof())
+  {
+    if (!traits_type::eq_int_type(c, traits_type::eof()))
+      str.push_back(traits_type::to_char_type(c));
+    return traits_type::not_eof(c);
+  }
+
+private:
+  std::string str;
+};
+
+void test09()
+{
+  bool test = true;
+  
+  std::istringstream stream("Bad Moon Rising");
+  Outbuf buf;
+  stream >> &buf;
+
+  VERIFY( buf.result() == "Bad Moon Rising" );
+}
+
+int main() 
+{
+  test09();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/char/9424-in.cc b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/char/9424-in.cc
new file mode 100644 (file)
index 0000000..3c9266b
--- /dev/null
@@ -0,0 +1,113 @@
+// 1999-10-11 bkoz
+
+// Copyright (C) 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.5.2 template class basic_streambuf
+
+#include <cstring> // for memset, memcmp
+#include <streambuf>
+#include <sstream>
+#include <ostream>
+#include <testsuite_hooks.h>
+
+// libstdc++/9424
+class Outbuf_2 : public std::streambuf
+{
+  char buf[1];
+
+public:
+  Outbuf_2()
+  {
+    setp(buf, buf + 1);
+  }
+
+  int_type overflow(int_type c)
+  {
+    int_type eof = traits_type::eof();
+    
+    if (pptr() < epptr())
+      {
+       if (traits_type::eq_int_type(c, eof))
+         return traits_type::not_eof(c);
+       
+       *pptr() = traits_type::to_char_type(c);
+       pbump(1);
+       return c;
+      }
+
+    return eof;
+  }
+};
+
+class Inbuf_2 : public std::streambuf
+{
+  static const char buf[];
+  const char* current;
+  int size;
+
+public:
+  Inbuf_2()
+  {
+    current = buf;
+    size = std::strlen(buf);
+  }
+  
+  int_type underflow()
+  {
+    if (current < buf + size)
+      return traits_type::to_int_type(*current);
+    return traits_type::eof();
+  }
+  
+  int_type uflow()
+  {
+    if (current < buf + size)
+      return traits_type::to_int_type(*current++);
+    return traits_type::eof();
+  }
+};
+
+const char Inbuf_2::buf[] = "Atteivlis";
+
+void test11()
+{
+  bool test = true;
+
+  Inbuf_2 inbuf1;
+  std::istream is(&inbuf1);
+  Outbuf_2 outbuf1;
+  is >> &outbuf1;
+  VERIFY( inbuf1.sgetc() == 't' );
+  VERIFY( is.good() );
+}
+
+int main() 
+{
+  test11();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/get/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_istream/get/char/1.cc
new file mode 100644 (file)
index 0000000..446b6d9
--- /dev/null
@@ -0,0 +1,128 @@
+// 1999-08-11 bkoz
+
+// Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation
+//
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.1.3 unformatted input functions
+// @require@ %-*.tst %-*.txt
+// @diff@ %-*.tst %-*.txt
+
+#include <cstring> // for strncmp,...
+#include <istream>
+#include <sstream>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+void
+test03()
+{
+  typedef std::char_traits<char>       traits_type;
+
+  bool test = true;
+  const char str_lit01[] = 
+  "   sun*ra \n\t\t\t   & his arkestra, featuring john gilmore: \n"
+  "                         "
+    "jazz in silhouette: images and forecasts of tomorrow";
+
+  std::string str01(str_lit01);
+  std::string strtmp;
+
+  std::stringbuf sbuf_03;
+  std::stringbuf sbuf_04(str01, std::ios_base::in);
+  std::stringbuf sbuf_05(str01, std::ios_base::in);
+
+  std::istream is_00(NULL);
+  std::istream is_04(&sbuf_04);
+  std::istream is_05(&sbuf_05);
+  std::ios_base::iostate state1, state2, statefail, stateeof;
+  statefail = std::ios_base::failbit;
+  stateeof = std::ios_base::eofbit;
+  std::streamsize count1, count2;
+  char carray1[400] = "";
+
+  // int_type get()
+  // istream& get(char*, streamsize, char delim)
+  // istream& get(char*, streamsize)
+  // istream& get(streambuf&, char delim)
+  // istream& get(streambuf&)
+  is_00.get(carray1, 2);
+  VERIFY( static_cast<bool>(is_00.rdstate() & statefail) ); 
+  VERIFY( is_00.gcount() == 0 );
+
+  is_04.get(carray1, 4);
+  VERIFY( !(is_04.rdstate() & statefail) );
+  VERIFY( !traits_type::compare(carray1, "   ", 4) );
+  VERIFY( is_04.gcount() == 3 );
+
+  is_04.clear();
+  is_04.get(carray1 + 3, 200);
+  VERIFY( !(is_04.rdstate() & statefail) );
+  VERIFY( !(is_04.rdstate() & stateeof) );
+  VERIFY( !traits_type::compare(carray1, str_lit01, 10) );
+  VERIFY( is_04.gcount() == 7 );
+
+  is_04.clear();
+  is_04.get(carray1, 200);
+  VERIFY( !(is_04.rdstate() & stateeof) );
+  VERIFY( static_cast<bool>(is_04.rdstate() & statefail) ); // delimiter
+  VERIFY( is_04.gcount() == 0 );
+  is_04.clear();
+  is_04.get(carray1, 200, '[');
+  VERIFY( static_cast<bool>(is_04.rdstate() & stateeof) );
+  VERIFY( !(is_04.rdstate() & statefail) );
+  VERIFY( is_04.gcount() == 125 );
+  is_04.clear();  
+  is_04.get(carray1, 200);
+  VERIFY( static_cast<bool>(is_04.rdstate() & stateeof) );
+  VERIFY( static_cast<bool>(is_04.rdstate() & statefail) ); 
+  VERIFY( is_04.gcount() == 0 );
+
+  std::stringbuf sbuf_02(std::ios_base::in);
+  is_05.clear();
+  is_05.get(sbuf_02);
+  VERIFY( is_05.gcount() == 0 );
+  VERIFY( static_cast<bool>(is_05.rdstate() & statefail) ); 
+  VERIFY( !(is_05.rdstate() & stateeof) ); 
+
+  is_05.clear();
+  is_05.get(sbuf_03);
+  VERIFY( is_05.gcount() == 10 );
+  VERIFY( sbuf_03.str() == "   sun*ra " );
+  VERIFY( !(is_05.rdstate() & statefail) ); 
+  VERIFY( !(is_05.rdstate() & stateeof) ); 
+
+  is_05.clear();
+  is_05.get(sbuf_03, '|');
+  VERIFY( is_05.gcount() == 125 );
+  VERIFY( sbuf_03.str() == str_lit01 );
+  VERIFY( !(is_05.rdstate() & statefail) ); 
+  VERIFY( static_cast<bool>(is_05.rdstate() & stateeof) ); 
+
+  is_05.clear();
+  is_05.get(sbuf_03, '|');
+  VERIFY( is_05.gcount() == 0 );
+  VERIFY( static_cast<bool>(is_05.rdstate() & stateeof) ); 
+  VERIFY( static_cast<bool>(is_05.rdstate() & statefail) ); 
+}
+
+int 
+main()
+{
+  test03();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/get/char/2.cc b/libstdc++-v3/testsuite/27_io/basic_istream/get/char/2.cc
new file mode 100644 (file)
index 0000000..fa35144
--- /dev/null
@@ -0,0 +1,59 @@
+// 1999-08-11 bkoz
+
+// Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation
+//
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.1.3 unformatted input functions
+// @require@ %-*.tst %-*.txt
+// @diff@ %-*.tst %-*.txt
+
+#include <cstring> // for strncmp,...
+#include <istream>
+#include <sstream>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+//libstdc++/92: Bug in istream::get(basic_streambuf*)
+// bug reported by bgarcia@laurelnetworks.com
+// http://gcc.gnu.org/ml/libstdc++-prs/2000-q3/msg00041.html
+void
+test07()
+{
+  bool test = true;
+  const char* tfn = "istream_unformatted-1.txt";
+  std::ifstream infile;
+  infile.open(tfn);
+  VERIFY( !(!infile) );
+  while (infile)
+    {
+      std::string line;
+      std::ostringstream line_ss;
+      while (infile.peek() == '\n')
+       infile.get();
+      infile.get(*(line_ss.rdbuf()));
+      line = line_ss.str();
+      VERIFY( line == "1234567890" || line == "" );
+    }
+}
+
+int 
+main()
+{
+  test07();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/getline/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_istream/getline/char/1.cc
new file mode 100644 (file)
index 0000000..6df68c7
--- /dev/null
@@ -0,0 +1,125 @@
+// 1999-08-11 bkoz
+
+// Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation
+//
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.1.3 unformatted input functions
+// @require@ %-*.tst %-*.txt
+// @diff@ %-*.tst %-*.txt
+
+#include <cstring> // for strncmp,...
+#include <istream>
+#include <sstream>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+void
+test02()
+{
+  typedef std::char_traits<char>       traits_type;
+
+  bool test = true;
+  const char str_lit01[] = "\t\t\t    sun*ra \n"
+  "                            "
+  "and his myth science arkestra present\n"
+  "                            "
+  "angles and demons @ play\n"
+  "                            "
+  "the nubians of plutonia";
+  std::string str01(str_lit01);
+  std::string strtmp;
+
+  std::stringbuf sbuf_04(str01, std::ios_base::in);
+
+  std::istream is_00(NULL);
+  std::istream is_04(&sbuf_04);
+  std::ios_base::iostate state1, state2, statefail, stateeof;
+  statefail = std::ios_base::failbit;
+  stateeof = std::ios_base::eofbit;
+  std::streamsize count1, count2;
+  char carray1[400] = "";
+
+  // istream& getline(char* s, streamsize n, char delim)
+  // istream& getline(char* s, streamsize n)
+  state1 = is_00.rdstate();
+  is_00.getline(carray1, 20, '*');
+  state2 = is_00.rdstate();
+  // make sure failbit was set, since we couldn't extract
+  // from the NULL streambuf...
+  VERIFY( state1 != state2 );
+  VERIFY( static_cast<bool>(state2 & statefail) );
+  
+  VERIFY( is_04.gcount() == 0 );
+  state1 = is_04.rdstate();
+  is_04.getline(carray1, 1, '\t'); // extracts, throws away
+  state2 = is_04.rdstate();  
+  VERIFY( is_04.gcount() == 1 );
+  VERIFY( state1 == state2 );
+  VERIFY( state1 == 0 );
+  VERIFY( !traits_type::compare("", carray1, 1) );
+
+  state1 = is_04.rdstate();
+  is_04.getline(carray1, 20, '*');
+  state2 = is_04.rdstate();  
+  VERIFY( is_04.gcount() == 10 );
+  VERIFY( state1 == state2 );
+  VERIFY( state1 == 0 );
+  VERIFY( !traits_type::compare("\t\t    sun", carray1, 10) );
+
+  state1 = is_04.rdstate();
+  is_04.getline(carray1, 20);
+  state2 = is_04.rdstate();  
+  VERIFY( is_04.gcount() == 4 );
+  VERIFY( state1 == state2 );
+  VERIFY( state1 == 0 );
+  VERIFY( !traits_type::compare("ra ", carray1, 4) );
+
+  state1 = is_04.rdstate();
+  is_04.getline(carray1, 65);
+  state2 = is_04.rdstate();  
+  VERIFY( is_04.gcount() == 64 );
+  VERIFY( state1 != state2 );
+  VERIFY( state2 == statefail );
+  VERIFY( !traits_type::compare(
+  "                            and his myth science arkestra presen",
+                               carray1, 65) );
+
+  is_04.clear();
+  state1 = is_04.rdstate();
+  is_04.getline(carray1, 120, '|');
+  state2 = is_04.rdstate();  
+  VERIFY( is_04.gcount() == 106 );
+  VERIFY( state1 != state2 );
+  VERIFY( state2 == stateeof );
+
+  is_04.clear();
+  state1 = is_04.rdstate();
+  is_04.getline(carray1, 100, '|');
+  state2 = is_04.rdstate();  
+  VERIFY( is_04.gcount() == 0 ); 
+  VERIFY( state1 != state2 );
+  VERIFY( static_cast<bool>(state2 & stateeof) );
+  VERIFY( static_cast<bool>(state2 & statefail) );
+}
+int 
+main()
+{
+  test02();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/getline/char/2.cc b/libstdc++-v3/testsuite/27_io/basic_istream/getline/char/2.cc
new file mode 100644 (file)
index 0000000..53b14a9
--- /dev/null
@@ -0,0 +1,103 @@
+// 1999-08-11 bkoz
+
+// Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation
+//
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.1.3 unformatted input functions
+// @require@ %-*.tst %-*.txt
+// @diff@ %-*.tst %-*.txt
+
+#include <cstring> // for strncmp,...
+#include <istream>
+#include <sstream>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+// [patch] bits/istream.tcc - getline(char_type*,streamsize,char_type)
+// http://gcc.gnu.org/ml/libstdc++/2000-07/msg00003.html
+void
+test05()
+{
+  const char* charray = "\n"
+"a\n"
+"aa\n"
+"aaa\n"
+"aaaa\n"
+"aaaaa\n"
+"aaaaaa\n"
+"aaaaaaa\n"
+"aaaaaaaa\n"
+"aaaaaaaaa\n"
+"aaaaaaaaaa\n"
+"aaaaaaaaaaa\n"
+"aaaaaaaaaaaa\n"
+"aaaaaaaaaaaaa\n"
+"aaaaaaaaaaaaaa\n";
+
+  bool test = true;
+  const std::streamsize it = 5;
+  std::streamsize br = 0;
+  char tmp[it];
+  std::stringbuf sb(charray, std::ios_base::in);
+  std::istream ifs(&sb);
+  std::streamsize blen = std::strlen(charray);
+  VERIFY(!(!ifs));
+  while(ifs.getline(tmp, it) || ifs.gcount())
+    {
+      br += ifs.gcount();
+      if(ifs.eof())
+        {
+          // Just sanity checks to make sure we've extracted the same
+          // number of chars that were in the streambuf
+          VERIFY(br == blen);
+          // Also, we should only set the failbit if we could
+          // _extract_ no chars from the stream, i.e. the first read
+          // returned EOF. 
+          VERIFY(ifs.fail() && ifs.gcount() == 0);
+        }
+      else if(ifs.fail())
+        {
+         // delimiter not read
+         //
+         // either
+         // -> extracted no characters
+         // or
+         // -> n - 1 characters are stored
+          ifs.clear(ifs.rdstate() & ~std::ios::failbit);
+          VERIFY((ifs.gcount() == 0) || (std::strlen(tmp) == it - 1));
+          VERIFY(!(!ifs));
+          continue;
+        }
+      else 
+        {
+         // delimiter was read.
+         //
+         // -> strlen(__s) < n - 1 
+         // -> delimiter was seen -> gcount() > strlen(__s)
+          VERIFY(ifs.gcount() == std::strlen(tmp) + 1);
+          continue;
+        }
+    }
+}
+
+int 
+main()
+{
+  test05();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/getline/char/3.cc b/libstdc++-v3/testsuite/27_io/basic_istream/getline/char/3.cc
new file mode 100644 (file)
index 0000000..f4627ef
--- /dev/null
@@ -0,0 +1,64 @@
+// 1999-08-11 bkoz
+
+// Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation
+//
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.1.3 unformatted input functions
+// @require@ %-*.tst %-*.txt
+// @diff@ %-*.tst %-*.txt
+
+#include <cstring> // for strncmp,...
+#include <istream>
+#include <sstream>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+// [bug] istream::getline(char*,streamsize) still broken
+// http://gcc.gnu.org/ml/libstdc++/2000-07/msg00126.html
+// brent verner <brent at rcfile dot org
+void
+test06()
+{
+  using namespace std;
+
+  bool test = true;
+  const streamsize it = 5;
+  char tmp[it];
+  const char* str_lit = "abcd\n";
+
+  stringbuf strbuf(str_lit, std::ios_base::in);
+  istream istr(&strbuf);
+  
+  istr.getline(tmp,it); 
+  VERIFY( istr.gcount() == it );  // extracted whole string
+  VERIFY( strlen(tmp) == 4 );     // stored all but '\n'
+  VERIFY( !istr.eof() );          // extracted up to but not eof
+  VERIFY( !istr.fail() );         // failbit not set
+  
+  char c = 'z';
+  istr.get(c);
+  VERIFY( c == 'z' );
+  VERIFY( istr.eof() );
+}
+
+int 
+main()
+{
+  test06();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/ignore/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_istream/ignore/char/1.cc
new file mode 100644 (file)
index 0000000..cc6a9a5
--- /dev/null
@@ -0,0 +1,84 @@
+// 1999-08-11 bkoz
+
+// Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation
+//
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.1.3 unformatted input functions
+// @require@ %-*.tst %-*.txt
+// @diff@ %-*.tst %-*.txt
+
+#include <cstring> // for strncmp,...
+#include <istream>
+#include <sstream>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+  typedef std::ios::traits_type traits_type;
+
+  bool test = true;
+  const std::string str_01;
+  const std::string str_02("soul eyes: john coltrane quartet");
+  std::string strtmp;
+
+  std::stringbuf isbuf_03(str_02, std::ios_base::in);
+  std::stringbuf isbuf_04(str_02, std::ios_base::in);
+
+  std::istream is_00(NULL);
+  std::istream is_03(&isbuf_03);
+  std::istream is_04(&isbuf_04);
+  std::ios_base::iostate state1, state2, statefail, stateeof;
+  statefail = std::ios_base::failbit;
+  stateeof = std::ios_base::eofbit;
+
+  // istream& read(char_type* s, streamsize n)
+  char carray[60] = "";
+  is_04.read(carray, 9);
+  VERIFY( is_04.peek() == ':' );
+
+  // istream& ignore(streamsize n = 1, int_type delim = traits::eof())
+  state1 = is_04.rdstate();
+  is_04.ignore();
+  VERIFY( is_04.gcount() == 1 );
+  state2 = is_04.rdstate();
+  VERIFY( state1 == state2 );
+  VERIFY( is_04.peek() == ' ' );
+
+  state1 = is_04.rdstate();
+  is_04.ignore(0);
+  VERIFY( is_04.gcount() == 0 );
+  state2 = is_04.rdstate();
+  VERIFY( state1 == state2 );
+  VERIFY( is_04.peek() == ' ' );
+
+  state1 = is_04.rdstate();
+  is_04.ignore(5, traits_type::to_int_type(' '));
+  VERIFY( is_04.gcount() == 1 );
+  state2 = is_04.rdstate();
+  VERIFY( state1 == state2 );
+  VERIFY( is_04.peek() == 'j' );
+}
+
+int 
+main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/ignore/char/6360.cc b/libstdc++-v3/testsuite/27_io/basic_istream/ignore/char/6360.cc
new file mode 100644 (file)
index 0000000..8e79620
--- /dev/null
@@ -0,0 +1,52 @@
+// 1999-08-11 bkoz
+
+// Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation
+//
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.1.3 unformatted input functions
+// @require@ %-*.tst %-*.txt
+// @diff@ %-*.tst %-*.txt
+
+#include <cstring> // for strncmp,...
+#include <istream>
+#include <sstream>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+// 2002-04-19 PR libstdc++ 6360
+void
+test08()
+{
+  using namespace std;
+  bool test = true;
+
+  stringstream ss("abcd" "\xFF" "1234ina donna coolbrith");  
+  char c;
+  ss >> c;
+  VERIFY( c == 'a' );
+  ss.ignore(8);
+  ss >> c;
+  VERIFY( c == 'i' );
+}
+
+int 
+main()
+{
+  test08();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/ignore/char/7220.cc b/libstdc++-v3/testsuite/27_io/basic_istream/ignore/char/7220.cc
new file mode 100644 (file)
index 0000000..87ac36a
--- /dev/null
@@ -0,0 +1,73 @@
+// 1999-08-11 bkoz
+
+// Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation
+//
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.1.3 unformatted input functions
+// @require@ %-*.tst %-*.txt
+// @diff@ %-*.tst %-*.txt
+
+#include <cstring> // for strncmp,...
+#include <istream>
+#include <sstream>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+// libstdc++/70220
+void
+test10()
+{
+  using namespace std;
+  bool test = true;
+  typedef string string_type;
+  typedef stringbuf stringbuf_type;
+  typedef istream istream_type;
+
+  int res = 0;
+  streamsize n;
+  string_type  input("abcdefg\n");
+  stringbuf_type sbuf(input);
+  istream_type  istr(&sbuf);
+  
+  istr.ignore(0);
+  if (istr.gcount() != 0) 
+    test = false;
+  VERIFY( test );
+  
+  istr.ignore(0, 'b');
+  if (istr.gcount() != 0) 
+    test = false;
+  VERIFY( test );
+  
+  istr.ignore();       // Advance to next position.
+  istr.ignore(0, 'b');
+  if ((n=istr.gcount()) != 0) 
+    test = false;
+  VERIFY( test );
+  
+  if (istr.peek() != 'b')
+    test = false;
+  VERIFY( test );
+}
+
+int 
+main()
+{
+  test10();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/peek/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_istream/peek/char/1.cc
new file mode 100644 (file)
index 0000000..53317ed
--- /dev/null
@@ -0,0 +1,98 @@
+// 1999-08-11 bkoz
+
+// Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation
+//
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.1.3 unformatted input functions
+// @require@ %-*.tst %-*.txt
+// @diff@ %-*.tst %-*.txt
+
+#include <cstring> // for strncmp,...
+#include <istream>
+#include <sstream>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+  typedef std::ios::traits_type traits_type;
+
+  bool test = true;
+  const std::string str_01;
+  const std::string str_02("soul eyes: john coltrane quartet");
+  std::string strtmp;
+
+  std::stringbuf isbuf_03(str_02, std::ios_base::in);
+  std::stringbuf isbuf_04(str_02, std::ios_base::in);
+
+  std::istream is_00(NULL);
+  std::istream is_03(&isbuf_03);
+  std::istream is_04(&isbuf_04);
+  std::ios_base::iostate state1, state2, statefail, stateeof;
+  statefail = std::ios_base::failbit;
+  stateeof = std::ios_base::eofbit;
+
+  char carray[60] = "";
+
+  // istream& ignore(streamsize n = 1, int_type delim = traits::eof())
+  is_04.read(carray, 9);
+  VERIFY( is_04.peek() == ':' );
+
+  state1 = is_04.rdstate();
+  is_04.ignore();
+  VERIFY( is_04.gcount() == 1 );
+  state2 = is_04.rdstate();
+  VERIFY( state1 == state2 );
+  VERIFY( is_04.peek() == ' ' );
+
+  state1 = is_04.rdstate();
+  is_04.ignore(0);
+  VERIFY( is_04.gcount() == 0 );
+  state2 = is_04.rdstate();
+  VERIFY( state1 == state2 );
+  VERIFY( is_04.peek() == ' ' );
+
+  state1 = is_04.rdstate();
+  is_04.ignore(5, traits_type::to_int_type(' '));
+  VERIFY( is_04.gcount() == 1 );
+  state2 = is_04.rdstate();
+  VERIFY( state1 == state2 );
+  VERIFY( is_04.peek() == 'j' );
+
+  // int_type peek()
+  state1 = is_04.rdstate();
+  VERIFY( is_04.peek() == 'j' );
+  VERIFY( is_04.gcount() == 0 );
+  state2 = is_04.rdstate();
+  VERIFY( state1 == state2 );
+
+  is_04.ignore(30);
+  state1 = is_04.rdstate();
+  VERIFY( is_04.peek() == traits_type::eof() );
+  VERIFY( is_04.gcount() == 0 );
+  state2 = is_04.rdstate();
+  VERIFY( state1 != state2 );
+}
+
+int 
+main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/peek/char/6414.cc b/libstdc++-v3/testsuite/27_io/basic_istream/peek/char/6414.cc
new file mode 100644 (file)
index 0000000..4fbd5cc
--- /dev/null
@@ -0,0 +1,51 @@
+// 2000-06-29 bkoz
+
+// Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation
+//
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.1.3 unformatted input functions
+// NB: ostream has a particular "seeks" category. Adopt this for istreams too.
+// @require@ %-*.tst %-*.txt
+// @diff@ %-*.tst %-*.txt
+
+#include <istream>
+#include <sstream>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+// fstreams
+void test04(void)
+{
+  bool test = true;
+  std::istream::pos_type pos01, pos02, pos03, pos04, pos05, pos06;
+  const char str_lit01[] = "istream_seeks-1.txt";
+  std::ifstream if01(str_lit01, std::ios_base::in | std::ios_base::out);
+  // libstdc++/6414
+  if01.seekg(0, std::ios_base::beg);
+  pos01 = if01.tellg();
+  if01.peek();
+  pos02 = if01.tellg();
+  VERIFY( pos02 == pos01 );
+}
+
+int main()
+{
+  test04();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/putback/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_istream/putback/char/1.cc
new file mode 100644 (file)
index 0000000..17b55d8
--- /dev/null
@@ -0,0 +1,80 @@
+// 1999-08-11 bkoz
+
+// Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation
+//
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.1.3 unformatted input functions
+// @require@ %-*.tst %-*.txt
+// @diff@ %-*.tst %-*.txt
+
+#include <cstring> // for strncmp,...
+#include <istream>
+#include <sstream>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+  typedef std::ios::traits_type traits_type;
+
+  bool test = true;
+  const std::string str_01;
+  const std::string str_02("soul eyes: john coltrane quartet");
+  std::string strtmp;
+
+  std::stringbuf isbuf_03(str_02, std::ios_base::in);
+  std::stringbuf isbuf_04(str_02, std::ios_base::in);
+
+  std::istream is_00(NULL);
+  std::istream is_03(&isbuf_03);
+  std::istream is_04(&isbuf_04);
+  std::ios_base::iostate state1, state2, statefail, stateeof;
+  statefail = std::ios_base::failbit;
+  stateeof = std::ios_base::eofbit;
+
+  char carray[60] = "";
+
+  // istream& putback(char c)
+  is_04.ignore(30);
+  is_04.clear();
+  state1 = is_04.rdstate();
+  is_04.putback('|');
+  VERIFY( is_04.gcount() == 0 );
+  state2 = is_04.rdstate();
+  VERIFY( state1 == state2 );
+  VERIFY( is_04.peek() == '|' );
+
+  // istream& unget()
+  is_04.clear();
+  state1 = is_04.rdstate();
+  is_04.unget();
+  VERIFY( is_04.gcount() == 0 );
+  state2 = is_04.rdstate();
+  VERIFY( state1 == state2 );
+  VERIFY( is_04.peek() == 'r' );
+  
+  // int sync()
+  int i = is_00.sync();
+}
+
+int 
+main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/read/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_istream/read/char/1.cc
new file mode 100644 (file)
index 0000000..e79e4a2
--- /dev/null
@@ -0,0 +1,79 @@
+// 1999-08-11 bkoz
+
+// Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation
+//
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.1.3 unformatted input functions
+// @require@ %-*.tst %-*.txt
+// @diff@ %-*.tst %-*.txt
+
+#include <cstring> // for strncmp,...
+#include <istream>
+#include <sstream>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+  typedef std::ios::traits_type traits_type;
+
+  bool test = true;
+  const std::string str_01;
+  const std::string str_02("soul eyes: john coltrane quartet");
+  std::string strtmp;
+
+  std::stringbuf isbuf_03(str_02, std::ios_base::in);
+  std::stringbuf isbuf_04(str_02, std::ios_base::in);
+
+  std::istream is_00(NULL);
+  std::istream is_03(&isbuf_03);
+  std::istream is_04(&isbuf_04);
+  std::ios_base::iostate state1, state2, statefail, stateeof;
+  statefail = std::ios_base::failbit;
+  stateeof = std::ios_base::eofbit;
+
+  // istream& read(char_type* s, streamsize n)
+  char carray[60] = "";
+  state1 = is_04.rdstate();
+  is_04.read(carray, 0);
+  state2 = is_04.rdstate();
+  VERIFY( state1 == state2 );
+
+  state1 = is_04.rdstate();
+  is_04.read(carray, 9);
+  state2 = is_04.rdstate();
+  VERIFY( state1 == state2 );
+  VERIFY( !std::strncmp(carray, "soul eyes", 9) );
+  VERIFY( is_04.peek() == ':' );
+
+  state1 = is_03.rdstate();
+  is_03.read(carray, 60);
+  state2 = is_03.rdstate();
+  VERIFY( state1 != state2 );
+  VERIFY( static_cast<bool>(state2 & stateeof) ); 
+  VERIFY( static_cast<bool>(state2 & statefail) ); 
+  VERIFY( !std::strncmp(carray, "soul eyes: john coltrane quartet", 35) );
+}
+
+int 
+main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/read/char/2.cc b/libstdc++-v3/testsuite/27_io/basic_istream/read/char/2.cc
new file mode 100644 (file)
index 0000000..4133e1a
--- /dev/null
@@ -0,0 +1,63 @@
+// 1999-08-11 bkoz
+
+// Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation
+//
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.1.3 unformatted input functions
+// @require@ %-*.tst %-*.txt
+// @diff@ %-*.tst %-*.txt
+
+#include <cstring> // for strncmp,...
+#include <istream>
+#include <sstream>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+// Jim Parsons <parsons at clearway dot com>
+// http://gcc.gnu.org/ml/libstdc++/2000-q1/msg00177.html
+void
+test04()
+{
+  bool test = true;
+
+  const std::string str_00("Red_Garland_Qunitet-Soul_Junction");
+  std::string strtmp;
+  char c_array[str_00.size() + 4];
+
+  std::stringbuf isbuf_00(str_00, std::ios_base::in);
+  std::istream is_00(&isbuf_00);
+  std::ios_base::iostate state1, state2, statefail, stateeof;
+  statefail = std::ios_base::failbit;
+  stateeof = std::ios_base::eofbit;
+
+  state1 = stateeof | statefail;
+  VERIFY( is_00.gcount() == 0 );
+  is_00.read(c_array, str_00.size() + 1);
+  VERIFY( is_00.gcount() == str_00.size() );
+  VERIFY( is_00.rdstate() == state1 );
+
+  is_00.read(c_array, str_00.size());
+  VERIFY( is_00.rdstate() == state1 );
+}
+int 
+main()
+{
+  test04();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/read/char/3.cc b/libstdc++-v3/testsuite/27_io/basic_istream/read/char/3.cc
new file mode 100644 (file)
index 0000000..3c418e9
--- /dev/null
@@ -0,0 +1,51 @@
+// 1999-08-11 bkoz
+
+// Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation
+//
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.1.3 unformatted input functions
+// @require@ %-*.tst %-*.txt
+// @diff@ %-*.tst %-*.txt
+
+#include <cstring> // for strncmp,...
+#include <istream>
+#include <sstream>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+// Theodore Papadopoulo 
+void 
+test09()
+{
+  using namespace std;
+  bool test = true;
+
+  istringstream iss("Juana Briones");
+  char tab[13];
+  iss.read(tab, 13);
+  if (!iss)
+    test = false;
+  VERIFY( test );
+}
+int 
+main()
+{
+  test09();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/readsome/char/6746-1.cc b/libstdc++-v3/testsuite/27_io/basic_istream/readsome/char/6746-1.cc
new file mode 100644 (file)
index 0000000..f0109b0
--- /dev/null
@@ -0,0 +1,60 @@
+// 1999-08-11 bkoz
+
+// Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation
+//
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.1.3 unformatted input functions
+// @require@ %-*.tst %-*.txt
+// @diff@ %-*.tst %-*.txt
+
+#include <cstring> // for strncmp,...
+#include <istream>
+#include <sstream>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+// libstdc++/6746   
+void test12()
+{
+  using namespace std;
+  bool test = true;
+  streamsize sum = 0;
+  istringstream iss("shamma shamma");
+      
+  // test01
+  size_t i = iss.rdbuf()->in_avail();
+  VERIFY( i != 0 );
+    
+  // test02
+  streamsize extracted;
+  do
+    {
+      char buf[1024];
+      extracted = iss.readsome(buf, sizeof buf);
+      sum += extracted;
+    }
+  while (iss.good() && extracted);
+  VERIFY( sum != 0 );  
+}
+
+int 
+main()
+{
+  test12();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/readsome/char/6746-2.cc b/libstdc++-v3/testsuite/27_io/basic_istream/readsome/char/6746-2.cc
new file mode 100644 (file)
index 0000000..6d87a29
--- /dev/null
@@ -0,0 +1,60 @@
+// 1999-08-11 bkoz
+
+// Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation
+//
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.1.3 unformatted input functions
+// @require@ %-*.tst %-*.txt
+// @diff@ %-*.tst %-*.txt
+
+#include <cstring> // for strncmp,...
+#include <istream>
+#include <sstream>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+// libstdc++/6746   
+void test13()
+{
+  using namespace std;
+  bool test = true;
+  streamsize sum = 0;
+  ifstream ifs("istream_unformatted-1.tst");
+      
+  // test01
+  size_t i = ifs.rdbuf()->in_avail();
+  VERIFY( i != 0 );
+    
+  // test02
+  streamsize extracted;
+  do
+    {
+      char buf[1024];
+      extracted = ifs.readsome(buf, sizeof buf);
+      sum += extracted;
+    }
+  while (ifs.good() && extracted);
+  VERIFY( sum != 0 );  
+}
+int 
+main()
+{
+  test13();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/readsome/char/8258.cc b/libstdc++-v3/testsuite/27_io/basic_istream/readsome/char/8258.cc
new file mode 100644 (file)
index 0000000..fdb412c
--- /dev/null
@@ -0,0 +1,53 @@
+// 1999-08-11 bkoz
+
+// Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation
+//
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.1.3 unformatted input functions
+// @require@ %-*.tst %-*.txt
+// @diff@ %-*.tst %-*.txt
+
+#include <cstring> // for strncmp,...
+#include <istream>
+#include <sstream>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+// libstdc++/8258
+class mybuf : public std::basic_streambuf<char> 
+{ };
+
+void test11()
+{
+  bool test = true;
+  using namespace std;
+  char arr[10];
+  mybuf sbuf;
+  basic_istream<char, char_traits<char> > istr(&sbuf);
+  
+  VERIFY(istr.rdstate() == ios_base::goodbit);
+  VERIFY(istr.readsome(arr, 10) == 0);
+  VERIFY(istr.rdstate() == ios_base::goodbit);
+}
+int 
+main()
+{
+  test11();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/seekg/char/2346-fstream.cc b/libstdc++-v3/testsuite/27_io/basic_istream/seekg/char/2346-fstream.cc
new file mode 100644 (file)
index 0000000..4c4b25c
--- /dev/null
@@ -0,0 +1,90 @@
+// 2000-06-29 bkoz
+
+// Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation
+//
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.1.3 unformatted input functions
+// NB: ostream has a particular "seeks" category. Adopt this for istreams too.
+// @require@ %-*.tst %-*.txt
+// @diff@ %-*.tst %-*.txt
+
+#include <istream>
+#include <sstream>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+const char* s = " lootpack, peanut butter wolf, rob swift, madlib, quasimoto";
+const int times = 10;
+
+void write_rewind(std::iostream& stream)
+{
+  for (int j = 0; j < times; j++) 
+    {
+      bool test = true;
+      std::streampos begin = stream.tellg();
+      
+      for (int i = 0; i < times; ++i)
+       stream << j << '-' << i << s << '\n';
+      
+      stream.seekg(begin);
+      std::streampos end = stream.tellg(); 
+      std::streampos badpos = std::streampos(std::streambuf::off_type(-1));
+    }
+}
+
+void check_contents(std::iostream& stream)
+{
+  bool test = true;
+
+  stream.clear();
+  stream.seekg(0, std::ios::beg);
+  int i = 0;
+  int loop = times * times + 2;
+  while (i < loop)
+    {
+      stream.ignore(80, '\n');
+      if (stream.good())
+       ++i;
+      else
+       break;
+    }
+  VERIFY( i == times );
+}
+
+// fstream
+// libstdc++/2346
+void test02()
+{       
+  std::fstream ofstrm;
+  ofstrm.open("istream_seeks-3.txt", std::ios::out);
+  if (!ofstrm)
+    std::abort();
+  write_rewind(ofstrm);
+  ofstrm.close();
+
+  std::fstream ifstrm;
+  ifstrm.open("istream_seeks-3.txt", std::ios::in);
+  check_contents(ifstrm);
+  ifstrm.close();
+}
+
+int main()
+{
+  test02();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/seekg/char/2346-sstream.cc b/libstdc++-v3/testsuite/27_io/basic_istream/seekg/char/2346-sstream.cc
new file mode 100644 (file)
index 0000000..ab35ddb
--- /dev/null
@@ -0,0 +1,83 @@
+// 2000-06-29 bkoz
+
+// Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation
+//
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.1.3 unformatted input functions
+// NB: ostream has a particular "seeks" category. Adopt this for istreams too.
+// @require@ %-*.tst %-*.txt
+// @diff@ %-*.tst %-*.txt
+
+#include <istream>
+#include <sstream>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+const char* s = " lootpack, peanut butter wolf, rob swift, madlib, quasimoto";
+const int times = 10;
+
+void write_rewind(std::iostream& stream)
+{
+  for (int j = 0; j < times; j++) 
+    {
+      bool test = true;
+      std::streampos begin = stream.tellg();
+      
+      for (int i = 0; i < times; ++i)
+       stream << j << '-' << i << s << '\n';
+      
+      stream.seekg(begin);
+      std::streampos end = stream.tellg(); 
+      std::streampos badpos = std::streampos(std::streambuf::off_type(-1));
+    }
+}
+
+void check_contents(std::iostream& stream)
+{
+  bool test = true;
+
+  stream.clear();
+  stream.seekg(0, std::ios::beg);
+  int i = 0;
+  int loop = times * times + 2;
+  while (i < loop)
+    {
+      stream.ignore(80, '\n');
+      if (stream.good())
+       ++i;
+      else
+       break;
+    }
+  VERIFY( i == times );
+}
+
+// stringstream
+// libstdc++/2346
+void test03()
+{       
+  std::stringstream sstrm;
+
+  write_rewind(sstrm);
+  check_contents(sstrm);
+}
+
+int main()
+{
+  test03();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/seekg/char/8348-1.cc b/libstdc++-v3/testsuite/27_io/basic_istream/seekg/char/8348-1.cc
new file mode 100644 (file)
index 0000000..823e237
--- /dev/null
@@ -0,0 +1,55 @@
+// 2000-06-29 bkoz
+
+// Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation
+//
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.1.3 unformatted input functions
+// NB: ostream has a particular "seeks" category. Adopt this for istreams too.
+// @require@ %-*.tst %-*.txt
+// @diff@ %-*.tst %-*.txt
+
+#include <istream>
+#include <sstream>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+// libstdc++/8348
+void test06(void)
+{
+  using namespace std;
+  bool test = true;
+  string num1("555");
+
+  // seekg
+  {
+    istringstream iss(num1);
+    istream::pos_type pos1 = iss.tellg();
+    int asNum = 0;
+    iss >> asNum;
+    VERIFY( test = iss.eof() );
+    VERIFY( test = !iss.fail() );
+    iss.seekg(pos1);
+    VERIFY( test = !iss.fail() );
+  }
+}
+
+int main()
+{
+  test06();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/seekg/char/8348-2.cc b/libstdc++-v3/testsuite/27_io/basic_istream/seekg/char/8348-2.cc
new file mode 100644 (file)
index 0000000..aeed532
--- /dev/null
@@ -0,0 +1,55 @@
+// 2000-06-29 bkoz
+
+// Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation
+//
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.1.3 unformatted input functions
+// NB: ostream has a particular "seeks" category. Adopt this for istreams too.
+// @require@ %-*.tst %-*.txt
+// @diff@ %-*.tst %-*.txt
+
+#include <istream>
+#include <sstream>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+// libstdc++/8348
+void test06(void)
+{
+  using namespace std;
+  bool test = true;
+  string num1("555");
+
+  // seekg
+  {
+    istringstream iss(num1);
+    istream::pos_type pos1 = iss.tellg();
+    int asNum = 0;
+    iss >> asNum;
+    VERIFY( test = iss.eof() );
+    VERIFY( test = !iss.fail() );
+    iss.seekg(0, ios_base::beg);
+    VERIFY( test = !iss.fail() );
+  }
+}
+
+int main()
+{
+  test06();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/seekg/char/fstream.cc b/libstdc++-v3/testsuite/27_io/basic_istream/seekg/char/fstream.cc
new file mode 100644 (file)
index 0000000..27dca74
--- /dev/null
@@ -0,0 +1,127 @@
+// 2000-06-29 bkoz
+
+// Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation
+//
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.1.3 unformatted input functions
+// NB: ostream has a particular "seeks" category. Adopt this for istreams too.
+// @require@ %-*.tst %-*.txt
+// @diff@ %-*.tst %-*.txt
+
+#include <istream>
+#include <sstream>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+// fstreams
+void test04(void)
+{
+  typedef std::istream::off_type off_type;
+
+  bool test = true;
+  std::istream::pos_type pos01, pos02, pos03, pos04, pos05, pos06;
+  std::ios_base::iostate state01, state02;
+  const char str_lit01[] = "istream_seeks-1.txt";
+  const char str_lit02[] = "istream_seeks-2.txt";
+  std::ifstream if01(str_lit01, std::ios_base::in | std::ios_base::out);
+  std::ifstream if02(str_lit01, std::ios_base::in);
+  std::ifstream if03(str_lit02, std::ios_base::out | std::ios_base::trunc); 
+  VERIFY( if01.good() );
+  VERIFY( if02.good() );
+  VERIFY( if03.good() );
+
+  std::istream is01(if01.rdbuf());
+  std::istream is02(if02.rdbuf());
+  std::istream is03(if03.rdbuf());
+
+  pos01 = is01.tellg();
+  pos02 = is01.tellg();
+  pos03 = is02.tellg();
+  pos04 = is02.tellg();
+  pos05 = is03.tellg();
+  pos06 = is03.tellg();
+
+  // istream& seekg(pos_type)
+  // istream& seekg(off_type, ios_base::seekdir)
+
+  // cur 
+  // NB: see library issues list 136. It's the v-3 interp that seekg
+  // only sets the input buffer, or else istreams with buffers that
+  // have _M_mode == ios_base::out will fail to have consistency
+  // between seekg and tellg.
+  state01 = is01.rdstate();
+  is01.seekg(10, std::ios_base::cur);
+  state02 = is01.rdstate();
+  pos01 = is01.tellg(); 
+  VERIFY( pos01 == pos02 + off_type(10) ); 
+  VERIFY( state01 == state02 );
+  pos02 = is01.tellg(); 
+  VERIFY( pos02 == pos01 ); 
+
+  state01 = is02.rdstate();
+  is02.seekg(10, std::ios_base::cur);
+  state02 = is02.rdstate();
+  pos03 = is02.tellg(); 
+  VERIFY( pos03 == pos04 + off_type(10) ); 
+  VERIFY( state01 == state02 );
+  pos04 = is02.tellg(); 
+  VERIFY( pos03 == pos04 ); 
+
+  state01 = is03.rdstate();
+  is03.seekg(10, std::ios_base::cur);
+  state02 = is03.rdstate();
+  pos05 = is03.tellg(); 
+  VERIFY( pos05 == pos06 + off_type(10) ); 
+  VERIFY( state01 == state02 );
+  pos06 = is03.tellg(); 
+  VERIFY( pos05 == pos06 ); 
+
+  // beg
+  state01 = is01.rdstate();
+  is01.seekg(20, std::ios_base::beg);
+  state02 = is01.rdstate();
+  pos01 = is01.tellg(); 
+  VERIFY( pos01 == pos02 + off_type(10) ); 
+  VERIFY( state01 == state02 );
+  pos02 = is01.tellg(); 
+  VERIFY( pos02 == pos01 ); 
+
+  state01 = is02.rdstate();
+  is02.seekg(20, std::ios_base::beg);
+  state02 = is02.rdstate();
+  pos03 = is02.tellg(); 
+  VERIFY( pos03 == pos04 + off_type(10) ); 
+  VERIFY( state01 == state02 );
+  pos04 = is02.tellg(); 
+  VERIFY( pos03 == pos04 ); 
+
+  state01 = is03.rdstate();
+  is03.seekg(20, std::ios_base::beg);
+  state02 = is03.rdstate();
+  pos05 = is03.tellg(); 
+  VERIFY( pos05 == pos06 + off_type(10) );
+  VERIFY( state01 == state02 );
+  pos06 = is03.tellg(); 
+  VERIFY( pos05 == pos06 );
+}
+
+int main()
+{
+  test04();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/seekg/char/sstream.cc b/libstdc++-v3/testsuite/27_io/basic_istream/seekg/char/sstream.cc
new file mode 100644 (file)
index 0000000..cf1455f
--- /dev/null
@@ -0,0 +1,135 @@
+// 2000-06-29 bkoz
+
+// Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation
+//
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.1.3 unformatted input functions
+// NB: ostream has a particular "seeks" category. Adopt this for istreams too.
+// @require@ %-*.tst %-*.txt
+// @diff@ %-*.tst %-*.txt
+
+#include <istream>
+#include <sstream>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+// stringstreams
+void test05(void)
+{
+  typedef std::istream::off_type off_type;
+
+  bool test = true;
+  std::istream::pos_type pos01, pos02, pos03, pos04, pos05, pos06;
+  std::ios_base::iostate state01, state02;
+  const char str_lit01[] = "istream_seeks-1.tst";
+  std::ifstream if01(str_lit01);
+  std::ifstream if02(str_lit01);
+  std::ifstream if03(str_lit01);
+  VERIFY( if01.good() );
+  VERIFY( if02.good() );
+  VERIFY( if03.good() );
+
+  std::stringbuf strbuf01(std::ios_base::in | std::ios_base::out);
+  if01 >> &strbuf01; 
+  // initialize stringbufs that are ios_base::out
+  std::stringbuf strbuf03(strbuf01.str(), std::ios_base::out);
+  // initialize stringbufs that are ios_base::in
+  std::stringbuf strbuf02(strbuf01.str(), std::ios_base::in);
+
+  std::istream is01(&strbuf01);
+  std::istream is02(&strbuf02);
+  std::istream is03(&strbuf03);
+
+  // pos_type tellg()
+  // in | out
+  pos01 = is01.tellg();
+  pos02 = is01.tellg();
+  pos03 = is02.tellg();
+  pos04 = is02.tellg();
+  pos05 = is03.tellg();
+  pos06 = is03.tellg();
+
+  // istream& seekg(pos_type)
+  // istream& seekg(off_type, ios_base::seekdir)
+
+  // cur 
+  // NB: see library issues list 136. It's the v-3 interp that seekg
+  // only sets the input buffer, or else istreams with buffers that
+  // have _M_mode == ios_base::out will fail to have consistency
+  // between seekg and tellg.
+  state01 = is01.rdstate();
+  is01.seekg(10, std::ios_base::cur);
+  state02 = is01.rdstate();
+  pos01 = is01.tellg(); 
+  VERIFY( pos01 == pos02 + off_type(10) ); 
+  VERIFY( state01 == state02 );
+  pos02 = is01.tellg(); 
+  VERIFY( pos02 == pos01 ); 
+
+  state01 = is02.rdstate();
+  is02.seekg(10, std::ios_base::cur);
+  state02 = is02.rdstate();
+  pos03 = is02.tellg(); 
+  VERIFY( pos03 == pos04 + off_type(10) ); 
+  VERIFY( state01 == state02 );
+  pos04 = is02.tellg(); 
+  VERIFY( pos03 == pos04 ); 
+
+  state01 = is03.rdstate();
+  is03.seekg(10, std::ios_base::cur);
+  state02 = is03.rdstate();
+  pos05 = is03.tellg(); 
+  VERIFY( pos05 == pos06 ); // as only out buffer 
+  VERIFY( state01 != state02 );
+  pos06 = is03.tellg(); 
+  VERIFY( pos05 == pos06 ); 
+
+  // beg
+  state01 = is01.rdstate();
+  is01.seekg(20, std::ios_base::beg);
+  state02 = is01.rdstate();
+  pos01 = is01.tellg(); 
+  VERIFY( pos01 == pos02 + off_type(10) ); 
+  VERIFY( state01 == state02 );
+  pos02 = is01.tellg(); 
+  VERIFY( pos02 == pos01 ); 
+
+  state01 = is02.rdstate();
+  is02.seekg(20, std::ios_base::beg);
+  state02 = is02.rdstate();
+  pos03 = is02.tellg(); 
+  VERIFY( pos03 == pos04 + off_type(10) ); 
+  VERIFY( state01 == state02 );
+  pos04 = is02.tellg(); 
+  VERIFY( pos03 == pos04 ); 
+
+  state01 = is03.rdstate();
+  is03.seekg(20, std::ios_base::beg);
+  state02 = is03.rdstate();
+  pos05 = is03.tellg(); 
+  VERIFY( pos05 == pos06 ); // as only out buffer 
+  VERIFY( state01 == state02 );
+  pos06 = is03.tellg(); 
+  VERIFY( pos05 == pos06 ); 
+}
+
+int main()
+{
+  test05();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/sentry/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_istream/sentry/char/1.cc
new file mode 100644 (file)
index 0000000..1bc58ad
--- /dev/null
@@ -0,0 +1,66 @@
+// 1999-10-14 bkoz
+
+// Copyright (C) 1999, 2001, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.6.1.1.2 class basic_istream::sentry
+
+#include <istream>
+#include <sstream>
+#include <testsuite_hooks.h>
+
+void test01()
+{
+  bool test = true;
+  const char* lit01 = "stereolab on the bolsinga tip";
+  const std::string str01(lit01);
+
+  std::stringbuf strbuf01;
+  std::stringbuf strbuf02(str01);
+  std::istream istr01(&strbuf01);
+  std::istream istr02(&strbuf02);
+  
+  // test negatives
+  std::istream::sentry sentry01(istr01);       
+  VERIFY( bool(sentry01) == false ); 
+
+  std::istream::sentry sentry02(istr01, true);
+  VERIFY( bool(sentry02) == false ); 
+
+  // positive tests
+  std::istream::sentry sentry03(istr02);       
+  VERIFY( bool(sentry03) == true ); 
+
+  std::istream::sentry sentry04(istr02, true);
+  VERIFY( bool(sentry04) == true ); 
+}
+
+int main() 
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/sentry/char/2.cc b/libstdc++-v3/testsuite/27_io/basic_istream/sentry/char/2.cc
new file mode 100644 (file)
index 0000000..1e42d18
--- /dev/null
@@ -0,0 +1,60 @@
+// 1999-10-14 bkoz
+
+// Copyright (C) 1999, 2001, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.6.1.1.2 class basic_istream::sentry
+
+#include <istream>
+#include <sstream>
+#include <testsuite_hooks.h>
+
+// libstdc++/944
+void 
+test02()
+{
+  using namespace std;
+  istringstream in("80.21 56.89 12.3");
+  bool test = true;
+  int i = 0;
+  double x;
+
+  // ios_base::eof == 2
+  while (in >> x)
+    {
+      ++i;
+      if (i > 3) 
+       break;
+    }
+  VERIFY( i == 3 );
+}    
+
+int main() 
+{
+  test02();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/sentry/char/3.cc b/libstdc++-v3/testsuite/27_io/basic_istream/sentry/char/3.cc
new file mode 100644 (file)
index 0000000..9f9e06a
--- /dev/null
@@ -0,0 +1,53 @@
+// 1999-10-14 bkoz
+
+// Copyright (C) 1999, 2001, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.6.1.1.2 class basic_istream::sentry
+
+#include <istream>
+#include <sstream>
+#include <testsuite_hooks.h>
+
+// libstdc++/9562
+void
+test03()
+{
+  bool test = true;
+
+  std::stringbuf strbuf01;
+  std::istream strm1(&strbuf01);
+  const std::istream::sentry sentry1(strm1);
+
+  VERIFY( bool(sentry1) == false );
+}
+
+int main() 
+{
+  test03();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/sentry/char/3983-fstream.cc b/libstdc++-v3/testsuite/27_io/basic_istream/sentry/char/3983-fstream.cc
new file mode 100644 (file)
index 0000000..99dd0b0
--- /dev/null
@@ -0,0 +1,189 @@
+// 2001-06-05 Benjamin Kosnik  <bkoz@redhat.com>
+
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.4.2.1.6 class ios_base::init
+
+#include <fstream>
+#include <testsuite_hooks.h>
+
+// char_traits specialization
+namespace std
+{
+  template<>
+    struct char_traits<unsigned char>
+    {
+      typedef unsigned char    char_type;
+      // Unsigned as wint_t in unsigned.
+      typedef unsigned long    int_type;
+      typedef streampos        pos_type;
+      typedef streamoff        off_type;
+      typedef mbstate_t        state_type;
+      
+      static void 
+      assign(char_type& __c1, const char_type& __c2)
+      { __c1 = __c2; }
+
+      static bool 
+      eq(const char_type& __c1, const char_type& __c2)
+      { return __c1 == __c2; }
+
+      static bool 
+      lt(const char_type& __c1, const char_type& __c2)
+      { return __c1 < __c2; }
+
+      static int 
+      compare(const char_type* __s1, const char_type* __s2, size_t __n)
+      { 
+       for (size_t __i = 0; __i < __n; ++__i)
+         if (!eq(__s1[__i], __s2[__i]))
+           return lt(__s1[__i], __s2[__i]) ? -1 : 1;
+       return 0; 
+      }
+
+      static size_t
+      length(const char_type* __s)
+      { 
+       const char_type* __p = __s; 
+       while (__p && *__p) 
+         ++__p; 
+       return (__p - __s); 
+      }
+
+      static const char_type* 
+      find(const char_type* __s, size_t __n, const char_type& __a)
+      { 
+       for (const char_type* __p = __s; size_t(__p - __s) < __n; ++__p)
+         if (*__p == __a) return __p;
+       return 0;
+      }
+
+      static char_type* 
+      move(char_type* __s1, const char_type* __s2, size_t __n)
+      { return (char_type*) memmove(__s1, __s2, __n * sizeof(char_type)); }
+
+      static char_type* 
+      copy(char_type* __s1, const char_type* __s2, size_t __n)
+      { return (char_type*) memcpy(__s1, __s2, __n * sizeof(char_type)); }
+
+      static char_type* 
+      assign(char_type* __s, size_t __n, char_type __a)
+      { 
+       for (char_type* __p = __s; __p < __s + __n; ++__p) 
+         assign(*__p, __a);
+        return __s; 
+      }
+
+      static char_type 
+      to_char_type(const int_type& __c)
+      { return char_type(); }
+
+      static int_type 
+      to_int_type(const char_type& __c) { return int_type(); }
+
+      static bool 
+      eq_int_type(const int_type& __c1, const int_type& __c2)
+      { return __c1 == __c2; }
+
+      static int_type 
+      eof() { return static_cast<int_type>(-1); }
+
+      static int_type 
+      not_eof(const int_type& __c)
+      { return eq_int_type(__c, eof()) ? int_type(0) : __c; }
+    };
+} // namespace std
+
+// libstdc++/3983
+// Sentry uses locale info, so have to try one formatted input/output.
+void test03()
+{
+  using namespace std;
+  bool test = true;
+
+  // input streams
+  basic_ifstream<unsigned char> ifs_uc;
+  unsigned char arr[6] = { 'a', 'b', 'c', 'd', 'e' };
+
+  try 
+    { 
+      int i;
+      ifs_uc >> i;
+    }
+  catch (bad_cast& obj)
+    { }
+  catch (exception& obj)
+    { test = false; }
+  
+  try 
+    { 
+      ifs_uc >> arr;
+    }
+  catch (bad_cast& obj)
+    { }
+  catch (exception& obj)
+    { test = false; }
+  
+  try 
+    { 
+      ifs_uc >> ws;
+    }
+  catch (bad_cast& obj)
+    { }
+  catch (exception& obj)
+    { test = false; }
+  try 
+    { 
+      basic_string<unsigned char> s_uc(arr);
+      ifs_uc >> s_uc;
+    }
+  catch (bad_cast& obj)
+    { }
+  catch (exception& obj)
+    { test = false; }
+   
+  VERIFY( test );
+}
+
+#if !__GXX_WEAK__
+// Explicitly instantiate for systems with no COMDAT or weak support.
+template 
+  std::basic_string<unsigned char>::size_type 
+  std::basic_string<unsigned char>::_Rep::_S_max_size;
+
+template 
+  unsigned char
+  std::basic_string<unsigned char>::_Rep::_S_terminal;
+#endif
+
+int main()
+{
+  test03();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/sentry/char/3983-sstream.cc b/libstdc++-v3/testsuite/27_io/basic_istream/sentry/char/3983-sstream.cc
new file mode 100644 (file)
index 0000000..6f51df5
--- /dev/null
@@ -0,0 +1,189 @@
+// 2001-06-05 Benjamin Kosnik  <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.4.2.1.6 class ios_base::init
+
+#include <sstream>
+#include <testsuite_hooks.h>
+
+// char_traits specialization
+namespace std
+{
+  template<>
+    struct char_traits<unsigned char>
+    {
+      typedef unsigned char    char_type;
+      // Unsigned as wint_t in unsigned.
+      typedef unsigned long    int_type;
+      typedef streampos        pos_type;
+      typedef streamoff        off_type;
+      typedef mbstate_t        state_type;
+      
+      static void 
+      assign(char_type& __c1, const char_type& __c2)
+      { __c1 = __c2; }
+
+      static bool 
+      eq(const char_type& __c1, const char_type& __c2)
+      { return __c1 == __c2; }
+
+      static bool 
+      lt(const char_type& __c1, const char_type& __c2)
+      { return __c1 < __c2; }
+
+      static int 
+      compare(const char_type* __s1, const char_type* __s2, size_t __n)
+      { 
+       for (size_t __i = 0; __i < __n; ++__i)
+         if (!eq(__s1[__i], __s2[__i]))
+           return lt(__s1[__i], __s2[__i]) ? -1 : 1;
+       return 0; 
+      }
+
+      static size_t
+      length(const char_type* __s)
+      { 
+       const char_type* __p = __s; 
+       while (__p && *__p) 
+         ++__p; 
+       return (__p - __s); 
+      }
+
+      static const char_type* 
+      find(const char_type* __s, size_t __n, const char_type& __a)
+      { 
+       for (const char_type* __p = __s; size_t(__p - __s) < __n; ++__p)
+         if (*__p == __a) return __p;
+       return 0;
+      }
+
+      static char_type* 
+      move(char_type* __s1, const char_type* __s2, size_t __n)
+      { return (char_type*) memmove(__s1, __s2, __n * sizeof(char_type)); }
+
+      static char_type* 
+      copy(char_type* __s1, const char_type* __s2, size_t __n)
+      { return (char_type*) memcpy(__s1, __s2, __n * sizeof(char_type)); }
+
+      static char_type* 
+      assign(char_type* __s, size_t __n, char_type __a)
+      { 
+       for (char_type* __p = __s; __p < __s + __n; ++__p) 
+         assign(*__p, __a);
+        return __s; 
+      }
+
+      static char_type 
+      to_char_type(const int_type& __c)
+      { return char_type(); }
+
+      static int_type 
+      to_int_type(const char_type& __c) { return int_type(); }
+
+      static bool 
+      eq_int_type(const int_type& __c1, const int_type& __c2)
+      { return __c1 == __c2; }
+
+      static int_type 
+      eof() { return static_cast<int_type>(-1); }
+
+      static int_type 
+      not_eof(const int_type& __c)
+      { return eq_int_type(__c, eof()) ? int_type(0) : __c; }
+    };
+} // namespace std
+
+// libstdc++/3983
+// Sentry uses locale info, so have to try one formatted input/output.
+void test03()
+{
+  using namespace std;
+  bool test = true;
+
+  // input streams
+  basic_istringstream<unsigned char> iss_uc;
+  unsigned char arr[6] = { 'a', 'b', 'c', 'd', 'e' };
+
+  try 
+    { 
+      int i;
+      iss_uc >> i;
+    }
+  catch (bad_cast& obj)
+    { }
+  catch (exception& obj)
+    { test = false; }
+  
+  try 
+    { 
+      iss_uc >> arr;
+    }
+  catch (bad_cast& obj)
+    { }
+  catch (exception& obj)
+    { test = false; }
+  
+  try 
+    { 
+      iss_uc >> ws;
+    }
+  catch (bad_cast& obj)
+    { }
+  catch (exception& obj)
+    { test = false; }
+  try 
+    { 
+      basic_string<unsigned char> s_uc(arr);
+      iss_uc >> s_uc;
+    }
+  catch (bad_cast& obj)
+    { }
+  catch (exception& obj)
+    { test = false; }
+   
+  VERIFY( test );
+}
+
+#if !__GXX_WEAK__
+// Explicitly instantiate for systems with no COMDAT or weak support.
+template 
+  std::basic_string<unsigned char>::size_type 
+  std::basic_string<unsigned char>::_Rep::_S_max_size;
+
+template 
+  unsigned char
+  std::basic_string<unsigned char>::_Rep::_S_terminal;
+#endif
+
+int main()
+{
+  test03();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/tellg/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_istream/tellg/char/1.cc
new file mode 100644 (file)
index 0000000..6ec4d69
--- /dev/null
@@ -0,0 +1,64 @@
+// 2000-06-29 bkoz
+
+// Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation
+//
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.1.3 unformatted input functions
+// NB: ostream has a particular "seeks" category. Adopt this for istreams too.
+// @require@ %-*.tst %-*.txt
+// @diff@ %-*.tst %-*.txt
+
+#include <istream>
+#include <sstream>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+void test01()
+{
+  using namespace std;
+  typedef ios::pos_type pos_type;
+
+  bool test = true;
+  const char str_lit01[] = "istream_seeks-1.tst";
+
+  // in
+  // test default ctors leave things in the same positions...
+  istringstream ist1;
+  pos_type p3 = ist1.tellg();
+
+  ifstream ifs1;
+  pos_type p4 = ifs1.tellg();
+
+  VERIFY( p3 == p4 );
+
+  // in
+  // test ctors leave things in the same positions...
+  istringstream ist2("bob_marley:kaya");
+  p3 = ist2.tellg();
+
+  ifstream ifs2(str_lit01);
+  p4 = ifs2.tellg();
+
+  VERIFY( p3 == p4 );
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/tellg/char/8348.cc b/libstdc++-v3/testsuite/27_io/basic_istream/tellg/char/8348.cc
new file mode 100644 (file)
index 0000000..771d25b
--- /dev/null
@@ -0,0 +1,79 @@
+// 2000-06-29 bkoz
+
+// Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation
+//
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.1.3 unformatted input functions
+// NB: ostream has a particular "seeks" category. Adopt this for istreams too.
+// @require@ %-*.tst %-*.txt
+// @diff@ %-*.tst %-*.txt
+
+#include <istream>
+#include <sstream>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+// libstdc++/8348
+void test06(void)
+{
+  using namespace std;
+  bool test = true;
+  string num1("555");
+
+  // tellg
+  {
+    istringstream iss(num1);
+    istream::pos_type pos1 = iss.tellg();
+    int asNum = 0;
+    iss >> asNum;
+    VERIFY( test = iss.eof() );
+    VERIFY( test = !iss.fail() );
+    iss.tellg();
+    VERIFY( test = !iss.fail() );
+  }
+
+  // seekg
+  {
+    istringstream iss(num1);
+    istream::pos_type pos1 = iss.tellg();
+    int asNum = 0;
+    iss >> asNum;
+    VERIFY( test = iss.eof() );
+    VERIFY( test = !iss.fail() );
+    iss.seekg(0, ios_base::beg);
+    VERIFY( test = !iss.fail() );
+  }
+
+  // seekg
+  {
+    istringstream iss(num1);
+    istream::pos_type pos1 = iss.tellg();
+    int asNum = 0;
+    iss >> asNum;
+    VERIFY( test = iss.eof() );
+    VERIFY( test = !iss.fail() );
+    iss.seekg(pos1);
+    VERIFY( test = !iss.fail() );
+  }
+}
+
+int main()
+{
+  test06();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/tellg/char/fstream.cc b/libstdc++-v3/testsuite/27_io/basic_istream/tellg/char/fstream.cc
new file mode 100644 (file)
index 0000000..d9d2f02
--- /dev/null
@@ -0,0 +1,87 @@
+// 2000-06-29 bkoz
+
+// Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation
+//
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.1.3 unformatted input functions
+// NB: ostream has a particular "seeks" category. Adopt this for istreams too.
+// @require@ %-*.tst %-*.txt
+// @diff@ %-*.tst %-*.txt
+
+#include <istream>
+#include <sstream>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+// fstreams
+void test04(void)
+{
+  typedef std::istream::off_type off_type;
+
+  bool test = true;
+  std::istream::pos_type pos01, pos02, pos03, pos04, pos05, pos06;
+  std::ios_base::iostate state01, state02;
+  const char str_lit01[] = "istream_seeks-1.txt";
+  const char str_lit02[] = "istream_seeks-2.txt";
+  std::ifstream if01(str_lit01, std::ios_base::in | std::ios_base::out);
+  std::ifstream if02(str_lit01, std::ios_base::in);
+  std::ifstream if03(str_lit02, std::ios_base::out | std::ios_base::trunc); 
+  VERIFY( if01.good() );
+  VERIFY( if02.good() );
+  VERIFY( if03.good() );
+
+  std::istream is01(if01.rdbuf());
+  std::istream is02(if02.rdbuf());
+  std::istream is03(if03.rdbuf());
+
+  // pos_type tellg()
+  // in | out
+  pos01 = is01.tellg();
+  pos02 = is01.tellg();
+  VERIFY( pos01 == pos02 );
+
+  // in
+  pos03 = is02.tellg();
+  pos04 = is02.tellg();
+  VERIFY( pos03 == pos04 );
+
+  // out
+  pos05 = is03.tellg();
+  pos06 = is03.tellg();
+  VERIFY( pos05 == pos06 );
+
+  // cur 
+  // NB: see library issues list 136. It's the v-3 interp that seekg
+  // only sets the input buffer, or else istreams with buffers that
+  // have _M_mode == ios_base::out will fail to have consistency
+  // between seekg and tellg.
+  state01 = is01.rdstate();
+  is01.seekg(10, std::ios_base::cur);
+  state02 = is01.rdstate();
+  pos01 = is01.tellg(); 
+  VERIFY( pos01 == pos02 + off_type(10) ); 
+  VERIFY( state01 == state02 );
+  pos02 = is01.tellg(); 
+  VERIFY( pos02 == pos01 ); 
+}
+
+int main()
+{
+  test04();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/tellg/char/sstream.cc b/libstdc++-v3/testsuite/27_io/basic_istream/tellg/char/sstream.cc
new file mode 100644 (file)
index 0000000..abc99f8
--- /dev/null
@@ -0,0 +1,93 @@
+// 2000-06-29 bkoz
+
+// Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation
+//
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.1.3 unformatted input functions
+// NB: ostream has a particular "seeks" category. Adopt this for istreams too.
+// @require@ %-*.tst %-*.txt
+// @diff@ %-*.tst %-*.txt
+
+#include <istream>
+#include <sstream>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+// stringstreams
+void test05(void)
+{
+  typedef std::istream::off_type off_type;
+
+  bool test = true;
+  std::istream::pos_type pos01, pos02, pos03, pos04, pos05, pos06;
+  std::ios_base::iostate state01, state02;
+  const char str_lit01[] = "istream_seeks-1.tst";
+  std::ifstream if01(str_lit01);
+  std::ifstream if02(str_lit01);
+  std::ifstream if03(str_lit01);
+  VERIFY( if01.good() );
+  VERIFY( if02.good() );
+  VERIFY( if03.good() );
+
+  std::stringbuf strbuf01(std::ios_base::in | std::ios_base::out);
+  if01 >> &strbuf01; 
+  // initialize stringbufs that are ios_base::out
+  std::stringbuf strbuf03(strbuf01.str(), std::ios_base::out);
+  // initialize stringbufs that are ios_base::in
+  std::stringbuf strbuf02(strbuf01.str(), std::ios_base::in);
+
+  std::istream is01(&strbuf01);
+  std::istream is02(&strbuf02);
+  std::istream is03(&strbuf03);
+
+  // pos_type tellg()
+  // in | out
+  pos01 = is01.tellg();
+  pos02 = is01.tellg();
+  VERIFY( pos01 == pos02 );
+
+  // in
+  pos03 = is02.tellg();
+  pos04 = is02.tellg();
+  VERIFY( pos03 == pos04 );
+
+  // out
+  pos05 = is03.tellg();
+  pos06 = is03.tellg();
+  VERIFY( pos05 == pos06 );
+
+  // cur 
+  // NB: see library issues list 136. It's the v-3 interp that seekg
+  // only sets the input buffer, or else istreams with buffers that
+  // have _M_mode == ios_base::out will fail to have consistency
+  // between seekg and tellg.
+  state01 = is01.rdstate();
+  is01.seekg(10, std::ios_base::cur);
+  state02 = is01.rdstate();
+  pos01 = is01.tellg(); 
+  VERIFY( pos01 == pos02 + off_type(10) ); 
+  VERIFY( state01 == state02 );
+  pos02 = is01.tellg(); 
+  VERIFY( pos02 == pos01 ); 
+}
+
+int main()
+{
+  test05();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/ws/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_istream/ws/char/1.cc
new file mode 100644 (file)
index 0000000..3761e94
--- /dev/null
@@ -0,0 +1,81 @@
+// 1999-07-22 bkoz
+
+// Copyright (C) 1994, 1999, 2001, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.1.4 standard basic_istream manipulators
+
+#include <istream>
+#include <sstream>
+#include <stdexcept>
+#include <testsuite_hooks.h>
+
+void test01(void)
+{
+  bool test = true;
+
+  const char str_lit01[] = "  venice ";
+  const std::string str01(" santa barbara ");
+  std::string str02(str_lit01);
+  std::string str04;
+  std::string str05;
+  std::ios_base::iostate flag1, flag2, flag3, flag4, flag5;
+
+  // template<_CharT, _Traits>
+  //  basic_istream<_CharT, _Traits>& ws(basic_istream<_Char, _Traits>& is)
+  std::istringstream iss01(str01);
+  std::istringstream iss02(str01);
+  
+  iss01 >> str04;
+  VERIFY( str04.size() != str01.size() );
+  VERIFY( str04 == "santa" );
+
+  iss02 >> std::ws;
+  iss02 >> str05;
+  VERIFY( str05.size() != str01.size() );
+  VERIFY( str05 == "santa" );
+  VERIFY( str05 == str04 );
+
+  iss01 >> str04;
+  VERIFY( str04.size() != str01.size() );
+  VERIFY( str04 == "barbara" );
+  
+  iss02 >> std::ws;
+  iss02 >> str05;
+  VERIFY( str05.size() != str01.size() );
+  VERIFY( str05 == "barbara" );
+  VERIFY( str05 == str04 );
+
+  flag3 = std::ios_base::eofbit;
+  flag4 = std::ios_base::badbit;
+  flag5 = std::ios_base::failbit;
+  VERIFY( !iss01.fail() );
+  VERIFY( !iss02.fail() );
+  VERIFY( !iss01.eof() );
+  VERIFY( !iss02.eof() );
+
+  iss01 >> std::ws;
+  VERIFY( !iss01.fail() );
+  VERIFY( iss01.eof() );
+}
+
+int main()
+{ 
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istringstream/1.cc b/libstdc++-v3/testsuite/27_io/basic_istringstream/1.cc
new file mode 100644 (file)
index 0000000..f8b76ee
--- /dev/null
@@ -0,0 +1,47 @@
+// 2002-07-25 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2002 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.7.2 - Template class basic_istringstream
+// NB: This file is for testing basic_istringstream with NO OTHER INCLUDES.
+
+#include <sstream>
+
+// { dg-do compile }
+
+// libstdc++/7216
+void test01()
+{
+  // Check for required typedefs
+  typedef std::istringstream test_type;
+  typedef test_type::char_type char_type;
+  typedef test_type::traits_type traits_type;
+  typedef test_type::int_type int_type;
+  typedef test_type::pos_type pos_type;
+  typedef test_type::off_type off_type;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istringstream/2.cc b/libstdc++-v3/testsuite/27_io/basic_istringstream/2.cc
new file mode 100644 (file)
index 0000000..becb4c8
--- /dev/null
@@ -0,0 +1,42 @@
+// 2002-07-25 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2002 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.7.2 - Template class basic_istringstream
+// NB: This file is for testing basic_istringstream with NO OTHER INCLUDES.
+
+#include <sstream>
+
+// { dg-do compile }
+
+namespace test 
+{
+  using namespace std;
+  typedef short type_t;
+  template class basic_istringstream<type_t, char_traits<type_t> >;
+} // test
diff --git a/libstdc++-v3/testsuite/27_io/basic_istringstream/3.cc b/libstdc++-v3/testsuite/27_io/basic_istringstream/3.cc
new file mode 100644 (file)
index 0000000..9b53545
--- /dev/null
@@ -0,0 +1,149 @@
+// 1999-01-17 bkoz test functionality of basic_filebuf for char_type == char
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.1 - Template class basic_filebuf 
+// NB: This file is for testing basic_filebuf with NO OTHER INCLUDES.
+
+#include <sstream>
+#include <testsuite_hooks.h>
+
+// { dg-do compile }
+
+// libstdc++/2020
+// should be able to use custom char_type, custom traits type
+class gnu_char_type
+{
+  unsigned long character;
+public:
+  // operator ==
+  bool
+  operator==(const gnu_char_type& __lhs) 
+  { return character == __lhs.character; }
+
+  // operator <
+  bool
+  operator<(const gnu_char_type& __lhs) 
+  { return character < __lhs.character; }
+
+  // default ctor
+  gnu_char_type() { }
+
+  // to_char_type
+  gnu_char_type(const unsigned long& __l) : character(__l) { } 
+
+  // to_int_type
+  operator unsigned long() const { return character; }
+};
+
+// char_traits specialization
+struct gnu_char_traits
+{
+  typedef gnu_char_type        char_type;
+  typedef long                 int_type;
+  typedef long                 pos_type;
+  typedef unsigned long        off_type;
+  typedef long                 state_type;
+  
+  static void 
+  assign(char_type& __c1, const char_type& __c2) { }
+  
+  static bool 
+  eq(const char_type& __c1, const char_type& __c2) { return true; }
+  
+  static bool 
+  lt(const char_type& __c1, const char_type& __c2) { return true; }
+  
+  static int 
+  compare(const char_type* __s1, const char_type* __s2, size_t __n)
+  { return 0; }
+  
+  static size_t
+  length(const char_type* __s) { return 0; }
+  
+  static const char_type* 
+  find(const char_type* __s, size_t __n, const char_type& __a)
+  { return __s; }
+  
+  static char_type* 
+  move(char_type* __s1, const char_type* __s2, size_t __n)
+  { return __s1; }
+  
+  static char_type* 
+  copy(char_type* __s1, const char_type* __s2, size_t __n)
+  { return __s1; }
+  
+  static char_type* 
+  assign(char_type* __s, size_t __n, char_type __a)
+  { return __s; }
+  
+  static char_type 
+  to_char_type(const int_type& __c)
+  { return char_type(); }
+  
+  static int_type 
+  to_int_type(const char_type& __c)
+  { return int_type(); }
+  
+  static bool 
+  eq_int_type(const int_type& __c1, const int_type& __c2)
+  { return true; }
+  
+  static int_type 
+  eof()
+  { return int_type(); }
+  
+  static int_type 
+  not_eof(const int_type& __c)
+  { return int_type(); }
+};
+
+void test07()
+{
+  bool test = true;
+  typedef std::basic_istringstream<gnu_char_type, gnu_char_traits> gnu_isstr;
+
+  try
+    { 
+      gnu_isstr obj;
+    }
+  catch(std::exception& obj)
+    { 
+      test = false; 
+      VERIFY( test );
+    }
+}
+
+#if !__GXX_WEAK__
+// Explicitly instantiate for systems with no COMDAT or weak support.
+template 
+  std::basic_streambuf<gnu_char_type>::int_type
+  std::basic_streambuf<gnu_char_type>::_S_pback_size;
+#endif
+
+int main() 
+{
+  test07();
+  return 0;
+}
+
+
+
+// more surf!!!
diff --git a/libstdc++-v3/testsuite/27_io/basic_istringstream/4.cc b/libstdc++-v3/testsuite/27_io/basic_istringstream/4.cc
new file mode 100644 (file)
index 0000000..764dd14
--- /dev/null
@@ -0,0 +1,50 @@
+// 2003-03-26 B enjamin Kosnik  <bkoz@redhat.com>
+
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.1 - Template class basic_filebuf 
+
+#include <istream>
+#include <sstream>
+
+void test01()
+{
+  // Check for required base class.
+  typedef std::istringstream test_type;
+  typedef std::istream base_type;
+  const test_type& obj = test_type();
+  const base_type* base = &obj;
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
+
+// more surf!!!
+
+
+
+
+
+
+
+
+
diff --git a/libstdc++-v3/testsuite/27_io/basic_istringstream/rdbuf/char/2832.cc b/libstdc++-v3/testsuite/27_io/basic_istringstream/rdbuf/char/2832.cc
new file mode 100644 (file)
index 0000000..59b601e
--- /dev/null
@@ -0,0 +1,79 @@
+// 2000-01-10 bkoz
+
+// Copyright (C) 2000, 2001, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.7.2.2 member functions (istringstream_members)
+
+#include <sstream>
+#include <testsuite_hooks.h>
+
+void 
+redirect_buffer(std::ios& stream, std::streambuf* new_buf) 
+{ stream.rdbuf(new_buf); }
+
+std::streambuf*
+active_buffer(std::ios& stream)
+{ return stream.rdbuf(); }
+
+// libstdc++/2832
+void test02()
+{
+  bool test = true;
+  const char* strlit01 = "fuck war";
+  const char* strlit02 = "two less cars abstract riot crew, critical mass/SF";
+  const std::string str00;
+  const std::string str01(strlit01);
+  std::string str02;
+  std::stringbuf sbuf(str01);
+  std::streambuf* pbasebuf0 = &sbuf;
+
+  std::istringstream sstrm1;
+  VERIFY( sstrm1.str() == str00 );
+  // derived rdbuf() always returns original streambuf, even though
+  // it's no longer associated with the stream.
+  std::stringbuf* const buf1 = sstrm1.rdbuf();
+  // base rdbuf() returns the currently associated streambuf
+  std::streambuf* pbasebuf1 = active_buffer(sstrm1);
+  redirect_buffer(sstrm1, &sbuf);
+  std::stringbuf* const buf2 = sstrm1.rdbuf();
+  std::streambuf* pbasebuf2 = active_buffer(sstrm1);
+  VERIFY( buf1 == buf2 ); 
+  VERIFY( pbasebuf1 != pbasebuf2 );
+  VERIFY( pbasebuf2 == pbasebuf0 );
+
+  // derived rdbuf() returns the original buf, so str() doesn't change.
+  VERIFY( sstrm1.str() != str01 );
+  VERIFY( sstrm1.str() == str00 );
+  // however, casting the active streambuf to a stringbuf shows what's up:
+  std::stringbuf* psbuf = dynamic_cast<std::stringbuf*>(pbasebuf2);
+  str02 = psbuf->str();
+  VERIFY( str02 == str01 );
+
+  // How confusing and non-intuitive is this?
+  // These semantics are a joke, a serious defect, and incredibly lame.
+}
+
+int main()
+{
+  test02();
+  return 0;
+}
+
+
+
diff --git a/libstdc++-v3/testsuite/27_io/basic_istringstream/str/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_istringstream/str/char/1.cc
new file mode 100644 (file)
index 0000000..32acd5b
--- /dev/null
@@ -0,0 +1,80 @@
+// 2000-01-10 bkoz
+
+// Copyright (C) 2000, 2001, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.7.2.2 member functions (istringstream_members)
+
+#include <sstream>
+#include <testsuite_hooks.h>
+
+void test01()
+{
+  bool test = true;
+  std::istringstream is01;
+  const std::string str00; 
+  const std::string str01 = "123";
+  std::string str02;
+  const int i01 = 123;
+  int a,b;
+
+  std::ios_base::iostate state1, state2, statefail, stateeof;
+  statefail = std::ios_base::failbit;
+  stateeof = std::ios_base::eofbit;
+
+  // string str() const
+  str02 = is01.str();
+  VERIFY( str00 == str02 );
+
+  // void str(const basic_string&)
+  is01.str(str01);
+  str02 = is01.str();
+  VERIFY( str01 == str02 );
+  state1 = is01.rdstate();
+  is01 >> a;
+  state2 = is01.rdstate();
+  VERIFY( a = i01 );
+  // 22.2.2.1.2 num_get virtual functions
+  // p 13
+  // in any case, if stage 2 processing was terminated by the test for
+  // in == end then err != ios_base::eofbit is performed.
+  VERIFY( state1 != state2 );
+  VERIFY( state2 == stateeof ); 
+
+  is01.str(str01);
+  is01 >> b;
+  VERIFY( b != a ); 
+  // as is01.good() is false, istream::sentry blocks extraction.
+
+  is01.clear();
+  state1 = is01.rdstate();
+  is01 >> b;
+  state2 = is01.rdstate();
+  VERIFY( b == a ); 
+  VERIFY( state1 != state2 );
+  VERIFY( state2 == stateeof ); 
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
+
+
+
diff --git a/libstdc++-v3/testsuite/27_io/basic_ofstream/1.cc b/libstdc++-v3/testsuite/27_io/basic_ofstream/1.cc
new file mode 100644 (file)
index 0000000..497e467
--- /dev/null
@@ -0,0 +1,47 @@
+// 2002-07-25 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2002 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.8.1.8 - Template class basic_ofstream
+// NB: This file is for testing basic_ofstream with NO OTHER INCLUDES.
+
+#include <fstream>
+
+// { dg-do compile }
+
+// libstdc++/7216
+void test01()
+{
+  // Check for required typedefs
+  typedef std::ifstream test_type;
+  typedef test_type::char_type char_type;
+  typedef test_type::traits_type traits_type;
+  typedef test_type::int_type int_type;
+  typedef test_type::pos_type pos_type;
+  typedef test_type::off_type off_type;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ofstream/2.cc b/libstdc++-v3/testsuite/27_io/basic_ofstream/2.cc
new file mode 100644 (file)
index 0000000..b139489
--- /dev/null
@@ -0,0 +1,42 @@
+// 2002-07-25 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2002 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.8.1.8 - Template class basic_ofstream
+// NB: This file is for testing basic_ofstream with NO OTHER INCLUDES.
+
+#include <fstream>
+
+// { dg-do compile }
+
+namespace test 
+{
+  using namespace std;
+  typedef short type_t;
+  template class basic_ifstream<type_t, char_traits<type_t> >;
+} // test
diff --git a/libstdc++-v3/testsuite/27_io/basic_ofstream/3.cc b/libstdc++-v3/testsuite/27_io/basic_ofstream/3.cc
new file mode 100644 (file)
index 0000000..0b2d7c9
--- /dev/null
@@ -0,0 +1,149 @@
+// 1999-01-17 bkoz test functionality of basic_filebuf for char_type == char
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.1 - Template class basic_filebuf 
+// NB: This file is for testing basic_filebuf with NO OTHER INCLUDES.
+
+#include <fstream>
+#include <testsuite_hooks.h>
+
+// { dg-do compile }
+
+// libstdc++/2020
+// should be able to use custom char_type, custom traits type
+class gnu_char_type
+{
+  unsigned long character;
+public:
+  // operator ==
+  bool
+  operator==(const gnu_char_type& __lhs) 
+  { return character == __lhs.character; }
+
+  // operator <
+  bool
+  operator<(const gnu_char_type& __lhs) 
+  { return character < __lhs.character; }
+
+  // default ctor
+  gnu_char_type() { }
+
+  // to_char_type
+  gnu_char_type(const unsigned long& __l) : character(__l) { } 
+
+  // to_int_type
+  operator unsigned long() const { return character; }
+};
+
+// char_traits specialization
+struct gnu_char_traits
+{
+  typedef gnu_char_type        char_type;
+  typedef long                 int_type;
+  typedef long                 pos_type;
+  typedef unsigned long        off_type;
+  typedef long                 state_type;
+  
+  static void 
+  assign(char_type& __c1, const char_type& __c2) { }
+  
+  static bool 
+  eq(const char_type& __c1, const char_type& __c2) { return true; }
+  
+  static bool 
+  lt(const char_type& __c1, const char_type& __c2) { return true; }
+  
+  static int 
+  compare(const char_type* __s1, const char_type* __s2, size_t __n)
+  { return 0; }
+  
+  static size_t
+  length(const char_type* __s) { return 0; }
+  
+  static const char_type* 
+  find(const char_type* __s, size_t __n, const char_type& __a)
+  { return __s; }
+  
+  static char_type* 
+  move(char_type* __s1, const char_type* __s2, size_t __n)
+  { return __s1; }
+  
+  static char_type* 
+  copy(char_type* __s1, const char_type* __s2, size_t __n)
+  { return __s1; }
+  
+  static char_type* 
+  assign(char_type* __s, size_t __n, char_type __a)
+  { return __s; }
+  
+  static char_type 
+  to_char_type(const int_type& __c)
+  { return char_type(); }
+  
+  static int_type 
+  to_int_type(const char_type& __c)
+  { return int_type(); }
+  
+  static bool 
+  eq_int_type(const int_type& __c1, const int_type& __c2)
+  { return true; }
+  
+  static int_type 
+  eof()
+  { return int_type(); }
+  
+  static int_type 
+  not_eof(const int_type& __c)
+  { return int_type(); }
+};
+
+void test07()
+{
+  bool test = true;
+  typedef std::basic_ofstream<gnu_char_type, gnu_char_traits> gnu_ofstr;
+
+  try
+    { 
+      gnu_ofstr obj;
+    }
+  catch(std::exception& obj)
+    { 
+      test = false; 
+      VERIFY( test );
+    }
+}
+
+#if !__GXX_WEAK__
+// Explicitly instantiate for systems with no COMDAT or weak support.
+template 
+  std::basic_streambuf<gnu_char_type>::int_type
+  std::basic_streambuf<gnu_char_type>::_S_pback_size;
+#endif
+
+int main() 
+{
+  test07();
+  return 0;
+}
+
+
+
+// more surf!!!
diff --git a/libstdc++-v3/testsuite/27_io/basic_ofstream/4.cc b/libstdc++-v3/testsuite/27_io/basic_ofstream/4.cc
new file mode 100644 (file)
index 0000000..9d58396
--- /dev/null
@@ -0,0 +1,50 @@
+// 2003-03-26 B enjamin Kosnik  <bkoz@redhat.com>
+
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.1 - Template class basic_filebuf 
+
+#include <ostream>
+#include <fstream>
+
+void test01()
+{
+  // Check for required base class.
+  typedef std::ofstream test_type;
+  typedef std::ostream base_type;
+  const test_type& obj = test_type();
+  const base_type* base = &obj;
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
+
+// more surf!!!
+
+
+
+
+
+
+
+
+
diff --git a/libstdc++-v3/testsuite/27_io/basic_ofstream/cons/char/2.cc b/libstdc++-v3/testsuite/27_io/basic_ofstream/cons/char/2.cc
new file mode 100644 (file)
index 0000000..14e217e
--- /dev/null
@@ -0,0 +1,49 @@
+// Copyright (C) 2000, 2001, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.10 ofstream member functions
+// @require@ %-*.tst
+// @diff@ %-*.tst %-*.txt
+
+#include <ostream>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+const char name_02[] = "ofstream_members-1.txt";
+
+// http://gcc.gnu.org/ml/libstdc++/2000-07/msg00004.html
+void test02()
+{
+  bool test = true;
+  const int more_than_max_open_files = 8200;
+  
+  for(int i = 0; ++i < more_than_max_open_files;)
+    {
+      std::ofstream ifs(name_02);
+      VERIFY( static_cast<bool>(ifs) );
+    }
+}
+
+int main()
+{
+  test02();
+  return 0;
+}
+
+
+
diff --git a/libstdc++-v3/testsuite/27_io/basic_ofstream/open/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_ofstream/open/char/1.cc
new file mode 100644 (file)
index 0000000..f97eec1
--- /dev/null
@@ -0,0 +1,58 @@
+// Copyright (C) 2000, 2001, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.10 ofstream member functions
+// @require@ %-*.tst
+// @diff@ %-*.tst %-*.txt
+
+#include <ostream>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+const char name_01[] = "ofstream_members-1.tst";
+const char name_02[] = "ofstream_members-1.txt";
+
+// http://gcc.gnu.org/ml/libstdc++/2000-06/msg00136.html
+void test01()
+{
+  bool test = true;
+  std::ofstream ofs1;
+  ofs1.close();
+  
+  // false as expected:
+  VERIFY( !ofs1.is_open() );
+   // this is now true:
+  VERIFY( !(ofs1) );
+  
+  ofs1.open(name_02);
+  VERIFY( ofs1.is_open() );
+  // fail bit still true
+  VERIFY( !(ofs1) );
+  VERIFY( ofs1.rdstate() == std::ios_base::failbit );
+
+  ofs1.close();
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
+
+
+
diff --git a/libstdc++-v3/testsuite/27_io/basic_ofstream/rdbuf/char/2832.cc b/libstdc++-v3/testsuite/27_io/basic_ofstream/rdbuf/char/2832.cc
new file mode 100644 (file)
index 0000000..7e897ef
--- /dev/null
@@ -0,0 +1,73 @@
+// Copyright (C) 2000, 2001, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.10 ofstream member functions
+// @require@ %-*.tst
+// @diff@ %-*.tst %-*.txt
+
+#include <ostream>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+const char name_01[] = "ofstream_members-1.tst";
+
+void 
+redirect_buffer(std::ios& stream, std::streambuf* new_buf) 
+{ stream.rdbuf(new_buf); }
+
+std::streambuf*
+active_buffer(std::ios& stream)
+{ return stream.rdbuf(); }
+
+// libstdc++/2832
+void test03()
+{
+  bool test = true;
+  const char* strlit01 = "fuck war";
+  const char* strlit02 = "two less cars abstract riot crew, critical mass/SF";
+  const std::string str00;
+  const std::string str01(strlit01);
+  std::string str02;
+  std::filebuf fbuf;
+  std::streambuf* pbasebuf0 = &fbuf;
+
+  std::ofstream sstrm1;
+  // derived rdbuf() always returns original streambuf, even though
+  // it's no longer associated with the stream.
+  std::filebuf* const buf1 = sstrm1.rdbuf();
+  // base rdbuf() returns the currently associated streambuf
+  std::streambuf* pbasebuf1 = active_buffer(sstrm1);
+  redirect_buffer(sstrm1, &fbuf);
+  std::filebuf* const buf2 = sstrm1.rdbuf();
+  std::streambuf* pbasebuf2 = active_buffer(sstrm1);
+  VERIFY( buf1 == buf2 ); 
+  VERIFY( pbasebuf1 != pbasebuf2 );
+  VERIFY( pbasebuf2 == pbasebuf0 );
+
+  // How confusing and non-intuitive is this?
+  // These semantics are a joke, a serious defect, and incredibly lame.
+}
+
+int main()
+{
+  test03();
+  return 0;
+}
+
+
+
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/1.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/1.cc
new file mode 100644 (file)
index 0000000..0240171
--- /dev/null
@@ -0,0 +1,48 @@
+// 1999-09-20 bkoz
+
+// Copyright (C) 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.6.2.1 basic_ostream
+// NB: This file is for testing ostream with NO OTHER INCLUDES.
+
+#include <ostream>
+#include <testsuite_hooks.h>
+
+// { dg-do compile }
+
+// libstdc++/7216
+void test01()
+{
+  // Check for required typedefs
+  typedef std::ostream test_type;
+  typedef test_type::char_type char_type;
+  typedef test_type::traits_type traits_type;
+  typedef test_type::int_type int_type;
+  typedef test_type::pos_type pos_type;
+  typedef test_type::off_type off_type;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/2.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/2.cc
new file mode 100644 (file)
index 0000000..8c672b1
--- /dev/null
@@ -0,0 +1,45 @@
+// 1999-09-20 bkoz
+
+// Copyright (C) 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.6.2.1 basic_ostream
+// NB: This file is for testing ostream with NO OTHER INCLUDES.
+
+#include <ostream>
+#include <testsuite_hooks.h>
+
+// { dg-do compile }
+
+namespace test 
+{
+  using namespace std;
+  using __gnu_cxx_test::pod_char;
+  typedef short type_t;
+  template class basic_ostream<type_t, char_traits<type_t> >;
+  template class basic_ostream<pod_char, char_traits<pod_char> >;
+} // test
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/3.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/3.cc
new file mode 100644 (file)
index 0000000..0c71061
--- /dev/null
@@ -0,0 +1,149 @@
+// 1999-01-17 bkoz test functionality of basic_filebuf for char_type == char
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.1 - Template class basic_filebuf 
+// NB: This file is for testing basic_filebuf with NO OTHER INCLUDES.
+
+#include <ostream>
+#include <testsuite_hooks.h>
+
+// { dg-do compile }
+
+// libstdc++/2020
+// should be able to use custom char_type, custom traits type
+class gnu_char_type
+{
+  unsigned long character;
+public:
+  // operator ==
+  bool
+  operator==(const gnu_char_type& __lhs) 
+  { return character == __lhs.character; }
+
+  // operator <
+  bool
+  operator<(const gnu_char_type& __lhs) 
+  { return character < __lhs.character; }
+
+  // default ctor
+  gnu_char_type() { }
+
+  // to_char_type
+  gnu_char_type(const unsigned long& __l) : character(__l) { } 
+
+  // to_int_type
+  operator unsigned long() const { return character; }
+};
+
+// char_traits specialization
+struct gnu_char_traits
+{
+  typedef gnu_char_type        char_type;
+  typedef long                 int_type;
+  typedef long                 pos_type;
+  typedef unsigned long        off_type;
+  typedef long                 state_type;
+  
+  static void 
+  assign(char_type& __c1, const char_type& __c2) { }
+  
+  static bool 
+  eq(const char_type& __c1, const char_type& __c2) { return true; }
+  
+  static bool 
+  lt(const char_type& __c1, const char_type& __c2) { return true; }
+  
+  static int 
+  compare(const char_type* __s1, const char_type* __s2, size_t __n)
+  { return 0; }
+  
+  static size_t
+  length(const char_type* __s) { return 0; }
+  
+  static const char_type* 
+  find(const char_type* __s, size_t __n, const char_type& __a)
+  { return __s; }
+  
+  static char_type* 
+  move(char_type* __s1, const char_type* __s2, size_t __n)
+  { return __s1; }
+  
+  static char_type* 
+  copy(char_type* __s1, const char_type* __s2, size_t __n)
+  { return __s1; }
+  
+  static char_type* 
+  assign(char_type* __s, size_t __n, char_type __a)
+  { return __s; }
+  
+  static char_type 
+  to_char_type(const int_type& __c)
+  { return char_type(); }
+  
+  static int_type 
+  to_int_type(const char_type& __c)
+  { return int_type(); }
+  
+  static bool 
+  eq_int_type(const int_type& __c1, const int_type& __c2)
+  { return true; }
+  
+  static int_type 
+  eof()
+  { return int_type(); }
+  
+  static int_type 
+  not_eof(const int_type& __c)
+  { return int_type(); }
+};
+
+void test07()
+{
+  bool test = true;
+  typedef std::basic_ostream<gnu_char_type, gnu_char_traits> gnu_ostr;
+
+  try
+    { 
+      gnu_ostr obj(NULL); 
+    }
+  catch(std::exception& obj)
+    { 
+      test = false; 
+      VERIFY( test );
+    }
+}
+
+#if !__GXX_WEAK__
+// Explicitly instantiate for systems with no COMDAT or weak support.
+template 
+  std::basic_streambuf<gnu_char_type>::int_type
+  std::basic_streambuf<gnu_char_type>::_S_pback_size;
+#endif
+
+int main() 
+{
+  test07();
+  return 0;
+}
+
+
+
+// more surf!!!
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/4.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/4.cc
new file mode 100644 (file)
index 0000000..b1b669c
--- /dev/null
@@ -0,0 +1,52 @@
+// 2003-03-26 B enjamin Kosnik  <bkoz@redhat.com>
+
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.1 - Template class basic_filebuf 
+
+#include <ostream>
+#include <sstream>
+
+void test01()
+{
+  // Check for required base class.
+  typedef std::ostream test_type;
+  typedef std::ios base_type;
+  
+  std::stringbuf buf;
+  const test_type& obj = test_type(&buf);
+  const base_type* base = &obj;
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
+
+// more surf!!!
+
+
+
+
+
+
+
+
+
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/cons/char/9827.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/cons/char/9827.cc
new file mode 100644 (file)
index 0000000..7a4f263
--- /dev/null
@@ -0,0 +1,46 @@
+// 2003-02-24 Petur Runolfsson <peturr02 at ru dot is>
+
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+#include <ostream>
+#include <streambuf>
+#include <testsuite_hooks.h>
+
+// libstdc++/9827
+class Buf : public std::streambuf
+{
+};
+
+void test01()
+{
+  using namespace std;
+  bool test = true;
+
+  Buf buf;
+  ostream stream(&buf);
+
+  stream << 1;
+  VERIFY(!stream.good());
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/endl/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/endl/char/1.cc
new file mode 100644 (file)
index 0000000..8e69c42
--- /dev/null
@@ -0,0 +1,59 @@
+// 1999-07-22 bkoz
+
+// Copyright (C) 1994, 1999, 2000, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.2.7 standard basic_ostream manipulators
+
+#include <ostream>
+#include <sstream>
+#include <stdexcept>
+#include <testsuite_hooks.h>
+
+void test01(void)
+{
+  bool test = true;
+
+  const char str_lit01[] = "  venice ";
+  const std::string str01(" santa barbara ");
+  std::string str02(str_lit01);
+  std::string str04;
+  std::string str05;
+  std::ios_base::iostate flag1, flag2, flag3, flag4, flag5;
+
+  std::ostringstream oss01(str01);
+  std::ostringstream oss02;
+  std::ostringstream::int_type i01, i02;
+  typedef std::ostringstream::traits_type traits_type;
+
+  // template<_CharT, _Traits>
+  //  basic_ostream<_CharT, _Traits>& ends(basic_ostream<_Char, _Traits>& os)
+  oss01 << std::endl;
+  str04 = oss01.str();
+  VERIFY( str04.size() == str01.size() );
+
+  oss02 << std::endl;
+  str05 = oss02.str();
+  VERIFY( str05.size() == 1 );
+}
+
+int main()
+{ 
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/ends/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/ends/char/1.cc
new file mode 100644 (file)
index 0000000..a3c1179
--- /dev/null
@@ -0,0 +1,61 @@
+// 1999-07-22 bkoz
+
+// Copyright (C) 1994, 1999, 2000, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.2.7 standard basic_ostream manipulators
+
+#include <ostream>
+#include <sstream>
+#include <stdexcept>
+//#include <testsuite_hooks.h>
+#define VERIFY(x) test&=x
+
+void test01(void)
+{
+  bool test = true;
+
+  const char str_lit01[] = "  venice ";
+  const std::string str01(" santa barbara ");
+  std::string str02(str_lit01);
+  std::string str04;
+  std::string str05;
+  std::ios_base::iostate flag1, flag2, flag3, flag4, flag5;
+
+  std::ostringstream oss01(str01);
+  std::ostringstream oss02;
+  std::ostringstream::int_type i01, i02;
+  typedef std::ostringstream::traits_type traits_type;
+
+  // template<_CharT, _Traits>
+  //  basic_ostream<_CharT, _Traits>& ends(basic_ostream<_Char, _Traits>& os)
+  oss01 << std::ends;
+  str04 = oss01.str();
+  VERIFY( str04.size() == str01.size() );
+
+  oss02 << std::ends;
+  str05 = oss02.str();
+  VERIFY( str05.size() == 1 );
+  VERIFY( str05[0] == char() );
+}
+
+int main()
+{ 
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/ends/char/2.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/ends/char/2.cc
new file mode 100644 (file)
index 0000000..34de949
--- /dev/null
@@ -0,0 +1,65 @@
+// 1999-07-22 bkoz
+
+// Copyright (C) 1994, 1999, 2000, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.2.7 standard basic_ostream manipulators
+
+#include <ostream>
+#include <sstream>
+#include <stdexcept>
+#include <testsuite_hooks.h>
+
+// based vaguely on this:
+// http://gcc.gnu.org/ml/libstdc++/2000-q2/msg00109.html
+void test02()
+{
+  using namespace std;
+  typedef ostringstream::int_type int_type;
+
+  bool test = true;
+  ostringstream osst_01;
+  const string str_00("herbie_hancock");
+  int_type len1 = str_00.size();
+  osst_01 << str_00;
+  VERIFY( osst_01.str().size() == len1 );
+
+  osst_01 << ends;
+
+  const string str_01("speak like a child");
+  int_type len2 = str_01.size();
+  osst_01 << str_01;
+  int_type len3 = osst_01.str().size();
+  VERIFY( len1 < len3 );
+  VERIFY( len3 == len1 + len2 + 1 );
+
+  osst_01 << ends;
+
+  const string str_02("+ inventions and dimensions");
+  int_type len4 = str_02.size();
+  osst_01 << str_02;
+  int_type len5 = osst_01.str().size();
+  VERIFY( len3 < len5 );
+  VERIFY( len5 == len3 + len4 + 1 );
+}
+
+int main()
+{ 
+  test02();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/exceptions/char/9561.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/exceptions/char/9561.cc
new file mode 100644 (file)
index 0000000..3e3726c
--- /dev/null
@@ -0,0 +1,65 @@
+// 2003-03-08  Jerry Quinn  <jlquinn@optonline.net>
+
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+#include <ostream>
+#include <streambuf>
+#include <testsuite_hooks.h>
+
+// libstdc++/9561
+struct foobar: std::exception { };
+
+struct buf: std::streambuf
+{
+    virtual int_type overflow (int_type) {
+        throw foobar ();
+        return -1;
+    }
+};
+
+void test01()
+{
+  using namespace std;
+  bool test = true;
+
+  buf b;
+  std::ostream strm (&b);
+  strm.exceptions (std::ios::badbit);
+
+  try {
+    strm << std::endl;
+  }
+  catch (foobar) {
+    // strm should throw foobar and not do anything else
+    VERIFY(strm.bad());
+    return;
+  }
+  catch (...) {
+    VERIFY(false);
+    return;
+  }
+
+  VERIFY(false);
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/flush/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/flush/char/1.cc
new file mode 100644 (file)
index 0000000..3d9098f
--- /dev/null
@@ -0,0 +1,59 @@
+// 1999-07-22 bkoz
+
+// Copyright (C) 1994, 1999, 2000, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.2.7 standard basic_ostream manipulators
+
+#include <ostream>
+#include <sstream>
+#include <stdexcept>
+#include <testsuite_hooks.h>
+
+void test01(void)
+{
+  bool test = true;
+
+  const char str_lit01[] = "  venice ";
+  const std::string str01(" santa barbara ");
+  std::string str02(str_lit01);
+  std::string str04;
+  std::string str05;
+  std::ios_base::iostate flag1, flag2, flag3, flag4, flag5;
+
+  std::ostringstream oss01(str01);
+  std::ostringstream oss02;
+  std::ostringstream::int_type i01, i02;
+  typedef std::ostringstream::traits_type traits_type;
+
+  // template<_CharT, _Traits>
+  //  basic_ostream<_CharT, _Traits>& flush(basic_ostream<_Char, _Traits>& os)
+  oss01.flush();
+  str04 = oss01.str();
+  VERIFY( str04.size() == str01.size() );
+
+  oss02.flush();
+  str05 = oss02.str();
+  VERIFY( str05.size() == 0 );
+}
+
+int main()
+{ 
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/char/1.cc
new file mode 100644 (file)
index 0000000..8a81b96
--- /dev/null
@@ -0,0 +1,194 @@
+// 1999-11-15 Kevin Ediger  <kediger@licor.com>
+// test the floating point inserters (facet num_put)
+
+// Copyright (C) 1999, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+#include <cstdio> // for sprintf
+#include <cmath> // for abs
+#include <cfloat> // for DBL_EPSILON
+#include <iostream>
+#include <iomanip>
+#include <sstream>
+#include <limits>
+#include <testsuite_hooks.h>
+
+using namespace std;
+
+#ifndef DEBUG_ASSERT
+#  define TEST_NUMPUT_VERBOSE 1
+#endif
+
+struct _TestCase
+{
+  double val;
+    
+  int precision;
+  int width;
+  char decimal;
+  char fill;
+
+  bool fixed;
+  bool scientific;
+  bool showpos;
+  bool showpoint;
+  bool uppercase;
+  bool internal;
+  bool left;
+  bool right;
+
+  const char* result;
+};
+
+static bool T=true;
+static bool F=false;
+
+static _TestCase testcases[] =
+{
+  // standard output (no formatting applied)
+  { 1.2, 6,0,'.',' ', F,F,F,F,F,F,F,F, "1.2" },
+  { 54, 6,0,'.',' ', F,F,F,F,F,F,F,F, "54" },
+  { -.012, 6,0,'.',' ', F,F,F,F,F,F,F,F, "-0.012" },
+  { -.00000012, 6,0,'.',' ', F,F,F,F,F,F,F,F, "-1.2e-07" },
+    
+  // fixed formatting
+  { 10.2345, 0,0,'.',' ', T,F,F,F,F,F,F,F, "10" },
+  { 10.2345, 0,0,'.',' ', T,F,F,T,F,F,F,F, "10." },
+  { 10.2345, 1,0,'.',' ', T,F,F,F,F,F,F,F, "10.2" },
+  { 10.2345, 4,0,'.',' ', T,F,F,F,F,F,F,F, "10.2345" },
+  { 10.2345, 6,0,'.',' ', T,F,T,F,F,F,F,F, "+10.234500" },
+  { -10.2345, 6,0,'.',' ', T,F,F,F,F,F,F,F, "-10.234500" },
+  { -10.2345, 6,0,',',' ', T,F,F,F,F,F,F,F, "-10,234500" },
+
+  // fixed formatting with width
+  { 10.2345, 4,5,'.',' ', T,F,F,F,F,F,F,F, "10.2345" },
+  { 10.2345, 4,6,'.',' ', T,F,F,F,F,F,F,F, "10.2345" },
+  { 10.2345, 4,7,'.',' ', T,F,F,F,F,F,F,F, "10.2345" },
+  { 10.2345, 4,8,'.',' ', T,F,F,F,F,F,F,F, " 10.2345" },
+  { 10.2345, 4,10,'.',' ', T,F,F,F,F,F,F,F, "   10.2345" },
+  { 10.2345, 4,10,'.',' ', T,F,F,F,F,F,T,F, "10.2345   " },
+  { 10.2345, 4,10,'.',' ', T,F,F,F,F,F,F,T, "   10.2345" },
+  { 10.2345, 4,10,'.',' ', T,F,F,F,F,T,F,F, "   10.2345" },
+  { -10.2345, 4,10,'.',' ', T,F,F,F,F,T,F,F, "-  10.2345" },
+  { -10.2345, 4,10,'.','A', T,F,F,F,F,T,F,F, "-AA10.2345" },
+  { 10.2345, 4,10,'.','#', T,F,T,F,F,T,F,F, "+##10.2345" },
+
+  // scientific formatting
+  { 1.23e+12, 1,0,'.',' ', F,T,F,F,F,F,F,F, "1.2e+12" },
+  { 1.23e+12, 1,0,'.',' ', F,T,F,F,T,F,F,F, "1.2E+12" },
+  { 1.23e+12, 2,0,'.',' ', F,T,F,F,F,F,F,F, "1.23e+12" },
+  { 1.23e+12, 3,0,'.',' ', F,T,F,F,F,F,F,F, "1.230e+12" },
+  { 1.23e+12, 3,0,'.',' ', F,T,T,F,F,F,F,F, "+1.230e+12" },
+  { -1.23e-12, 3,0,'.',' ', F,T,F,F,F,F,F,F, "-1.230e-12" },
+  { 1.23e+12, 3,0,',',' ', F,T,F,F,F,F,F,F, "1,230e+12" },
+};
+
+template<typename _CharT>
+class testpunct : public numpunct<_CharT>
+{
+public:
+  typedef _CharT  char_type;
+  const char_type dchar;
+
+  explicit
+  testpunct(char_type decimal_char) : numpunct<_CharT>(), dchar(decimal_char)
+  { }
+
+protected:
+  char_type 
+  do_decimal_point() const
+  { return dchar; }
+    
+  char_type 
+  do_thousands_sep() const
+  { return ','; }
+
+  string 
+  do_grouping() const
+  { return string(); }
+};
+template<typename _CharT>  
+void apply_formatting(const _TestCase & tc, basic_ostream<_CharT> & os)
+{
+  os.precision(tc.precision);
+  os.width(tc.width);
+  os.fill(static_cast<_CharT>(tc.fill));
+  if (tc.fixed)
+    os.setf(ios::fixed);
+  if (tc.scientific)
+    os.setf(ios::scientific);
+  if (tc.showpos)
+    os.setf(ios::showpos);
+  if (tc.showpoint)
+    os.setf(ios::showpoint);
+  if (tc.uppercase)
+    os.setf(ios::uppercase);
+  if (tc.internal)
+    os.setf(ios::internal);
+  if (tc.left)
+    os.setf(ios::left);
+  if (tc.right)
+    os.setf(ios::right);
+}
+
+void
+test01()
+{
+  bool test = true;
+  for (int j=0; j<sizeof(testcases)/sizeof(testcases[0]); j++)
+    {
+      _TestCase & tc = testcases[j];
+#ifdef TEST_NUMPUT_VERBOSE
+      cout << "expect: " << tc.result << endl;
+#endif
+      // test double with char type
+      {
+        testpunct<char>* __tp = new testpunct<char>(tc.decimal);
+        ostringstream os;
+        locale __loc(os.getloc(), __tp);
+        os.imbue(__loc);
+        apply_formatting(tc, os);
+        os << tc.val;
+#ifdef TEST_NUMPUT_VERBOSE
+        cout << j << "result 1: " << os.str() << endl;
+#endif
+        VERIFY( os && os.str() == tc.result );
+      }
+      // test long double with char type
+      {
+        testpunct<char>* __tp = new testpunct<char>(tc.decimal);
+        ostringstream os;
+        locale __loc(os.getloc(), __tp);
+        os.imbue(__loc);
+        apply_formatting(tc, os);
+        os << (long double)tc.val;
+#ifdef TEST_NUMPUT_VERBOSE
+        cout << j << "result 2: " << os.str() << endl;
+#endif
+        VERIFY( os && os.str() == tc.result );
+      }
+    }
+}
+
+int 
+main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/char/2.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/char/2.cc
new file mode 100644 (file)
index 0000000..ed4979f
--- /dev/null
@@ -0,0 +1,58 @@
+// 1999-11-15 Kevin Ediger  <kediger@licor.com>
+// test the floating point inserters (facet num_put)
+
+// Copyright (C) 1999, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+#include <cstdio> // for sprintf
+#include <iostream>
+#include <iomanip>
+#include <locale>
+#include <sstream>
+#include <limits>
+#include <testsuite_hooks.h>
+
+using namespace std;
+
+void
+test02()
+{
+  bool test = true;
+
+  // Make sure we can output a long float in fixed format
+  // without seg-faulting (libstdc++/4402)
+  double val2 = 3.5e230;
+
+  ostringstream os2;
+  os2.precision(3);
+  os2.setf(ios::fixed);
+
+  // Check it can be done in a locale with grouping on.
+  locale loc2("de_DE");
+  os2.imbue(loc2);
+  os2 << fixed << setprecision(3) << val2 << endl;
+  os2 << endl;
+  os2 << fixed << setprecision(1) << val2 << endl;
+}
+
+int 
+main()
+{
+  __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test02);
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/char/3.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/char/3.cc
new file mode 100644 (file)
index 0000000..d26463b
--- /dev/null
@@ -0,0 +1,69 @@
+// 1999-11-15 Kevin Ediger  <kediger@licor.com>
+// test the floating point inserters (facet num_put)
+
+// Copyright (C) 1999, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+#include <sstream>
+#include <limits>
+#include <testsuite_hooks.h>
+
+using namespace std;
+
+template<typename T>
+bool
+test03_check(T n)
+{
+  stringbuf strbuf;
+  ostream o(&strbuf);
+  const char *expect;
+  bool test = true;
+
+  if (numeric_limits<T>::digits + 1 == 16)
+    expect = "177777 ffff";
+  else if (numeric_limits<T>::digits + 1 == 32)
+    expect = "37777777777 ffffffff";
+  else if (numeric_limits<T>::digits + 1 == 64)
+    expect = "1777777777777777777777 ffffffffffffffff";
+  else
+    expect = "wow, you've got some big numbers here";
+
+  o << oct << n << ' ' << hex << n;
+  VERIFY ( strbuf.str() == expect );
+
+  return test;
+}
+
+void
+test03()
+{
+  short s = -1;
+  int i = -1;
+  long l = -1;
+
+  test03_check (s);
+  test03_check (i);
+  test03_check (l);
+}
+
+int 
+main()
+{
+  test03();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/char/4.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/char/4.cc
new file mode 100644 (file)
index 0000000..445f884
--- /dev/null
@@ -0,0 +1,51 @@
+// 1999-11-15 Kevin Ediger  <kediger@licor.com>
+// test the floating point inserters (facet num_put)
+
+// Copyright (C) 1999, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+#include <iomanip>
+#include <sstream>
+#include <testsuite_hooks.h>
+
+using namespace std;
+
+// libstdc++/3655
+int
+test04()
+{
+  stringbuf strbuf1, strbuf2;
+  ostream o1(&strbuf1), o2(&strbuf2);
+  bool test = true;
+
+  o1 << hex << showbase << setw(6) << internal << 0xff;
+  VERIFY( strbuf1.str() == "0x  ff" );
+  
+  // ... vs internal-adjusted const char*-type objects
+  o2 << hex << showbase << setw(6) << internal << "0xff";
+  VERIFY( strbuf2.str() == "  0xff" );
+
+  return 0;
+}
+
+int 
+main()
+{
+  test04();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/char/4402.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/char/4402.cc
new file mode 100644 (file)
index 0000000..67eeecc
--- /dev/null
@@ -0,0 +1,74 @@
+// 1999-11-15 Kevin Ediger  <kediger@licor.com>
+// test the floating point inserters (facet num_put)
+
+// Copyright (C) 1999, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+#include <cstdio> // for sprintf
+#include <iostream>
+#include <iomanip>
+#include <sstream>
+#include <limits>
+#include <testsuite_hooks.h>
+
+using namespace std;
+
+void
+test02()
+{
+  bool test = true;
+  // make sure we can output a very long float
+  long double val = 1.2345678901234567890123456789e+1000L;
+  int prec = numeric_limits<long double>::digits10;
+
+  ostringstream os;
+  os.precision(prec);
+  os.setf(ios::scientific);
+  os << val;
+
+  char largebuf[512];
+  sprintf(largebuf, "%.*Le", prec, val);
+#ifdef TEST_NUMPUT_VERBOSE
+  cout << "expect: " << largebuf << endl;
+  cout << "result: " << os.str() << endl;
+#endif
+  VERIFY(os && os.str() == largebuf);
+
+  // Make sure we can output a long float in fixed format
+  // without seg-faulting (libstdc++/4402)
+  double val2 = 3.5e230;
+
+  ostringstream os2;
+  os2.precision(3);
+  os2.setf(ios::fixed);
+  os2 << val2;
+
+  sprintf(largebuf, "%.*f", 3, val2);
+#ifdef TEST_NUMPUT_VERBOSE
+  cout << "expect: " << largebuf << endl;
+  cout << "result: " << os2.str() << endl;
+#endif
+  VERIFY(os2 && os2.str() == largebuf);
+}
+
+int 
+main()
+{
+  test02();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/char/5.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/char/5.cc
new file mode 100644 (file)
index 0000000..647f871
--- /dev/null
@@ -0,0 +1,50 @@
+// 1999-11-15 Kevin Ediger  <kediger@licor.com>
+// test the floating point inserters (facet num_put)
+
+// Copyright (C) 1999, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+#include <cmath> // for abs
+#include <cfloat> // for DBL_EPSILON
+#include <sstream>
+#include <limits>
+#include <testsuite_hooks.h>
+
+using namespace std;
+
+void
+test05()
+{
+  bool test = true;
+  double pi = 3.14159265358979323846;
+  ostringstream ostr;
+  ostr.precision(20);
+  ostr << pi;
+  string sval = ostr.str();
+  istringstream istr (sval);
+  double d;
+  istr >> d;
+  VERIFY( abs(pi-d)/pi < DBL_EPSILON );
+}
+
+int 
+main()
+{
+  test05();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/char/6.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/char/6.cc
new file mode 100644 (file)
index 0000000..d3f0499
--- /dev/null
@@ -0,0 +1,54 @@
+// 1999-11-15 Kevin Ediger  <kediger@licor.com>
+// test the floating point inserters (facet num_put)
+
+// Copyright (C) 1999, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+#include <cmath> // for abs
+#include <cfloat> // for DBL_EPSILON
+#include <sstream>
+#include <limits>
+#include <testsuite_hooks.h>
+
+using namespace std;
+
+// libstdc++/9151
+int
+test06()
+{
+  bool test = true;
+  int prec = numeric_limits<double>::digits10 + 2;
+  double oval = numeric_limits<double>::min();
+
+  stringstream ostr;
+  ostr.precision(prec);
+  ostr << oval;
+  string sval = ostr.str();
+  istringstream istr (sval);
+  double ival;
+  istr >> ival;
+  VERIFY( abs(oval-ival)/oval < DBL_EPSILON ); 
+  return 0;
+}
+
+int 
+main()
+{
+  test06();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/wchar_t/1.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/wchar_t/1.cc
new file mode 100644 (file)
index 0000000..a439c9e
--- /dev/null
@@ -0,0 +1,189 @@
+// 1999-11-15 Kevin Ediger  <kediger@licor.com>
+// test the floating point inserters (facet num_put)
+
+// Copyright (C) 1999, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+#include <cstdio> // for sprintf
+#include <cmath> // for abs
+#include <cfloat> // for DBL_EPSILON
+#include <iostream>
+#include <iomanip>
+#include <sstream>
+#include <limits>
+#include <testsuite_hooks.h>
+
+using namespace std;
+
+#ifndef DEBUG_ASSERT
+#  define TEST_NUMPUT_VERBOSE 1
+#endif
+
+struct _TestCase
+{
+  double val;
+    
+  int precision;
+  int width;
+  char decimal;
+  char fill;
+
+  bool fixed;
+  bool scientific;
+  bool showpos;
+  bool showpoint;
+  bool uppercase;
+  bool internal;
+  bool left;
+  bool right;
+
+  const char* result;
+  const wchar_t* wresult;
+};
+
+static bool T=true;
+static bool F=false;
+
+static _TestCase testcases[] =
+{
+  // standard output (no formatting applied) 1-4
+  { 1.2, 6,0,'.',' ', F,F,F,F,F,F,F,F, "1.2",L"1.2" },
+  { 54, 6,0,'.',' ', F,F,F,F,F,F,F,F, "54",L"54" },
+  { -.012, 6,0,'.',' ', F,F,F,F,F,F,F,F, "-0.012",L"-0.012" },
+  { -.00000012, 6,0,'.',' ', F,F,F,F,F,F,F,F, "-1.2e-07",L"-1.2e-07" },
+    
+  // fixed formatting 5-11
+  { 10.2345, 0,0,'.',' ', T,F,F,F,F,F,F,F, "10",L"10" },
+  { 10.2345, 0,0,'.',' ', T,F,F,T,F,F,F,F, "10.",L"10." },
+  { 10.2345, 1,0,'.',' ', T,F,F,F,F,F,F,F, "10.2",L"10.2" },
+  { 10.2345, 4,0,'.',' ', T,F,F,F,F,F,F,F, "10.2345",L"10.2345" },
+  { 10.2345, 6,0,'.',' ', T,F,T,F,F,F,F,F, "+10.234500",L"+10.234500" },
+  { -10.2345, 6,0,'.',' ', T,F,F,F,F,F,F,F, "-10.234500",L"-10.234500" },
+  { -10.2345, 6,0,',',' ', T,F,F,F,F,F,F,F, "-10,234500",L"-10,234500" },
+
+  // fixed formatting with width 12-22
+  { 10.2345, 4,5,'.',' ', T,F,F,F,F,F,F,F, "10.2345",L"10.2345" },
+  { 10.2345, 4,6,'.',' ', T,F,F,F,F,F,F,F, "10.2345",L"10.2345" },
+  { 10.2345, 4,7,'.',' ', T,F,F,F,F,F,F,F, "10.2345",L"10.2345" },
+  { 10.2345, 4,8,'.',' ', T,F,F,F,F,F,F,F, " 10.2345",L" 10.2345" },
+  { 10.2345, 4,10,'.',' ', T,F,F,F,F,F,F,F, "   10.2345",L"   10.2345" },
+  { 10.2345, 4,10,'.',' ', T,F,F,F,F,F,T,F, "10.2345   ",L"10.2345   " },
+  { 10.2345, 4,10,'.',' ', T,F,F,F,F,F,F,T, "   10.2345",L"   10.2345" },
+  { 10.2345, 4,10,'.',' ', T,F,F,F,F,T,F,F, "   10.2345",L"   10.2345" },
+  { -10.2345, 4,10,'.',' ', T,F,F,F,F,T,F,F, "-  10.2345",L"-  10.2345" },
+  { -10.2345, 4,10,'.','A', T,F,F,F,F,T,F,F, "-AA10.2345",L"-AA10.2345" },
+  { 10.2345, 4,10,'.','#', T,F,T,F,F,T,F,F, "+##10.2345",L"+##10.2345" },
+
+  // scientific formatting 23-29
+  { 1.23e+12, 1,0,'.',' ', F,T,F,F,F,F,F,F, "1.2e+12",L"1.2e+12" },
+  { 1.23e+12, 1,0,'.',' ', F,T,F,F,T,F,F,F, "1.2E+12",L"1.2E+12" },
+  { 1.23e+12, 2,0,'.',' ', F,T,F,F,F,F,F,F, "1.23e+12",L"1.23e+12" },
+  { 1.23e+12, 3,0,'.',' ', F,T,F,F,F,F,F,F, "1.230e+12",L"1.230e+12" },
+  { 1.23e+12, 3,0,'.',' ', F,T,T,F,F,F,F,F, "+1.230e+12",L"+1.230e+12" },
+  { -1.23e-12, 3,0,'.',' ', F,T,F,F,F,F,F,F, "-1.230e-12",L"-1.230e-12" },
+  { 1.23e+12, 3,0,',',' ', F,T,F,F,F,F,F,F, "1,230e+12",L"1,230e+12" },
+};
+
+template<typename _CharT>
+class testpunct : public numpunct<_CharT>
+{
+public:
+  typedef _CharT  char_type;
+  const char_type dchar;
+
+  explicit
+  testpunct(char_type decimal_char) : numpunct<_CharT>(), dchar(decimal_char)
+  { }
+
+protected:
+  char_type 
+  do_decimal_point() const
+  { return dchar; }
+    
+  char_type 
+  do_thousands_sep() const
+  { return ','; }
+
+  string 
+  do_grouping() const
+  { return string(); }
+};
+template<typename _CharT>  
+void apply_formatting(const _TestCase & tc, basic_ostream<_CharT> & os)
+{
+  os.precision(tc.precision);
+  os.width(tc.width);
+  os.fill(static_cast<_CharT>(tc.fill));
+  if (tc.fixed)
+    os.setf(ios::fixed);
+  if (tc.scientific)
+    os.setf(ios::scientific);
+  if (tc.showpos)
+    os.setf(ios::showpos);
+  if (tc.showpoint)
+    os.setf(ios::showpoint);
+  if (tc.uppercase)
+    os.setf(ios::uppercase);
+  if (tc.internal)
+    os.setf(ios::internal);
+  if (tc.left)
+    os.setf(ios::left);
+  if (tc.right)
+    os.setf(ios::right);
+}
+
+void
+test01()
+{
+  bool test = true;
+  for (int j=0; j<sizeof(testcases)/sizeof(testcases[0]); j++)
+    {
+      _TestCase & tc = testcases[j];
+#ifdef TEST_NUMPUT_VERBOSE
+      cout << "expect: " << tc.result << endl;
+#endif
+      // test double with wchar_t type
+      {
+        testpunct<wchar_t>* __tp = new testpunct<wchar_t>(tc.decimal);
+        wostringstream os;
+        locale __loc(os.getloc(), __tp);
+        os.imbue(__loc);
+        apply_formatting(tc, os);
+        os << tc.val;
+        VERIFY( os && os.str() == tc.wresult );
+      }
+      // test long double with wchar_t type
+      {
+        testpunct<wchar_t>* __tp = new testpunct<wchar_t>(tc.decimal);
+        wostringstream os;
+        locale __loc(os.getloc(), __tp);
+        os.imbue(__loc);
+        apply_formatting(tc, os);
+        os << (long double)tc.val;
+        VERIFY( os && os.str() == tc.wresult );
+      }
+    }
+}
+
+int 
+main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/char/1.cc
new file mode 100644 (file)
index 0000000..976d458
--- /dev/null
@@ -0,0 +1,59 @@
+// 1999-08-16 bkoz
+
+// Copyright (C) 1999, 2000, 2002, 2003 Free Software Foundation
+//
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.2.5.4 basic_ostream character inserters
+
+#include <string>
+#include <ostream>
+#include <sstream>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+// ofstream
+void test01()
+{
+  std::string str01;
+  const int size = 1000;
+  const char name_02[] = "ostream_inserter_char-1.txt";
+
+  // initialize string
+  for(int i=0 ; i < size; i++) {
+    str01 += '1';
+    str01 += '2';
+    str01 += '3';
+    str01 += '4';
+    str01 += '5';
+    str01 += '6';
+    str01 += '7';
+    str01 += '8';
+    str01 += '9';
+    str01 += '\n';
+  }
+  std::ofstream f(name_02);
+
+  f << str01;
+  f.close();
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/char/2.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/char/2.cc
new file mode 100644 (file)
index 0000000..9ffc492
--- /dev/null
@@ -0,0 +1,69 @@
+// 1999-08-16 bkoz
+
+// Copyright (C) 1999, 2000, 2002, 2003 Free Software Foundation
+//
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.2.5.4 basic_ostream character inserters
+
+#include <string>
+#include <ostream>
+#include <sstream>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+// ostringstream width() != zero
+// left
+void
+test02(void) 
+{
+  bool test = true;
+  std::string tmp;
+  
+  std::string str01 = "";
+  std::ostringstream oss01;
+  oss01.width(5);
+  oss01.fill('0');
+  oss01.flags(std::ios_base::left);
+  oss01 << str01;
+  tmp = oss01.str();
+  VERIFY( tmp == "00000" );
+
+  std::string str02 = "1";
+  std::ostringstream oss02;
+  oss02.width(5);
+  oss02.fill('0');
+  oss02.flags(std::ios_base::left);
+  oss02 << str02;
+  tmp = oss02.str();
+  VERIFY( tmp == "10000" );
+
+  std::string str03 = "909909";
+  std::ostringstream oss03;
+  oss03.width(5);
+  oss03.fill('0');
+  oss03.flags(std::ios_base::left);
+  oss03 << str03;
+  tmp = oss03.str();
+  VERIFY( tmp == "909909" );
+}
+
+int main()
+{
+  test02();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/char/3.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/char/3.cc
new file mode 100644 (file)
index 0000000..5b95862
--- /dev/null
@@ -0,0 +1,68 @@
+// 1999-08-16 bkoz
+
+// Copyright (C) 1999, 2000, 2002, 2003 Free Software Foundation
+//
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.2.5.4 basic_ostream character inserters
+
+#include <string>
+#include <ostream>
+#include <sstream>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+// width() != zero
+// right
+void test03(void) 
+{
+  bool test = true;
+  std::string tmp;
+
+  std::string str01 = "";
+  std::ostringstream oss01;
+  oss01.width(5);
+  oss01.fill('0');
+  oss01.flags(std::ios_base::right);
+  oss01 << str01;
+  tmp = oss01.str();
+  VERIFY( tmp == "00000" );
+
+  std::string str02 = "1";
+  std::ostringstream oss02;
+  oss02.width(5);
+  oss02.fill('0');
+  oss02.flags(std::ios_base::right);
+  oss02 << str02;
+  tmp = oss02.str();
+  VERIFY( tmp == "00001" );
+
+  std::string str03 = "909909";
+  std::ostringstream oss03;
+  oss03.width(5);
+  oss03.fill('0');
+  oss03.flags(std::ios_base::right);
+  oss03 << str03;
+  tmp = oss03.str();
+  VERIFY( tmp == "909909" );
+}
+
+int main()
+{
+  test03();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/char/4.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/char/4.cc
new file mode 100644 (file)
index 0000000..52d92ec
--- /dev/null
@@ -0,0 +1,61 @@
+// 1999-08-16 bkoz
+
+// Copyright (C) 1999, 2000, 2002, 2003 Free Software Foundation
+//
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.2.5.4 basic_ostream character inserters
+
+#include <string>
+#include <ostream>
+#include <sstream>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+// stringstream and large strings
+void
+test04() 
+{
+  bool test = true;
+  std::string str_01;
+  const std::string str_02("coltrane playing 'softly as a morning sunrise'");
+  const std::string str_03("coltrane");
+  std::string str_tmp;
+  const int i_max=250;
+
+  std::ostringstream oss_01(std::ios_base::out);
+  std::ostringstream oss_02(str_01, std::ios_base::out);
+
+  std::ios_base::iostate state1, state2, statefail;
+  statefail = std::ios_base::failbit;
+
+  // template<_CharT, _Traits>
+  //  basic_ostream& operator<<(ostream&, const char*)
+  for (int i = 0; i < i_max; ++i) 
+    oss_02 << "Test: " << i << std::endl;
+  str_tmp = oss_02.str();
+  VERIFY( !oss_02.bad() );
+  VERIFY( oss_02.good() );
+  VERIFY( str_tmp != str_01 );
+  VERIFY( str_tmp.size() == 2390 );
+}
+
+int main()
+{
+  test04();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/char/5.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/char/5.cc
new file mode 100644 (file)
index 0000000..c68f227
--- /dev/null
@@ -0,0 +1,78 @@
+// 1999-08-16 bkoz
+
+// Copyright (C) 1999, 2000, 2002, 2003 Free Software Foundation
+//
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.2.5.4 basic_ostream character inserters
+
+#include <string>
+#include <ostream>
+#include <sstream>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+// ostringstream and large strings number 2
+void
+test05()
+{
+  bool test = true;
+  std::string str05, str10;
+
+  typedef std::ostream::pos_type       pos_type;
+  typedef std::ostream::off_type       off_type;
+  std::string str01;
+  const int size = 1000;
+
+  // initialize string
+  for(int i=0 ; i < size; i++) {
+    str01 += '1';
+    str01 += '2';
+    str01 += '3';
+    str01 += '4';
+    str01 += '5';
+    str01 += '6';
+    str01 += '7';
+    str01 += '8';
+    str01 += '9';
+    str01 += '\n';
+  }
+
+  // test 1: out
+  std::ostringstream sstr01(str01, std::ios_base::out);
+  std::ostringstream sstr02;
+  sstr02 << str01;
+  str05 = sstr01.str();
+  str10 = sstr02.str();
+  VERIFY( str05 == str01 );
+  VERIFY( str10 == str01 );
+
+  // test 2: in | out 
+  std::ostringstream sstr04(str01,  std::ios_base::out | std::ios_base::in);
+  std::ostringstream sstr05(std::ios_base::in | std::ios_base::out);
+  sstr05 << str01;
+  str05 = sstr04.str();
+  str10 = sstr05.str();
+  VERIFY( str05 == str01 );
+  VERIFY( str10 == str01 );
+}
+
+int main()
+{
+  test05();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/char/6.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/char/6.cc
new file mode 100644 (file)
index 0000000..a73329c
--- /dev/null
@@ -0,0 +1,59 @@
+// 1999-08-16 bkoz
+
+// Copyright (C) 1999, 2000, 2002, 2003 Free Software Foundation
+//
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.2.5.4 basic_ostream character inserters
+
+#include <string>
+#include <ostream>
+#include <sstream>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+// ostringstream and positioning, multiple writes
+// http://gcc.gnu.org/ml/libstdc++/2000-q1/msg00326.html
+void test06()
+{
+  bool test = true;
+  const char carray01[] = "mos def & talib kweli are black star";
+
+  // normal
+  std::ostringstream ostr1("mos def");
+  VERIFY( ostr1.str() == "mos def" ); 
+  ostr1 << " & talib kweli";  // should overwrite first part of buffer
+  VERIFY( ostr1.str() == " & talib kweli" );
+  ostr1 << " are black star";  // should append to string from above
+  VERIFY( ostr1.str() != carray01 );
+  VERIFY( ostr1.str() == " & talib kweli are black star" );
+
+  // appending
+  std::ostringstream ostr2("blackalicious", 
+                          std::ios_base::out | std::ios_base::ate);
+  VERIFY( ostr2.str() == "blackalicious" ); 
+  ostr2 << " NIA ";  // should not overwrite first part of buffer
+  VERIFY( ostr2.str() == "blackalicious NIA " );
+  ostr2 << "4: deception (5:19)";  // should append to full string from above
+  VERIFY( ostr2.str() == "blackalicious NIA 4: deception (5:19)" );
+}
+
+int main()
+{
+  test06();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/char/8.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/char/8.cc
new file mode 100644 (file)
index 0000000..244ee75
--- /dev/null
@@ -0,0 +1,49 @@
+// 1999-08-16 bkoz
+
+// Copyright (C) 1999, 2000, 2002, 2003 Free Software Foundation
+//
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.2.5.4 basic_ostream character inserters
+
+#include <string>
+#include <ostream>
+#include <sstream>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+void test08()
+{
+  bool test = true;
+  char* pt = NULL;
+
+  // 1
+  std::ostringstream oss;
+  oss << pt;
+  VERIFY( oss.bad() );
+  VERIFY( oss.str().size() == 0 );
+
+  oss.clear();
+  oss << "";
+  VERIFY( oss.good() );
+}
+
+int main()
+{
+  test08();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/wchar_t/7.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/wchar_t/7.cc
new file mode 100644 (file)
index 0000000..6344dd4
--- /dev/null
@@ -0,0 +1,92 @@
+// 1999-08-16 bkoz
+
+// Copyright (C) 1999, 2000, 2002, 2003 Free Software Foundation
+//
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.2.5.4 basic_ostream character inserters
+
+#include <string>
+#include <ostream>
+#include <sstream>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+// Global counter, needs to be reset after use.
+bool used;
+
+class gnu_ctype : public std::ctype<wchar_t>
+{
+protected:
+  char_type        
+  do_widen(char c) const
+  { 
+    used = true;
+    return std::ctype<wchar_t>::do_widen(c);
+  }
+
+  const char*  
+  do_widen(const char* low, const char* high, char_type* dest) const
+  { 
+    used = true;
+    return std::ctype<wchar_t>::do_widen(low, high, dest);
+  }
+};
+
+// 27.6.2.5.4 - Character inserter template functions 
+// [lib.ostream.inserters.character]
+void test07()
+{
+  using namespace std;
+  bool test = true;
+
+  const char* buffer = "SFPL 5th floor, outside carrol, the Asian side";
+
+  wostringstream oss;
+  oss.imbue(locale(locale::classic(), new gnu_ctype));
+  
+  // 1
+  // template<class charT, class traits>
+  // basic_ostream<charT,traits>& operator<<(basic_ostream<charT,traits>& out,
+  //                                           const char* s);
+  used = false;
+  oss << buffer;
+  VERIFY( used ); // Only required for char_type != char
+  wstring str = oss.str();
+  wchar_t c1 = oss.widen(buffer[0]);
+  VERIFY( str[0] == c1 );
+  wchar_t c2 = oss.widen(buffer[1]);
+  VERIFY( str[1] == c2 );
+
+  // 2
+  // template<class charT, class traits>
+  // basic_ostream<charT,traits>& operator<<(basic_ostream<charT,traits>& out,
+  //                                         char c);
+  used = false;
+  oss.str(wstring());
+  oss << 'b';
+  VERIFY( used ); // Only required for char_type != char
+  str = oss.str();
+  wchar_t c3 = oss.widen('b');
+  VERIFY( str[0] == c3 );
+}
+
+int main()
+{
+  test07();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/wchar_t/8.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/wchar_t/8.cc
new file mode 100644 (file)
index 0000000..bf4480d
--- /dev/null
@@ -0,0 +1,60 @@
+// 1999-08-16 bkoz
+
+// Copyright (C) 1999, 2000, 2002, 2003 Free Software Foundation
+//
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.2.5.4 basic_ostream character inserters
+
+#include <string>
+#include <ostream>
+#include <sstream>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+void test08()
+{
+  bool test = true;
+  char* pt = NULL;
+
+  // 2
+  std::wostringstream woss;
+  woss << pt;
+  VERIFY( woss.bad() );
+  VERIFY( woss.str().size() == 0 );
+
+  woss.clear();
+  woss << "";
+  VERIFY( woss.good() );
+
+  // 3
+  wchar_t* wt = NULL;
+  woss.clear();
+  woss << wt;
+  VERIFY( woss.bad() );
+  VERIFY( woss.str().size() == 0 );
+
+  woss.clear();
+  woss << L"";
+  VERIFY( woss.good() );
+}
+
+int main()
+{
+  test08();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/1.cc
new file mode 100644 (file)
index 0000000..3fa9e68
--- /dev/null
@@ -0,0 +1,82 @@
+// 1999-08-16 bkoz
+// 1999-11-01 bkoz
+
+// Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation
+//
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.2.5.4 basic_ostream character inserters
+// @require@ %-*.tst %-*.txt
+// @diff@ %-*.tst %-*.txt
+
+#include <ostream>
+#include <sstream>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+const int size = 1000;
+const char name_01[] = "ostream_inserter_other-1.tst";
+const char name_02[] = "ostream_inserter_other-1.txt";
+const char name_03[] = "ostream_inserter_other-2.tst";
+const char name_04[] = "ostream_inserter_other-2.txt";
+
+// fstream
+void
+test02() 
+{
+  typedef std::ios_base::iostate iostate;
+  bool test = true;
+
+  // basic_ostream<_CharT, _Traits>::operator<<(__streambuf_type* __sb)
+  // filebuf-> NULL 
+  std::ifstream f_in1(name_01);
+  std::ofstream f_out1(name_02);
+  std::stringbuf* strbuf01 = NULL;
+  iostate state01 = f_in1.rdstate();
+  f_in1 >> strbuf01;
+  iostate state02 = f_in1.rdstate();
+  VERIFY( state01 != state02 );
+  VERIFY( (state02 & std::ios_base::failbit) != 0 );
+  state01 = f_out1.rdstate();
+  f_out1 << strbuf01;
+  state02 = f_out1.rdstate();
+  VERIFY( state01 != state02 );
+  VERIFY( (state02 & std::ios_base::badbit) != 0 );
+
+  // filebuf->filebuf
+  std::ifstream f_in(name_01);
+  std::ofstream f_out(name_02);
+  f_out << f_in.rdbuf();
+  f_in.close();
+  f_out.close();
+
+  // filebuf->stringbuf->filebuf
+  std::ifstream f_in2(name_03);
+  std::ofstream f_out2(name_04); // should be different name
+  std::stringbuf strbuf02;
+  f_in2 >> &strbuf02;
+  f_out2 << &strbuf02;
+  f_in2.close();
+  f_out2.close();
+}
+
+int 
+main()
+{
+  test02();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/2.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/2.cc
new file mode 100644 (file)
index 0000000..c82e5cf
--- /dev/null
@@ -0,0 +1,70 @@
+// 1999-08-16 bkoz
+// 1999-11-01 bkoz
+
+// Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation
+//
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.2.5.4 basic_ostream character inserters
+// @require@ %-*.tst %-*.txt
+// @diff@ %-*.tst %-*.txt
+
+#include <ostream>
+#include <sstream>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+// via Brent Verner <brent@rcfile.org>
+// http://gcc.gnu.org/ml/libstdc++/2000-06/msg00005.html
+void
+test03(void)
+{
+  using namespace std;
+
+  typedef ios::pos_type        pos_type;
+
+  const char* TEST_IN = "ostream_inserter_other_in";
+  const char* TEST_OUT = "ostream_inserter_other_out";
+  pos_type i_read, i_wrote, rs, ws;
+  double tf_size = BUFSIZ * 2.5;
+  ofstream testfile(TEST_IN);
+
+  for (int i = 0; i < tf_size; ++i)
+    testfile.put('.');
+  testfile.close();
+
+  ifstream in(TEST_IN);
+  ofstream out(TEST_OUT);
+  out << in.rdbuf();
+  in.seekg(0,ios_base::beg);
+  out.seekp(0,ios_base::beg);
+  rs = in.tellg();
+  ws = out.tellp();
+  in.seekg(0,ios_base::end);
+  out.seekp(0,ios_base::end);
+  i_read = in.tellg() - rs;
+  i_wrote = out.tellp() - ws;
+  in.close();
+  out.close();
+}
+
+int 
+main()
+{
+  test03();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/3.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/3.cc
new file mode 100644 (file)
index 0000000..89dca57
--- /dev/null
@@ -0,0 +1,50 @@
+// 1999-08-16 bkoz
+// 1999-11-01 bkoz
+
+// Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation
+//
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.2.5.4 basic_ostream character inserters
+// @require@ %-*.tst %-*.txt
+// @diff@ %-*.tst %-*.txt
+
+#include <ostream>
+#include <sstream>
+#include <testsuite_hooks.h>
+
+// libstdc++/3272
+void test04()
+{
+  using namespace std;
+  bool test = true;
+  istringstream istr("inside betty carter");
+  ostringstream ostr;
+  ostr << istr.rdbuf() << endl;
+
+  if (ostr.rdstate() & ios_base::eofbit) 
+    test = false;
+
+  VERIFY( test );
+}
+
+int 
+main()
+{
+  test04(); 
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/4.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/4.cc
new file mode 100644 (file)
index 0000000..1ba200a
--- /dev/null
@@ -0,0 +1,154 @@
+// 1999-08-16 bkoz
+// 1999-11-01 bkoz
+
+// Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation
+//
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.2.5.4 basic_ostream character inserters
+// @require@ %-*.tst %-*.txt
+// @diff@ %-*.tst %-*.txt
+
+#include <ostream>
+#include <sstream>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+class test_buffer_1 : public std::streambuf 
+{
+public:
+  test_buffer_1(const std::string& s) : str(s), it(str.begin()) { }
+  
+protected:
+  virtual int underflow() { return (it != str.end() ? *it : EOF); }
+  virtual int uflow() { return (it != str.end() ? *it++ : EOF); }
+
+private:
+  const std::string str;
+  std::string::const_iterator it;
+};
+
+
+class test_buffer_2 : public std::streambuf 
+{
+public:
+  test_buffer_2(const std::string& s) : str(s), it(str.begin()) { }
+  
+protected:
+  virtual int underflow() { return (it != str.end() ? *it : EOF); }
+  virtual int uflow() { return (it != str.end() ? *it++ : EOF); }
+  virtual std::streamsize showmanyc() { return std::distance(it, str.end()); }
+private:
+  const std::string str;
+  std::string::const_iterator it;
+};
+
+
+class test_buffer_3 : public std::streambuf 
+{
+public:
+  test_buffer_3(const std::string& s) : str(s), it(str.begin()) { }
+
+protected:
+  virtual int underflow() { return (it != str.end() ? *it : EOF); }
+  virtual int uflow() { return (it != str.end() ? *it++ : EOF); }
+  virtual std::streamsize showmanyc() 
+  {
+    std::streamsize ret = std::distance(it, str.end());
+    return ret > 0 ? ret : -1;
+  }
+private:
+  const std::string str;
+  std::string::const_iterator it;
+};
+
+class test_buffer_4 : public std::streambuf {
+public:
+  test_buffer_4(const std::string& s) : str(s), it(str.begin())
+  {
+    if (it != str.end()) {
+      buf[0] = *it++;
+      setg(buf, buf, buf+1);
+    }
+  }
+
+protected:
+  virtual int underflow() { return (it != str.end() ? *it : EOF); }
+  virtual int uflow() { return (it != str.end() ? *it++ : EOF); }
+  virtual std::streamsize showmanyc() {
+    std::streamsize ret = std::distance(it, str.end());
+    return ret > 0 ? ret : -1;
+  }
+private:
+  const std::string str;
+  std::string::const_iterator it;
+  char buf[1];
+};
+
+void test(const std::string& str, std::streambuf& buf)
+{
+  bool test = true;
+
+  std::ostringstream out;
+  std::istream in(&buf);
+
+  out << in.rdbuf();
+
+  if (out.str() != str) 
+    VERIFY( false );
+}
+
+// libstdc++/6745
+// libstdc++/8071
+// libstdc++/8127
+// Jonathan Lennox  <lennox@cs.columbia.edu>
+void test05()
+{
+  std::string string_a("Hello, world!");
+  std::string string_b("");
+
+  test_buffer_1 buf1a(string_a);
+  test_buffer_1 buf1b(string_b);
+
+  test_buffer_2 buf2a(string_a);
+  test_buffer_2 buf2b(string_b);
+
+  test_buffer_3 buf3a(string_a);
+  test_buffer_3 buf3b(string_b);
+
+  test_buffer_4 buf4a(string_a);
+  test_buffer_4 buf4b(string_b);
+
+  test(string_a, buf1a);
+  test(string_b, buf1b);
+
+  test(string_a, buf2a);
+  test(string_b, buf2b);
+
+  test(string_a, buf3a);
+  test(string_b, buf3b);
+
+  test(string_a, buf4a);
+  test(string_b, buf4b);
+}
+
+int 
+main()
+{
+  test05();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/9318-out.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/9318-out.cc
new file mode 100644 (file)
index 0000000..fcacbcb
--- /dev/null
@@ -0,0 +1,73 @@
+// 1999-10-11 bkoz
+
+// Copyright (C) 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.5.2 template class basic_streambuf
+
+#include <streambuf>
+#include <sstream>
+#include <ostream>
+#include <testsuite_hooks.h>
+
+// libstdc++/9318
+class Outbuf : public std::streambuf
+{
+public:
+  typedef std::streambuf::traits_type traits_type;
+
+  std::string result() const { return str; }
+
+protected:
+  virtual int_type overflow(int_type c = traits_type::eof())
+  {
+    if (!traits_type::eq_int_type(c, traits_type::eof()))
+      str.push_back(traits_type::to_char_type(c));
+    return traits_type::not_eof(c);
+  }
+
+private:
+  std::string str;
+};
+
+void test10()
+{
+  bool test = true;
+
+  std::stringbuf sbuf("Bad Moon Rising", std::ios::in);
+  Outbuf buf;
+  std::ostream stream(&buf);
+  stream << &sbuf;
+
+  VERIFY( buf.result() == "Bad Moon Rising" );
+}
+
+int main() 
+{
+  test10();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/9424-out.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/9424-out.cc
new file mode 100644 (file)
index 0000000..61ec1a7
--- /dev/null
@@ -0,0 +1,113 @@
+// 1999-10-11 bkoz
+
+// Copyright (C) 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.5.2 template class basic_streambuf
+
+#include <cstring> // for memset, memcmp
+#include <streambuf>
+#include <sstream>
+#include <ostream>
+#include <testsuite_hooks.h>
+
+// libstdc++/9424
+class Outbuf_2 : public std::streambuf
+{
+  char buf[1];
+
+public:
+  Outbuf_2()
+  {
+    setp(buf, buf + 1);
+  }
+
+  int_type overflow(int_type c)
+  {
+    int_type eof = traits_type::eof();
+    
+    if (pptr() < epptr())
+      {
+       if (traits_type::eq_int_type(c, eof))
+         return traits_type::not_eof(c);
+       
+       *pptr() = traits_type::to_char_type(c);
+       pbump(1);
+       return c;
+      }
+
+    return eof;
+  }
+};
+
+class Inbuf_2 : public std::streambuf
+{
+  static const char buf[];
+  const char* current;
+  int size;
+
+public:
+  Inbuf_2()
+  {
+    current = buf;
+    size = std::strlen(buf);
+  }
+  
+  int_type underflow()
+  {
+    if (current < buf + size)
+      return traits_type::to_int_type(*current);
+    return traits_type::eof();
+  }
+  
+  int_type uflow()
+  {
+    if (current < buf + size)
+      return traits_type::to_int_type(*current++);
+    return traits_type::eof();
+  }
+};
+
+const char Inbuf_2::buf[] = "Atteivlis";
+
+void test12()
+{ 
+  bool test = true;
+  Outbuf_2 outbuf2;
+  std::ostream os (&outbuf2);
+  Inbuf_2 inbuf2;
+  os << &inbuf2;
+  VERIFY( inbuf2.sgetc() == 't' );
+  VERIFY( os.good() );
+}
+
+int main() 
+{
+  test12();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/sentry/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/sentry/char/1.cc
new file mode 100644 (file)
index 0000000..cba75f2
--- /dev/null
@@ -0,0 +1,53 @@
+// 2003-02-06  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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.6.2.3 class basic_ostream::sentry
+
+#include <ostream>
+#include <sstream>
+#include <testsuite_hooks.h>
+
+// libstdc++/9562
+void
+test01()
+{
+  bool test = true;
+
+  std::stringbuf strbuf01;
+  std::ostream strm1(&strbuf01);
+  const std::ostream::sentry sentry1(strm1);
+
+  VERIFY( bool(sentry1) == true );
+}
+
+int main() 
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/sentry/char/2.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/sentry/char/2.cc
new file mode 100644 (file)
index 0000000..4e7562c
--- /dev/null
@@ -0,0 +1,71 @@
+// 2003-02-06  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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.6.2.3 class basic_ostream::sentry
+
+#include <ostream>
+#include <sstream>
+#include <testsuite_hooks.h>
+
+// libstdc++/9563
+struct buf: std::streambuf
+{
+  std::ios *io_;
+  
+  buf (std::ios *io): io_ (io) { }
+  
+  virtual int sync ()
+  {
+    io_->setstate (std::ios::failbit);
+    return 0;
+  }
+};
+
+void
+test02()
+{
+  bool test = true;
+
+  buf b(0);
+  std::ostream strm(&b);
+  
+  buf tb(&strm);
+  std::ostream tied(&tb);
+
+  strm.tie(&tied);
+  std::ostream::sentry s(strm);
+
+  VERIFY( !s );
+}
+
+int main() 
+{
+  test02();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/sentry/char/3983-fstream.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/sentry/char/3983-fstream.cc
new file mode 100644 (file)
index 0000000..3cdf3b8
--- /dev/null
@@ -0,0 +1,160 @@
+// 2001-06-05 Benjamin Kosnik  <bkoz@redhat.com>
+
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.4.2.1.6 class ios_base::init
+
+#include <fstream>
+#include <testsuite_hooks.h>
+
+// char_traits specialization
+namespace std
+{
+  template<>
+    struct char_traits<unsigned char>
+    {
+      typedef unsigned char    char_type;
+      // Unsigned as wint_t in unsigned.
+      typedef unsigned long    int_type;
+      typedef streampos        pos_type;
+      typedef streamoff        off_type;
+      typedef mbstate_t        state_type;
+      
+      static void 
+      assign(char_type& __c1, const char_type& __c2)
+      { __c1 = __c2; }
+
+      static bool 
+      eq(const char_type& __c1, const char_type& __c2)
+      { return __c1 == __c2; }
+
+      static bool 
+      lt(const char_type& __c1, const char_type& __c2)
+      { return __c1 < __c2; }
+
+      static int 
+      compare(const char_type* __s1, const char_type* __s2, size_t __n)
+      { 
+       for (size_t __i = 0; __i < __n; ++__i)
+         if (!eq(__s1[__i], __s2[__i]))
+           return lt(__s1[__i], __s2[__i]) ? -1 : 1;
+       return 0; 
+      }
+
+      static size_t
+      length(const char_type* __s)
+      { 
+       const char_type* __p = __s; 
+       while (__p && *__p) 
+         ++__p; 
+       return (__p - __s); 
+      }
+
+      static const char_type* 
+      find(const char_type* __s, size_t __n, const char_type& __a)
+      { 
+       for (const char_type* __p = __s; size_t(__p - __s) < __n; ++__p)
+         if (*__p == __a) return __p;
+       return 0;
+      }
+
+      static char_type* 
+      move(char_type* __s1, const char_type* __s2, size_t __n)
+      { return (char_type*) memmove(__s1, __s2, __n * sizeof(char_type)); }
+
+      static char_type* 
+      copy(char_type* __s1, const char_type* __s2, size_t __n)
+      { return (char_type*) memcpy(__s1, __s2, __n * sizeof(char_type)); }
+
+      static char_type* 
+      assign(char_type* __s, size_t __n, char_type __a)
+      { 
+       for (char_type* __p = __s; __p < __s + __n; ++__p) 
+         assign(*__p, __a);
+        return __s; 
+      }
+
+      static char_type 
+      to_char_type(const int_type& __c)
+      { return char_type(); }
+
+      static int_type 
+      to_int_type(const char_type& __c) { return int_type(); }
+
+      static bool 
+      eq_int_type(const int_type& __c1, const int_type& __c2)
+      { return __c1 == __c2; }
+
+      static int_type 
+      eof() { return static_cast<int_type>(-1); }
+
+      static int_type 
+      not_eof(const int_type& __c)
+      { return eq_int_type(__c, eof()) ? int_type(0) : __c; }
+    };
+} // namespace std
+
+// libstdc++/3983
+// Sentry uses locale info, so have to try one formatted input/output.
+void test03()
+{
+  using namespace std;
+  bool test = true;
+
+  // output streams
+  basic_ofstream<unsigned char> ofs_uc;
+
+  try 
+    { 
+      bool b = true;
+      ofs_uc << b;
+    }
+  catch (bad_cast& obj)
+    { }
+  catch (exception& obj)
+    { test = false; }
+   
+  VERIFY( test );
+}
+
+#if !__GXX_WEAK__
+// Explicitly instantiate for systems with no COMDAT or weak support.
+template 
+  std::basic_string<unsigned char>::size_type 
+  std::basic_string<unsigned char>::_Rep::_S_max_size;
+
+template 
+  unsigned char
+  std::basic_string<unsigned char>::_Rep::_S_terminal;
+#endif
+
+int main()
+{
+  test03();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/sentry/char/3983-sstream.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/sentry/char/3983-sstream.cc
new file mode 100644 (file)
index 0000000..5f68c58
--- /dev/null
@@ -0,0 +1,160 @@
+// 2001-06-05 Benjamin Kosnik  <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.4.2.1.6 class ios_base::init
+
+#include <sstream>
+#include <testsuite_hooks.h>
+
+// char_traits specialization
+namespace std
+{
+  template<>
+    struct char_traits<unsigned char>
+    {
+      typedef unsigned char    char_type;
+      // Unsigned as wint_t in unsigned.
+      typedef unsigned long    int_type;
+      typedef streampos        pos_type;
+      typedef streamoff        off_type;
+      typedef mbstate_t        state_type;
+      
+      static void 
+      assign(char_type& __c1, const char_type& __c2)
+      { __c1 = __c2; }
+
+      static bool 
+      eq(const char_type& __c1, const char_type& __c2)
+      { return __c1 == __c2; }
+
+      static bool 
+      lt(const char_type& __c1, const char_type& __c2)
+      { return __c1 < __c2; }
+
+      static int 
+      compare(const char_type* __s1, const char_type* __s2, size_t __n)
+      { 
+       for (size_t __i = 0; __i < __n; ++__i)
+         if (!eq(__s1[__i], __s2[__i]))
+           return lt(__s1[__i], __s2[__i]) ? -1 : 1;
+       return 0; 
+      }
+
+      static size_t
+      length(const char_type* __s)
+      { 
+       const char_type* __p = __s; 
+       while (__p && *__p) 
+         ++__p; 
+       return (__p - __s); 
+      }
+
+      static const char_type* 
+      find(const char_type* __s, size_t __n, const char_type& __a)
+      { 
+       for (const char_type* __p = __s; size_t(__p - __s) < __n; ++__p)
+         if (*__p == __a) return __p;
+       return 0;
+      }
+
+      static char_type* 
+      move(char_type* __s1, const char_type* __s2, size_t __n)
+      { return (char_type*) memmove(__s1, __s2, __n * sizeof(char_type)); }
+
+      static char_type* 
+      copy(char_type* __s1, const char_type* __s2, size_t __n)
+      { return (char_type*) memcpy(__s1, __s2, __n * sizeof(char_type)); }
+
+      static char_type* 
+      assign(char_type* __s, size_t __n, char_type __a)
+      { 
+       for (char_type* __p = __s; __p < __s + __n; ++__p) 
+         assign(*__p, __a);
+        return __s; 
+      }
+
+      static char_type 
+      to_char_type(const int_type& __c)
+      { return char_type(); }
+
+      static int_type 
+      to_int_type(const char_type& __c) { return int_type(); }
+
+      static bool 
+      eq_int_type(const int_type& __c1, const int_type& __c2)
+      { return __c1 == __c2; }
+
+      static int_type 
+      eof() { return static_cast<int_type>(-1); }
+
+      static int_type 
+      not_eof(const int_type& __c)
+      { return eq_int_type(__c, eof()) ? int_type(0) : __c; }
+    };
+} // namespace std
+
+// libstdc++/3983
+// Sentry uses locale info, so have to try one formatted input/output.
+void test03()
+{
+  using namespace std;
+  bool test = true;
+
+  // output streams
+  basic_ostringstream<unsigned char> oss_uc;
+
+  try 
+    { 
+      bool b = true;
+      oss_uc << b;
+    }
+  catch (bad_cast& obj)
+    { }
+  catch (exception& obj)
+    { test = false; }
+   
+  VERIFY( test );
+}
+
+#if !__GXX_WEAK__
+// Explicitly instantiate for systems with no COMDAT or weak support.
+template 
+  std::basic_string<unsigned char>::size_type 
+  std::basic_string<unsigned char>::_Rep::_S_max_size;
+
+template 
+  unsigned char
+  std::basic_string<unsigned char>::_Rep::_S_terminal;
+#endif
+
+int main()
+{
+  test03();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/tellp/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/tellp/char/1.cc
new file mode 100644 (file)
index 0000000..05884fc
--- /dev/null
@@ -0,0 +1,62 @@
+// 2000-06-29 bkoz
+
+// Copyright (C) 2000, 2003 Free Software Foundation
+//
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.2.4 basic_ostream seek members
+
+#include <ostream>
+#include <sstream>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+
+void test01()
+{
+  using namespace std;
+  typedef ios::pos_type pos_type;
+
+  bool test = true;
+  const char str_lit01[] = "ostream_seeks-1.txt";
+
+  // out
+  // test default ctors leave things in the same positions...
+  ostringstream ost1;
+  pos_type p1 = ost1.tellp();
+
+  ofstream ofs1;
+  pos_type p2 = ofs1.tellp();
+
+  VERIFY( p1 == p2 );
+
+  // out
+  // test ctors leave things in the same positions...
+  ostringstream ost2("bob_marley:kaya");
+  p1 = ost2.tellp();
+
+  ofstream ofs2(str_lit01);
+  p2 = ofs2.tellp();
+  VERIFY( p1 == p2 );
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/tellp/char/2.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/tellp/char/2.cc
new file mode 100644 (file)
index 0000000..e278dae
--- /dev/null
@@ -0,0 +1,49 @@
+// 2000-03-23 bkoz
+
+// Copyright (C) 2000, 2003 Free Software Foundation
+//
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+//
+
+#include <sstream>
+#include <ostream>
+#include <testsuite_hooks.h>
+
+void test01()
+{
+  using namespace std;
+  typedef std::stringbuf::pos_type        pos_type;
+  typedef std::stringbuf::off_type        off_type;
+  bool test = true;
+
+  // tellp
+  ostringstream ost;
+  pos_type pos1;
+  pos1 = ost.tellp();
+  VERIFY( pos1 == pos_type(-1) );
+  ost << "RZA ";
+  pos1 = ost.tellp();
+  VERIFY( pos1 == pos_type(4) );
+  ost << "ghost dog: way of the samurai";
+  pos1 = ost.tellp();
+  VERIFY( pos1 == pos_type(33) );
+}                                    
+
+int main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostringstream/1.cc b/libstdc++-v3/testsuite/27_io/basic_ostringstream/1.cc
new file mode 100644 (file)
index 0000000..4fd6be6
--- /dev/null
@@ -0,0 +1,47 @@
+// 2002-07-25 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2002 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.7.3 - Class basic_ostringstream
+// NB: This file is for testing basic_ostringstream with NO OTHER INCLUDES.
+
+#include <sstream>
+
+// { dg-do compile }
+
+// libstdc++/7216
+void test01()
+{
+  // Check for required typedefs
+  typedef std::ostringstream test_type;
+  typedef test_type::char_type char_type;
+  typedef test_type::traits_type traits_type;
+  typedef test_type::int_type int_type;
+  typedef test_type::pos_type pos_type;
+  typedef test_type::off_type off_type;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostringstream/2.cc b/libstdc++-v3/testsuite/27_io/basic_ostringstream/2.cc
new file mode 100644 (file)
index 0000000..a1ca0bf
--- /dev/null
@@ -0,0 +1,42 @@
+// 2002-07-25 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2002 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.7.3 - Class basic_ostringstream
+// NB: This file is for testing basic_ostringstream with NO OTHER INCLUDES.
+
+#include <sstream>
+
+// { dg-do compile }
+
+namespace test 
+{
+  using namespace std;
+  typedef short type_t;
+  template class basic_ostringstream<type_t, char_traits<type_t> >;
+} // test
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostringstream/3.cc b/libstdc++-v3/testsuite/27_io/basic_ostringstream/3.cc
new file mode 100644 (file)
index 0000000..777b702
--- /dev/null
@@ -0,0 +1,149 @@
+// 1999-01-17 bkoz test functionality of basic_filebuf for char_type == char
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.1 - Template class basic_filebuf 
+// NB: This file is for testing basic_filebuf with NO OTHER INCLUDES.
+
+#include <sstream>
+#include <testsuite_hooks.h>
+
+// { dg-do compile }
+
+// libstdc++/2020
+// should be able to use custom char_type, custom traits type
+class gnu_char_type
+{
+  unsigned long character;
+public:
+  // operator ==
+  bool
+  operator==(const gnu_char_type& __lhs) 
+  { return character == __lhs.character; }
+
+  // operator <
+  bool
+  operator<(const gnu_char_type& __lhs) 
+  { return character < __lhs.character; }
+
+  // default ctor
+  gnu_char_type() { }
+
+  // to_char_type
+  gnu_char_type(const unsigned long& __l) : character(__l) { } 
+
+  // to_int_type
+  operator unsigned long() const { return character; }
+};
+
+// char_traits specialization
+struct gnu_char_traits
+{
+  typedef gnu_char_type        char_type;
+  typedef long                 int_type;
+  typedef long                 pos_type;
+  typedef unsigned long        off_type;
+  typedef long                 state_type;
+  
+  static void 
+  assign(char_type& __c1, const char_type& __c2) { }
+  
+  static bool 
+  eq(const char_type& __c1, const char_type& __c2) { return true; }
+  
+  static bool 
+  lt(const char_type& __c1, const char_type& __c2) { return true; }
+  
+  static int 
+  compare(const char_type* __s1, const char_type* __s2, size_t __n)
+  { return 0; }
+  
+  static size_t
+  length(const char_type* __s) { return 0; }
+  
+  static const char_type* 
+  find(const char_type* __s, size_t __n, const char_type& __a)
+  { return __s; }
+  
+  static char_type* 
+  move(char_type* __s1, const char_type* __s2, size_t __n)
+  { return __s1; }
+  
+  static char_type* 
+  copy(char_type* __s1, const char_type* __s2, size_t __n)
+  { return __s1; }
+  
+  static char_type* 
+  assign(char_type* __s, size_t __n, char_type __a)
+  { return __s; }
+  
+  static char_type 
+  to_char_type(const int_type& __c)
+  { return char_type(); }
+  
+  static int_type 
+  to_int_type(const char_type& __c)
+  { return int_type(); }
+  
+  static bool 
+  eq_int_type(const int_type& __c1, const int_type& __c2)
+  { return true; }
+  
+  static int_type 
+  eof()
+  { return int_type(); }
+  
+  static int_type 
+  not_eof(const int_type& __c)
+  { return int_type(); }
+};
+
+void test07()
+{
+  bool test = true;
+  typedef std::basic_ostringstream<gnu_char_type, gnu_char_traits> gnu_osstr;
+
+  try
+    { 
+      gnu_osstr obj;
+    }
+  catch(std::exception& obj)
+    { 
+      test = false; 
+      VERIFY( test );
+    }
+}
+
+#if !__GXX_WEAK__
+// Explicitly instantiate for systems with no COMDAT or weak support.
+template 
+  std::basic_streambuf<gnu_char_type>::int_type
+  std::basic_streambuf<gnu_char_type>::_S_pback_size;
+#endif
+
+int main() 
+{
+  test07();
+  return 0;
+}
+
+
+
+// more surf!!!
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostringstream/4.cc b/libstdc++-v3/testsuite/27_io/basic_ostringstream/4.cc
new file mode 100644 (file)
index 0000000..48c5638
--- /dev/null
@@ -0,0 +1,50 @@
+// 2003-03-26 B enjamin Kosnik  <bkoz@redhat.com>
+
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.1 - Template class basic_filebuf 
+
+#include <ostream>
+#include <sstream>
+
+void test01()
+{
+  // Check for required base class.
+  typedef std::ostringstream test_type;
+  typedef std::ostream base_type;
+  const test_type& obj = test_type();
+  const base_type* base = &obj;
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
+
+// more surf!!!
+
+
+
+
+
+
+
+
+
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostringstream/cons/char/3.cc b/libstdc++-v3/testsuite/27_io/basic_ostringstream/cons/char/3.cc
new file mode 100644 (file)
index 0000000..3edad1a
--- /dev/null
@@ -0,0 +1,64 @@
+// 2001-05-23 Benjamin Kosnik  <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.7.3.2 member functions (ostringstream_members)
+
+#include <sstream>
+#include <testsuite_hooks.h>
+
+// 03: sanity checks for strings, stringbufs
+void
+test03()
+{
+  bool test = false;
+
+  // Empty string sanity check.
+  std::string str01;
+  std::string::iterator __i_start = str01.begin();
+  std::string::iterator __i_end = str01.end();
+  std::string::size_type len = str01.size();
+  test = __i_start == __i_end;
+  VERIFY( len == 0 );
+
+  // Full string sanity check.
+  std::string str02("these golden days, i spend waiting for you:\n"
+                   "Betty Carter on Verve with I'm Yours and You're Mine.");
+  __i_start = str02.begin();
+  __i_end = str02.end();
+  len = str02.size();
+  VERIFY( __i_start != __i_end );
+  VERIFY( len != 0 );
+  // Test an empty ostringstream for sanity.
+  std::ostringstream ostrstream0;
+  std::string str03 = ostrstream0.str();
+  __i_start = str03.begin();
+  __i_end = str03.end();
+  len = str03.size();
+  VERIFY( __i_start == __i_end );
+  VERIFY( len == 0 );
+  VERIFY( str01 == str03 );
+}
+
+int main()
+{
+  test03();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostringstream/rdbuf/char/2832.cc b/libstdc++-v3/testsuite/27_io/basic_ostringstream/rdbuf/char/2832.cc
new file mode 100644 (file)
index 0000000..8019bba
--- /dev/null
@@ -0,0 +1,76 @@
+// 2001-05-23 Benjamin Kosnik  <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.7.3.2 member functions (ostringstream_members)
+
+#include <sstream>
+#include <testsuite_hooks.h>
+
+void 
+redirect_buffer(std::ios& stream, std::streambuf* new_buf) 
+{ stream.rdbuf(new_buf); }
+
+std::streambuf*
+active_buffer(std::ios& stream)
+{ return stream.rdbuf(); }
+
+// libstdc++/2832
+void test02()
+{
+  bool test = true;
+  const char* strlit01 = "fuck war";
+  const char* strlit02 = "two less cars abstract riot crew, critical mass/SF";
+  const std::string str00;
+  const std::string str01(strlit01);
+  std::string str02;
+  std::stringbuf sbuf(str01);
+  std::streambuf* pbasebuf0 = &sbuf;
+
+  std::ostringstream sstrm1;
+  VERIFY( sstrm1.str() == str00 );
+  // derived rdbuf() always returns original streambuf, even though
+  // it's no longer associated with the stream.
+  std::stringbuf* const buf1 = sstrm1.rdbuf();
+  // base rdbuf() returns the currently associated streambuf
+  std::streambuf* pbasebuf1 = active_buffer(sstrm1);
+  redirect_buffer(sstrm1, &sbuf);
+  std::stringbuf* const buf2 = sstrm1.rdbuf();
+  std::streambuf* pbasebuf2 = active_buffer(sstrm1);
+  VERIFY( buf1 == buf2 ); 
+  VERIFY( pbasebuf1 != pbasebuf2 );
+  VERIFY( pbasebuf2 == pbasebuf0 );
+
+  // derived rdbuf() returns the original buf, so str() doesn't change.
+  VERIFY( sstrm1.str() != str01 );
+  VERIFY( sstrm1.str() == str00 );
+  // however, casting the active streambuf to a stringbuf shows what's up:
+  std::stringbuf* psbuf = dynamic_cast<std::stringbuf*>(pbasebuf2);
+  str02 = psbuf->str();
+  VERIFY( str02 == str01 );
+
+  // How confusing and non-intuitive is this?
+  // These semantics are a joke, a serious defect, and incredibly lame.
+}
+
+int main()
+{
+  test02();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostringstream/str/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_ostringstream/str/char/1.cc
new file mode 100644 (file)
index 0000000..7a3b758
--- /dev/null
@@ -0,0 +1,54 @@
+// 2001-05-23 Benjamin Kosnik  <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.7.3.2 member functions (ostringstream_members)
+
+#include <sstream>
+#include <testsuite_hooks.h>
+
+void test01()
+{
+  bool test = true;
+  std::ostringstream os01;
+  const std::string str00; 
+  const std::string str01 = "123";
+  std::string str02;
+  const int i01 = 123;
+  int a,b;
+
+  std::ios_base::iostate state1, state2, statefail, stateeof;
+  statefail = std::ios_base::failbit;
+  stateeof = std::ios_base::eofbit;
+
+  // string str() const
+  str02 = os01.str();
+  VERIFY( str00 == str02 );
+
+  // void str(const basic_string&)
+  os01.str(str01);
+  str02 = os01.str();
+  VERIFY( str01 == str02 );
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostringstream/str/char/2.cc b/libstdc++-v3/testsuite/27_io/basic_ostringstream/str/char/2.cc
new file mode 100644 (file)
index 0000000..310b298
--- /dev/null
@@ -0,0 +1,46 @@
+// 2001-05-23 Benjamin Kosnik  <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.7.3.2 member functions (ostringstream_members)
+
+#include <sstream>
+#include <testsuite_hooks.h>
+
+// user-reported error
+class derived_oss: public std::ostringstream 
+{
+public:
+  derived_oss() : std::ostringstream() { }
+};
+
+void
+test04()
+{
+  bool test = true;
+  derived_oss yy;
+  yy << "buena vista social club\n";
+  VERIFY( yy.str() == std::string("buena vista social club\n") );
+}
+
+int main()
+{
+  test04();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_streambuf/1.cc b/libstdc++-v3/testsuite/27_io/basic_streambuf/1.cc
new file mode 100644 (file)
index 0000000..d666528
--- /dev/null
@@ -0,0 +1,48 @@
+// 2002-07-25 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.5.2 - Template class basic_streambuf
+// NB: This file is for testing basic_streambuf with NO OTHER INCLUDES.
+
+#include <streambuf>
+#include <testsuite_hooks.h>
+
+// { dg-do compile }
+
+// libstdc++/7216
+void test01()
+{
+  // Check for required typedefs
+  typedef std::streambuf test_type;
+  typedef test_type::char_type char_type;
+  typedef test_type::traits_type traits_type;
+  typedef test_type::int_type int_type;
+  typedef test_type::pos_type pos_type;
+  typedef test_type::off_type off_type;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_streambuf/2.cc b/libstdc++-v3/testsuite/27_io/basic_streambuf/2.cc
new file mode 100644 (file)
index 0000000..b3a4826
--- /dev/null
@@ -0,0 +1,45 @@
+// 2002-07-25 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.5.2 - Template class basic_streambuf
+// NB: This file is for testing basic_streambuf with NO OTHER INCLUDES.
+
+#include <streambuf>
+#include <testsuite_hooks.h>
+
+// { dg-do compile }
+
+namespace test 
+{
+  using namespace std;
+  using __gnu_cxx_test::pod_char;
+  typedef short type_t;
+  template class basic_streambuf<type_t, char_traits<type_t> >;
+  template class basic_streambuf<pod_char, char_traits<pod_char> >;
+} // test
diff --git a/libstdc++-v3/testsuite/27_io/basic_streambuf/3.cc b/libstdc++-v3/testsuite/27_io/basic_streambuf/3.cc
new file mode 100644 (file)
index 0000000..ffc765f
--- /dev/null
@@ -0,0 +1,147 @@
+// 1999-01-17 bkoz test functionality of basic_filebuf for char_type == char
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.1 - Template class basic_filebuf 
+// NB: This file is for testing basic_filebuf with NO OTHER INCLUDES.
+
+#include <fstream>
+#include <testsuite_hooks.h>
+
+// libstdc++/2020
+// should be able to use custom char_type, custom traits type
+class gnu_char_type
+{
+  unsigned long character;
+public:
+  // operator ==
+  bool
+  operator==(const gnu_char_type& __lhs) 
+  { return character == __lhs.character; }
+
+  // operator <
+  bool
+  operator<(const gnu_char_type& __lhs) 
+  { return character < __lhs.character; }
+
+  // default ctor
+  gnu_char_type() { }
+
+  // to_char_type
+  gnu_char_type(const unsigned long& __l) : character(__l) { } 
+
+  // to_int_type
+  operator unsigned long() const { return character; }
+};
+
+// char_traits specialization
+struct gnu_char_traits
+{
+  typedef gnu_char_type        char_type;
+  typedef long                 int_type;
+  typedef long                 pos_type;
+  typedef unsigned long        off_type;
+  typedef long                 state_type;
+  
+  static void 
+  assign(char_type& __c1, const char_type& __c2) { }
+  
+  static bool 
+  eq(const char_type& __c1, const char_type& __c2) { return true; }
+  
+  static bool 
+  lt(const char_type& __c1, const char_type& __c2) { return true; }
+  
+  static int 
+  compare(const char_type* __s1, const char_type* __s2, size_t __n)
+  { return 0; }
+  
+  static size_t
+  length(const char_type* __s) { return 0; }
+  
+  static const char_type* 
+  find(const char_type* __s, size_t __n, const char_type& __a)
+  { return __s; }
+  
+  static char_type* 
+  move(char_type* __s1, const char_type* __s2, size_t __n)
+  { return __s1; }
+  
+  static char_type* 
+  copy(char_type* __s1, const char_type* __s2, size_t __n)
+  { return __s1; }
+  
+  static char_type* 
+  assign(char_type* __s, size_t __n, char_type __a)
+  { return __s; }
+  
+  static char_type 
+  to_char_type(const int_type& __c)
+  { return char_type(); }
+  
+  static int_type 
+  to_int_type(const char_type& __c)
+  { return int_type(); }
+  
+  static bool 
+  eq_int_type(const int_type& __c1, const int_type& __c2)
+  { return true; }
+  
+  static int_type 
+  eof()
+  { return int_type(); }
+  
+  static int_type 
+  not_eof(const int_type& __c)
+  { return int_type(); }
+};
+
+class gnu_sbuf: public std::basic_streambuf<gnu_char_type, gnu_char_traits>
+{ };
+
+void test07()
+{
+  bool test = true;
+  
+  try
+    { gnu_sbuf obj; }
+  catch(std::exception& obj)
+    { 
+      test = false; 
+      VERIFY( test );
+    }
+}
+
+#if !__GXX_WEAK__
+// Explicitly instantiate for systems with no COMDAT or weak support.
+template 
+  std::basic_streambuf<gnu_char_type>::int_type
+  std::basic_streambuf<gnu_char_type>::_S_pback_size;
+#endif
+
+int main() 
+{
+  test07();
+  return 0;
+}
+
+
+
+// more surf!!!
diff --git a/libstdc++-v3/testsuite/27_io/basic_streambuf/cons/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_streambuf/cons/char/1.cc
new file mode 100644 (file)
index 0000000..9058524
--- /dev/null
@@ -0,0 +1,111 @@
+// 1999-10-11 bkoz
+
+// Copyright (C) 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.5.2 template class basic_streambuf
+
+#include <streambuf>
+#include <testsuite_hooks.h>
+
+class testbuf : public std::streambuf
+{
+public:
+
+  // Typedefs:
+  typedef std::streambuf::traits_type traits_type;
+  typedef std::streambuf::char_type char_type;
+
+  testbuf(): std::streambuf() 
+  { _M_mode = (std::ios_base::in | std::ios_base::out); }
+
+  bool
+  check_pointers()
+  { 
+    bool test = true;
+    VERIFY( this->eback() == NULL );
+    VERIFY( this->gptr() == NULL );
+    VERIFY( this->egptr() == NULL );
+    VERIFY( this->pbase() == NULL );
+    VERIFY( this->pptr() == NULL );
+    VERIFY( this->epptr() == NULL );
+    return test;
+  }
+
+  int_type 
+  pub_uflow() 
+  { return (this->uflow()); }
+
+  int_type 
+  pub_overflow(int_type __c = traits_type::eof()) 
+  { return (this->overflow(__c)); }
+
+  int_type 
+  pub_pbackfail(int_type __c) 
+  { return (this->pbackfail(__c)); }
+
+  void 
+  pub_setg(char* beg, char* cur, char *end) 
+  { this->setg(beg, cur, end); }
+
+  void 
+  pub_setp(char* beg, char* end) 
+  { this->setp(beg, end); }
+
+protected:
+  int_type 
+  underflow() 
+  { 
+    int_type __retval = traits_type::eof();
+    if (this->gptr() < this->egptr())
+      __retval = traits_type::not_eof(0); 
+    return __retval;
+  }
+};
+
+void test01()
+{
+  typedef testbuf::traits_type traits_type;
+  typedef testbuf::int_type int_type;
+
+  bool test = true;
+  char* lit01 = "chicago underground trio/possible cube on delmark";
+  testbuf buf01;
+
+  // 27.5.2.1 basic_streambuf ctors
+  // default ctor initializes 
+  // - all pointer members to null pointers
+  // - locale to current global locale
+  VERIFY( buf01.check_pointers() );
+  VERIFY( buf01.getloc() == std::locale() );
+}
+
+int main() 
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_streambuf/imbue/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_streambuf/imbue/char/1.cc
new file mode 100644 (file)
index 0000000..b574cdc
--- /dev/null
@@ -0,0 +1,52 @@
+// 981208 bkoz test functionality of basic_stringbuf for char_type == char
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+#include <streambuf>
+#include <testsuite_hooks.h>
+
+class testbuf : public std::streambuf
+{
+public:
+  typedef std::streambuf::traits_type traits_type;
+
+  testbuf() : std::streambuf() { }
+};
+
+// test the streambuf locale settings
+void test02() 
+{
+  testbuf buf;
+  std::locale loc_c = std::locale::classic();
+  loc_c = buf.getloc();
+  buf.pubimbue(loc_c); //This should initialize _M_init to true
+  std::locale loc_tmp = buf.getloc(); 
+  VERIFY( loc_tmp == loc_c );
+}
+
+int main()
+{
+  test02();
+  return 0;
+}
+
+
+
+// more candy!!!
diff --git a/libstdc++-v3/testsuite/27_io/basic_streambuf/imbue/char/9322.cc b/libstdc++-v3/testsuite/27_io/basic_streambuf/imbue/char/9322.cc
new file mode 100644 (file)
index 0000000..3b8da10
--- /dev/null
@@ -0,0 +1,72 @@
+// 1999-10-11 bkoz
+
+// Copyright (C) 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.5.2 template class basic_streambuf
+
+#include <cstring> // for memset, memcmp
+#include <streambuf>
+#include <sstream>
+#include <ostream>
+#include <testsuite_hooks.h>
+
+class testbuf : public std::streambuf
+{
+public:
+  typedef std::streambuf::traits_type traits_type;
+
+  testbuf() : std::streambuf() { }
+};
+
+// libstdc++/9322
+void test08()
+{
+  using std::locale;
+  bool test = true;
+
+  locale loc;
+  testbuf ob;
+  VERIFY( ob.getloc() == loc );
+
+  locale::global(locale("en_US"));
+  VERIFY( ob.getloc() == loc );
+
+  locale loc_de ("de_DE");
+  locale ret = ob.pubimbue(loc_de);
+  VERIFY( ob.getloc() == loc_de );
+  VERIFY( ret == loc );
+
+  locale::global(loc);
+  VERIFY( ob.getloc() == loc_de );
+}
+
+int main() 
+{
+  __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test08);
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_streambuf/overflow/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_streambuf/overflow/char/1.cc
new file mode 100644 (file)
index 0000000..386193b
--- /dev/null
@@ -0,0 +1,116 @@
+// 1999-10-11 bkoz
+
+// Copyright (C) 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.5.2 template class basic_streambuf
+
+#include <streambuf>
+#include <testsuite_hooks.h>
+
+class testbuf : public std::streambuf
+{
+public:
+
+  // Typedefs:
+  typedef std::streambuf::traits_type traits_type;
+  typedef std::streambuf::char_type char_type;
+
+  testbuf(): std::streambuf() 
+  { _M_mode = (std::ios_base::in | std::ios_base::out); }
+
+  bool
+  check_pointers()
+  { 
+    bool test = true;
+    VERIFY( this->eback() == NULL );
+    VERIFY( this->gptr() == NULL );
+    VERIFY( this->egptr() == NULL );
+    VERIFY( this->pbase() == NULL );
+    VERIFY( this->pptr() == NULL );
+    VERIFY( this->epptr() == NULL );
+    return test;
+  }
+
+  int_type 
+  pub_uflow() 
+  { return (this->uflow()); }
+
+  int_type 
+  pub_overflow(int_type __c = traits_type::eof()) 
+  { return (this->overflow(__c)); }
+
+  int_type 
+  pub_pbackfail(int_type __c) 
+  { return (this->pbackfail(__c)); }
+
+  void 
+  pub_setg(char* beg, char* cur, char *end) 
+  { this->setg(beg, cur, end); }
+
+  void 
+  pub_setp(char* beg, char* end) 
+  { this->setp(beg, end); }
+
+protected:
+  int_type 
+  underflow() 
+  { 
+    int_type __retval = traits_type::eof();
+    if (this->gptr() < this->egptr())
+      __retval = traits_type::not_eof(0); 
+    return __retval;
+  }
+};
+
+void test01()
+{
+  typedef testbuf::traits_type traits_type;
+  typedef testbuf::int_type int_type;
+
+  bool test = true;
+  char* lit01 = "chicago underground trio/possible cube on delmark";
+  testbuf buf01;
+
+  // pbackfail
+  int i01 = 3;
+  buf01.pub_setg(lit01, lit01, (lit01 + i01));
+  VERIFY( i01 == buf01.in_avail() );
+  int_type intt01 = traits_type::to_int_type('b');
+  VERIFY( traits_type::eof() == buf01.pub_pbackfail(intt01) );
+
+  // overflow
+  VERIFY( traits_type::eof() == buf01.pub_overflow(intt01) );
+  VERIFY( traits_type::eof() == buf01.pub_overflow() );
+  VERIFY( buf01.sgetc() == traits_type::to_int_type(lit01[0]) );
+}
+
+int main() 
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_streambuf/overflow/char/2.cc b/libstdc++-v3/testsuite/27_io/basic_streambuf/overflow/char/2.cc
new file mode 100644 (file)
index 0000000..dcee654
--- /dev/null
@@ -0,0 +1,80 @@
+// 1999-10-11 bkoz
+
+// Copyright (C) 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.5.2 template class basic_streambuf
+
+#include <streambuf>
+#include <ostream>
+#include <testsuite_hooks.h>
+
+// test03
+// http://gcc.gnu.org/ml/libstdc++/2000-q1/msg00151.html
+template<typename charT, typename traits = std::char_traits<charT> >
+  class basic_nullbuf : public std::basic_streambuf<charT, traits>
+  {
+  protected:
+    typedef typename
+      std::basic_streambuf<charT, traits>::int_type int_type;
+    virtual int_type 
+    overflow(int_type c) 
+    {  return traits::not_eof(c); }
+  };
+
+typedef basic_nullbuf<char> nullbuf;
+
+template<typename T>
+  char
+  print(const T& x) 
+  {
+   nullbuf ob;
+   std::ostream out(&ob); 
+   out << x << std::endl;
+   return (!out ? '0' : '1');
+ }
+
+void test03() 
+{
+  bool test = true;
+  const std::string control01("11111");
+  std::string test01;
+
+  test01 += print(true);
+  test01 += print(3.14159);
+  test01 += print(10);
+  test01 += print('x');
+  test01 += print("pipo");
+
+  VERIFY( test01 == control01 );
+}
+
+int main() 
+{
+  test03();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_streambuf/overflow/char/3599.cc b/libstdc++-v3/testsuite/27_io/basic_streambuf/overflow/char/3599.cc
new file mode 100644 (file)
index 0000000..1b6cf0c
--- /dev/null
@@ -0,0 +1,68 @@
+// 1999-10-11 bkoz
+
+// Copyright (C) 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.5.2 template class basic_streambuf
+
+#include <streambuf>
+#include <ostream>
+#include <testsuite_hooks.h>
+
+// libstdc++/3599
+class testbuf : public std::streambuf
+{
+public:
+  typedef std::streambuf::traits_type traits_type;
+
+  testbuf() : std::streambuf() { }
+protected:
+  int_type 
+  overflow(int_type c = traits_type::eof()) 
+  { return traits_type::not_eof(0); }
+};
+
+void
+test07()
+{
+  bool test = true;
+  testbuf ob;
+  std::ostream out(&ob); 
+
+  out << "gasp";
+  VERIFY(out.good());
+
+  out << std::endl;
+  VERIFY(out.good());
+}
+
+int main() 
+{
+  test07();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_streambuf/sgetc/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_streambuf/sgetc/char/1.cc
new file mode 100644 (file)
index 0000000..9efa3a7
--- /dev/null
@@ -0,0 +1,118 @@
+// 1999-10-11 bkoz
+
+// Copyright (C) 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.5.2 template class basic_streambuf
+
+#include <streambuf>
+#include <testsuite_hooks.h>
+
+class testbuf : public std::streambuf
+{
+public:
+
+  // Typedefs:
+  typedef std::streambuf::traits_type traits_type;
+  typedef std::streambuf::char_type char_type;
+
+  testbuf(): std::streambuf() 
+  { _M_mode = (std::ios_base::in | std::ios_base::out); }
+
+  bool
+  check_pointers()
+  { 
+    bool test = true;
+    VERIFY( this->eback() == NULL );
+    VERIFY( this->gptr() == NULL );
+    VERIFY( this->egptr() == NULL );
+    VERIFY( this->pbase() == NULL );
+    VERIFY( this->pptr() == NULL );
+    VERIFY( this->epptr() == NULL );
+    return test;
+  }
+
+  int_type 
+  pub_uflow() 
+  { return (this->uflow()); }
+
+  int_type 
+  pub_overflow(int_type __c = traits_type::eof()) 
+  { return (this->overflow(__c)); }
+
+  int_type 
+  pub_pbackfail(int_type __c) 
+  { return (this->pbackfail(__c)); }
+
+  void 
+  pub_setg(char* beg, char* cur, char *end) 
+  { this->setg(beg, cur, end); }
+
+  void 
+  pub_setp(char* beg, char* end) 
+  { this->setp(beg, end); }
+
+protected:
+  int_type 
+  underflow() 
+  { 
+    int_type __retval = traits_type::eof();
+    if (this->gptr() < this->egptr())
+      __retval = traits_type::not_eof(0); 
+    return __retval;
+  }
+};
+
+void test01()
+{
+  typedef testbuf::traits_type traits_type;
+  typedef testbuf::int_type int_type;
+
+  bool test = true;
+  char* lit01 = "chicago underground trio/possible cube on delmark";
+  testbuf buf01;
+
+  // 27.5.2.3.1 get area
+  // 27.5.2.2.3 get area
+  // 27.5.2.4.3 get area
+  int i01 = 3;
+  buf01.pub_setg(lit01, lit01, (lit01 + i01));
+  VERIFY( i01 == buf01.in_avail() );
+
+  VERIFY( buf01.pub_uflow() == lit01[0] );
+  VERIFY( buf01.sgetc() == traits_type::to_int_type(lit01[1]) );
+  VERIFY( buf01.pub_uflow() == lit01[1] );
+  VERIFY( buf01.sgetc() == traits_type::to_int_type(lit01[2]) );
+  VERIFY( buf01.pub_uflow() == lit01[2] );
+  VERIFY( buf01.sgetc() == traits_type::eof() );
+}
+
+int main() 
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_streambuf/sgetn/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_streambuf/sgetn/char/1.cc
new file mode 100644 (file)
index 0000000..2466de5
--- /dev/null
@@ -0,0 +1,126 @@
+// 1999-10-11 bkoz
+
+// Copyright (C) 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.5.2 template class basic_streambuf
+
+#include <streambuf>
+#include <testsuite_hooks.h>
+
+class testbuf : public std::streambuf
+{
+public:
+
+  // Typedefs:
+  typedef std::streambuf::traits_type traits_type;
+  typedef std::streambuf::char_type char_type;
+
+  testbuf(): std::streambuf() 
+  { _M_mode = (std::ios_base::in | std::ios_base::out); }
+
+  bool
+  check_pointers()
+  { 
+    bool test = true;
+    VERIFY( this->eback() == NULL );
+    VERIFY( this->gptr() == NULL );
+    VERIFY( this->egptr() == NULL );
+    VERIFY( this->pbase() == NULL );
+    VERIFY( this->pptr() == NULL );
+    VERIFY( this->epptr() == NULL );
+    return test;
+  }
+
+  int_type 
+  pub_uflow() 
+  { return (this->uflow()); }
+
+  int_type 
+  pub_overflow(int_type __c = traits_type::eof()) 
+  { return (this->overflow(__c)); }
+
+  int_type 
+  pub_pbackfail(int_type __c) 
+  { return (this->pbackfail(__c)); }
+
+  void 
+  pub_setg(char* beg, char* cur, char *end) 
+  { this->setg(beg, cur, end); }
+
+  void 
+  pub_setp(char* beg, char* end) 
+  { this->setp(beg, end); }
+
+protected:
+  int_type 
+  underflow() 
+  { 
+    int_type __retval = traits_type::eof();
+    if (this->gptr() < this->egptr())
+      __retval = traits_type::not_eof(0); 
+    return __retval;
+  }
+};
+
+void test02()
+{
+  typedef testbuf::traits_type traits_type;
+  typedef testbuf::int_type int_type;
+
+  bool test = true;
+  char* lit01 = "chicago underground trio/possible cube on delmark";
+  testbuf buf01;
+
+  // 27.5.2.1 basic_streambuf ctors
+  // default ctor initializes 
+  // - all pointer members to null pointers
+  // - locale to current global locale
+  VERIFY( buf01.check_pointers() );
+  VERIFY( buf01.getloc() == std::locale() );
+
+  // 27.5.2.2.5 Put area
+  size_t i01 = traits_type::length(lit01);
+  char carray01[i01];
+  std::memset(carray01, 0, i01);
+  
+  buf01.pub_setg(lit01, lit01, lit01 + i01);
+  buf01.sgetn(carray01, 0);
+  VERIFY( carray01[0] == 0 );
+  buf01.sgetn(carray01, 1);
+  VERIFY( carray01[0] == 'c' );
+  buf01.sgetn(carray01 + 1, i01 - 1);
+  VERIFY( carray01[0] == 'c' );
+  VERIFY( carray01[1] == 'h' );
+  VERIFY( carray01[i01 - 1] == 'k' );
+}
+
+int main() 
+{
+  test02();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_streambuf/sputbackc/char/9538.cc b/libstdc++-v3/testsuite/27_io/basic_streambuf/sputbackc/char/9538.cc
new file mode 100644 (file)
index 0000000..b90e3d5
--- /dev/null
@@ -0,0 +1,65 @@
+// 2001-05-21 Benjamin Kosnik  <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <streambuf>
+#include <locale>
+#include <testsuite_hooks.h>
+
+class MyTraits : public std::char_traits<char>
+{
+public:
+  static bool eq(char c1, char c2)
+  {
+    bool test = true;
+    VERIFY( c1 != 'X' );
+    VERIFY( c2 != 'X' );
+    return std::char_traits<char>::eq(c1, c2);
+  }
+};
+
+class MyBuf : public std::basic_streambuf<char, MyTraits>
+{
+  char buffer[8];
+
+public:
+  MyBuf()
+  {
+    std::memset(buffer, 'X', sizeof(buffer));
+    std::memset(buffer + 2, 'f', 4);
+    setg(buffer + 2, buffer + 2, buffer + 6);
+  }
+};
+
+// libstdc++/9538
+void test08()
+{
+  bool test = true;
+
+  MyBuf mb;
+  mb.sputbackc('a');  
+}
+
+main() 
+{
+  test08();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_streambuf/sputc/char/1057.cc b/libstdc++-v3/testsuite/27_io/basic_streambuf/sputc/char/1057.cc
new file mode 100644 (file)
index 0000000..de84951
--- /dev/null
@@ -0,0 +1,61 @@
+// 1999-10-11 bkoz
+
+// Copyright (C) 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.5.2 template class basic_streambuf
+
+#include <string>
+#include <streambuf>
+#include <testsuite_hooks.h>
+
+class nullsetpbuf : public std::streambuf
+{
+  char foo[64];
+public:
+  nullsetpbuf()
+  {
+    setp(foo, foo + 64);
+    setp(NULL, NULL);
+  }
+};
+
+// libstdc++/1057
+void test05()
+{
+  std::string text1 = "abcdefghijklmn";
+  
+  nullsetpbuf nsp;
+  // Immediate crash as sputc writes to null pointer
+  nsp.sputc('a');
+}
+
+int main() 
+{
+  test05();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_streambuf/sputn/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_streambuf/sputn/char/1.cc
new file mode 100644 (file)
index 0000000..f48f788
--- /dev/null
@@ -0,0 +1,124 @@
+// 1999-10-11 bkoz
+
+// Copyright (C) 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.5.2 template class basic_streambuf
+
+#include <streambuf>
+#include <testsuite_hooks.h>
+
+class testbuf : public std::streambuf
+{
+public:
+
+  // Typedefs:
+  typedef std::streambuf::traits_type traits_type;
+  typedef std::streambuf::char_type char_type;
+
+  testbuf(): std::streambuf() 
+  { _M_mode = (std::ios_base::in | std::ios_base::out); }
+
+  bool
+  check_pointers()
+  { 
+    bool test = true;
+    VERIFY( this->eback() == NULL );
+    VERIFY( this->gptr() == NULL );
+    VERIFY( this->egptr() == NULL );
+    VERIFY( this->pbase() == NULL );
+    VERIFY( this->pptr() == NULL );
+    VERIFY( this->epptr() == NULL );
+    return test;
+  }
+
+  int_type 
+  pub_uflow() 
+  { return (this->uflow()); }
+
+  int_type 
+  pub_overflow(int_type __c = traits_type::eof()) 
+  { return (this->overflow(__c)); }
+
+  int_type 
+  pub_pbackfail(int_type __c) 
+  { return (this->pbackfail(__c)); }
+
+  void 
+  pub_setg(char* beg, char* cur, char *end) 
+  { this->setg(beg, cur, end); }
+
+  void 
+  pub_setp(char* beg, char* end) 
+  { this->setp(beg, end); }
+
+protected:
+  int_type 
+  underflow() 
+  { 
+    int_type __retval = traits_type::eof();
+    if (this->gptr() < this->egptr())
+      __retval = traits_type::not_eof(0); 
+    return __retval;
+  }
+};
+
+void test01()
+{
+  typedef testbuf::traits_type traits_type;
+  typedef testbuf::int_type int_type;
+
+  bool test = true;
+  char* lit01 = "chicago underground trio/possible cube on delmark";
+  testbuf buf01;
+  int i01 = 3;
+
+  // sputn/xsputn
+  char* lit02 = "isotope 217: the unstable molecule on thrill jockey";
+  int i02 = std::strlen(lit02);
+  char carray[i02 + 1];
+  std::memset(carray, 0, i02 + 1);
+
+  buf01.pub_setp(carray, (carray + i02));
+  buf01.sputn(lit02, 0);
+  VERIFY( carray[0] == 0 );
+  VERIFY( lit02[0] == 'i' );
+  buf01.sputn(lit02, 1);
+  VERIFY( lit02[0] == carray[0] );
+  VERIFY( lit02[1] == 's' );
+  VERIFY( carray[1] == 0 );
+  buf01.sputn(lit02 + 1, 10);
+  VERIFY( std::memcmp(lit02, carray, 10) == 0 );
+  buf01.sputn(lit02 + 11, 20);
+  VERIFY( std::memcmp(lit02, carray, 30) == 0 );
+}
+
+int main() 
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_streambuf/sputn/char/1057.cc b/libstdc++-v3/testsuite/27_io/basic_streambuf/sputn/char/1057.cc
new file mode 100644 (file)
index 0000000..628e2e7
--- /dev/null
@@ -0,0 +1,61 @@
+// 1999-10-11 bkoz
+
+// Copyright (C) 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.5.2 template class basic_streambuf
+
+#include <streambuf>
+#include <sstream>
+#include <testsuite_hooks.h>
+
+class nullsetpbuf : public std::streambuf
+{
+  char foo[64];
+public:
+  nullsetpbuf()
+  {
+    setp(foo, foo + 64);
+    setp(NULL, NULL);
+  }
+};
+
+// libstdc++/1057
+void test05()
+{
+  std::string text1 = "abcdefghijklmn";
+  
+  nullsetpbuf nsp;
+  // Immediate crash as xsputn writes to null pointer
+  nsp.sputn(text1.c_str(), text1.length());
+}
+
+int main() 
+{
+  test05();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_streambuf/sync/char/1057.cc b/libstdc++-v3/testsuite/27_io/basic_streambuf/sync/char/1057.cc
new file mode 100644 (file)
index 0000000..8e2d3c0
--- /dev/null
@@ -0,0 +1,108 @@
+// 1999-10-11 bkoz
+
+// Copyright (C) 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.5.2 template class basic_streambuf
+
+#include <streambuf>
+#include <testsuite_hooks.h>
+
+class setpbuf : public std::streambuf
+{
+  char                 buffer[4];
+  std::string  result;
+
+public:
+
+  std::string&
+  get_result()
+  { return result; }
+
+  setpbuf()
+  {
+    char foo [32];
+    setp(foo, foo + 32);
+    setp(buffer, buffer + 4);
+  }
+
+  ~setpbuf()
+  { sync(); }
+
+  virtual int_type 
+  overflow(int_type n)
+  {
+    if (sync() != 0)
+      return traits_type::eof();
+    
+    result += traits_type::to_char_type(n);
+    
+    return n;
+  }
+  
+  virtual int 
+  sync()
+  {
+    result.append(pbase(), pptr());
+    setp(buffer, buffer + 4);
+    return 0;
+  }
+};
+
+// libstdc++/1057
+void test04()
+{
+  bool test = true;
+  std::string text = "abcdefghijklmn";
+  
+  // 01
+  setpbuf sp1;
+  // Here xsputn writes over sp1.result
+  sp1.sputn(text.c_str(), text.length());
+
+  // This crashes when result is accessed
+  sp1.pubsync();
+  VERIFY( sp1.get_result() == text );
+  
+  // 02
+  setpbuf sp2;
+  for (std::string::size_type i = 0; i < text.length(); ++i)
+    {
+      // sputc also writes over result
+      sp2.sputc(text[i]);
+    }
+  
+  // Crash here
+  sp2.pubsync();
+  VERIFY( sp2.get_result() == text );
+}
+
+int main() 
+{
+  test04();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_stringbuf/1.cc b/libstdc++-v3/testsuite/27_io/basic_stringbuf/1.cc
new file mode 100644 (file)
index 0000000..a91deab
--- /dev/null
@@ -0,0 +1,63 @@
+// 2002-07-25 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.7.1 - Template class basic_stringbuf
+// NB: This file is for testing basic_stringbuf with NO OTHER INCLUDES.
+
+#include <sstream>
+#include <testsuite_hooks.h>
+
+// { dg-do compile }
+
+// libstdc++/7216
+void test01()
+{
+  // Check for required typedefs
+  typedef std::stringbuf test_type;
+  typedef test_type::char_type char_type;
+  typedef test_type::traits_type traits_type;
+  typedef test_type::int_type int_type;
+  typedef test_type::pos_type pos_type;
+  typedef test_type::off_type off_type;
+}
+
+namespace test 
+{
+  using namespace std;
+  using __gnu_cxx_test::pod_char;
+  typedef short type_t;
+  template class basic_stringbuf<type_t, char_traits<type_t> >;
+  template class basic_stringbuf<pod_char, char_traits<pod_char> >;
+} // test
+
+int main() 
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_stringbuf/2.cc b/libstdc++-v3/testsuite/27_io/basic_stringbuf/2.cc
new file mode 100644 (file)
index 0000000..f40868a
--- /dev/null
@@ -0,0 +1,51 @@
+// 1999-01-17 bkoz test functionality of basic_filebuf for char_type == char
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.7.1 - Template class basic_stringbuf
+// NB: This file is for testing basic_filebuf with NO OTHER INCLUDES.
+
+#include <sstream>
+#include <testsuite_hooks.h>
+
+// { dg-do compile }
+
+// test05
+// libstdc++/1886
+// should be able to instantiate basic_stringbuf for non-standard types.
+namespace test 
+{
+  using namespace std;
+  using __gnu_cxx_test::pod_char;
+  typedef short type_t;
+  template class basic_stringbuf<type_t, char_traits<type_t> >;
+  template class basic_stringbuf<pod_char, char_traits<pod_char> >;
+} // test
+
+// more surf!!!
+
+
+
+
+
+
+
+
+
diff --git a/libstdc++-v3/testsuite/27_io/basic_stringbuf/3.cc b/libstdc++-v3/testsuite/27_io/basic_stringbuf/3.cc
new file mode 100644 (file)
index 0000000..93358cc
--- /dev/null
@@ -0,0 +1,145 @@
+// 1999-01-17 bkoz test functionality of basic_filebuf for char_type == char
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.7.1 - Template class basic_stringbuf
+// NB: This file is for testing basic_filebuf with NO OTHER INCLUDES.
+
+#include <sstream>
+#include <testsuite_hooks.h>
+
+// libstdc++/2020
+// should be able to use custom char_type, custom traits type
+class gnu_char_type
+{
+  unsigned long character;
+public:
+  // operator ==
+  bool
+  operator==(const gnu_char_type& __lhs) 
+  { return character == __lhs.character; }
+
+  // operator <
+  bool
+  operator<(const gnu_char_type& __lhs) 
+  { return character < __lhs.character; }
+
+  // default ctor
+  gnu_char_type() { }
+
+  // to_char_type
+  gnu_char_type(const unsigned long& __l) : character(__l) { } 
+
+  // to_int_type
+  operator unsigned long() const { return character; }
+};
+
+// char_traits specialization
+struct gnu_char_traits
+{
+  typedef gnu_char_type        char_type;
+  typedef long                 int_type;
+  typedef long                 pos_type;
+  typedef unsigned long        off_type;
+  typedef long                 state_type;
+  
+  static void 
+  assign(char_type& __c1, const char_type& __c2) { }
+  
+  static bool 
+  eq(const char_type& __c1, const char_type& __c2) { return true; }
+  
+  static bool 
+  lt(const char_type& __c1, const char_type& __c2) { return true; }
+  
+  static int 
+  compare(const char_type* __s1, const char_type* __s2, size_t __n)
+  { return 0; }
+  
+  static size_t
+  length(const char_type* __s) { return 0; }
+  
+  static const char_type* 
+  find(const char_type* __s, size_t __n, const char_type& __a)
+  { return __s; }
+  
+  static char_type* 
+  move(char_type* __s1, const char_type* __s2, size_t __n)
+  { return __s1; }
+  
+  static char_type* 
+  copy(char_type* __s1, const char_type* __s2, size_t __n)
+  { return __s1; }
+  
+  static char_type* 
+  assign(char_type* __s, size_t __n, char_type __a)
+  { return __s; }
+  
+  static char_type 
+  to_char_type(const int_type& __c)
+  { return char_type(); }
+  
+  static int_type 
+  to_int_type(const char_type& __c)
+  { return int_type(); }
+  
+  static bool 
+  eq_int_type(const int_type& __c1, const int_type& __c2)
+  { return true; }
+  
+  static int_type 
+  eof()
+  { return int_type(); }
+  
+  static int_type 
+  not_eof(const int_type& __c)
+  { return int_type(); }
+};
+
+void test07()
+{
+  bool test = true;
+  typedef std::basic_stringbuf<gnu_char_type, gnu_char_traits> gnu_ssbuf;
+  
+  try
+    { gnu_ssbuf obj; }
+  catch(std::exception& obj)
+    { 
+      test = false; 
+      VERIFY( test );
+    }
+}
+
+#if !__GXX_WEAK__
+// Explicitly instantiate for systems with no COMDAT or weak support.
+template 
+  std::basic_streambuf<gnu_char_type>::int_type
+  std::basic_streambuf<gnu_char_type>::_S_pback_size;
+#endif
+
+int main() 
+{
+  test07();
+  return 0;
+}
+
+
+
+// more surf!!!
diff --git a/libstdc++-v3/testsuite/27_io/basic_stringbuf/4.cc b/libstdc++-v3/testsuite/27_io/basic_stringbuf/4.cc
new file mode 100644 (file)
index 0000000..cd4c431
--- /dev/null
@@ -0,0 +1,47 @@
+// 2003-04-07 bkoz
+
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.7.1 - Template class basic_stringbuf
+// NB: This file is for testing basic_filebuf with NO OTHER INCLUDES.
+
+#include <sstream>
+#include <testsuite_hooks.h>
+#include <testsuite_allocator.h>
+
+// { dg-do compile }
+
+namespace test 
+{
+  using namespace std;
+  using __gnu_cxx_test::pod_char;
+  typedef __gnu_cxx_test::tracker_alloc<char> alloc_type;
+  template class basic_stringbuf<char, char_traits<char>, alloc_type>;
+} // test
+
+// more surf!!!
+
+
+
+
+
+
+
+
+
diff --git a/libstdc++-v3/testsuite/27_io/basic_stringbuf/5.cc b/libstdc++-v3/testsuite/27_io/basic_stringbuf/5.cc
new file mode 100644 (file)
index 0000000..4f308b9
--- /dev/null
@@ -0,0 +1,49 @@
+// 2003-03-26 B enjamin Kosnik  <bkoz@redhat.com>
+
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.7.1 - Template class basic_stringbuf
+
+#include <sstream>
+
+void test01()
+{
+  // Check for required base class.
+  typedef std::stringbuf test_type;
+  typedef std::streambuf base_type;
+  const test_type& obj = test_type();
+  const base_type* base = &obj;
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
+
+// more surf!!!
+
+
+
+
+
+
+
+
+
diff --git a/libstdc++-v3/testsuite/27_io/basic_stringbuf/imbue/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_stringbuf/imbue/char/1.cc
new file mode 100644 (file)
index 0000000..153d7df
--- /dev/null
@@ -0,0 +1,46 @@
+// 981208 bkoz test functionality of basic_stringbuf for char_type == char
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+#include <sstream>
+#include <testsuite_hooks.h>
+
+std::string str_01("mykonos. . . or what?");
+std::stringbuf strb_01(str_01);
+
+// test the streambuf/stringbuf locale settings
+void test02() 
+{
+  std::locale loc_c = std::locale::classic();
+  loc_c = strb_01.getloc();
+  strb_01.pubimbue(loc_c); //This should initialize _M_init to true
+  std::locale loc_tmp = strb_01.getloc(); 
+  VERIFY( loc_tmp == loc_c );
+}
+
+int main()
+{
+  test02();
+  return 0;
+}
+
+
+
+// more candy!!!
diff --git a/libstdc++-v3/testsuite/27_io/basic_stringbuf/imbue/char/9322.cc b/libstdc++-v3/testsuite/27_io/basic_stringbuf/imbue/char/9322.cc
new file mode 100644 (file)
index 0000000..3da38fb
--- /dev/null
@@ -0,0 +1,53 @@
+// 2001-05-21 Benjamin Kosnik  <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.7.1.3 Overridden virtual functions
+
+#include <sstream>
+#include <testsuite_hooks.h>
+
+// libstdc++/9322
+void test03()
+{
+  using std::locale;
+  bool test = true;
+
+  locale loc =  std::locale::classic();
+  std::stringbuf ob;
+  VERIFY( ob.getloc() == loc );
+
+  locale::global(locale("en_US"));
+  VERIFY( ob.getloc() == loc );
+
+  locale loc_de ("de_DE");
+  locale ret = ob.pubimbue(loc_de);
+  VERIFY( ob.getloc() == loc_de );
+  VERIFY( ret == loc );
+
+  locale::global(loc);
+  VERIFY( ob.getloc() == loc_de );
+}
+
+int main() 
+{
+  using namespace std;
+  __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test03);
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_stringbuf/in_avail/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_stringbuf/in_avail/char/1.cc
new file mode 100644 (file)
index 0000000..928f945
--- /dev/null
@@ -0,0 +1,65 @@
+// 981208 bkoz test functionality of basic_stringbuf for char_type == char
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+#include <sstream>
+#include <testsuite_hooks.h>
+
+std::string str_01("mykonos. . . or what?");
+std::string str_02("paris, or sainte-maxime?");
+std::string str_03;
+std::stringbuf strb_01(str_01);
+std::stringbuf strb_02(str_02, std::ios_base::in);
+std::stringbuf strb_03(str_03, std::ios_base::out);
+
+// test overloaded virtual functions
+void test04() 
+{
+  bool                         test = true;
+  std::string          str_tmp;
+  std::stringbuf               strb_tmp;
+  std::streamsize              strmsz_1, strmsz_2;
+  std::streamoff               strmof_1(-1), strmof_2;
+  typedef std::stringbuf::int_type int_type;
+  typedef std::stringbuf::traits_type traits_type;
+  typedef std::stringbuf::pos_type pos_type;
+  typedef std::stringbuf::off_type off_type;
+
+  // GET
+  // int in_avail()
+  strmof_1 = strb_01.in_avail();
+  strmof_2 = strb_02.in_avail();
+  VERIFY( strmof_1 != strmof_2 );
+  VERIFY( strmof_1 == str_01.length() );
+  VERIFY( strmof_2 == str_02.length() );
+  strmof_1 = strb_03.in_avail(); 
+  // zero cuz write-only, or eof()? zero, from showmany
+  VERIFY( strmof_1 == 0 ); 
+}
+
+int main()
+{
+  test04();
+  return 0;
+}
+
+
+
+// more candy!!!
diff --git a/libstdc++-v3/testsuite/27_io/basic_stringbuf/overflow/char/2.cc b/libstdc++-v3/testsuite/27_io/basic_stringbuf/overflow/char/2.cc
new file mode 100644 (file)
index 0000000..90845d0
--- /dev/null
@@ -0,0 +1,80 @@
+// 1999-10-11 bkoz
+
+// Copyright (C) 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.5.2 template class basic_streambuf
+
+#include <sstream>
+#include <ostream>
+#include <testsuite_hooks.h>
+
+// test03
+// http://gcc.gnu.org/ml/libstdc++/2000-q1/msg00151.html
+template<typename charT, typename traits = std::char_traits<charT> >
+  class basic_nullbuf : public std::basic_stringbuf<charT, traits>
+  {
+  protected:
+    typedef typename
+      std::basic_stringbuf<charT, traits>::int_type int_type;
+    virtual int_type 
+    overflow(int_type c) 
+    {  return traits::not_eof(c); }
+  };
+
+typedef basic_nullbuf<char> nullbuf;
+
+template<typename T>
+  char
+  print(const T& x) 
+  {
+   nullbuf ob;
+   std::ostream out(&ob); 
+   out << x << std::endl;
+   return (!out ? '0' : '1');
+ }
+
+void test03() 
+{
+  bool test = true;
+  const std::string control01("11111");
+  std::string test01;
+
+  test01 += print(true);
+  test01 += print(3.14159);
+  test01 += print(10);
+  test01 += print('x');
+  test01 += print("pipo");
+
+  VERIFY( test01 == control01 );
+}
+
+int main() 
+{
+  test03();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_stringbuf/overflow/char/3599.cc b/libstdc++-v3/testsuite/27_io/basic_stringbuf/overflow/char/3599.cc
new file mode 100644 (file)
index 0000000..a8e3a28
--- /dev/null
@@ -0,0 +1,66 @@
+// 1999-10-11 bkoz
+
+// Copyright (C) 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+#include <sstream>
+#include <ostream>
+#include <testsuite_hooks.h>
+
+// libstdc++/3599
+class testbuf : public std::stringbuf
+{
+public:
+  typedef std::stringbuf::traits_type traits_type;
+
+  testbuf() : std::stringbuf() { }
+protected:
+  int_type 
+  overflow(int_type c = traits_type::eof()) 
+  { return traits_type::not_eof(0); }
+};
+
+void
+test07()
+{
+  bool test = true;
+  testbuf ob;
+  std::ostream out(&ob); 
+
+  out << "gasp";
+  VERIFY(out.good());
+
+  out << std::endl;
+  VERIFY(out.good());
+}
+
+int main() 
+{
+  test07();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_stringbuf/overflow/char/9988.cc b/libstdc++-v3/testsuite/27_io/basic_stringbuf/overflow/char/9988.cc
new file mode 100644 (file)
index 0000000..abdd4de
--- /dev/null
@@ -0,0 +1,63 @@
+// 2001-05-21 Benjamin Kosnik  <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <sstream>
+#include <testsuite_hooks.h>
+
+class OverBuf : public std::stringbuf
+{
+public:
+  int_type pub_overflow(int_type c = traits_type::eof())
+  { return std::stringbuf::overflow(c); }
+};
+
+// libstdc++/9988
+// filebuf::overflow writes EOF to file
+void test15()
+{
+  using namespace std;
+  bool test = true;
+  
+  OverBuf sb;
+
+  sb.sputc('a');
+  sb.pub_overflow('b');
+  sb.pub_overflow();
+  sb.sputc('c');
+
+  stringbuf sbin(sb.str(), ios_base::in);
+  stringbuf::int_type c;
+  c = sbin.sbumpc();
+  VERIFY( c == 'a' );
+  c = sbin.sbumpc();
+  VERIFY( c == 'b' );
+  c = sbin.sbumpc();
+  VERIFY( c == 'c' );
+  c = sbin.sbumpc();
+  VERIFY( c == stringbuf::traits_type::eof() );
+}
+
+main() 
+{
+  test15();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_stringbuf/sbumpc/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_stringbuf/sbumpc/char/1.cc
new file mode 100644 (file)
index 0000000..f075f9d
--- /dev/null
@@ -0,0 +1,74 @@
+// 981208 bkoz test functionality of basic_stringbuf for char_type == char
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+#include <sstream>
+#include <testsuite_hooks.h>
+
+std::string str_01("mykonos. . . or what?");
+std::string str_02("paris, or sainte-maxime?");
+std::string str_03;
+std::stringbuf strb_01(str_01);
+std::stringbuf strb_02(str_02, std::ios_base::in);
+std::stringbuf strb_03(str_03, std::ios_base::out);
+
+// test overloaded virtual functions
+void test04() 
+{
+  bool                         test = true;
+  std::string          str_tmp;
+  std::stringbuf               strb_tmp;
+  std::streamsize              strmsz_1, strmsz_2;
+  std::streamoff               strmof_1(-1), strmof_2;
+  typedef std::stringbuf::int_type int_type;
+  typedef std::stringbuf::traits_type traits_type;
+  typedef std::stringbuf::pos_type pos_type;
+  typedef std::stringbuf::off_type off_type;
+
+  // GET
+  strmof_1 = strb_01.in_avail();
+  strmof_2 = strb_02.in_avail();
+  strmof_1 = strb_03.in_avail(); 
+
+  // int_type sbumpc()
+  // if read_cur not avail, return uflow(), else return *read_cur & increment
+  int_type c1 = strb_01.sbumpc();
+  int_type c2 = strb_02.sbumpc();
+  VERIFY( c1 != c2 );
+  VERIFY( c1 == str_01[0] );
+  VERIFY( c2 == str_02[0] ); //should equal first letter at this point
+  int_type c3 = strb_01.sbumpc();
+  int_type c4 = strb_02.sbumpc();
+  VERIFY( c1 != c2 );
+  VERIFY( c1 != c3 );
+  VERIFY( c2 != c4 );
+  int_type c5 = strb_03.sbumpc();
+  VERIFY( c5 == traits_type::eof() );
+}
+
+int main()
+{
+  test04();
+  return 0;
+}
+
+
+
+// more candy!!!
diff --git a/libstdc++-v3/testsuite/27_io/basic_stringbuf/sbumpc/char/9825.cc b/libstdc++-v3/testsuite/27_io/basic_stringbuf/sbumpc/char/9825.cc
new file mode 100644 (file)
index 0000000..df6fa26
--- /dev/null
@@ -0,0 +1,50 @@
+// 2001-05-21 Benjamin Kosnik  <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <sstream>
+#include <testsuite_hooks.h>
+
+// libstdc++/9825
+// filebuf::sputbackc breaks sbumpc
+void test12()
+{
+  using namespace std;
+  bool test = true;
+
+  stringbuf sbuf;
+  sbuf.sputn("crazy bees!", 11);
+  sbuf.pubseekoff(0, ios_base::beg);
+  sbuf.sbumpc();
+  sbuf.sputbackc('x');
+  stringbuf::int_type c = sbuf.sbumpc();
+  VERIFY( c == 'x' );
+  c = sbuf.sbumpc();
+  VERIFY( c == 'r' );
+  c = sbuf.sbumpc();
+  VERIFY( c == 'a' );
+}
+
+main() 
+{
+  test12();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_stringbuf/seekoff/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_stringbuf/seekoff/char/1.cc
new file mode 100644 (file)
index 0000000..579206f
--- /dev/null
@@ -0,0 +1,124 @@
+// 981208 bkoz test functionality of basic_stringbuf for char_type == char
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+#include <sstream>
+#include <testsuite_hooks.h>
+
+std::string str_01("mykonos. . . or what?");
+std::string str_02("paris, or sainte-maxime?");
+std::string str_03;
+std::stringbuf strb_01(str_01);
+std::stringbuf strb_02(str_02, std::ios_base::in);
+std::stringbuf strb_03(str_03, std::ios_base::out);
+
+// test overloaded virtual functions
+void test04() 
+{
+  bool                         test = true;
+  std::string          str_tmp;
+  std::stringbuf               strb_tmp;
+  std::streamsize              strmsz_1, strmsz_2;
+  std::streamoff               strmof_1(-1), strmof_2;
+  typedef std::stringbuf::int_type int_type;
+  typedef std::stringbuf::traits_type traits_type;
+  typedef std::stringbuf::pos_type pos_type;
+  typedef std::stringbuf::off_type off_type;
+
+  int_type c1 = strb_01.sbumpc();
+  int_type c2 = strb_02.sbumpc();
+  int_type c3 = strb_01.sbumpc();
+  int_type c4 = strb_02.sbumpc();
+  int_type c5 = strb_03.sbumpc();
+
+  // PUT
+  strb_03.str(str_01); //reset
+  
+  // BUFFER MANAGEMENT & POSITIONING
+
+  // seekoff
+  // pubseekoff(off_type off, ios_base::seekdir way, ios_base::openmode which)
+  // alters the stream position to off
+  pos_type pt_1(off_type(-1));
+  pos_type pt_2(off_type(0));
+  off_type off_1 = 0;
+  off_type off_2 = 0;
+  strb_01.str(str_01); //in|out ("mykonos. . . or what?");
+  strb_02.str(str_02); //in ("paris, or sainte-maxime?");
+  strb_03.str(str_03); //out ("")
+  //IN|OUT
+  //beg
+  pt_1 = strb_01.pubseekoff(2, std::ios_base::beg);
+  off_1 = pt_1;
+  VERIFY( off_1 >= 0 );
+  c1 = strb_01.snextc(); //current in pointer +1
+  VERIFY( c1 == 'o' );
+  c2 = strb_01.sputc('x');  //test current out pointer
+  str_tmp = std::string("myxonos. . . or what?");
+  VERIFY( strb_01.str() == str_tmp );
+  //cur
+  pt_1 = strb_01.pubseekoff(2, std::ios_base::cur);
+  off_1 = pt_1;
+  VERIFY( off_1 == -1 ); // can't seekoff for in and out + cur in sstreams
+  pt_1 = strb_01.pubseekoff(2, std::ios_base::cur, std::ios_base::in);
+  off_1 = pt_1;
+  pt_2 = strb_01.pubseekoff(2, std::ios_base::cur, std::ios_base::in);
+  off_2 = pt_2;
+  VERIFY( off_2 == off_1 + 2 );
+  c1 = strb_01.snextc(); //current in pointer + 1
+  VERIFY( c1 == ' ' );
+  c2 = strb_01.sputc('x');  //test current out pointer
+  str_tmp = std::string("myxxnos. . . or what?");
+  VERIFY( strb_01.str() == str_tmp );
+  //end
+  pt_2 = strb_01.pubseekoff(2, std::ios_base::end);
+  off_1 = pt_2;
+  VERIFY( off_1 == -1 ); // not a valid position
+  VERIFY( strb_01.str() == str_tmp );
+  // end part two (from the filebuf tests)
+  strb_01.pubseekoff(0, std::ios_base::end);
+  strmsz_1 = strb_01.in_avail(); // 0 cuz at the end
+  c1 = strb_01.sgetc(); 
+  c2 = strb_01.sungetc();
+  strmsz_2 = strb_01.in_avail(); // 1
+  c3 = strb_01.sgetc();
+  VERIFY( c1 != c2 );
+  VERIFY( strmsz_2 != strmsz_1 );
+  VERIFY( strmsz_2 == 1 );
+  // end part three
+  strmsz_1 = strb_01.str().size();
+  strmsz_2 = strb_01.sputn(" ravi shankar meets carlos santana in LoHa", 90);
+  strb_01.pubseekoff(0, std::ios_base::end);
+  strb_01.sputc('<');
+  str_tmp = strb_01.str();
+  VERIFY( str_tmp.size() == strmsz_1 + strmsz_2 + 1 );
+  // IN
+  // OUT
+}
+
+int main()
+{
+  test04();
+  return 0;
+}
+
+
+
+// more candy!!!
diff --git a/libstdc++-v3/testsuite/27_io/basic_stringbuf/seekoff/char/2.cc b/libstdc++-v3/testsuite/27_io/basic_stringbuf/seekoff/char/2.cc
new file mode 100644 (file)
index 0000000..869cd46
--- /dev/null
@@ -0,0 +1,59 @@
+// 2001-05-21 Benjamin Kosnik  <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.7.1.3 Overridden virtual functions
+
+#include <sstream>
+#include <testsuite_hooks.h>
+
+void test02(std::stringbuf& in, bool pass)
+{
+  bool test = true;
+  using namespace std;
+  typedef streambuf::pos_type pos_type;
+  typedef streambuf::off_type off_type;
+  pos_type bad = pos_type(off_type(-1));
+  pos_type p = 0;
+
+  // seekoff
+  p = in.pubseekoff(0, ios_base::beg, ios_base::in);
+  if (pass)
+    VERIFY( p != bad );
+
+  p = in.pubseekoff(0, ios_base::beg, ios_base::out); 
+  VERIFY( p == bad );
+
+  p = in.pubseekoff(0, ios_base::beg); 
+  VERIFY( p == bad );
+}
+
+int main() 
+{
+  using namespace std;
+
+  // movie star, submarine scientist!
+  stringbuf in1("Hedy Lamarr", ios_base::in);
+  stringbuf in2(ios_base::in);
+  stringbuf in3("", ios_base::in);
+  test02(in1, true);
+  test02(in2, false);
+  test02(in3, false);
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_stringbuf/seekpos/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_stringbuf/seekpos/char/1.cc
new file mode 100644 (file)
index 0000000..12143c5
--- /dev/null
@@ -0,0 +1,98 @@
+// 981208 bkoz test functionality of basic_stringbuf for char_type == char
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+#include <sstream>
+#include <testsuite_hooks.h>
+
+std::string str_01("mykonos. . . or what?");
+std::string str_02("paris, or sainte-maxime?");
+std::string str_03;
+std::stringbuf strb_01(str_01);
+std::stringbuf strb_02(str_02, std::ios_base::in);
+std::stringbuf strb_03(str_03, std::ios_base::out);
+
+// test overloaded virtual functions
+void test04() 
+{
+  bool                         test = true;
+  std::string          str_tmp;
+  std::stringbuf               strb_tmp;
+  std::streamsize              strmsz_1, strmsz_2;
+  std::streamoff               strmof_1(-1), strmof_2;
+  typedef std::stringbuf::int_type int_type;
+  typedef std::stringbuf::traits_type traits_type;
+  typedef std::stringbuf::pos_type pos_type;
+  typedef std::stringbuf::off_type off_type;
+
+  int_type c1 = strb_01.sbumpc();
+  int_type c2 = strb_02.sbumpc();
+  int_type c3 = strb_01.sbumpc();
+  int_type c4 = strb_02.sbumpc();
+  int_type c5 = strb_03.sbumpc();
+
+  pos_type pt_1(off_type(-1));
+  pos_type pt_2(off_type(0));
+  off_type off_1 = 0;
+  off_type off_2 = 0;
+
+  // PUT
+  strb_03.str(str_01); //reset
+  
+  // BUFFER MANAGEMENT & POSITIONING
+
+  // seekpos
+  // pubseekpos(pos_type sp, ios_base::openmode)
+  // alters the stream position to sp
+  strb_01.str(str_01); //in|out ("mykonos. . . or what?");
+  strb_02.str(str_02); //in ("paris, or sainte-maxime?");
+  strb_03.str(str_03); //out ("")
+  //IN|OUT
+  //beg
+  pt_1 = strb_01.pubseekoff(2, std::ios_base::beg);
+  off_1 = pt_1;
+  VERIFY( off_1 >= 0 );
+  pt_1 = strb_01.pubseekoff(0, std::ios_base::cur, std::ios_base::out);
+  off_1 = pt_1;
+  c1 = strb_01.snextc(); //current in pointer +1
+  VERIFY( c1 == 'o' );
+  c2 = strb_01.sputc('x');  //test current out pointer
+  str_tmp = std::string("myxonos. . . or what?");
+  VERIFY( strb_01.str() == str_tmp );
+  strb_01.pubsync(); //resets pointers
+  pt_2 = strb_01.pubseekpos(pt_1, std::ios_base::in|std::ios_base::out);
+  off_2 = pt_2;
+  VERIFY( off_1 == off_2 );
+  c3 = strb_01.snextc(); //current in pointer +1
+  VERIFY( c1 == c3 );
+  c2 = strb_01.sputc('x');  //test current out pointer
+  str_tmp = std::string("myxonos. . . or what?");
+  VERIFY( strb_01.str() == str_tmp );
+}
+
+int main()
+{
+  test04();
+  return 0;
+}
+
+
+
+// more candy!!!
diff --git a/libstdc++-v3/testsuite/27_io/basic_stringbuf/seekpos/char/2.cc b/libstdc++-v3/testsuite/27_io/basic_stringbuf/seekpos/char/2.cc
new file mode 100644 (file)
index 0000000..c3c6a8a
--- /dev/null
@@ -0,0 +1,60 @@
+// 2001-05-21 Benjamin Kosnik  <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.7.1.3 Overridden virtual functions
+
+#include <sstream>
+#include <testsuite_hooks.h>
+
+void test02(std::stringbuf& in, bool pass)
+{
+  bool test = true;
+  using namespace std;
+  typedef streambuf::pos_type pos_type;
+  typedef streambuf::off_type off_type;
+  pos_type bad = pos_type(off_type(-1));
+  pos_type p = 0;
+
+  // seekpos
+  p = in.pubseekpos(0, ios_base::in);
+  if (pass)
+    VERIFY( p != bad );
+
+  p = in.pubseekpos(0, ios_base::out); 
+  VERIFY( p == bad );
+
+  p = in.pubseekpos(0); 
+  if (pass)
+    VERIFY( p != bad );
+}
+
+int main() 
+{
+  using namespace std;
+
+  // movie star, submarine scientist!
+  stringbuf in1("Hedy Lamarr", ios_base::in);
+  stringbuf in2(ios_base::in);
+  stringbuf in3("", ios_base::in);
+  test02(in1, true);
+  test02(in2, false);
+  test02(in3, false);
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_stringbuf/setbuf/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_stringbuf/setbuf/char/1.cc
new file mode 100644 (file)
index 0000000..e79da0e
--- /dev/null
@@ -0,0 +1,72 @@
+// 981208 bkoz test functionality of basic_stringbuf for char_type == char
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+#include <sstream>
+#include <testsuite_hooks.h>
+
+std::string str_01("mykonos. . . or what?");
+std::string str_02("paris, or sainte-maxime?");
+std::string str_03;
+std::stringbuf strb_01(str_01);
+std::stringbuf strb_02(str_02, std::ios_base::in);
+std::stringbuf strb_03(str_03, std::ios_base::out);
+
+// test overloaded virtual functions
+void test04() 
+{
+  bool                         test = true;
+  std::string          str_tmp;
+  std::stringbuf               strb_tmp;
+  std::streamsize              strmsz_1, strmsz_2;
+  std::streamoff               strmof_1(-1), strmof_2;
+  typedef std::stringbuf::int_type int_type;
+  typedef std::stringbuf::traits_type traits_type;
+  typedef std::stringbuf::pos_type pos_type;
+  typedef std::stringbuf::off_type off_type;
+
+  int_type c1 = strb_01.sbumpc();
+  int_type c2 = strb_02.sbumpc();
+  int_type c3 = strb_01.sbumpc();
+  int_type c4 = strb_02.sbumpc();
+  int_type c5 = strb_03.sbumpc();
+
+  // PUT
+  strb_03.str(str_01); //reset
+  
+  // BUFFER MANAGEMENT & POSITIONING
+  // setbuf
+  // pubsetbuf(char_type* s, streamsize n)
+  str_tmp = std::string("naaaah, go to cebu");
+  strb_01.pubsetbuf(const_cast<char*> (str_tmp.c_str()), str_tmp.size());
+  VERIFY( strb_01.str() == str_tmp );
+  strb_01.pubsetbuf(0,0);
+  VERIFY( strb_01.str() == str_tmp );
+}
+
+int main()
+{
+  test04();
+  return 0;
+}
+
+
+
+// more candy!!!
diff --git a/libstdc++-v3/testsuite/27_io/basic_stringbuf/setbuf/char/2.cc b/libstdc++-v3/testsuite/27_io/basic_stringbuf/setbuf/char/2.cc
new file mode 100644 (file)
index 0000000..0eade15
--- /dev/null
@@ -0,0 +1,45 @@
+// 2001-05-21 Benjamin Kosnik  <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <sstream>
+#include <testsuite_hooks.h>
+
+void test01()
+{
+  using namespace std;
+
+  bool test = true;
+  char buf[512];
+  const char* strlit = "how to tell a story and other essays: mark twain";
+  const size_t strlitsize = std::strlen(strlit);
+  stringbuf sbuf;
+
+  sbuf.pubsetbuf(buf, 512);
+  sbuf.sputn(strlit, strlitsize);
+  VERIFY( std::strncmp(strlit, buf, strlitsize) == 0 );
+}
+
+main() 
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_stringbuf/setbuf/char/3.cc b/libstdc++-v3/testsuite/27_io/basic_stringbuf/setbuf/char/3.cc
new file mode 100644 (file)
index 0000000..6a8d0b4
--- /dev/null
@@ -0,0 +1,45 @@
+// 2001-05-21 Benjamin Kosnik  <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <sstream>
+#include <testsuite_hooks.h>
+
+void test02()
+{
+  using namespace std;
+
+  bool test = true;
+  char buf[512];
+  const char* strlit = "how to tell a story and other essays: mark twain";
+  const size_t strlitsize = std::strlen(strlit);
+  string s("tmp");
+  stringbuf sbuf(s, ios_base::out);
+  sbuf.pubsetbuf(buf, strlitsize);
+  sbuf.sputn(strlit, strlitsize);
+  VERIFY( std::strncmp(strlit, buf, strlitsize) == 0 );
+}
+
+main() 
+{
+  test02();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_stringbuf/sgetc/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_stringbuf/sgetc/char/1.cc
new file mode 100644 (file)
index 0000000..c34109d
--- /dev/null
@@ -0,0 +1,78 @@
+// 981208 bkoz test functionality of basic_stringbuf for char_type == char
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+#include <sstream>
+#include <testsuite_hooks.h>
+
+std::string str_01("mykonos. . . or what?");
+std::string str_02("paris, or sainte-maxime?");
+std::string str_03;
+std::stringbuf strb_01(str_01);
+std::stringbuf strb_02(str_02, std::ios_base::in);
+std::stringbuf strb_03(str_03, std::ios_base::out);
+
+// test overloaded virtual functions
+void test04() 
+{
+  bool                         test = true;
+  std::string          str_tmp;
+  std::stringbuf               strb_tmp;
+  std::streamsize              strmsz_1, strmsz_2;
+  std::streamoff               strmof_1(-1), strmof_2;
+  typedef std::stringbuf::int_type int_type;
+  typedef std::stringbuf::traits_type traits_type;
+  typedef std::stringbuf::pos_type pos_type;
+  typedef std::stringbuf::off_type off_type;
+
+  // GET
+  strmof_1 = strb_01.in_avail();
+  strmof_2 = strb_02.in_avail();
+  strmof_1 = strb_03.in_avail(); 
+
+  int_type c1 = strb_01.sbumpc();
+  int_type c2 = strb_02.sbumpc();
+  int_type c3 = strb_01.sbumpc();
+  int_type c4 = strb_02.sbumpc();
+  int_type c5 = strb_03.sbumpc();
+
+  // int_type sgetc()
+  // if read_cur not avail, return uflow(), else return *read_cur  
+  int_type c6 = strb_01.sgetc();
+  int_type c7 = strb_02.sgetc();
+  VERIFY( c6 != c3 );
+  VERIFY( c7 != c4 );
+  int_type c8 = strb_01.sgetc();
+  int_type c9 = strb_02.sgetc();
+  VERIFY( c6 == c8 );
+  VERIFY( c7 == c9 );
+  c5 = strb_03.sgetc();
+  VERIFY( c5 == traits_type::eof() );
+}
+
+int main()
+{
+  test04();
+  return 0;
+}
+
+
+
+// more candy!!!
diff --git a/libstdc++-v3/testsuite/27_io/basic_stringbuf/sgetn/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_stringbuf/sgetn/char/1.cc
new file mode 100644 (file)
index 0000000..420a318
--- /dev/null
@@ -0,0 +1,108 @@
+// 981208 bkoz test functionality of basic_stringbuf for char_type == char
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+#include <sstream>
+#include <testsuite_hooks.h>
+
+std::string str_01("mykonos. . . or what?");
+std::string str_02("paris, or sainte-maxime?");
+std::string str_03;
+std::stringbuf strb_01(str_01);
+std::stringbuf strb_02(str_02, std::ios_base::in);
+std::stringbuf strb_03(str_03, std::ios_base::out);
+
+// test overloaded virtual functions
+void test04() 
+{
+  bool                         test = true;
+  std::string          str_tmp;
+  std::stringbuf               strb_tmp;
+  std::streamsize              strmsz_1, strmsz_2;
+  std::streamoff               strmof_1(-1), strmof_2;
+  typedef std::stringbuf::int_type int_type;
+  typedef std::stringbuf::traits_type traits_type;
+  typedef std::stringbuf::pos_type pos_type;
+  typedef std::stringbuf::off_type off_type;
+
+  // GET
+  strmof_1 = strb_01.in_avail();
+  strmof_2 = strb_02.in_avail();
+  strmof_1 = strb_03.in_avail(); 
+
+  int_type c1 = strb_01.sbumpc();
+  int_type c2 = strb_02.sbumpc();
+  int_type c3 = strb_01.sbumpc();
+  int_type c4 = strb_02.sbumpc();
+  int_type c5 = strb_03.sbumpc();
+
+  // int_type sgetc()
+  // if read_cur not avail, return uflow(), else return *read_cur  
+  int_type c6 = strb_01.sgetc();
+  int_type c7 = strb_02.sgetc();
+  int_type c8 = strb_01.sgetc();
+  int_type c9 = strb_02.sgetc();
+  c5 = strb_03.sgetc();
+
+  // int_type snextc()
+  // calls sbumpc and if sbumpc != eof, return sgetc
+  c6 = strb_01.snextc();
+  c7 = strb_02.snextc();
+  c5 = strb_03.snextc();
+
+  // streamsize sgetn(char_type *s, streamsize n)
+  // streamsize xsgetn(char_type *s, streamsize n)
+  // assign up to n chars to s from input sequence, indexing in_cur as
+  // approp and returning the number of chars assigned
+  strmsz_1 = strb_01.in_avail();
+  strmsz_2 = strb_02.in_avail();
+  test = strmsz_1 != strmsz_2;
+  VERIFY( strmsz_1 != str_01.length() );
+  VERIFY( strmsz_2 != str_02.length() ); //because now we've moved into string
+  char carray1[11] = "";
+  strmsz_1 = strb_01.sgetn(carray1, 10);
+  char carray2[20] = "";
+  strmsz_2 = strb_02.sgetn(carray2, 10);
+  VERIFY( strmsz_1 == strmsz_2 );
+  VERIFY( strmsz_1 == 10 );
+  c1 = strb_01.sgetc();
+  c2 = strb_02.sgetc();
+  VERIFY( c6 == c1 ); //just by co-incidence both o's
+  VERIFY( c7 != c2 ); // n != i
+  VERIFY( c1 == str_01[13] );
+  VERIFY( c2 == str_02[13] ); //should equal fourteenth letter at this point
+  strmsz_1 = strb_03.sgetn(carray1, 10);
+  VERIFY( !strmsz_1 ); //zero
+  strmsz_1 = strb_02.in_avail();
+  strmsz_2 = strb_02.sgetn(carray2, strmsz_1 + 5);
+  VERIFY( strmsz_1 == strmsz_2 ); //write off the end
+  c4 = strb_02.sgetc(); // should be EOF
+  VERIFY( c4 == traits_type::eof() );
+}
+
+int main()
+{
+  test04();
+  return 0;
+}
+
+
+
+// more candy!!!
diff --git a/libstdc++-v3/testsuite/27_io/basic_stringbuf/snextc/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_stringbuf/snextc/char/1.cc
new file mode 100644 (file)
index 0000000..63e3515
--- /dev/null
@@ -0,0 +1,84 @@
+// 981208 bkoz test functionality of basic_stringbuf for char_type == char
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+#include <sstream>
+#include <testsuite_hooks.h>
+
+std::string str_01("mykonos. . . or what?");
+std::string str_02("paris, or sainte-maxime?");
+std::string str_03;
+std::stringbuf strb_01(str_01);
+std::stringbuf strb_02(str_02, std::ios_base::in);
+std::stringbuf strb_03(str_03, std::ios_base::out);
+
+// test overloaded virtual functions
+void test04() 
+{
+  bool                         test = true;
+  std::string          str_tmp;
+  std::stringbuf               strb_tmp;
+  std::streamsize              strmsz_1, strmsz_2;
+  std::streamoff               strmof_1(-1), strmof_2;
+  typedef std::stringbuf::int_type int_type;
+  typedef std::stringbuf::traits_type traits_type;
+  typedef std::stringbuf::pos_type pos_type;
+  typedef std::stringbuf::off_type off_type;
+
+  // GET
+  strmof_1 = strb_01.in_avail();
+  strmof_2 = strb_02.in_avail();
+  strmof_1 = strb_03.in_avail(); 
+
+  int_type c1 = strb_01.sbumpc();
+  int_type c2 = strb_02.sbumpc();
+  int_type c3 = strb_01.sbumpc();
+  int_type c4 = strb_02.sbumpc();
+  int_type c5 = strb_03.sbumpc();
+
+  // int_type sgetc()
+  // if read_cur not avail, return uflow(), else return *read_cur  
+  int_type c6 = strb_01.sgetc();
+  int_type c7 = strb_02.sgetc();
+  int_type c8 = strb_01.sgetc();
+  int_type c9 = strb_02.sgetc();
+  c5 = strb_03.sgetc();
+
+  // int_type snextc()
+  // calls sbumpc and if sbumpc != eof, return sgetc
+  c6 = strb_01.snextc();
+  c7 = strb_02.snextc();
+  VERIFY( c6 != c8 );
+  VERIFY( c7 != c9 );
+  VERIFY( c6 == str_01[3] );
+  VERIFY( c7 == str_02[3] ); //should equal fourth letter at this point
+  c5 = strb_03.snextc();
+  VERIFY( c5 == traits_type::eof() );
+}
+
+int main()
+{
+  test04();
+  return 0;
+}
+
+
+
+// more candy!!!
diff --git a/libstdc++-v3/testsuite/27_io/basic_stringbuf/sputbackc/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_stringbuf/sputbackc/char/1.cc
new file mode 100644 (file)
index 0000000..ef7c68f
--- /dev/null
@@ -0,0 +1,122 @@
+// 981208 bkoz test functionality of basic_stringbuf for char_type == char
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+#include <sstream>
+#include <testsuite_hooks.h>
+
+std::string str_01("mykonos. . . or what?");
+std::string str_02("paris, or sainte-maxime?");
+std::string str_03;
+std::stringbuf strb_01(str_01);
+std::stringbuf strb_02(str_02, std::ios_base::in);
+std::stringbuf strb_03(str_03, std::ios_base::out);
+
+// test overloaded virtual functions
+void test04() 
+{
+  bool                         test = true;
+  std::string          str_tmp, str_tmp2;
+  std::stringbuf               strb_tmp;
+  std::streamsize              strmsz_1, strmsz_2;
+  std::streamoff               strmof_1(-1), strmof_2;
+  typedef std::stringbuf::int_type int_type;
+  typedef std::stringbuf::traits_type traits_type;
+  typedef std::stringbuf::pos_type pos_type;
+  typedef std::stringbuf::off_type off_type;
+
+  int_type c1 = strb_01.sbumpc();
+  int_type c2 = strb_02.sbumpc();
+  int_type c3 = strb_01.sbumpc();
+  int_type c4 = strb_02.sbumpc();
+  int_type c5 = strb_03.sbumpc();
+
+  // PUT
+  strb_03.str(str_01); //reset
+  std::string::size_type sz1 = strb_03.str().length();
+  std::string::size_type sz2 = strb_03.str().length();
+  
+  // streamsize sputn(const char_typs* s, streamsize n)
+  // write up to n chars to out_cur from s, returning number assigned
+  // NB *sputn will happily put '\0' into your stream if you give it a chance*
+  str_tmp = strb_03.str();
+  sz1 = str_tmp.length();
+  strmsz_1 = strb_03.sputn("racadabras", 10);//"abracadabras or what?"
+  sz2 = strb_03.str().length();
+  strmsz_2 = strb_03.sputn(", i wanna reach out and", 10);
+  sz2 = strb_03.str().length();
+  str_tmp = strb_02.str();
+  strmsz_1 = strb_02.sputn("racadabra", 10);
+
+  // PUTBACK
+
+  // int_type sputbackc(char_type c)
+  // if in_cur not avail || ! traits::eq(c, gptr() [-1]), return pbfail
+  // otherwise decrements in_cur and returns *gptr()
+  strmsz_1 = strb_01.in_avail();
+  str_tmp = strb_01.str();
+  c1 = strb_01.sgetc(); //"mykonos. . . 'o'r what?"
+  c2 = strb_01.sputbackc('z');//"mykonos. . .zor what?"
+  c3 = strb_01.sgetc();
+  str_tmp2 = strb_01.str();
+  VERIFY( c1 != c2 );
+  VERIFY( c3 == c2 );
+  VERIFY( str_tmp2 == std::string("mzkonos. . . or what?") );
+  VERIFY( str_tmp.size() == str_tmp2.size() );
+  //test for _in_cur == _in_beg
+  strb_01.str(str_tmp);
+  strmsz_1 = strb_01.in_avail();
+  c1 = strb_01.sgetc(); //"'m'ykonos. . . or what?"
+  c2 = strb_01.sputbackc('z');//"mykonos. . . or what?"
+  c3 = strb_01.sgetc();
+  VERIFY( c1 != c2 );
+  VERIFY( c3 != c2 );
+  VERIFY( c1 == c3 );
+  VERIFY( c2 == traits_type::eof() );
+  VERIFY( strb_01.str() == str_tmp );
+  VERIFY( str_tmp.size() == strb_01.str().size() );
+  // test for replacing char with identical one
+  strb_01.str(str_01); //reset
+  strmsz_1 = strb_01.in_avail();
+  strb_01.sbumpc();
+  strb_01.sbumpc();
+  c1 = strb_01.sgetc(); //"my'k'onos. . . or what?"
+  c2 = strb_01.sputbackc('y');//"mykonos. . . or what?"
+  c3 = strb_01.sgetc();
+  VERIFY( c1 != c2 );
+  VERIFY( c3 == c2 );
+  VERIFY( c1 != c3 );
+  VERIFY( strb_01.str() == str_01 );
+  VERIFY( str_01.size() == strb_01.str().size() );
+  //test for ios_base::out
+  strmsz_2 = strb_03.in_avail();
+  c4 = strb_03.sputbackc('x');
+  VERIFY( c4 == traits_type::eof() );
+}
+
+int main()
+{
+  test04();
+  return 0;
+}
+
+
+
+// more candy!!!
diff --git a/libstdc++-v3/testsuite/27_io/basic_stringbuf/sputbackc/char/9425.cc b/libstdc++-v3/testsuite/27_io/basic_stringbuf/sputbackc/char/9425.cc
new file mode 100644 (file)
index 0000000..e7dcaa1
--- /dev/null
@@ -0,0 +1,43 @@
+// 2001-05-21 Benjamin Kosnik  <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <sstream>
+#include <testsuite_hooks.h>
+
+// libstdc++/9439, libstdc++/9425
+// basic_filebuf<>::pbackfail calls basic_filebuf<>::seekoff, but
+// fails to check the return value
+void test09()
+{
+  using namespace std;
+  bool test = true;
+
+  stringbuf sbuf;
+  stringbuf::int_type r = sbuf.sputbackc('a');
+  VERIFY( r == stringbuf::traits_type::eof() );
+}
+
+main() 
+{
+  test09();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_stringbuf/sputc/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_stringbuf/sputc/char/1.cc
new file mode 100644 (file)
index 0000000..8e48642
--- /dev/null
@@ -0,0 +1,75 @@
+// 981208 bkoz test functionality of basic_stringbuf for char_type == char
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+#include <sstream>
+#include <testsuite_hooks.h>
+
+std::string str_01("mykonos. . . or what?");
+std::string str_02("paris, or sainte-maxime?");
+std::string str_03;
+std::stringbuf strb_01(str_01);
+std::stringbuf strb_02(str_02, std::ios_base::in);
+std::stringbuf strb_03(str_03, std::ios_base::out);
+
+// test overloaded virtual functions
+void test04() 
+{
+  bool                         test = true;
+  std::string          str_tmp;
+  std::stringbuf               strb_tmp;
+  std::streamsize              strmsz_1, strmsz_2;
+  std::streamoff               strmof_1(-1), strmof_2;
+  typedef std::stringbuf::int_type int_type;
+  typedef std::stringbuf::traits_type traits_type;
+  typedef std::stringbuf::pos_type pos_type;
+  typedef std::stringbuf::off_type off_type;
+
+  int_type c1 = strb_01.sbumpc();
+  int_type c2 = strb_02.sbumpc();
+  int_type c3 = strb_01.sbumpc();
+  int_type c4 = strb_02.sbumpc();
+  int_type c5 = strb_03.sbumpc();
+
+  // PUT
+  // int_type sputc(char_type c)
+  // if out_cur not avail, return overflow. Else, stores c at out_cur,
+  // increments out_cur, and returns c as int_type
+  strb_03.str(str_01); //reset
+  std::string::size_type sz1 = strb_03.str().length();
+  c1 = strb_03.sputc('a'); 
+  std::string::size_type sz2 = strb_03.str().length();
+  VERIFY( sz1 == sz2 ); //cuz inserting at out_cur, which is at beg to start
+  c2 = strb_03.sputc('b'); 
+  VERIFY( c1 != c2 );
+  VERIFY( strb_03.str() != str_01 );
+  c3 = strb_02.sputc('a'); // should be EOF because this is read-only
+  VERIFY( c3 == traits_type::eof() );
+}
+
+int main()
+{
+  test04();
+  return 0;
+}
+
+
+
+// more candy!!!
diff --git a/libstdc++-v3/testsuite/27_io/basic_stringbuf/sputc/char/1057.cc b/libstdc++-v3/testsuite/27_io/basic_stringbuf/sputc/char/1057.cc
new file mode 100644 (file)
index 0000000..d4f005e
--- /dev/null
@@ -0,0 +1,61 @@
+// 1999-10-11 bkoz
+
+// Copyright (C) 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.5.2 template class basic_streambuf
+
+#include <string>
+#include <sstream>
+#include <testsuite_hooks.h>
+
+class nullsetpbuf : public std::stringbuf
+{
+  char foo[64];
+public:
+  nullsetpbuf()
+  {
+    setp(foo, foo + 64);
+    setp(NULL, NULL);
+  }
+};
+
+// libstdc++/1057
+void test05()
+{
+  std::string text1 = "abcdefghijklmn";
+  
+  nullsetpbuf nsp;
+  // Immediate crash as sputc writes to null pointer
+  nsp.sputc('a');
+}
+
+int main() 
+{
+  test05();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_stringbuf/sputc/char/9404-1.cc b/libstdc++-v3/testsuite/27_io/basic_stringbuf/sputc/char/9404-1.cc
new file mode 100644 (file)
index 0000000..6d40192
--- /dev/null
@@ -0,0 +1,73 @@
+// 2001-05-21 Benjamin Kosnik  <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.7.1.3 Overridden virtual functions
+
+#include <sstream>
+#include <testsuite_hooks.h>
+
+bool over_called;
+
+class Derived_stringbuf : public std::stringbuf
+{
+public:
+  int_type overflow(int_type c)
+  {
+    over_called = true;
+    return std::stringbuf::overflow(c);
+  }
+  
+  const char_type* pub_epptr() const
+  {
+    return epptr();
+  }
+  
+  const char_type* pub_pptr() const
+  {
+    return pptr();
+  }
+};
+
+// libstdc++/9404
+void test04()
+{
+  bool test = true;
+
+  bool over_expected;
+
+  // sputc
+  Derived_stringbuf dsbuf_01;
+  over_called = false;
+  dsbuf_01.sputc('i');
+  VERIFY( over_called );
+  over_expected = dsbuf_01.pub_epptr() == dsbuf_01.pub_pptr();
+  over_called = false;
+  dsbuf_01.sputc('v');
+  VERIFY( (!over_expected && !over_called)
+         || (over_expected && over_called) );
+  dsbuf_01.sputc('i');
+  VERIFY( dsbuf_01.str() == "ivi" ); // Sanity check.
+}
+
+int main() 
+{
+  test04();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_stringbuf/sputn/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_stringbuf/sputn/char/1.cc
new file mode 100644 (file)
index 0000000..525014c
--- /dev/null
@@ -0,0 +1,87 @@
+// 981208 bkoz test functionality of basic_stringbuf for char_type == char
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+#include <sstream>
+#include <testsuite_hooks.h>
+
+std::string str_01("mykonos. . . or what?");
+std::string str_02("paris, or sainte-maxime?");
+std::string str_03;
+std::stringbuf strb_01(str_01);
+std::stringbuf strb_02(str_02, std::ios_base::in);
+std::stringbuf strb_03(str_03, std::ios_base::out);
+
+// test overloaded virtual functions
+void test04() 
+{
+  bool                         test = true;
+  std::string          str_tmp;
+  std::stringbuf               strb_tmp;
+  std::streamsize              strmsz_1, strmsz_2;
+  std::streamoff               strmof_1(-1), strmof_2;
+  typedef std::stringbuf::int_type int_type;
+  typedef std::stringbuf::traits_type traits_type;
+  typedef std::stringbuf::pos_type pos_type;
+  typedef std::stringbuf::off_type off_type;
+
+  int_type c1 = strb_01.sbumpc();
+  int_type c2 = strb_02.sbumpc();
+  int_type c3 = strb_01.sbumpc();
+  int_type c4 = strb_02.sbumpc();
+  int_type c5 = strb_03.sbumpc();
+
+  // PUT
+  strb_03.str(str_01); //reset
+  std::string::size_type sz1 = strb_03.str().length();
+  std::string::size_type sz2 = strb_03.str().length();
+  
+  // streamsize sputn(const char_typs* s, streamsize n)
+  // write up to n chars to out_cur from s, returning number assigned
+  // NB *sputn will happily put '\0' into your stream if you give it a chance*
+  str_tmp = strb_03.str();
+  sz1 = str_tmp.length();
+  strmsz_1 = strb_03.sputn("racadabras", 10);//"abracadabras or what?"
+  sz2 = strb_03.str().length();
+  VERIFY( sz1 == sz2 ); //shouldn't have changed length
+  VERIFY( strmsz_1 == 10 );
+  VERIFY( str_tmp != strb_03.str() );
+  strmsz_2 = strb_03.sputn(", i wanna reach out and", 23);
+  VERIFY( strmsz_1 != strmsz_2 ); // should re-allocate, copy 10 chars.
+  VERIFY( strmsz_1 == 10 );
+  VERIFY( strmsz_2 == 23 );
+  sz2 = strb_03.str().length();
+  VERIFY( sz1 != sz2 ); // need to change length
+  VERIFY( str_tmp != strb_03.str() );
+  str_tmp = strb_02.str();
+  strmsz_1 = strb_02.sputn("racadabra", 10);
+  VERIFY( strmsz_1 == 0 );  
+  VERIFY( str_tmp == strb_02.str() );
+}
+
+int main()
+{
+  test04();
+  return 0;
+}
+
+
+
+// more candy!!!
diff --git a/libstdc++-v3/testsuite/27_io/basic_stringbuf/sputn/char/1057.cc b/libstdc++-v3/testsuite/27_io/basic_stringbuf/sputn/char/1057.cc
new file mode 100644 (file)
index 0000000..2af2dff
--- /dev/null
@@ -0,0 +1,61 @@
+// 1999-10-11 bkoz
+
+// Copyright (C) 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.5.2 template class basic_streambuf
+
+#include <string>
+#include <sstream>
+#include <testsuite_hooks.h>
+
+class nullsetpbuf : public std::stringbuf
+{
+  char foo[64];
+public:
+  nullsetpbuf()
+  {
+    setp(foo, foo + 64);
+    setp(NULL, NULL);
+  }
+};
+
+// libstdc++/1057
+void test05()
+{
+  std::string text1 = "abcdefghijklmn";
+  
+  nullsetpbuf nsp;
+  // Immediate crash as xsputn writes to null pointer
+  nsp.sputn(text1.c_str(), text1.length());
+}
+
+int main() 
+{
+  test05();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_stringbuf/sputn/char/9404-2.cc b/libstdc++-v3/testsuite/27_io/basic_stringbuf/sputn/char/9404-2.cc
new file mode 100644 (file)
index 0000000..3cb743c
--- /dev/null
@@ -0,0 +1,73 @@
+// 2001-05-21 Benjamin Kosnik  <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.7.1.3 Overridden virtual functions
+
+#include <sstream>
+#include <testsuite_hooks.h>
+
+bool over_called;
+
+class Derived_stringbuf : public std::stringbuf
+{
+public:
+  int_type overflow(int_type c)
+  {
+    over_called = true;
+    return std::stringbuf::overflow(c);
+  }
+  
+  const char_type* pub_epptr() const
+  {
+    return epptr();
+  }
+  
+  const char_type* pub_pptr() const
+  {
+    return pptr();
+  }
+};
+
+// libstdc++/9404
+void test04()
+{
+  bool test = true;
+
+  bool over_expected;
+  Derived_stringbuf dsbuf_01;
+
+  // sputn
+  Derived_stringbuf dsbuf_02;
+  over_called = false;
+  dsbuf_02.sputn("sonne's", 7);
+  VERIFY( over_called );
+  over_expected = dsbuf_02.pub_epptr() == dsbuf_02.pub_pptr();
+  over_called = false;
+  dsbuf_02.sputn(" peak", 5);
+  VERIFY( (!over_expected && !over_called)
+         || (over_expected && over_called) );
+  VERIFY( dsbuf_02.str() == "sonne's peak" ); // Sanity check.
+}
+
+int main() 
+{
+  test04();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_stringbuf/str/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_stringbuf/str/char/1.cc
new file mode 100644 (file)
index 0000000..8de264b
--- /dev/null
@@ -0,0 +1,74 @@
+// 981208 bkoz test functionality of basic_stringbuf for char_type == char
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+#include <sstream>
+#include <testsuite_hooks.h>
+
+std::string str_01("mykonos. . . or what?");
+std::string str_02("paris, or sainte-maxime?");
+std::string str_03;
+std::stringbuf strb_01(str_01);
+std::stringbuf strb_02(str_02, std::ios_base::in);
+std::stringbuf strb_03(str_03, std::ios_base::out);
+
+// test member functions
+void test03() 
+{
+  bool test = true;
+
+  //stringbuf::str()
+  VERIFY( strb_01.str() == str_01 );
+  VERIFY( strb_02.str() == str_02 );
+  VERIFY( strb_03.str() == str_03 );
+  //stringbuf::str(string&)
+  strb_03.str("none of the above, go to the oberoi in cairo, egypt.");
+  strb_03.str(str_01);
+  std::streamsize d1 = strb_01.in_avail();
+  std::streamsize d2 = strb_03.in_avail();
+  VERIFY( d1 ); // non-zero
+  VERIFY( !d2 ); // zero, cuz ios_base::out
+  VERIFY( d1 != d2 ); //these should be the same
+  VERIFY( str_01.length() == d1 );  
+  VERIFY( strb_01.str() == strb_03.str() ); //ditto
+
+  // stringbuf::str(string&) and stringbuf::stringbuf(string&), where the
+  // string in question contains embedded NUL characters.  Note that in this
+  // embedded-NUL situation, the size must be passed to the string ctor.
+  std::string str_nulls ("eschew \0 obfuscation", 20);  // tested in 21_strings
+  std::stringbuf strb_normal (str_01);
+  std::stringbuf strb_nulls (str_nulls);
+  strb_normal.str(str_nulls);  // tried using 'strb_01' rather than declaring
+                               // another variable, but then test04 broke!
+  VERIFY( strb_nulls.in_avail() == str_nulls.size()  );
+  VERIFY( strb_nulls.str().size() == 20              );
+  VERIFY( strb_normal.in_avail() == str_nulls.size() );
+}
+
+int main()
+{
+  test03();
+  return 0;
+}
+
+
+
+// more candy!!!
diff --git a/libstdc++-v3/testsuite/27_io/basic_stringbuf/str/char/2.cc b/libstdc++-v3/testsuite/27_io/basic_stringbuf/str/char/2.cc
new file mode 100644 (file)
index 0000000..feabe74
--- /dev/null
@@ -0,0 +1,55 @@
+// 981208 bkoz test functionality of basic_stringbuf for char_type == char
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+#include <sstream>
+#include <testsuite_hooks.h>
+
+// http://gcc.gnu.org/ml/libstdc++/2003-02/msg00269.html
+// Growing and then seeking to ios_base::beg triggered a bug in str(),
+// which didn't notice the grow.
+void test07()
+{
+  bool test = true;
+
+  std::stringbuf strb_01;
+  strb_01.sputc('s');
+  strb_01.pubseekoff(0, std::ios_base::beg);
+  std::string tmp = strb_01.str();
+  VERIFY( tmp == "s" );
+
+  std::string str("strivi,");
+  std::stringbuf strb_02(str);
+  strb_02.pubseekoff(0, std::ios_base::end);
+  strb_02.sputn(" no better!", 11);
+  strb_02.pubseekoff(0, std::ios_base::beg);
+  tmp = strb_02.str();
+  VERIFY( tmp == "strivi, no better!" );
+}
+
+int main()
+{
+  test07();
+  return 0;
+}
+
+
+
+// more candy!!!
diff --git a/libstdc++-v3/testsuite/27_io/basic_stringbuf/str/char/3.cc b/libstdc++-v3/testsuite/27_io/basic_stringbuf/str/char/3.cc
new file mode 100644 (file)
index 0000000..7fa42a6
--- /dev/null
@@ -0,0 +1,43 @@
+// 981208 bkoz test functionality of basic_stringbuf for char_type == char
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+#include <sstream>
+#include <testsuite_hooks.h>
+
+void test06()
+{
+  bool test = true;
+
+  std::ostringstream os ("foo", std::ios_base::app);
+  os << "bar";
+
+  VERIFY( os.str() == "foobar" );
+}
+
+int main()
+{
+  test06();
+  return 0;
+}
+
+
+
+// more candy!!!
diff --git a/libstdc++-v3/testsuite/27_io/basic_stringbuf/str/char/3955.cc b/libstdc++-v3/testsuite/27_io/basic_stringbuf/str/char/3955.cc
new file mode 100644 (file)
index 0000000..d43fd89
--- /dev/null
@@ -0,0 +1,44 @@
+// 981208 bkoz test functionality of basic_stringbuf for char_type == char
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+#include <sstream>
+#include <testsuite_hooks.h>
+
+// libstdc++/3955 -- ios_base::app overwrites from the beginning
+void test05()
+{
+  bool test = true;
+
+  std::ostringstream os ("foo");
+  os << "bar";
+
+  VERIFY( os.str() == "bar" );
+}
+
+int main()
+{
+  test05();
+  return 0;
+}
+
+
+
+// more candy!!!
diff --git a/libstdc++-v3/testsuite/27_io/basic_stringbuf/sungetc/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_stringbuf/sungetc/char/1.cc
new file mode 100644 (file)
index 0000000..c7bb352
--- /dev/null
@@ -0,0 +1,151 @@
+// 981208 bkoz test functionality of basic_stringbuf for char_type == char
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+#include <sstream>
+#include <testsuite_hooks.h>
+
+std::string str_01("mykonos. . . or what?");
+std::string str_02("paris, or sainte-maxime?");
+std::string str_03;
+std::stringbuf strb_01(str_01);
+std::stringbuf strb_02(str_02, std::ios_base::in);
+std::stringbuf strb_03(str_03, std::ios_base::out);
+
+// test overloaded virtual functions
+void test04() 
+{
+  bool                         test = true;
+  std::string          str_tmp;
+  std::stringbuf               strb_tmp;
+  std::streamsize              strmsz_1, strmsz_2;
+  std::streamoff               strmof_1(-1), strmof_2;
+  typedef std::stringbuf::int_type int_type;
+  typedef std::stringbuf::traits_type traits_type;
+  typedef std::stringbuf::pos_type pos_type;
+  typedef std::stringbuf::off_type off_type;
+
+  int_type c1 = strb_01.sbumpc();
+  int_type c2 = strb_02.sbumpc();
+  int_type c3 = strb_01.sbumpc();
+  int_type c4 = strb_02.sbumpc();
+  int_type c5 = strb_03.sbumpc();
+
+  // PUT
+  strb_03.str(str_01); //reset
+  std::string::size_type sz1 = strb_03.str().length();
+  std::string::size_type sz2 = strb_03.str().length();
+  
+  // streamsize sputn(const char_typs* s, streamsize n)
+  // write up to n chars to out_cur from s, returning number assigned
+  // NB *sputn will happily put '\0' into your stream if you give it a chance*
+  str_tmp = strb_03.str();
+  sz1 = str_tmp.length();
+  strmsz_1 = strb_03.sputn("racadabras", 10);//"abracadabras or what?"
+  sz2 = strb_03.str().length();
+  strmsz_2 = strb_03.sputn(", i wanna reach out and", 10);
+  sz2 = strb_03.str().length();
+  str_tmp = strb_02.str();
+  strmsz_1 = strb_02.sputn("racadabra", 10);
+
+  // PUTBACK
+
+  // int_type sputbackc(char_type c)
+  // if in_cur not avail || ! traits::eq(c, gptr() [-1]), return pbfail
+  // otherwise decrements in_cur and returns *gptr()
+  strmsz_1 = strb_01.in_avail();
+  str_tmp = strb_01.str();
+  c1 = strb_01.sgetc(); //"mykonos. . . 'o'r what?"
+  c2 = strb_01.sputbackc('z');//"mykonos. . .zor what?"
+  c3 = strb_01.sgetc();
+  //test for _in_cur == _in_beg
+  strb_01.str(str_tmp);
+  strmsz_1 = strb_01.in_avail();
+  c1 = strb_01.sgetc(); //"'m'ykonos. . . or what?"
+  c2 = strb_01.sputbackc('z');//"mykonos. . . or what?"
+  c3 = strb_01.sgetc();
+  // test for replacing char with identical one
+  strb_01.str(str_01); //reset
+  strmsz_1 = strb_01.in_avail();
+  strb_01.sbumpc();
+  strb_01.sbumpc();
+  c1 = strb_01.sgetc(); //"my'k'onos. . . or what?"
+  c2 = strb_01.sputbackc('y');//"mykonos. . . or what?"
+  c3 = strb_01.sgetc();
+  //test for ios_base::out
+  strmsz_2 = strb_03.in_avail();
+  c4 = strb_03.sputbackc('x');
+
+  // int_type sungetc()
+  // if in_cur not avail, return pbackfail(), else decrement and
+  // return to_int_type(*gptr())
+  for (int i = 0; i<12; ++i)
+    strb_01.sbumpc();
+  strmsz_1 = strb_01.in_avail();
+  str_tmp = strb_01.str();
+  c1 = strb_01.sgetc(); //"mykonos. . . 'o'r what?"
+  c2 = strb_01.sungetc();//"mykonos. . . or what?"
+  c3 = strb_01.sgetc();
+  VERIFY( c1 != c2 );
+  VERIFY( c3 == c2 );
+  VERIFY( c1 != c3 );
+  VERIFY( c2 == ' ' );
+  VERIFY( strb_01.str() == str_01 );
+  VERIFY( str_01.size() == strb_01.str().size() );
+  //test for _in_cur == _in_beg
+  strb_01.str(str_tmp);
+  strmsz_1 = strb_01.in_avail();
+  c1 = strb_01.sgetc(); //"'m'ykonos. . . or what?"
+  c2 = strb_01.sungetc();//"mykonos. . . or what?"
+  c3 = strb_01.sgetc();
+  VERIFY( c1 != c2 );
+  VERIFY( c3 != c2 );
+  VERIFY( c1 == c3 );
+  VERIFY( c2 == traits_type::eof() );
+  VERIFY( strb_01.str() == str_01 );
+  VERIFY( str_01.size() == strb_01.str().size() );
+  // test for replacing char with identical one
+  strb_01.str(str_01); //reset
+  strmsz_1 = strb_01.in_avail();
+  strb_01.sbumpc();
+  strb_01.sbumpc();
+  c1 = strb_01.sgetc(); //"my'k'onos. . . or what?"
+  c2 = strb_01.sungetc();//"mykonos. . . or what?"
+  c3 = strb_01.sgetc();
+  VERIFY( c1 != c2 );
+  VERIFY( c3 == c2 );
+  VERIFY( c1 != c3 );
+  VERIFY( strb_01.str() == str_01 );
+  VERIFY( str_01.size() == strb_01.str().size() );
+  //test for ios_base::out
+  strmsz_2 = strb_03.in_avail();
+  c4 = strb_03.sungetc();
+  VERIFY( c4 == traits_type::eof() );
+}
+
+int main()
+{
+  test04();
+  return 0;
+}
+
+
+
+// more candy!!!
diff --git a/libstdc++-v3/testsuite/27_io/basic_stringbuf/sync/char/1057.cc b/libstdc++-v3/testsuite/27_io/basic_stringbuf/sync/char/1057.cc
new file mode 100644 (file)
index 0000000..8571720
--- /dev/null
@@ -0,0 +1,108 @@
+// 1999-10-11 bkoz
+
+// Copyright (C) 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.5.2 template class basic_streambuf
+
+#include <sstream>
+#include <testsuite_hooks.h>
+
+class setpbuf : public std::stringbuf
+{
+  char                 buffer[4];
+  std::string  result;
+
+public:
+
+  std::string&
+  get_result()
+  { return result; }
+
+  setpbuf()
+  {
+    char foo [32];
+    setp(foo, foo + 32);
+    setp(buffer, buffer + 4);
+  }
+
+  ~setpbuf()
+  { sync(); }
+
+  virtual int_type 
+  overflow(int_type n)
+  {
+    if (sync() != 0)
+      return traits_type::eof();
+    
+    result += traits_type::to_char_type(n);
+    
+    return n;
+  }
+  
+  virtual int 
+  sync()
+  {
+    result.append(pbase(), pptr());
+    setp(buffer, buffer + 4);
+    return 0;
+  }
+};
+
+// libstdc++/1057
+void test04()
+{
+  bool test = true;
+  std::string text = "abcdefghijklmn";
+  
+  // 01
+  setpbuf sp1;
+  // Here xsputn writes over sp1.result
+  sp1.sputn(text.c_str(), text.length());
+
+  // This crashes when result is accessed
+  sp1.pubsync();
+  VERIFY( sp1.get_result() == text );
+  
+  // 02
+  setpbuf sp2;
+  for (std::string::size_type i = 0; i < text.length(); ++i)
+    {
+      // sputc also writes over result
+      sp2.sputc(text[i]);
+    }
+  
+  // Crash here
+  sp2.pubsync();
+  VERIFY( sp2.get_result() == text );
+}
+
+int main() 
+{
+  test04();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_stringstream/1.cc b/libstdc++-v3/testsuite/27_io/basic_stringstream/1.cc
new file mode 100644 (file)
index 0000000..e53b91d
--- /dev/null
@@ -0,0 +1,48 @@
+// 2002-07-25 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.7.4 - Template class basic_stringstream
+// NB: This file is for testing basic_stringstream with NO OTHER INCLUDES.
+
+#include <sstream>
+#include <testsuite_hooks.h>
+
+// { dg-do compile }
+
+// libstdc++/7216
+void test01()
+{
+  // Check for required typedefs
+  typedef std::stringstream test_type;
+  typedef test_type::char_type char_type;
+  typedef test_type::traits_type traits_type;
+  typedef test_type::int_type int_type;
+  typedef test_type::pos_type pos_type;
+  typedef test_type::off_type off_type;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_stringstream/2.cc b/libstdc++-v3/testsuite/27_io/basic_stringstream/2.cc
new file mode 100644 (file)
index 0000000..abadf82
--- /dev/null
@@ -0,0 +1,45 @@
+// 2002-07-25 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.7.4 - Template class basic_stringstream
+// NB: This file is for testing basic_stringstream with NO OTHER INCLUDES.
+
+#include <sstream>
+#include <testsuite_hooks.h>
+
+// { dg-do compile }
+
+namespace test 
+{
+  using namespace std;
+  using __gnu_cxx_test::pod_char;
+  typedef short type_t;
+  template class basic_stringstream<type_t, char_traits<type_t> >;
+  template class basic_stringstream<pod_char, char_traits<pod_char> >;
+} // test
diff --git a/libstdc++-v3/testsuite/27_io/basic_stringstream/3.cc b/libstdc++-v3/testsuite/27_io/basic_stringstream/3.cc
new file mode 100644 (file)
index 0000000..d877dbb
--- /dev/null
@@ -0,0 +1,149 @@
+// 1999-01-17 bkoz test functionality of basic_filebuf for char_type == char
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.1 - Template class basic_filebuf 
+// NB: This file is for testing basic_filebuf with NO OTHER INCLUDES.
+
+#include <sstream>
+#include <testsuite_hooks.h>
+
+// { dg-do compile }
+
+// libstdc++/2020
+// should be able to use custom char_type, custom traits type
+class gnu_char_type
+{
+  unsigned long character;
+public:
+  // operator ==
+  bool
+  operator==(const gnu_char_type& __lhs) 
+  { return character == __lhs.character; }
+
+  // operator <
+  bool
+  operator<(const gnu_char_type& __lhs) 
+  { return character < __lhs.character; }
+
+  // default ctor
+  gnu_char_type() { }
+
+  // to_char_type
+  gnu_char_type(const unsigned long& __l) : character(__l) { } 
+
+  // to_int_type
+  operator unsigned long() const { return character; }
+};
+
+// char_traits specialization
+struct gnu_char_traits
+{
+  typedef gnu_char_type        char_type;
+  typedef long                 int_type;
+  typedef long                 pos_type;
+  typedef unsigned long        off_type;
+  typedef long                 state_type;
+  
+  static void 
+  assign(char_type& __c1, const char_type& __c2) { }
+  
+  static bool 
+  eq(const char_type& __c1, const char_type& __c2) { return true; }
+  
+  static bool 
+  lt(const char_type& __c1, const char_type& __c2) { return true; }
+  
+  static int 
+  compare(const char_type* __s1, const char_type* __s2, size_t __n)
+  { return 0; }
+  
+  static size_t
+  length(const char_type* __s) { return 0; }
+  
+  static const char_type* 
+  find(const char_type* __s, size_t __n, const char_type& __a)
+  { return __s; }
+  
+  static char_type* 
+  move(char_type* __s1, const char_type* __s2, size_t __n)
+  { return __s1; }
+  
+  static char_type* 
+  copy(char_type* __s1, const char_type* __s2, size_t __n)
+  { return __s1; }
+  
+  static char_type* 
+  assign(char_type* __s, size_t __n, char_type __a)
+  { return __s; }
+  
+  static char_type 
+  to_char_type(const int_type& __c)
+  { return char_type(); }
+  
+  static int_type 
+  to_int_type(const char_type& __c)
+  { return int_type(); }
+  
+  static bool 
+  eq_int_type(const int_type& __c1, const int_type& __c2)
+  { return true; }
+  
+  static int_type 
+  eof()
+  { return int_type(); }
+  
+  static int_type 
+  not_eof(const int_type& __c)
+  { return int_type(); }
+};
+
+void test07()
+{
+  bool test = true;
+  typedef std::basic_stringstream<gnu_char_type, gnu_char_traits> gnu_sstr;
+
+  try
+    { 
+      gnu_sstr obj;
+    }
+  catch(std::exception& obj)
+    { 
+      test = false; 
+      VERIFY( test );
+    }
+}
+
+#if !__GXX_WEAK__
+// Explicitly instantiate for systems with no COMDAT or weak support.
+template 
+  std::basic_streambuf<gnu_char_type>::int_type
+  std::basic_streambuf<gnu_char_type>::_S_pback_size;
+#endif
+
+int main() 
+{
+  test07();
+  return 0;
+}
+
+
+
+// more surf!!!
diff --git a/libstdc++-v3/testsuite/27_io/basic_stringstream/4.cc b/libstdc++-v3/testsuite/27_io/basic_stringstream/4.cc
new file mode 100644 (file)
index 0000000..dcd5dc3
--- /dev/null
@@ -0,0 +1,50 @@
+// 2003-03-26 B enjamin Kosnik  <bkoz@redhat.com>
+
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.1 - Template class basic_filebuf 
+
+#include <iostream>
+#include <sstream>
+
+void test01()
+{
+  // Check for required base class.
+  typedef std::stringstream test_type;
+  typedef std::iostream base_type;
+  const test_type& obj = test_type();
+  const base_type* base = &obj;
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
+
+// more surf!!!
+
+
+
+
+
+
+
+
+
diff --git a/libstdc++-v3/testsuite/27_io/basic_stringstream/rdbuf/char/2832.cc b/libstdc++-v3/testsuite/27_io/basic_stringstream/rdbuf/char/2832.cc
new file mode 100644 (file)
index 0000000..5e4fe02
--- /dev/null
@@ -0,0 +1,70 @@
+// 2003-04-01 Benjamin Kosnik  <bkoz@redhat.com>
+
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.7.6 - Member functions [lib.stringstream.members]
+
+#include <sstream>
+#include <testsuite_hooks.h>
+
+void 
+redirect_buffer(std::ios& stream, std::streambuf* new_buf) 
+{ stream.rdbuf(new_buf); }
+
+std::streambuf*
+active_buffer(std::ios& stream)
+{ return stream.rdbuf(); }
+
+// libstdc++/2832
+void test02()
+{
+  bool test = true;
+  const char* strlit01 = "fuck war";
+  const char* strlit02 = "two less cars abstract riot crew, critical mass/SF";
+  const std::string str00;
+  const std::string str01(strlit01);
+  std::string str02;
+  std::stringbuf sbuf;
+  std::streambuf* pbasebuf0 = &sbuf;
+
+  std::stringstream sstrm1;
+  // derived rdbuf() always returns original streambuf, even though
+  // it's no longer associated with the stream.
+  std::stringbuf* const buf1 = sstrm1.rdbuf();
+  // base rdbuf() returns the currently associated streambuf
+  std::streambuf* pbasebuf1 = active_buffer(sstrm1);
+  redirect_buffer(sstrm1, &sbuf);
+  std::stringbuf* const buf2 = sstrm1.rdbuf();
+  std::streambuf* pbasebuf2 = active_buffer(sstrm1);
+  VERIFY( buf1 == buf2 ); 
+  VERIFY( pbasebuf1 != pbasebuf2 );
+  VERIFY( pbasebuf2 == pbasebuf0 );
+
+  // How confusing and non-intuitive is this?
+  // These semantics are a joke, a serious defect, and incredibly lame.
+}
+
+int main()
+{
+  test02();
+  return 0;
+}
+
+
+
diff --git a/libstdc++-v3/testsuite/27_io/basic_stringstream/str/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_stringstream/str/char/1.cc
new file mode 100644 (file)
index 0000000..79b1e9c
--- /dev/null
@@ -0,0 +1,77 @@
+// 2001-05-24 Benjamin Kosnik  <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.7.6 member functions (stringstream_members)
+
+#include <sstream>
+#include <testsuite_hooks.h>
+
+void test01()
+{
+  bool test = true;
+  std::stringstream is01;
+  const std::string str00; 
+  const std::string str01 = "123";
+  std::string str02;
+  const int i01 = 123;
+  int a,b;
+
+  std::ios_base::iostate state1, state2, statefail, stateeof;
+  statefail = std::ios_base::failbit;
+  stateeof = std::ios_base::eofbit;
+
+  // string str() const
+  str02 = is01.str();
+  VERIFY( str00 == str02 );
+
+  // void str(const basic_string&)
+  is01.str(str01);
+  str02 = is01.str();
+  VERIFY( str01 == str02 );
+  state1 = is01.rdstate();
+  is01 >> a;
+  state2 = is01.rdstate();
+  VERIFY( a = i01 );
+  // 22.2.2.1.2 num_get virtual functions
+  // p 13
+  // in any case, if stage 2 processing was terminated by the test for
+  // in == end then err != ios_base::eofbit is performed.
+  VERIFY( state1 != state2 );
+  VERIFY( state2 == stateeof ); 
+
+  is01.str(str01);
+  is01 >> b;
+  VERIFY( b != a ); 
+  // as is01.good() is false, istream::sentry blocks extraction.
+
+  is01.clear();
+  state1 = is01.rdstate();
+  is01 >> b;
+  state2 = is01.rdstate();
+  VERIFY( b == a ); 
+  VERIFY( state1 != state2 );
+  VERIFY( state2 == stateeof ); 
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_stringstream/str/char/2.cc b/libstdc++-v3/testsuite/27_io/basic_stringstream/str/char/2.cc
new file mode 100644 (file)
index 0000000..04f2746
--- /dev/null
@@ -0,0 +1,76 @@
+// 2001-05-24 Benjamin Kosnik  <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.7.6 member functions (stringstream_members)
+
+#include <sstream>
+#include <testsuite_hooks.h>
+
+void 
+redirect_buffer(std::ios& stream, std::streambuf* new_buf) 
+{ stream.rdbuf(new_buf); }
+
+std::streambuf*
+active_buffer(std::ios& stream)
+{ return stream.rdbuf(); }
+
+// libstdc++/2832
+void test02()
+{
+  bool test = true;
+  const char* strlit01 = "fuck war";
+  const char* strlit02 = "two less cars abstract riot crew, critical mass/SF";
+  const std::string str00;
+  const std::string str01(strlit01);
+  std::string str02;
+  std::stringbuf sbuf(str01);
+  std::streambuf* pbasebuf0 = &sbuf;
+
+  std::stringstream sstrm1;
+  VERIFY( sstrm1.str() == str00 );
+  // derived rdbuf() always returns original streambuf, even though
+  // it's no longer associated with the stream.
+  std::stringbuf* const buf1 = sstrm1.rdbuf();
+  // base rdbuf() returns the currently associated streambuf
+  std::streambuf* pbasebuf1 = active_buffer(sstrm1);
+  redirect_buffer(sstrm1, &sbuf);
+  std::stringbuf* const buf2 = sstrm1.rdbuf();
+  std::streambuf* pbasebuf2 = active_buffer(sstrm1);
+  VERIFY( buf1 == buf2 ); 
+  VERIFY( pbasebuf1 != pbasebuf2 );
+  VERIFY( pbasebuf2 == pbasebuf0 );
+
+  // derived rdbuf() returns the original buf, so str() doesn't change.
+  VERIFY( sstrm1.str() != str01 );
+  VERIFY( sstrm1.str() == str00 );
+  // however, casting the active streambuf to a stringbuf shows what's up:
+  std::stringbuf* psbuf = dynamic_cast<std::stringbuf*>(pbasebuf2);
+  str02 = psbuf->str();
+  VERIFY( str02 == str01 );
+
+  // How confusing and non-intuitive is this?
+  // These semantics are a joke, a serious defect, and incredibly lame.
+}
+
+int main()
+{
+  test02();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_stringstream/str/char/3.cc b/libstdc++-v3/testsuite/27_io/basic_stringstream/str/char/3.cc
new file mode 100644 (file)
index 0000000..47901a6
--- /dev/null
@@ -0,0 +1,65 @@
+// 2001-05-24 Benjamin Kosnik  <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.7.6 member functions (stringstream_members)
+
+#include <sstream>
+#include <testsuite_hooks.h>
+
+void
+test03()
+{
+  bool test = true;
+
+  //
+  // 1: Automatic formatting of a compound string
+  //
+  int i = 1024;
+  int *pi = &i;
+  double d = 3.14159;
+  double *pd = &d;
+  std::string blank;
+  std::ostringstream ostrst01; 
+  std::ostringstream ostrst02(blank); 
+  
+  // No buffer, so should be created.
+  ostrst01 << "i: " << i << " i's address:  " << pi << "\n"
+            << "d: " << d << " d's address: " << pd << std::endl;
+  // Buffer, so existing buffer should be overwritten.
+  ostrst02 << "i: " << i << " i's address:  " << pi << "\n"
+            << "d: " << d << " d's address: " << pd << std::endl;
+
+  std::string msg01 = ostrst01.str();
+  std::string msg02 = ostrst02.str();
+  VERIFY( msg01 == msg02 );
+  VERIFY( msg02 != blank );
+
+  // stringstream
+  std::string str1("");
+  std::string str3("this is a somewhat  string");
+  std::stringstream ss1(str1, std::ios_base::in|std::ios_base::out);
+  std::stringstream ss2(str3, std::ios_base::in|std::ios_base::out);
+}
+
+int main()
+{
+  test03();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_stringstream/str/char/4.cc b/libstdc++-v3/testsuite/27_io/basic_stringstream/str/char/4.cc
new file mode 100644 (file)
index 0000000..7d77fc2
--- /dev/null
@@ -0,0 +1,45 @@
+// 2001-05-24 Benjamin Kosnik  <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.7.6 member functions (stringstream_members)
+
+#include <sstream>
+#include <testsuite_hooks.h>
+
+// libstdc++/8466
+void test04()
+{
+  bool test = true;
+
+  const char* strlit00 = "orvieto";
+  const std::string str00 = strlit00;
+
+  std::ostringstream oss;
+
+  oss.str(str00);
+  oss << "cortona";
+  VERIFY( str00 == strlit00 );
+}
+
+int main()
+{
+  test04();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/filebuf.cc b/libstdc++-v3/testsuite/27_io/filebuf.cc
deleted file mode 100644 (file)
index ab873be..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-// 1999-01-17 bkoz test functionality of basic_filebuf for char_type == char
-
-// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// 27.8.1.1 - Template class basic_filebuf 
-// NB: This file is for testing basic_filebuf with NO OTHER INCLUDES.
-
-#include <fstream>
-#include <testsuite_hooks.h>
-
-// { dg-do compile }
-
-// libstdc++/7216
-void test01()
-{
-  // Check for required typedefs
-  typedef std::filebuf test_type;
-  typedef test_type::char_type char_type;
-  typedef test_type::traits_type traits_type;
-  typedef test_type::int_type int_type;
-  typedef test_type::pos_type pos_type;
-  typedef test_type::off_type off_type;
-}
-
-// test05
-// libstdc++/1886
-// should be able to instantiate basic_filebuf for non-standard types.
-namespace test 
-{
-  using namespace std;
-  using __gnu_cxx_test::pod_char;
-  typedef short type_t;
-  template class basic_filebuf<type_t, char_traits<type_t> >;
-  template class basic_filebuf<pod_char, char_traits<pod_char> >;
-} // test
-
-
-// test07
-// libstdc++/2020
-// should be able to use custom char_type
-class gnu_char_type
-{
-  unsigned long character;
-public:
-  // operator ==
-  bool
-  operator==(const gnu_char_type& __lhs) 
-  { return character == __lhs.character; }
-
-  // operator <
-  bool
-  operator<(const gnu_char_type& __lhs) 
-  { return character < __lhs.character; }
-
-  // default ctor
-  gnu_char_type() { }
-
-  // to_char_type
-  gnu_char_type(const unsigned long& __l) : character(__l) { } 
-
-  // to_int_type
-  operator unsigned long() const { return character; }
-};
-
-void test07()
-{
-  bool test = true;
-  typedef std::basic_filebuf<gnu_char_type> gnu_filebuf;
-  
-  try
-    { gnu_filebuf obj; }
-  catch(std::exception& obj)
-    { 
-      test = false; 
-      VERIFY( test );
-    }
-}
-
-#if !__GXX_WEAK__
-// Explicitly instantiate for systems with no COMDAT or weak support.
-template 
-  std::basic_streambuf<gnu_char_type>::int_type
-  std::basic_streambuf<gnu_char_type>::_S_pback_size;
-#endif
-
-int main() 
-{
-  test01();
-  test07();
-  return 0;
-}
-
-
-
-// more surf!!!
-
-
-
-
-
-
-
-
-
diff --git a/libstdc++-v3/testsuite/27_io/filebuf_members-1.tst b/libstdc++-v3/testsuite/27_io/filebuf_members-1.tst
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/libstdc++-v3/testsuite/27_io/filebuf_members-1.txt b/libstdc++-v3/testsuite/27_io/filebuf_members-1.txt
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/libstdc++-v3/testsuite/27_io/filebuf_members.cc b/libstdc++-v3/testsuite/27_io/filebuf_members.cc
deleted file mode 100644 (file)
index 79dfa25..0000000
+++ /dev/null
@@ -1,276 +0,0 @@
-// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// 27.8.1.3 filebuf member functions
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %-*.txt
-
-// various tests for filebuf::open() and filebuf::close() including
-// the non-portable functionality in the libstdc++-v3 IO library
-
-#include <iostream>
-#include <fstream>
-#include <unistd.h>
-#include <signal.h>
-#include <fcntl.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <ext/stdio_filebuf.h>
-#include <testsuite_hooks.h>
-
-const char name_01[] = "filebuf_members-1.tst";
-const char name_02[] = "filebuf_members-1.txt";
-
-// Test member functions.
-void test_01() 
-{
-  bool                         test = true;
-  const char* name_03 = "filebuf_members-3"; // empty file, need to create
-
-  std::filebuf fb_01; // in 
-  std::filebuf fb_02; // out
-  std::filebuf fb_03; // in | out
-
-  // bool is_open()
-  VERIFY( !fb_01.is_open() );
-  VERIFY( !fb_02.is_open() );
-  VERIFY( !fb_03.is_open() );
-
-  // filebuf_type* open(const char* __s, ios_base::openmode __mode)
-  fb_01.open(name_01, std::ios_base::in | std::ios_base::ate);
-  fb_02.open(name_02, std::ios_base::in | std::ios_base::out 
-            | std::ios_base::trunc);
-  // Try to open two different files without closing the first:
-  // Should keep the old file attached, and disregard attempt to overthrow.
-  fb_02.open(name_03, std::ios_base::in | std::ios_base::out);
-  fb_03.open(name_03, std::ios_base::out | std::ios_base::trunc);
-  VERIFY( fb_01.is_open() );
-  VERIFY( fb_02.is_open() );
-  VERIFY( fb_03.is_open() );
-
-  // filebuf_type* close()
-  fb_01.close();
-  fb_02.close();
-  fb_03.close();
-  VERIFY( !fb_01.is_open() );
-  VERIFY( !fb_02.is_open() );
-  VERIFY( !fb_03.is_open() );
-}
-
-// Verify that std::filebuf doesn't close files that it didn't open
-// when using the following std::filebuf ctor:
-//
-//      std::filebuf(__c_file_type*  __f,
-//                   ios_base::openmode __mode,
-//                   int_type  __s);
-//
-// Thanks to "George T. Talbot" <george@moberg.com> for uncovering
-// this bug/situation. 
-void test_02()
-{
-  bool test = true;
-  int close_num;
-
-  // read (ext)
-  FILE* f2 = fopen(name_01, "r");
-  VERIFY( f2 != NULL );
-  if (f2)
-  {
-    __gnu_cxx::stdio_filebuf<char> fb(f2, std::ios_base::in, 512);
-    close_num = fclose(f2);
-  }
-  VERIFY( close_num == 0 );
-
-  // read (standard)
-  FILE* f = fopen(name_01, "r");
-  VERIFY( f != NULL );
-  if (f)
-  {
-    std::ifstream ifstream1(name_01);
-    VERIFY( ifstream1.is_open() );
-    std::ios_base::iostate st01 = ifstream1.rdstate();
-    VERIFY( st01 == std::ios_base::goodbit );
-    close_num = fclose(f);
-  }
-  VERIFY( close_num == 0 );
-}
-
-void test_03()
-{
-  bool test = true;
-  int first_fd = ::open(name_01, O_RDONLY);
-  VERIFY( first_fd != -1 );
-  FILE* first_file = ::fdopen(first_fd, "r");
-  VERIFY( first_file != NULL );
-  __gnu_cxx::stdio_filebuf<char> fb(first_file, std::ios_base::in);
-
-  int second_fd = fb.fd();
-
-  VERIFY( first_fd == second_fd );
-}
-
-// libstdc++/2913, libstdc++/4879
-// John Fardo  <jfardo@laurelnetworks.com>, Brad Garcia <garsh@attbi.com>
-void
-test_04()
-{
-  bool test = true;
-  const char* name = "tmp_fifo1";
-  signal(SIGPIPE, SIG_IGN);
-  
-  unlink(name);
-  if (0 != mkfifo(name, S_IRWXU))
-    {
-      std::cerr << "failed to create fifo" << std::endl;
-      exit(-1);
-    }
-  
-  int fval = fork();
-  if (fval == -1)
-    {
-      std::cerr << "failed to fork" << std::endl;
-      unlink(name);
-      exit(-1);
-    }
-  else if (fval == 0)
-    {
-      std::ifstream ifs(name);
-      sleep(1);
-      ifs.close();
-      exit(0);
-    }
-
-  std::ofstream ofs(name);
-  sleep(2);
-  ofs.put('t');
-
-  /*
-   * ISO/IED 14882:1998(E) 27.8.1.10.4
-   *
-   * void close();
-   *
-   * Effects:  Calls rdbuf()->close() and, if that function fails
-   * (returns a null pointer), calls setstate(failbit)...
-   */
-  ofs.close();
-  if (!(ofs.rdstate() & std::ios::failbit))
-    {
-      test = false;
-      VERIFY( test );
-      unlink(name);
-      exit(-1);
-    }
-
-  unlink(name);
-}
-
-// Charles Leggett <CGLeggett@lbl.gov>
-void test_05()
-{
-  bool test = true;
-  const char* name = "tmp_file5";
-
-  std::fstream scratch_file;
-
-  scratch_file.open(name, std::ios::out);
-  scratch_file.close();
-
-  scratch_file.open(name, std::ios::in);
-  if (!scratch_file)
-    VERIFY( false );
-  scratch_file.close();
-}
-
-// libstdc++/9507
-void test_06()
-{
-  bool test = true;
-  const char* name = "tmp_fifo2";
-
-  signal(SIGPIPE, SIG_IGN);
-
-  unlink(name);
-  mkfifo(name, S_IRWXU);
-       
-  if (!fork())
-    {
-      std::filebuf fbuf;
-      fbuf.open(name, std::ios_base::in);
-      fbuf.sgetc();
-      fbuf.close();
-      exit(0);
-    }
-
-  std::filebuf fbuf;
-  std::filebuf* r = fbuf.open(name, std::ios_base::out | std::ios_base::ate);
-  VERIFY( !fbuf.is_open() );
-  VERIFY( r == NULL );
-}
-
-// libstdc++/9964
-void test_07()
-{
-  using namespace std;
-  bool test = true;
-
-  const char* name = "tmp_fifo3";
-
-  signal(SIGPIPE, SIG_IGN);
-
-  unlink(name);  
-  mkfifo(name, S_IRWXU);
-  
-  int child = fork();
-  VERIFY( child != -1 );
-
-  if (child == 0)
-    {
-      filebuf fbin;
-      fbin.open(name, ios_base::in);
-      sleep(1);
-      fbin.close();
-      exit(0);
-    }
-  
-  filebuf fb;
-  filebuf* ret = fb.open(name, ios_base::out | ios_base::trunc);
-  VERIFY( ret != NULL );
-  VERIFY( fb.is_open() );
-
-  sleep(2);
-  fb.sputc('a');
-
-  ret = fb.close();
-  VERIFY( ret == NULL );
-  VERIFY( !fb.is_open() );
-}
-
-int
-main()
-{
-  test_01();
-  test_02();
-  test_03();
-  test_04();
-  test_05();
-  test_06();
-  test_07();
-  return 0;
-}
-
-
diff --git a/libstdc++-v3/testsuite/27_io/filebuf_virtuals-1.tst b/libstdc++-v3/testsuite/27_io/filebuf_virtuals-1.tst
deleted file mode 100644 (file)
index cb3c57f..0000000
+++ /dev/null
@@ -1,158 +0,0 @@
-// 990117 bkoz
-// test functionality of basic_filebuf for char_type == char
-// this is a data file for 27filebuf.cc
-
-// Copyright (C) 1997-1999 Cygnus Solutions
-//
-// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-/mnt/cdrom/sarah_vaughan/sarah_vaughan.allofme
-/mnt/cdrom/sarah_vaughan/sarah_vaughan.speaklow
-
-/mnt/cdrom/nikkigiovanni_thewayifeel/ng_01_the_way_i_feel
-/mnt/cdrom/nikkigiovanni_thewayifeel/ng_02_seduction_kidnap
-/mnt/cdrom/nikkigiovanni_thewayifeel/ng_03_just_a_ny_poem
-/mnt/cdrom/nikkigiovanni_thewayifeel/ng_04_butterflies_i_remem
-/mnt/cdrom/nikkigiovanni_thewayifeel/ng_05_luxury_poem
-/mnt/cdrom/nikkigiovanni_thewayifeel/ng_06_my_house
-/mnt/cdrom/nikkigiovanni_thewayifeel/ng_07_the_women_gather
-/mnt/cdrom/nikkigiovanni_thewayifeel/ng_08_the_life_i_led
-/mnt/cdrom/nikkigiovanni_thewayifeel/ng_09_when_i_die
-/mnt/cdrom/nikkigiovanni_thewayifeel/ng_10_revolutionary_dreams
-/mnt/cdrom/nikkigiovanni_thewayifeel/ng_11_winter_poem
-/mnt/cdrom/nikkigiovanni_thewayifeel/ng_12_a_certain_peace_i_nap
-/mnt/cdrom/nikkigiovanni_thewayifeel/ng_13_poem_for_a_lady_whose
-
-/mnt/cdrom/marley-songs_of_freedom/disk_1/
-/mnt/cdrom/marley-songs_of_freedom/disk_2/
-/mnt/cdrom/marley-songs_of_freedom/disk_4/
-
-/mnt/cdrom/marley-songs_of_freedom/disk_1/back out
-/mnt/cdrom/marley-songs_of_freedom/disk_1/bend down low
-/mnt/cdrom/marley-songs_of_freedom/disk_1/bus dem shut (pyaka)
-/mnt/cdrom/marley-songs_of_freedom/disk_1/caution
-/mnt/cdrom/marley-songs_of_freedom/disk_1/do it twice
-/mnt/cdrom/marley-songs_of_freedom/disk_1/don't rock the boat
-/mnt/cdrom/marley-songs_of_freedom/disk_1/duppy conqueror
-/mnt/cdrom/marley-songs_of_freedom/disk_1/hammer
-/mnt/cdrom/marley-songs_of_freedom/disk_1/hypocrites
-/mnt/cdrom/marley-songs_of_freedom/disk_1/i'm still waiting
-/mnt/cdrom/marley-songs_of_freedom/disk_1/judge not
-/mnt/cdrom/marley-songs_of_freedom/disk_1/mellow mood
-/mnt/cdrom/marley-songs_of_freedom/disk_1/mr brown
-/mnt/cdrom/marley-songs_of_freedom/disk_1/nice time
-/mnt/cdrom/marley-songs_of_freedom/disk_1/one cup of coffee
-/mnt/cdrom/marley-songs_of_freedom/disk_1/one love_people get ready
-/mnt/cdrom/marley-songs_of_freedom/disk_1/put it on
-/mnt/cdrom/marley-songs_of_freedom/disk_1/simmer down
-/mnt/cdrom/marley-songs_of_freedom/disk_1/small axe
-/mnt/cdrom/marley-songs_of_freedom/disk_1/soul rebel
-/mnt/cdrom/marley-songs_of_freedom/disk_1/soul shake down party
-/mnt/cdrom/marley-songs_of_freedom/disk_1/stir it up (original)
-/mnt/cdrom/marley-songs_of_freedom/disk_1/sun is shining
-/mnt/cdrom/marley-songs_of_freedom/disk_1/thank you lord (original)
-/mnt/cdrom/marley-songs_of_freedom/disk_2/acoustic medley
-/mnt/cdrom/marley-songs_of_freedom/disk_2/burnin' and lootin'
-/mnt/cdrom/marley-songs_of_freedom/disk_2/concrete jungle
-/mnt/cdrom/marley-songs_of_freedom/disk_2/craven choke puppy
-/mnt/cdrom/marley-songs_of_freedom/disk_2/get up stand up
-/mnt/cdrom/marley-songs_of_freedom/disk_2/guava jelly
-/mnt/cdrom/marley-songs_of_freedom/disk_2/high tide or low tide
-/mnt/cdrom/marley-songs_of_freedom/disk_2/i shot the sheriff
-/mnt/cdrom/marley-songs_of_freedom/disk_2/i'm hurting inside
-/mnt/cdrom/marley-songs_of_freedom/disk_2/iron lion zion
-/mnt/cdrom/marley-songs_of_freedom/disk_2/lick samba
-/mnt/cdrom/marley-songs_of_freedom/disk_2/lively up yourself
-/mnt/cdrom/marley-songs_of_freedom/disk_2/natty dread
-/mnt/cdrom/marley-songs_of_freedom/disk_2/no more trouble
-/mnt/cdrom/marley-songs_of_freedom/disk_2/rastaman chant
-/mnt/cdrom/marley-songs_of_freedom/disk_2/screw face
-/mnt/cdrom/marley-songs_of_freedom/disk_2/slave driver
-/mnt/cdrom/marley-songs_of_freedom/disk_2/trenchtown rock
-/mnt/cdrom/marley-songs_of_freedom/disk_4/africa unite
-/mnt/cdrom/marley-songs_of_freedom/disk_4/babylon system
-/mnt/cdrom/marley-songs_of_freedom/disk_4/bad card
-/mnt/cdrom/marley-songs_of_freedom/disk_4/coming in from the cold (12
-/mnt/cdrom/marley-songs_of_freedom/disk_4/could you be loved (12  mix
-/mnt/cdrom/marley-songs_of_freedom/disk_4/forever loving jah
-/mnt/cdrom/marley-songs_of_freedom/disk_4/give thanks and praise
-/mnt/cdrom/marley-songs_of_freedom/disk_4/one drop
-/mnt/cdrom/marley-songs_of_freedom/disk_4/one dub
-/mnt/cdrom/marley-songs_of_freedom/disk_4/rastaman live up
-/mnt/cdrom/marley-songs_of_freedom/disk_4/real situation
-/mnt/cdrom/marley-songs_of_freedom/disk_4/redemption song (live in pi
-/mnt/cdrom/marley-songs_of_freedom/disk_4/ride natty ride (12  mix)
-/mnt/cdrom/marley-songs_of_freedom/disk_4/so much trouble in the worl
-/mnt/cdrom/marley-songs_of_freedom/disk_4/survival
-/mnt/cdrom/marley-songs_of_freedom/disk_4/why should i (previously un
-/mnt/cdrom/marley-songs_of_freedom/disk_4/zimbabwe
-
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_01_pandemonium
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_02_sync_disjecta
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_03_object_unknown
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_04_it's_nice_not
-/mnt/cdrom/dj_spooky_rid-2dim_warefare/djspooky_05_dialectical_tra
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_06_post-human_soph
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_07_quilombo_ex
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_08_rekonstruction
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_09_scientifik
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_10_a_conversation
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_11_peace_in_zaire
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_13_degree_zero
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_14_roman_planeta
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_15_bass_digitalis
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_16_polyphony_of
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_17_riddim_warfare
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_18_the_nerd
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_20_theme_of_the
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_21_twilight_fugue
-
-/mnt/cdrom/stuff_smith_mosaic/disk3/01_desert_sands
-/mnt/cdrom/stuff_smith_mosaic/disk3/02_soft_winds
-/mnt/cdrom/stuff_smith_mosaic/disk3/03_time_and_again
-/mnt/cdrom/stuff_smith_mosaic/disk3/04_it_don't_mean_a_thing
-/mnt/cdrom/stuff_smith_mosaic/disk3/05_in_a_mellotone
-/mnt/cdrom/stuff_smith_mosaic/disk3/06_i_know_that_you_know
-/mnt/cdrom/stuff_smith_mosaic/disk3/07_heat_wave
-/mnt/cdrom/stuff_smith_mosaic/disk3/08_things_ain't_what_they_used_to_be
-/mnt/cdrom/stuff_smith_mosaic/disk3/09_body_and_soul
-
-So I take a break, wander down to the park to stand, then lean into
-the concrete railing demarking the beginnings of space, oceanic
-space. I watch the waves break, and form, and ease back out to sea and
-wrap my arms around myself and hug tightly because it's early in the
-morning and windy, and the sun is late getting out of bed today, which
-is good because if there was brilliant light illuminating all the
-beauty around me I would be shocked, stunned, forced to retreat back
-into my cabana in a daze, blinded by hummingbirds and callilillies and
-un-named red, yellow, and blue flowers. Green envelopes me, waves
-sooth me. I can see the wind flip the top of the waves seaward, right
-before they break. The sea seems so calm from my perch above the fray
-that I wonder if maybe there is just some part of the deepest, most
-abstract ocean where there is a large creature who happily chews
-plankton and wags its tail in gentle, adulating waves that spread and
-move and gracefully glide thousands of miles, to crash upon a beach,
-one after the other, politely waiting for a turn to dance with the
-seashore.
-
-I know: it is what the Mexican schoolchildren call "la vibora de la
-mer," the serpent of the sea.
-
-
-
-
-
diff --git a/libstdc++-v3/testsuite/27_io/filebuf_virtuals-1.txt b/libstdc++-v3/testsuite/27_io/filebuf_virtuals-1.txt
deleted file mode 100644 (file)
index cb3c57f..0000000
+++ /dev/null
@@ -1,158 +0,0 @@
-// 990117 bkoz
-// test functionality of basic_filebuf for char_type == char
-// this is a data file for 27filebuf.cc
-
-// Copyright (C) 1997-1999 Cygnus Solutions
-//
-// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-/mnt/cdrom/sarah_vaughan/sarah_vaughan.allofme
-/mnt/cdrom/sarah_vaughan/sarah_vaughan.speaklow
-
-/mnt/cdrom/nikkigiovanni_thewayifeel/ng_01_the_way_i_feel
-/mnt/cdrom/nikkigiovanni_thewayifeel/ng_02_seduction_kidnap
-/mnt/cdrom/nikkigiovanni_thewayifeel/ng_03_just_a_ny_poem
-/mnt/cdrom/nikkigiovanni_thewayifeel/ng_04_butterflies_i_remem
-/mnt/cdrom/nikkigiovanni_thewayifeel/ng_05_luxury_poem
-/mnt/cdrom/nikkigiovanni_thewayifeel/ng_06_my_house
-/mnt/cdrom/nikkigiovanni_thewayifeel/ng_07_the_women_gather
-/mnt/cdrom/nikkigiovanni_thewayifeel/ng_08_the_life_i_led
-/mnt/cdrom/nikkigiovanni_thewayifeel/ng_09_when_i_die
-/mnt/cdrom/nikkigiovanni_thewayifeel/ng_10_revolutionary_dreams
-/mnt/cdrom/nikkigiovanni_thewayifeel/ng_11_winter_poem
-/mnt/cdrom/nikkigiovanni_thewayifeel/ng_12_a_certain_peace_i_nap
-/mnt/cdrom/nikkigiovanni_thewayifeel/ng_13_poem_for_a_lady_whose
-
-/mnt/cdrom/marley-songs_of_freedom/disk_1/
-/mnt/cdrom/marley-songs_of_freedom/disk_2/
-/mnt/cdrom/marley-songs_of_freedom/disk_4/
-
-/mnt/cdrom/marley-songs_of_freedom/disk_1/back out
-/mnt/cdrom/marley-songs_of_freedom/disk_1/bend down low
-/mnt/cdrom/marley-songs_of_freedom/disk_1/bus dem shut (pyaka)
-/mnt/cdrom/marley-songs_of_freedom/disk_1/caution
-/mnt/cdrom/marley-songs_of_freedom/disk_1/do it twice
-/mnt/cdrom/marley-songs_of_freedom/disk_1/don't rock the boat
-/mnt/cdrom/marley-songs_of_freedom/disk_1/duppy conqueror
-/mnt/cdrom/marley-songs_of_freedom/disk_1/hammer
-/mnt/cdrom/marley-songs_of_freedom/disk_1/hypocrites
-/mnt/cdrom/marley-songs_of_freedom/disk_1/i'm still waiting
-/mnt/cdrom/marley-songs_of_freedom/disk_1/judge not
-/mnt/cdrom/marley-songs_of_freedom/disk_1/mellow mood
-/mnt/cdrom/marley-songs_of_freedom/disk_1/mr brown
-/mnt/cdrom/marley-songs_of_freedom/disk_1/nice time
-/mnt/cdrom/marley-songs_of_freedom/disk_1/one cup of coffee
-/mnt/cdrom/marley-songs_of_freedom/disk_1/one love_people get ready
-/mnt/cdrom/marley-songs_of_freedom/disk_1/put it on
-/mnt/cdrom/marley-songs_of_freedom/disk_1/simmer down
-/mnt/cdrom/marley-songs_of_freedom/disk_1/small axe
-/mnt/cdrom/marley-songs_of_freedom/disk_1/soul rebel
-/mnt/cdrom/marley-songs_of_freedom/disk_1/soul shake down party
-/mnt/cdrom/marley-songs_of_freedom/disk_1/stir it up (original)
-/mnt/cdrom/marley-songs_of_freedom/disk_1/sun is shining
-/mnt/cdrom/marley-songs_of_freedom/disk_1/thank you lord (original)
-/mnt/cdrom/marley-songs_of_freedom/disk_2/acoustic medley
-/mnt/cdrom/marley-songs_of_freedom/disk_2/burnin' and lootin'
-/mnt/cdrom/marley-songs_of_freedom/disk_2/concrete jungle
-/mnt/cdrom/marley-songs_of_freedom/disk_2/craven choke puppy
-/mnt/cdrom/marley-songs_of_freedom/disk_2/get up stand up
-/mnt/cdrom/marley-songs_of_freedom/disk_2/guava jelly
-/mnt/cdrom/marley-songs_of_freedom/disk_2/high tide or low tide
-/mnt/cdrom/marley-songs_of_freedom/disk_2/i shot the sheriff
-/mnt/cdrom/marley-songs_of_freedom/disk_2/i'm hurting inside
-/mnt/cdrom/marley-songs_of_freedom/disk_2/iron lion zion
-/mnt/cdrom/marley-songs_of_freedom/disk_2/lick samba
-/mnt/cdrom/marley-songs_of_freedom/disk_2/lively up yourself
-/mnt/cdrom/marley-songs_of_freedom/disk_2/natty dread
-/mnt/cdrom/marley-songs_of_freedom/disk_2/no more trouble
-/mnt/cdrom/marley-songs_of_freedom/disk_2/rastaman chant
-/mnt/cdrom/marley-songs_of_freedom/disk_2/screw face
-/mnt/cdrom/marley-songs_of_freedom/disk_2/slave driver
-/mnt/cdrom/marley-songs_of_freedom/disk_2/trenchtown rock
-/mnt/cdrom/marley-songs_of_freedom/disk_4/africa unite
-/mnt/cdrom/marley-songs_of_freedom/disk_4/babylon system
-/mnt/cdrom/marley-songs_of_freedom/disk_4/bad card
-/mnt/cdrom/marley-songs_of_freedom/disk_4/coming in from the cold (12
-/mnt/cdrom/marley-songs_of_freedom/disk_4/could you be loved (12  mix
-/mnt/cdrom/marley-songs_of_freedom/disk_4/forever loving jah
-/mnt/cdrom/marley-songs_of_freedom/disk_4/give thanks and praise
-/mnt/cdrom/marley-songs_of_freedom/disk_4/one drop
-/mnt/cdrom/marley-songs_of_freedom/disk_4/one dub
-/mnt/cdrom/marley-songs_of_freedom/disk_4/rastaman live up
-/mnt/cdrom/marley-songs_of_freedom/disk_4/real situation
-/mnt/cdrom/marley-songs_of_freedom/disk_4/redemption song (live in pi
-/mnt/cdrom/marley-songs_of_freedom/disk_4/ride natty ride (12  mix)
-/mnt/cdrom/marley-songs_of_freedom/disk_4/so much trouble in the worl
-/mnt/cdrom/marley-songs_of_freedom/disk_4/survival
-/mnt/cdrom/marley-songs_of_freedom/disk_4/why should i (previously un
-/mnt/cdrom/marley-songs_of_freedom/disk_4/zimbabwe
-
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_01_pandemonium
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_02_sync_disjecta
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_03_object_unknown
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_04_it's_nice_not
-/mnt/cdrom/dj_spooky_rid-2dim_warefare/djspooky_05_dialectical_tra
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_06_post-human_soph
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_07_quilombo_ex
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_08_rekonstruction
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_09_scientifik
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_10_a_conversation
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_11_peace_in_zaire
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_13_degree_zero
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_14_roman_planeta
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_15_bass_digitalis
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_16_polyphony_of
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_17_riddim_warfare
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_18_the_nerd
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_20_theme_of_the
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_21_twilight_fugue
-
-/mnt/cdrom/stuff_smith_mosaic/disk3/01_desert_sands
-/mnt/cdrom/stuff_smith_mosaic/disk3/02_soft_winds
-/mnt/cdrom/stuff_smith_mosaic/disk3/03_time_and_again
-/mnt/cdrom/stuff_smith_mosaic/disk3/04_it_don't_mean_a_thing
-/mnt/cdrom/stuff_smith_mosaic/disk3/05_in_a_mellotone
-/mnt/cdrom/stuff_smith_mosaic/disk3/06_i_know_that_you_know
-/mnt/cdrom/stuff_smith_mosaic/disk3/07_heat_wave
-/mnt/cdrom/stuff_smith_mosaic/disk3/08_things_ain't_what_they_used_to_be
-/mnt/cdrom/stuff_smith_mosaic/disk3/09_body_and_soul
-
-So I take a break, wander down to the park to stand, then lean into
-the concrete railing demarking the beginnings of space, oceanic
-space. I watch the waves break, and form, and ease back out to sea and
-wrap my arms around myself and hug tightly because it's early in the
-morning and windy, and the sun is late getting out of bed today, which
-is good because if there was brilliant light illuminating all the
-beauty around me I would be shocked, stunned, forced to retreat back
-into my cabana in a daze, blinded by hummingbirds and callilillies and
-un-named red, yellow, and blue flowers. Green envelopes me, waves
-sooth me. I can see the wind flip the top of the waves seaward, right
-before they break. The sea seems so calm from my perch above the fray
-that I wonder if maybe there is just some part of the deepest, most
-abstract ocean where there is a large creature who happily chews
-plankton and wags its tail in gentle, adulating waves that spread and
-move and gracefully glide thousands of miles, to crash upon a beach,
-one after the other, politely waiting for a turn to dance with the
-seashore.
-
-I know: it is what the Mexican schoolchildren call "la vibora de la
-mer," the serpent of the sea.
-
-
-
-
-
diff --git a/libstdc++-v3/testsuite/27_io/filebuf_virtuals-2.tst b/libstdc++-v3/testsuite/27_io/filebuf_virtuals-2.tst
deleted file mode 100644 (file)
index f25bba4..0000000
+++ /dev/null
@@ -1 +0,0 @@
-ac23456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZracadabras23456789:;<
\ No newline at end of file
diff --git a/libstdc++-v3/testsuite/27_io/filebuf_virtuals-3.tst b/libstdc++-v3/testsuite/27_io/filebuf_virtuals-3.tst
deleted file mode 100644 (file)
index 0a81f51..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-bd2
-456x
-9m;uva?@ABCDEFGHIJKLMNOPQRSTUVWXYZracadabras, i wanna 
-because because
-because. . .
-of the wonderful things he does!!
-ok
\ No newline at end of file
diff --git a/libstdc++-v3/testsuite/27_io/filebuf_virtuals.cc b/libstdc++-v3/testsuite/27_io/filebuf_virtuals.cc
deleted file mode 100644 (file)
index 6699d80..0000000
+++ /dev/null
@@ -1,892 +0,0 @@
-// 2001-05-21 Benjamin Kosnik  <bkoz@redhat.com>
-
-// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// 27.8.1.4 Overridden virtual functions
-
-#include <fstream>
-#include <unistd.h>
-#include <signal.h>
-#include <fcntl.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <locale>
-#include <testsuite_hooks.h>
-
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %*.txt
-
-void test01()
-{
-  using namespace std;
-
-  bool test = true;
-  char buf[512];
-  const char* strlit = "how to tell a story and other essays: mark twain";
-  const size_t strlitsize = std::strlen(strlit);
-  filebuf fbuf01;
-
-  fbuf01.pubsetbuf(buf, 512);
-  fbuf01.sputn(strlit, strlitsize);
-  VERIFY( std::strncmp(strlit, buf, strlitsize) != 0 );
-}
-
-void test02()
-{
-  using namespace std;
-
-  bool test = true;
-  char buf[512];
-  const char* strlit = "how to tell a story and other essays: mark twain";
-  const size_t strlitsize = std::strlen(strlit);
-  filebuf fbuf01;
-  fbuf01.open("tmp", ios_base::out);
-
-  fbuf01.pubsetbuf(buf, strlitsize);
-  fbuf01.sputn(strlit, strlitsize);
-  VERIFY( std::strncmp(strlit, buf, strlitsize) == 0 );
-}
-
-
-// NB: This test assumes that _M_buf_size == 40, and not the usual
-// buffer_size length of BUFSIZ (8192), so that overflow/underflow can be
-// simulated a bit more readily.
-// NRB (Nota Really Bene): setting it to 40 breaks the test, as intended.
-const int buffer_size = 8192;
-//const int buffer_size = 40;
-
-const char carray_01[] = "santa cruz or sandiego?";
-const char carray_02[] = "memphis, new orleans, and savanah";
-const char name_01[] = "filebuf_virtuals-1.txt"; // file with data in it
-const char name_02[] = "filebuf_virtuals-2.txt"; // empty file, need to create
-const char name_03[] = "filebuf_virtuals-3.txt"; // empty file, need to create
-const char name_04[] = "filebuf_virtuals-4.txt"; // empty file, need to create
-const char name_05[] = "filebuf_virtuals-5.txt"; // empty file, need to create
-const char name_06[] = "filebuf_virtuals-6.txt"; // empty file, need to create
-const char name_07[] = "filebuf_virtuals-7.txt"; // empty file, need to create
-const char name_08[] = "filebuf_virtuals-8.txt"; // empty file, need to create
-
-class derived_filebuf: public std::filebuf
-{
- public:
-  void
-  set_size(int_type __size) { _M_buf_size_opt = __size; }
-};
-
-derived_filebuf fb_01; // in 
-derived_filebuf fb_02; // out
-derived_filebuf fb_03; // in | out
-
-
-// Initialize filebufs to be the same size regardless of platform.
-void test03()
-{
-  fb_01.set_size(buffer_size);
-  fb_02.set_size(buffer_size);
-  fb_03.set_size(buffer_size);
-}
-
-
-// Test the filebuf/stringbuf locale settings.
-void test04() 
-{
-  std::locale loc_tmp;
-  loc_tmp = fb_01.getloc();
-  fb_01.pubimbue(loc_tmp); //This should initialize _M_init to true
-  fb_01.getloc(); //This should just return _M_locale
-}
-
-// Test overloaded virtual functions.
-void test05() 
-{
-  typedef std::filebuf::int_type       int_type;
-  typedef std::filebuf::traits_type    traits_type;
-  typedef std::filebuf::pos_type       pos_type;
-  typedef std::filebuf::off_type       off_type;
-  typedef size_t                       size_type;
-
-  bool                                         test = true;
-  std::filebuf                                 f_tmp;
-  std::streamsize                      strmsz_1, strmsz_2;
-  std::streamoff                       strmof_1, strmof_2;
-  int                                  i = 0, j = 0, k = 0;
-
-  // GET
-  // int showmanyc()
-  // returns an estimate of the numbers of chars in the seq, or -1.
-  // if __retval > 0, then calls to underflow won't return
-  // traits_type::eof() till at least __retval chars. 
-  // if __retval == -1, then calls to underflow or uflow will fail.
-  // NB overriding def if it can determine more chars can be read from 
-  // the input sequence.
-
-  // int in_avail()
-  // if a read position is available, return _M_in_end - _M_in_cur.
-  // else return showmanyc.
-  strmof_1 = fb_01.in_avail();
-  strmof_2 = fb_02.in_avail();
-  VERIFY( strmof_1 == -1 );
-  VERIFY( strmof_1 == strmof_2 ); //fail because not open
-  strmof_1 = fb_03.in_avail();
-  VERIFY( strmof_1 == strmof_2 );
-  fb_01.open(name_01, std::ios_base::in);
-  fb_02.open(name_02, std::ios_base::out | std::ios_base::trunc);
-  fb_03.open(name_03, std::ios_base::out | std::ios_base::in | std::ios_base::trunc); 
-  strmof_1 = fb_01.in_avail();
-  strmof_2 = fb_02.in_avail();
-  VERIFY( strmof_1 != strmof_2 );
-  VERIFY( strmof_1 >= 0 );
-  VERIFY( strmof_2 == -1 );  // empty file
-  strmof_1 = fb_03.in_avail(); 
-  VERIFY( strmof_1  == 0 ); // empty file
-
-  // int_type sbumpc()
-  // if read_cur not avail returns uflow(), else return *read_cur & increment
-  int_type c1 = fb_01.sbumpc();
-  int_type c2 = fb_02.sbumpc();
-  VERIFY( c1 != c2 );
-  VERIFY( c1 == '/' );
-  VERIFY( c2 == -1 );
-  int_type c3 = fb_01.sbumpc();
-  int_type c4 = fb_02.sbumpc();
-  VERIFY( c3 != c4 );
-  VERIFY( c1 == c3 ); // fluke, both happen to be '/'
-  VERIFY( c2 == c4 );
-  int_type c5 = fb_03.sbumpc();
-  VERIFY( c5 == traits_type::eof() );
-  // XXX should do some kind of test to make sure that internal
-  // buffers point ot the same thing, to check consistancy.
-
-  // int_type sgetc()
-  // if read_cur not avail, return uflow(), else return *read_cur  
-  int_type c6 = fb_01.sgetc();
-  int_type c7 = fb_02.sgetc();
-  VERIFY( c6 != c3 );
-  VERIFY( c7 == c4 ); // both -1
-  int_type c8 = fb_01.sgetc();
-  int_type c9 = fb_02.sgetc();
-  VERIFY( c6 == c8 );
-  VERIFY( c7 == c9 );
-  c5 = fb_03.sgetc();
-  VERIFY( c5 == traits_type::eof() );
-
-  // int_type snextc()
-  // calls sbumpc and if sbumpc != eof, return sgetc
-  c6 = fb_01.snextc();
-  c7 = fb_02.snextc();
-  VERIFY( c6 != c8 );
-  VERIFY( c7 == c9 ); // -1
-  VERIFY( c6 == '9' );
-  c6 = fb_01.snextc();
-  c7 = fb_02.snextc();
-  VERIFY( c6 != c8 );
-  VERIFY( c7 == c9 ); // -1
-  VERIFY( c6 == '9' );
-  c5 = fb_03.snextc();
-  VERIFY( c5 == traits_type::eof() );
-
-  // streamsize sgetn(char_type *s, streamsize n)
-  // streamsize xsgetn(char_type *s, streamsize n)
-  // assign up to n chars to s from input sequence, indexing in_cur as
-  // approp and returning the number of chars assigned
-  strmsz_1 = fb_01.in_avail();
-  strmsz_2 = fb_02.in_avail();
-  test = strmsz_1 != strmsz_2;
-  char carray1[13] = "";
-  strmsz_1 = fb_01.sgetn(carray1, 10);
-  char carray2[buffer_size] = "";
-  strmsz_2 = fb_02.sgetn(carray2, 10);
-  VERIFY( strmsz_1 != strmsz_2 );
-  VERIFY( strmsz_1 == 10 );
-  VERIFY( strmsz_2 == 0 );
-  c1 = fb_01.sgetc();
-  c2 = fb_02.sgetc();
-  VERIFY( c1 == '\n' );  
-  VERIFY( c7 == c2 ); // n != i
-  strmsz_1 = fb_03.sgetn(carray1, 10);
-  VERIFY( !strmsz_1 ); //zero
-  strmsz_1 = fb_01.in_avail();
-  strmsz_2 = fb_01.sgetn(carray2, strmsz_1 + 5);
-  VERIFY( strmsz_1 == strmsz_2 - 5 ); 
-  c4 = fb_01.sgetc(); // buffer should have underflowed from above.
-  VERIFY( c4 == 'i' );
-  strmsz_1 = fb_01.in_avail();
-  VERIFY( strmsz_1 > 0 );
-  strmsz_2 = fb_01.sgetn(carray2, strmsz_1 + 5);
-  VERIFY( strmsz_1 == strmsz_2 ); //at the end of the actual file 
-  strmsz_1 = fb_02.in_avail();
-  strmsz_2 = fb_02.sgetn(carray2, strmsz_1 + 5);
-  VERIFY( strmsz_1 == -1 );
-  VERIFY( strmsz_2 == 0 );
-  c4 = fb_02.sgetc(); // should be EOF
-  VERIFY( c4 == traits_type::eof() );
-
-  // PUT
-  // int_type sputc(char_type c)
-  // if out_cur not avail, return overflow(traits_type::to_int_type(c)) 
-  // else, stores c at out_cur,
-  // increments out_cur, and returns c as int_type
-  // strmsz_1 = fb_03.in_avail();  // XXX valid for in|out??
-  c1 = fb_02.sputc('a'); 
-  c2 = fb_03.sputc('b'); 
-  VERIFY( c1 != c2 );
-  c1 = fb_02.sputc('c'); 
-  c2 = fb_03.sputc('d'); 
-  VERIFY( c1 != c2 );
-  // strmsz_2 = fb_03.in_avail();
-  // VERIFY( strmsz_1 != strmsz_2 );
-  for (int i = 50; i <= 90; ++i) 
-    c2 = fb_02.sputc(char(i));
-  // 27filebuf-2.txt == ac23456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWX
-  // fb_02._M_out_cur = '2'
-  strmsz_1 = fb_03.in_avail();
-  for (int i = 50; i <= 90; ++i) 
-    c2 = fb_03.sputc(char(i));
-  strmsz_2 = fb_03.in_avail();
-  // VERIFY( strmsz_1 != strmsz_2 );
-  // VERIFY( strmsz_1 > 0 );
-  // VERIFY( strmsz_2 > 0 );
-  // 27filebuf-2.txt == bd23456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWX
-  // fb_02._M_out_cur = '2'
-  c3 = fb_01.sputc('a'); // should be EOF because this is read-only
-  VERIFY( c3 == traits_type::eof() );
-
-  // streamsize sputn(const char_typs* s, streamsize n)
-  // write up to n chars to out_cur from s, returning number assigned
-  // NB *sputn will happily put '\0' into your stream if you give it a chance*
-  strmsz_1 = fb_03.sputn("racadabras", 10);//"abracadabras or what?"
-  VERIFY( strmsz_1 == 10 );
-  strmsz_2 = fb_03.sputn(", i wanna reach out and", 10);
-  VERIFY( strmsz_2 == 10 );
-  VERIFY( strmsz_1 == strmsz_2 ); 
-  // fb_03._M_out_beg = "YZracadabras, i wanna FGHIJKLMNOPQRSTUVW"
-  // fb_03._M_out_cur = "FGHIJKLMNOPQRSTUVW"
-  strmsz_1 = fb_02.sputn("racadabras", 10);
-  VERIFY( strmsz_1 == 10 );  
-  // fb_02._M_out_beg = "YZracadabras<=>?@ABCDEFGHIJKLMNOPQRSTUVW"
-  // fb_02._M_out_cur = "<=>?@ABCDEFGHIJKLMNOPQRSTUVW"
-  strmsz_1 = fb_01.sputn("racadabra", 10);
-  VERIFY( strmsz_1 == 0 );  
-
-  // PUTBACK
-  // int_type pbfail(int_type c)
-  // called when gptr() null, gptr() == eback(), or traits::eq(*gptr, c) false
-  // "pending sequence" is:
-  //   1) everything as defined in underflow
-  //   2) + if (traits::eq_int_type(c, traits::eof()), then input
-  //   sequence is backed up one char before the pending sequence is
-  //   determined.
-  //   3) + if (not 2) then c is prepended. Left unspecified is
-  //   whether the input sequence is backedup or modified in any way
-  // returns traits::eof() for failure, unspecified other value for success
-
-  // int_type sputbackc(char_type c)
-  // if in_cur not avail || ! traits::eq(c, gptr() [-1]), return pbfail
-  // otherwise decrements in_cur and returns *gptr()
-  c1 = fb_03.sgetc(); // -1
-  c2 = fb_03.sputbackc('z');
-  strmsz_2 = fb_03.in_avail();
-  c3 = fb_03.sgetc();
-  VERIFY( c3 == c2 );
-  VERIFY( c1 != c3 );
-  VERIFY( 1 == strmsz_2 );
-  //test for _in_cur == _in_beg
-  // fb_03._M_out_beg = "bd23456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZracada" etc
-  fb_03.pubseekoff(10, std::ios_base::beg, 
-                  std::ios_base::in | std::ios_base::out);
-  fb_03.sputc('m');
-  strmsz_1 = fb_03.in_avail(); 
-  c1 = fb_03.sgetc(); 
-  fb_03.snextc();
-  c2 = fb_03.sputbackc('z');  
-  strmsz_2 = fb_03.in_avail(); 
-  c3 = fb_03.sgetc();  
-  VERIFY( c1 != c2 );
-  VERIFY( c3 == c2 );
-  VERIFY( c1 != c3 );
-  VERIFY( c2 == 'z' );
-  //  VERIFY( strmsz_1 == strmsz_2 );
-  // test for replacing char with identical one
-  fb_03.snextc();
-  fb_03.sputc('u');
-  fb_03.sputc('v');
-  fb_03.sputc('a');
-  strmsz_1 = fb_03.in_avail();
-  c2 = fb_03.sputbackc('a');
-  strmsz_2 = fb_03.in_avail();
-  c3 = fb_03.sgetc();
-  VERIFY( c3 == c2 );
-  VERIFY( strmsz_1 + 1 == strmsz_2 );
-  //test for ios_base::out
-  c1 = fb_02.sgetc(); // undefined
-  c2 = fb_02.sputbackc('a');
-  VERIFY( c1 == c2 );
-  VERIFY( c1 == -1 );
-
-  // int_type sungetc()
-  // if in_cur not avail, return pbackfail(), else decrement and
-  // return to_int_type(*gptr())
-  // fb_03._M_out_beg = "uvaacadabras, i wannaZ[\\]^_`abcdefghijkl"
-  // fb_03._M_out_cur = "aacadabras, i wannaZ[\\]^_`abcdefghijkl"
-  strmsz_1 = fb_03.in_avail();
-  c2 = fb_03.sungetc(); // delete the 'a'
-  strmsz_2 = fb_03.in_avail();
-  VERIFY( c2 == 'v' ); //  VERIFY( c2 != traits_type::eof() );
-  VERIFY( strmsz_1 + 1 == strmsz_2 );
-  //test for _in_cur == _in_beg
-  for (int i = 50; i < 32 + 29; ++i)
-    fb_02.sputc(char(i));
-  fb_02.pubseekoff(0, std::ios_base::beg, std::ios_base::out);
-  c1 = fb_02.sgetc(); 
-  strmsz_1 = fb_02.in_avail();
-  c2 = fb_02.sungetc();
-  c3 = fb_02.sgetc();
-  strmsz_2 = fb_02.in_avail();
-  VERIFY( c1 == c2 );
-  VERIFY( c2 == c3 );
-  VERIFY( c1 == traits_type::eof() );
-  VERIFY( strmsz_1 == strmsz_2 );
-  //test for _in_cur == _in_end
-  fb_03.pubseekoff(0, std::ios_base::end);
-  strmsz_1 = fb_03.in_avail(); // -1 cuz at the end
-  c1 = fb_03.sgetc(); 
-  c2 = fb_03.sungetc();
-  strmsz_2 = fb_03.in_avail(); // 1
-  c3 = fb_03.sgetc();
-  VERIFY( c1 != c2 );
-  // VERIFY( c2 == c3 || c2 == traits_type::not_eof(int(c3)) );
-  VERIFY( strmsz_2 != strmsz_1 );
-  VERIFY( strmsz_2 == 1 );
-  //test for ios_base::out
-
-  // BUFFER MANAGEMENT & POSITIONING
-  // int sync()
-  // if a put area exists, overflow. 
-  // if a get area exists, do something undefined. (like, nothing)
-  strmsz_1 = fb_01.in_avail(); 
-  fb_01.pubsync();
-  strmsz_2 = fb_01.in_avail();
-  VERIFY( strmsz_2 == strmsz_1 );
-  strmsz_1 = fb_02.in_avail(); 
-  fb_02.pubsync();             
-  // 27filebuf-2.txt == 53 bytes after this.
-  strmsz_2 = fb_02.in_avail();
-  VERIFY( strmsz_2 == -1 );
-  VERIFY( strmsz_2 == strmsz_1 );
-  strmsz_1 = fb_03.in_avail(); 
-  fb_03.pubsync();
-  // 27filebuf-3.txt 
-  // bd23456789mzuva?@ABCDEFGHIJKLMNOPQRSTUVWXYZracadabras, i wannaz 
-  // 63 bytes.
-  strmsz_2 = fb_03.in_avail();
-  VERIFY( strmsz_1 == 1 );
-  // VERIFY( strmsz_2 == 1 );
-
-  // setbuf
-  // pubsetbuf(char_type* s, streamsize n)
-  fb_01.pubsetbuf(0,0);
-  fb_02.pubsetbuf(0,0);
-  fb_03.pubsetbuf(0,0);
-  // Need to test unbuffered output, which means calling this on some
-  // things that have just been opened.
-
-
-  // seekoff
-  // pubseekoff(off_type off, ios_base::seekdir way, ios_base::openmode which)
-  // alters the stream position to off
-  pos_type pt_1(off_type(-1));
-  pos_type pt_2(off_type(0));
-  off_type off_1 = 0;
-  off_type off_2 = 0;
-  //IN|OUT
-  // 27filebuf-3.txt = bd23456789:;<=>?...
-  //beg
-  strmsz_1 = fb_03.in_avail(); 
-  pt_1 = fb_03.pubseekoff(2, std::ios_base::beg);
-  strmsz_2 = fb_03.in_avail(); 
-  off_1 = pt_1;
-  VERIFY( off_1 > 0 );
-  c1 = fb_03.snextc(); //current in pointer +1
-  VERIFY( c1 == '3' );
-  c2 = fb_03.sputc('\n');  //current in pointer +1
-  c3 = fb_03.sgetc();
-  VERIFY( c2 != c3 ); 
-  VERIFY( c3 == '4' );
-  fb_03.pubsync(); 
-  c1 = fb_03.sgetc();
-  VERIFY( c1 == c3 );
-  //cur
-  // 27filebuf-3.txt = bd2\n456789:;<=>?...
-  pt_2 = fb_03.pubseekoff(2, std::ios_base::cur);
-  off_2 = pt_2;
-  VERIFY( (off_2 == (off_1 + 2 + 1 + 1)) );
-  c1 = fb_03.snextc(); //current in pointer +1
-  VERIFY( c1 == '7' );
-  c2 = fb_03.sputc('x');  //test current out pointer
-  c3 = fb_03.sputc('\n');
-  c1 = fb_03.sgetc();
-  fb_03.pubsync(); 
-  c3 = fb_03.sgetc();
-  VERIFY( c1 == c3 );
-  //end
-  // 27filebuf-3.txt = "bd2\n456x\n9" 
-  pt_2 = fb_03.pubseekoff(0, std::ios_base::end, 
-                         std::ios_base::in|std::ios_base::out);
-  off_1 = pt_2;
-  VERIFY( off_1 > off_2 ); //weak, but don't know exactly where it ends
-  c3 = fb_03.sputc('\n');
-  strmsz_1 = fb_03.sputn("because because because. . .", 28);  
-  VERIFY( strmsz_1 == 28 );
-  c1 = fb_03.sungetc();
-  // Defect?  retval of sungetc is not necessarily the character ungotten.
-  // So re-get it.
-  c1 = fb_03.sgetc();
-  fb_03.pubsync(); 
-  c3 = fb_03.sgetc();
-  VERIFY( c1 == c3 );
-  // IN
-  // OUT
-
-
-  // seekpos
-  // pubseekpos(pos_type sp, ios_base::openmode)
-  // alters the stream position to sp
-  //IN|OUT
-  //beg
-  pt_1 = fb_03.pubseekoff(78, std::ios_base::beg);
-  off_1 = pt_1;
-  VERIFY( off_1 > 0 );
-  c1 = fb_03.snextc();                 //current in pointer +1
-  VERIFY( c1 == ' ' );
-  c2 = fb_03.sputc('\n');      //test current out pointer
-  c3 = fb_03.sgetc();
-  fb_03.pubsync();             //resets pointers
-  pt_2 = fb_03.pubseekpos(pt_1);
-  off_2 = pt_2;
-  VERIFY( off_1 == off_2 );
-  c3 = fb_03.snextc();                 //current in pointer +1
-  VERIFY( c2 == c3 );
-  pt_1 = fb_03.pubseekoff(0, std::ios_base::end);
-  off_1 = pt_1;
-  VERIFY( off_1 > off_2 );
-  fb_03.sputn("\nof the wonderful things he does!!\nok", 37);
-  fb_03.pubsync();
-
-  // IN
-  // OUT
-
-  // VIRTUALS (indirectly tested)
-  // underflow
-  // if read position avail, returns *gptr()
-
-  // pbackfail(int_type c)
-  // put c back into input sequence
-
-  // overflow
-  // appends c to output seq
-
-  // NB Have to close these suckers. . .
-  // filebuf_type* close()
-  fb_01.close();
-  fb_02.close();
-  fb_03.close();
-  VERIFY( !fb_01.is_open() );
-  VERIFY( !fb_02.is_open() );
-  VERIFY( !fb_03.is_open() );
-}
-
-void test06()
-{
-  using namespace std;
-  typedef istream::int_type    int_type;
-
-  bool test = true;
-  ifstream ifs(name_02);
-  char buffer[] = "xxxxxxxxxx";
-  int_type len1 = ifs.rdbuf()->sgetn(buffer, sizeof(buffer));
-  VERIFY( len1 == sizeof(buffer) );
-  VERIFY( buffer[0] == 'a' );
-}
-
-// libstdc++/9322
-void test07()
-{
-  using std::locale;
-  bool test = true;
-
-  locale loc;
-  std::filebuf ob;
-  VERIFY( ob.getloc() == loc );
-
-  locale::global(locale("en_US"));
-  VERIFY( ob.getloc() == loc );
-
-  locale loc_de ("de_DE");
-  locale ret = ob.pubimbue(loc_de);
-  VERIFY( ob.getloc() == loc_de );
-  VERIFY( ret == loc );
-
-  locale::global(loc);
-  VERIFY( ob.getloc() == loc_de );
-}
-
-class MyTraits : public std::char_traits<char>
-{
-public:
-  static bool eq(char c1, char c2)
-  {
-    bool test = true;
-    VERIFY( c1 != 'X' );
-    VERIFY( c2 != 'X' );
-    return std::char_traits<char>::eq(c1, c2);
-  }
-};
-
-class MyBuf : public std::basic_streambuf<char, MyTraits>
-{
-  char buffer[8];
-
-public:
-  MyBuf()
-  {
-    std::memset(buffer, 'X', sizeof(buffer));
-    std::memset(buffer + 2, 'f', 4);
-    setg(buffer + 2, buffer + 2, buffer + 6);
-  }
-};
-
-// libstdc++/9538
-void test08()
-{
-  bool test = true;
-
-  MyBuf mb;
-  mb.sputbackc('a');  
-}
-
-// libstdc++/9439, libstdc++/9425
-void test09()
-{
-  using namespace std;
-  bool test = true;
-
-  filebuf fbuf;
-  fbuf.open(name_01, ios_base::in);
-  filebuf::int_type r = fbuf.sputbackc('a');
-  fbuf.close();
-
-  VERIFY( r == filebuf::traits_type::eof() );
-}
-
-class Cvt_to_upper : public std::codecvt<char, char, mbstate_t>
-{
-  bool do_always_noconv() const throw()
-  {
-    return false;
-  }
-};
-
-// libstdc++/9169
-void test10()
-{
-  using namespace std;
-  bool test = true;
-
-  locale c_loc;
-  locale loc(c_loc, new Cvt_to_upper);
-
-  string str("abcdefghijklmnopqrstuvwxyz");
-  string tmp;
-
-  {
-    ofstream out;
-    out.imbue(loc);
-    out.open(name_04);
-    copy(str.begin(), str.end(),
-        ostreambuf_iterator<char>(out));
-  }
-
-  {
-    ifstream in;
-    in.open(name_04);
-    copy(istreambuf_iterator<char>(in),
-        istreambuf_iterator<char>(),
-        back_inserter(tmp));
-  }
-
-  VERIFY( tmp.size() == str.size() );
-  VERIFY( tmp == str );
-}
-
-bool over_called;
-
-class Derived_filebuf : public std::filebuf
-{
-public:
-  int_type overflow(int_type c)
-  {
-    over_called = true;
-    return std::filebuf::overflow(c);
-  }
-  
-  const char_type* pub_epptr() const
-  {
-    return epptr();
-  }
-  
-  const char_type* pub_pptr() const
-  {
-    return pptr();
-  }
-};
-
-// libstdc++/9701 (partial)
-void test11()
-{
-  bool test = true;
-
-  bool over_expected;
-
-  // sputc
-  Derived_filebuf dfbuf_01;
-  dfbuf_01.open(name_05, std::ios_base::out);
-  over_called = false;
-  dfbuf_01.sputc('i');
-  VERIFY( !over_called );
-  over_expected = dfbuf_01.pub_epptr() == dfbuf_01.pub_pptr();
-  over_called = false;
-  dfbuf_01.sputc('v');
-  VERIFY( (!over_expected && !over_called)
-         || (over_expected && over_called) );
-  dfbuf_01.close();
-
-  // sputn
-  Derived_filebuf dfbuf_02;
-  dfbuf_02.open(name_05, std::ios_base::out);
-  over_called = false;
-  dfbuf_02.sputn("sonne's", 7);
-  VERIFY( !over_called );
-  over_expected = dfbuf_02.pub_epptr() == dfbuf_02.pub_pptr();
-  over_called = false;
-  dfbuf_02.sputn(" peak", 5);
-  VERIFY( (!over_expected && !over_called)
-         || (over_expected && over_called) );
-  dfbuf_02.close();
-}
-
-// libstdc++/9825
-void test12()
-{
-  using namespace std;
-  bool test = true;
-
-  filebuf fbuf;
-
-  fbuf.open(name_06, ios_base::in|ios_base::out|ios_base::trunc);
-  fbuf.sputn("crazy bees!", 11);
-  fbuf.pubseekoff(0, ios_base::beg);
-  fbuf.sbumpc();
-  fbuf.sputbackc('x');
-  filebuf::int_type c = fbuf.sbumpc();
-  VERIFY( c == 'x' );
-  c = fbuf.sbumpc();
-  VERIFY( c == 'r' );
-  c = fbuf.sbumpc();
-  VERIFY( c == 'a' );
-  fbuf.close();  
-}
-
-class errorcvt : public std::codecvt<char, char, mbstate_t>
-{
-protected:
-  std::codecvt_base::result
-  do_out(mbstate_t&, const char* from, const char*,
-        const char*& from_next, char* to, char*,
-        char*& to_next) const
-  {
-    from_next = from;
-    to_next = to;
-    return std::codecvt<char, char, mbstate_t>::error;
-  }
-  
-  virtual bool do_always_noconv() const throw()
-  {
-    return false;
-  }
-};
-
-// libstdc++/9182
-void test13()
-{
-  using namespace std;
-  bool test = true;
-
-  locale loc;
-  loc = locale(loc, new errorcvt);
-  
-  filebuf fbuf1;
-  fbuf1.pubimbue(loc);
-  fbuf1.open(name_07, ios_base::out | ios_base::trunc);
-  fbuf1.sputn("ison", 4); 
-  int r = fbuf1.pubsync();
-  VERIFY( r == -1 );
-  fbuf1.close();
-}
-
-void test14()
-{
-  using namespace std;
-  bool test = true;
-  
-  locale loc;
-  loc = locale(loc, new errorcvt);
-  
-  filebuf fbuf1;
-  fbuf1.pubimbue(loc);
-  fbuf1.pubsetbuf(0, 0);
-  fbuf1.open(name_07, ios_base::out | ios_base::trunc);
-  streamsize n = fbuf1.sputn("onne", 4);
-  VERIFY( n == 0 );
-  fbuf1.close();
-}
-
-
-class OverBuf : public std::filebuf
-{
-public:
-  int_type pub_overflow(int_type c = traits_type::eof())
-  { return std::filebuf::overflow(c); }
-};
-
-// libstdc++/9988
-void test15()
-{
-  using namespace std;
-  bool test = true;
-  
-  OverBuf fb;
-  fb.open(name_08, ios_base::out | ios_base::trunc);
-  
-  fb.sputc('a');
-  fb.pub_overflow('b');
-  fb.pub_overflow();
-  fb.sputc('c');
-  fb.close();
-
-  filebuf fbin;
-  fbin.open(name_08, ios_base::in);
-  filebuf::int_type c;
-  c = fbin.sbumpc();
-  VERIFY( c == 'a' );
-  c = fbin.sbumpc();
-  VERIFY( c == 'b' );
-  c = fbin.sbumpc();
-  VERIFY( c == 'c' );
-  c = fbin.sbumpc();
-  VERIFY( c == filebuf::traits_type::eof() );
-  fbin.close();
-}
-
-class UnderBuf : public std::filebuf
-{
-public:
-  int_type
-  pub_underflow()
-  { return underflow(); }
-
-  std::streamsize
-  pub_showmanyc()
-  { return showmanyc(); }
-};
-
-// libstdc++/10097
-void test16()
-{
-  using namespace std;
-  bool test = true;
-
-  const char* name = "tmp_fifo1";
-  
-  signal(SIGPIPE, SIG_IGN);
-  unlink(name);
-  
-  if (0 != mkfifo(name, S_IRWXU))
-    {
-      VERIFY( false );
-    }
-  
-  int fval = fork();
-  if (fval == -1)
-    {
-      unlink(name);
-      VERIFY( false );
-    }
-  else if (fval == 0)
-    {
-      filebuf fbout;
-      fbout.open(name, ios_base::out);
-      fbout.sputn("0123456789", 10);
-      fbout.pubsync();
-      sleep(2);
-      fbout.close();
-      exit(0);
-    }
-
-  UnderBuf fb;
-  fb.open(name, ios_base::in);
-  sleep(1);
-  
-  fb.sgetc();
-  streamsize n = fb.pub_showmanyc();
-
-  while (n > 0)
-    {
-      --n;
-      
-      UnderBuf::int_type c = fb.pub_underflow();
-      VERIFY( c != UnderBuf::traits_type::eof() );
-      
-      fb.sbumpc();
-    }
-
-  fb.close();
-}
-
-main() 
-{
-  test01();
-  test02();
-  
-  test03();
-  test04();
-  test05();
-  test06();
-
-  __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test07);
-  test08();
-  test09();
-  test10();
-  test11();
-  test12();
-  test13();
-  test14();
-  test15();
-  test16();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/27_io/fpos.cc b/libstdc++-v3/testsuite/27_io/fpos.cc
deleted file mode 100644 (file)
index 2f52fd3..0000000
+++ /dev/null
@@ -1,179 +0,0 @@
-// 1999-09-20 bkoz
-
-// Copyright (C) 1999, 2001 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// As a special exception, you may use this file as part of a free software
-// library without restriction.  Specifically, if other files instantiate
-// templates or use macros or inline functions from this file, or you compile
-// this file and link it with other files to produce an executable, this
-// file does not by itself cause the resulting executable to be covered by
-// the GNU General Public License.  This exception does not however
-// invalidate any other reasons why the executable file might be covered by
-// the GNU General Public License.
-
-// 27.4.3 template class fpos
-
-#include <cwchar> // for mbstate_t
-#include <ios>
-#include <testsuite_hooks.h>
-
-void test01()
-{
-  bool test = true;
-
-  typedef std::mbstate_t state_type;
-  state_type state01;
-  state_type state02;
-
-  std::streampos pos01;
-  std::streampos pos02;
-
-  std::streamoff off01;
-  std::streamoff off02;
-  
-  std::streamsize size01;
-  std::streamsize size02;
-
-  // 27.4.3.1 fpos members
-  // void state(state_type s);
-  // state_type state();
-#if 0
-// XXX Need to have some sanity checking for the mbstate_t type, or
-// whatever the insantiating type for class fpos happens to be for
-// streampos, as things like equality operators and assignment
-// operators, increment and deincrement operators need to be in place.
-  pos01.state(state02);
-  state01 = pos01.state();
-  VERIFY( state01 == state02 );
-#endif
-  
-#ifdef DEBUG_ASSERT
-  assert(test);
-#endif
-}
-
-// 27.4.3.2 fpos requirements/invariants
-void test02()
-{
-  bool test = true;
-
-  typedef std::mbstate_t state_type;
-  state_type state01;
-  state_type state02;
-
-  std::streamoff off01;
-  std::streamoff off02 = 997;
-  
-  int i01 = 0;
-  int i02 = 999;
-
-  // p(i), p = i
-  std::streampos pos01(i02);
-  std::streampos pos02 = i02;
-  VERIFY( pos01 == pos02 );
-  
-  // p(o), p = o 
-  // NB: P(o) is only required.
-  std::streampos pos03(off02);
-  std::streampos pos04 = off02;
-  VERIFY( pos03 == pos04 );
-  
-  // O(p)
-  std::streamoff off03(pos04);
-  VERIFY( off03 == off02 );
-
-  // p == q, p!= q
-  VERIFY( pos01 == pos02 );
-  VERIFY( pos02 != pos03 );
-
-  // q = p + o
-  // p += o
-  pos03 = pos03 + off02;
-  pos04 += off02;
-  VERIFY( pos03 == pos04 );
-  std::streampos pos05 = pos03;
-  std::streampos pos06 = pos03 + off02;
-  VERIFY ( pos05 == pos03 );
-
-  // q = p - o
-  // p -= o
-  pos03 = pos03 - off02;
-  pos04 -= off02;
-  VERIFY( pos03 == pos04 );
-  std::streampos pos07 = pos03;
-  std::streampos pos08 = pos03 - off02;
-  VERIFY ( pos07 == pos03 );
-
-  // o = p - q
-  VERIFY( 0 == pos03 - pos04 );
-
-  // streamsize -> streamoff
-  // streamoff -> streamsize 
-  off01 = off02;
-  std::streamsize size01(off02);
-  std::streamoff off04(size01);
-  VERIFY( off01 == off04 );
-
-#ifdef DEBUG_ASSERT
-  assert(test);
-#endif
-} 
-
-void test03()
-{
-  bool test = true;
-
-  typedef std::mbstate_t state_type;
-  state_type state01;
-  state_type state02;
-
-  std::streamoff off01;
-  std::streamoff off02 = 997;
-  
-  int i01 = 0;
-  int i02 = 999;
-
-  // casts to const streamoff
-  // (yes, I know this is weak code)
-  const std::streampos pos01 = 0;
-  off01 = pos01;
-
-  // equality/inequality with const args
-  const std::streampos pos02(54);
-  std::streampos pos03(44);
-  VERIFY( !(pos03 == pos02) );
-  VERIFY( pos03 != pos02 );
-  VERIFY( !(pos02 == pos03) );
-  VERIFY( pos02 != pos03 );
-
-  // default values
-  std::streampos pos04;
-  VERIFY( (std::streamoff)pos04 == 0 ); 
-
-#ifdef DEBUG_ASSERT
-  assert(test);
-#endif
-} 
-
-int main() {
-  test01();
-  test02();
-  test03();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/27_io/fpos/1.cc b/libstdc++-v3/testsuite/27_io/fpos/1.cc
new file mode 100644 (file)
index 0000000..4f33fd0
--- /dev/null
@@ -0,0 +1,71 @@
+// 1999-09-20 bkoz
+
+// Copyright (C) 1999, 2001, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.4.3 template class fpos
+
+#include <cwchar> // for mbstate_t
+#include <ios>
+#include <testsuite_hooks.h>
+
+void test01()
+{
+  bool test = true;
+
+  typedef std::mbstate_t state_type;
+  state_type state01;
+  state_type state02;
+
+  std::streampos pos01;
+  std::streampos pos02;
+
+  std::streamoff off01;
+  std::streamoff off02;
+  
+  std::streamsize size01;
+  std::streamsize size02;
+
+  // 27.4.3.1 fpos members
+  // void state(state_type s);
+  // state_type state();
+#if 0
+// XXX Need to have some sanity checking for the mbstate_t type, or
+// whatever the insantiating type for class fpos happens to be for
+// streampos, as things like equality operators and assignment
+// operators, increment and deincrement operators need to be in place.
+  pos01.state(state02);
+  state01 = pos01.state();
+  VERIFY( state01 == state02 );
+#endif
+}
+
+int main() 
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/fpos/2.cc b/libstdc++-v3/testsuite/27_io/fpos/2.cc
new file mode 100644 (file)
index 0000000..46c64b8
--- /dev/null
@@ -0,0 +1,103 @@
+// 1999-09-20 bkoz
+
+// Copyright (C) 1999, 2001, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.4.3 template class fpos
+
+#include <cwchar> // for mbstate_t
+#include <ios>
+#include <testsuite_hooks.h>
+
+// 27.4.3.2 fpos requirements/invariants
+void test02()
+{
+  bool test = true;
+
+  typedef std::mbstate_t state_type;
+  state_type state01;
+  state_type state02;
+
+  std::streamoff off01;
+  std::streamoff off02 = 997;
+  
+  int i01 = 0;
+  int i02 = 999;
+
+  // p(i), p = i
+  std::streampos pos01(i02);
+  std::streampos pos02 = i02;
+  VERIFY( pos01 == pos02 );
+  
+  // p(o), p = o 
+  // NB: P(o) is only required.
+  std::streampos pos03(off02);
+  std::streampos pos04 = off02;
+  VERIFY( pos03 == pos04 );
+  
+  // O(p)
+  std::streamoff off03(pos04);
+  VERIFY( off03 == off02 );
+
+  // p == q, p!= q
+  VERIFY( pos01 == pos02 );
+  VERIFY( pos02 != pos03 );
+
+  // q = p + o
+  // p += o
+  pos03 = pos03 + off02;
+  pos04 += off02;
+  VERIFY( pos03 == pos04 );
+  std::streampos pos05 = pos03;
+  std::streampos pos06 = pos03 + off02;
+  VERIFY ( pos05 == pos03 );
+
+  // q = p - o
+  // p -= o
+  pos03 = pos03 - off02;
+  pos04 -= off02;
+  VERIFY( pos03 == pos04 );
+  std::streampos pos07 = pos03;
+  std::streampos pos08 = pos03 - off02;
+  VERIFY ( pos07 == pos03 );
+
+  // o = p - q
+  VERIFY( 0 == pos03 - pos04 );
+
+  // streamsize -> streamoff
+  // streamoff -> streamsize 
+  off01 = off02;
+  std::streamsize size01(off02);
+  std::streamoff off04(size01);
+  VERIFY( off01 == off04 );
+} 
+
+int main() 
+{
+  test02();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/fpos/3.cc b/libstdc++-v3/testsuite/27_io/fpos/3.cc
new file mode 100644 (file)
index 0000000..777de9e
--- /dev/null
@@ -0,0 +1,72 @@
+// 1999-09-20 bkoz
+
+// Copyright (C) 1999, 2001, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.4.3 template class fpos
+
+#include <cwchar> // for mbstate_t
+#include <ios>
+#include <testsuite_hooks.h>
+
+void test03()
+{
+  bool test = true;
+
+  typedef std::mbstate_t state_type;
+  state_type state01;
+  state_type state02;
+
+  std::streamoff off01;
+  std::streamoff off02 = 997;
+  
+  int i01 = 0;
+  int i02 = 999;
+
+  // casts to const streamoff
+  // (yes, I know this is weak code)
+  const std::streampos pos01 = 0;
+  off01 = pos01;
+
+  // equality/inequality with const args
+  const std::streampos pos02(54);
+  std::streampos pos03(44);
+  VERIFY( !(pos03 == pos02) );
+  VERIFY( pos03 != pos02 );
+  VERIFY( !(pos02 == pos03) );
+  VERIFY( pos02 != pos03 );
+
+  // default values
+  std::streampos pos04;
+  VERIFY( std::streamoff(pos04) == 0 ); 
+} 
+
+int main() 
+{
+  test03();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/fstream.cc b/libstdc++-v3/testsuite/27_io/fstream.cc
deleted file mode 100644 (file)
index c37be6b..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-// 2002-07-25 Benjamin Kosnik <bkoz@redhat.com>
-
-// Copyright (C) 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// As a special exception, you may use this file as part of a free software
-// library without restriction.  Specifically, if other files instantiate
-// templates or use macros or inline functions from this file, or you compile
-// this file and link it with other files to produce an executable, this
-// file does not by itself cause the resulting executable to be covered by
-// the GNU General Public License.  This exception does not however
-// invalidate any other reasons why the executable file might be covered by
-// the GNU General Public License.
-
-// 27.8.1.11 - Template class basic_fstream
-// NB: This file is for testing basic_fstream with NO OTHER INCLUDES.
-
-#include <fstream>
-#include <testsuite_hooks.h>
-
-// { dg-do compile }
-
-// libstdc++/7216
-void test01()
-{
-  // Check for required typedefs
-  typedef std::fstream test_type;
-  typedef test_type::char_type char_type;
-  typedef test_type::traits_type traits_type;
-  typedef test_type::int_type int_type;
-  typedef test_type::pos_type pos_type;
-  typedef test_type::off_type off_type;
-}
-
-namespace test 
-{
-  using namespace std;
-  using __gnu_cxx_test::pod_char;
-  typedef short type_t;
-  template class basic_fstream<type_t, char_traits<type_t> >;
-  template class basic_fstream<pod_char, char_traits<pod_char> >;
-} // test
-
-int main() 
-{
-  test01();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/27_io/fstream_members.cc b/libstdc++-v3/testsuite/27_io/fstream_members.cc
deleted file mode 100644 (file)
index 136252b..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-// 2001-05-24 Benjamin Kosnik  <bkoz@redhat.com>
-
-// Copyright (C) 2001 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// 27.8.1.13 member functions (fstream_members)
-
-#include <fstream>
-#include <testsuite_hooks.h>
-
-void 
-redirect_buffer(std::ios& stream, std::streambuf* new_buf) 
-{ stream.rdbuf(new_buf); }
-
-std::streambuf*
-active_buffer(std::ios& stream)
-{ return stream.rdbuf(); }
-
-// libstdc++/2832
-void test02()
-{
-  bool test = true;
-  const char* strlit01 = "fuck war";
-  const char* strlit02 = "two less cars abstract riot crew, critical mass/SF";
-  const std::string str00;
-  const std::string str01(strlit01);
-  std::string str02;
-  std::filebuf fbuf;
-  std::streambuf* pbasebuf0 = &fbuf;
-
-  std::fstream sstrm1;
-  // derived rdbuf() always returns original streambuf, even though
-  // it's no longer associated with the stream.
-  std::filebuf* const buf1 = sstrm1.rdbuf();
-  // base rdbuf() returns the currently associated streambuf
-  std::streambuf* pbasebuf1 = active_buffer(sstrm1);
-  redirect_buffer(sstrm1, &fbuf);
-  std::filebuf* const buf2 = sstrm1.rdbuf();
-  std::streambuf* pbasebuf2 = active_buffer(sstrm1);
-  VERIFY( buf1 == buf2 ); 
-  VERIFY( pbasebuf1 != pbasebuf2 );
-  VERIFY( pbasebuf2 == pbasebuf0 );
-
-  // How confusing and non-intuitive is this?
-  // These semantics are a joke, a serious defect, and incredibly lame.
-}
-
-int main()
-{
-  test02();
-  return 0;
-}
-
-
-
diff --git a/libstdc++-v3/testsuite/27_io/ifstream.cc b/libstdc++-v3/testsuite/27_io/ifstream.cc
deleted file mode 100644 (file)
index 9bc38a8..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-// 2002-07-25 Benjamin Kosnik <bkoz@redhat.com>
-
-// Copyright (C) 2002 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// As a special exception, you may use this file as part of a free software
-// library without restriction.  Specifically, if other files instantiate
-// templates or use macros or inline functions from this file, or you compile
-// this file and link it with other files to produce an executable, this
-// file does not by itself cause the resulting executable to be covered by
-// the GNU General Public License.  This exception does not however
-// invalidate any other reasons why the executable file might be covered by
-// the GNU General Public License.
-
-// 27.8.1.5 - Template class basic_ifstream
-// NB: This file is for testing basic_ifstream with NO OTHER INCLUDES.
-
-#include <fstream>
-
-// { dg-do compile }
-
-// libstdc++/7216
-void test01()
-{
-  // Check for required typedefs
-  typedef std::ifstream test_type;
-  typedef test_type::char_type char_type;
-  typedef test_type::traits_type traits_type;
-  typedef test_type::int_type int_type;
-  typedef test_type::pos_type pos_type;
-  typedef test_type::off_type off_type;
-}
-
-namespace test 
-{
-  using namespace std;
-  typedef short type_t;
-  template class basic_ifstream<type_t, char_traits<type_t> >;
-} // test
-
-int main() 
-{
-  test01();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/27_io/ifstream_members-1.tst b/libstdc++-v3/testsuite/27_io/ifstream_members-1.tst
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/libstdc++-v3/testsuite/27_io/ifstream_members-1.txt b/libstdc++-v3/testsuite/27_io/ifstream_members-1.txt
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/libstdc++-v3/testsuite/27_io/ifstream_members.cc b/libstdc++-v3/testsuite/27_io/ifstream_members.cc
deleted file mode 100644 (file)
index ad21fe5..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-// Copyright (C) 2000, 2001 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// 27.8.1.7 ifstream member functions
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %-*.txt
-
-#include <istream>
-#include <fstream>
-#include <testsuite_hooks.h>
-
-const char name_01[] = "ifstream_members-1.tst";
-const char name_02[] = "ifstream_members-1.txt";
-
-// http://gcc.gnu.org/ml/libstdc++/2000-06/msg00136.html
-bool test00()
-{
-  bool test = true;
-  std::ifstream ifs1;
-  ifs1.close();
-  
-  // false as expected:
-  VERIFY( !ifs1.is_open() );
-   // this is now true:
-  VERIFY( !(ifs1) );
-  
-  ifs1.open(name_01);
-  VERIFY( ifs1.is_open() );
-  // fail bit still true
-  VERIFY( !(ifs1) );
-  VERIFY( ifs1.rdstate() == std::ios_base::failbit );
-
-  ifs1.close();
-
-#ifdef DEBUG_ASSERT
-  assert(test);
-#endif
-  
-  return test;
-}
-
-// http://gcc.gnu.org/ml/libstdc++/2000-07/msg00004.html
-bool test01()
-{
-  bool test = true;
-  const int more_than_max_open_files = 8200;
-  
-  for(int i = 0; ++i < more_than_max_open_files;)
-    {
-      std::ifstream ifs(name_01);
-      VERIFY( static_cast<bool>(ifs) );
-    }
-
-#ifdef DEBUG_ASSERT
-  assert(test);
-#endif
-  return test;
-}
-
-void 
-redirect_buffer(std::ios& stream, std::streambuf* new_buf) 
-{ stream.rdbuf(new_buf); }
-
-std::streambuf*
-active_buffer(std::ios& stream)
-{ return stream.rdbuf(); }
-
-// libstdc++/2832
-void test02()
-{
-  bool test = true;
-  const char* strlit01 = "fuck war";
-  const char* strlit02 = "two less cars abstract riot crew, critical mass/SF";
-  const std::string str00;
-  const std::string str01(strlit01);
-  std::string str02;
-  std::filebuf fbuf;
-  std::streambuf* pbasebuf0 = &fbuf;
-
-  std::ifstream sstrm1;
-  // derived rdbuf() always returns original streambuf, even though
-  // it's no longer associated with the stream.
-  std::filebuf* const buf1 = sstrm1.rdbuf();
-  // base rdbuf() returns the currently associated streambuf
-  std::streambuf* pbasebuf1 = active_buffer(sstrm1);
-  redirect_buffer(sstrm1, &fbuf);
-  std::filebuf* const buf2 = sstrm1.rdbuf();
-  std::streambuf* pbasebuf2 = active_buffer(sstrm1);
-  VERIFY( buf1 == buf2 ); 
-  VERIFY( pbasebuf1 != pbasebuf2 );
-  VERIFY( pbasebuf2 == pbasebuf0 );
-
-  // How confusing and non-intuitive is this?
-  // These semantics are a joke, a serious defect, and incredibly lame.
-}
-
-int main()
-{
-  test00();
-  test01();
-
-  test02();
-  return 0;
-}
-
-
-
diff --git a/libstdc++-v3/testsuite/27_io/instantiations.cc b/libstdc++-v3/testsuite/27_io/instantiations.cc
deleted file mode 100644 (file)
index b7ee2b4..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-// Copyright (C) 2001, 2002 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// Some members need to be explicitly instantiated, so that users can build
-// their own code with -fno-implicit-templates and not suffer from a zillion
-// link errors.
-
-// { dg-options "-fno-implicit-templates" }
-
-#include <fstream>
-#include <istream>
-#include <ostream>
-#include <sstream>
-#include <iomanip>
-#include <testsuite_hooks.h>
-
-
-// PR libstdc++/3829
-void
-test01()
-{
-  using namespace std;
-  bool test = true;
-  string x ("   this is text");
-  istringstream  sin (x);
-  ostringstream  sout;
-
-  // same order as in bits/std_iomanip.h
-  sin >> resetiosflags(ios_base::dec)
-      >> setiosflags(ios_base::dec)
-      >> setbase(ios_base::dec)
-      >> setfill('c')
-      >> setprecision(5)
-      >> setw(20)
-      >> ws;
-  VERIFY(sin.good());
-
-  sout << resetiosflags(ios_base::dec)
-       << setiosflags(ios_base::dec)
-       << setbase(ios_base::dec)
-       << setfill('c')
-       << setprecision(5)
-       << setw(20)
-       << ends << flush << endl;
-  VERIFY(sout.good());
-}
-
-
-int
-main()
-{
-  test01();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/27_io/ios.cc b/libstdc++-v3/testsuite/27_io/ios.cc
deleted file mode 100644 (file)
index c124938..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-// 2002-07-25 Benjamin Kosnik <bkoz@redhat.com>
-
-// Copyright (C) 2002 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// As a special exception, you may use this file as part of a free software
-// library without restriction.  Specifically, if other files instantiate
-// templates or use macros or inline functions from this file, or you compile
-// this file and link it with other files to produce an executable, this
-// file does not by itself cause the resulting executable to be covered by
-// the GNU General Public License.  This exception does not however
-// invalidate any other reasons why the executable file might be covered by
-// the GNU General Public License.
-
-// 27.4.4 - Template class basic_ios
-// NB: This file is for testing basic_ios with NO OTHER INCLUDES.
-
-#include <ios>
-
-// { dg-do compile }
-
-// libstdc++/7216
-void test01()
-{
-  // Check for required typedefs
-  typedef std::ios test_type;
-  typedef test_type::char_type char_type;
-  typedef test_type::traits_type traits_type;
-  typedef test_type::int_type int_type;
-  typedef test_type::pos_type pos_type;
-  typedef test_type::off_type off_type;
-}
-
-namespace test 
-{
-  using namespace std;
-  typedef short type_t;
-  template class basic_ios<type_t, char_traits<type_t> >;
-} // test
-
-int main() 
-{
-  test01();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/27_io/ios_base/callbacks/1.cc b/libstdc++-v3/testsuite/27_io/ios_base/callbacks/1.cc
new file mode 100644 (file)
index 0000000..09cfee4
--- /dev/null
@@ -0,0 +1,62 @@
+// 1999-11-10 bkoz
+
+// Copyright (C) 1999, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.4.2.6 ios_base callbacks
+
+#include <string>
+#include <sstream>
+#include <testsuite_hooks.h>
+
+const std::string str01("the nubians of plutonia");
+std::string str02;
+
+void 
+callb01(std::ios_base::event e,  std::ios_base& b, int i)
+{ str02 += "the nubians"; }
+
+void 
+callb02(std::ios_base::event e,  std::ios_base& b, int i)
+{ str02 += " of "; }
+
+void 
+callb03(std::ios_base::event e,  std::ios_base& b, int i)
+{ str02 += "plutonia"; }
+
+void test01() 
+{
+  bool test = true;
+  std::locale loc("C");
+  std::stringbuf       strbuf01;
+  std::ios             ios01(&strbuf01);
+
+  ios01.register_callback(callb03, 1);
+  ios01.register_callback(callb02, 1);
+  ios01.register_callback(callb01, 1);
+  ios01.imbue(loc);
+  VERIFY( str01 == str02 );
+}
+
+
+int main(void)
+{
+  test01();
+  return 0;
+}
+
diff --git a/libstdc++-v3/testsuite/27_io/ios_base/state/1.cc b/libstdc++-v3/testsuite/27_io/ios_base/state/1.cc
new file mode 100644 (file)
index 0000000..6097fdb
--- /dev/null
@@ -0,0 +1,62 @@
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+#include <sstream>
+#include <locale>
+#include <testsuite_hooks.h>
+
+void
+test02()
+{
+  bool test = true;
+  const std::string strue("true");
+  const std::string sfalse("false");
+  std::string str01;
+  std::string str02;
+
+  std::locale loc("");
+  std::ostringstream ostr01;
+  ostr01.imbue(loc);
+  std::ios_base::fmtflags ff = ostr01.flags(std::ios_base::boolalpha);
+
+  ostr01 << true;
+  str02 = ostr01.str();
+  VERIFY( str02 == strue );
+
+  ostr01.str(str01);
+  ostr01 << false;
+  str02 = ostr01.str();
+  VERIFY( str02 == sfalse );
+}
+
+int 
+main() 
+{
+  test02();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/ios_base/storage/1.cc b/libstdc++-v3/testsuite/27_io/ios_base/storage/1.cc
new file mode 100644 (file)
index 0000000..dac74cd
--- /dev/null
@@ -0,0 +1,54 @@
+// 2000-12-19 bkoz
+
+// Copyright (C) 2000, 2002, 2003 Free Software Foundation
+//
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.4.2.5 ios_base storage functions
+
+// XXX This test will not work for some versions of irix6 because of
+// XXX bug(s) in libc malloc for very large allocations.  However
+// XXX -lmalloc seems to work.
+// See http://gcc.gnu.org/ml/gcc/2002-05/msg01012.html
+// { dg-options "-lmalloc" { target mips*-*-irix6* } }
+
+#include <sstream>
+#include <iostream>
+#include <testsuite_hooks.h>
+
+// http://gcc.gnu.org/ml/gcc-bugs/2000-12/msg00413.html
+void test01() 
+{
+  bool test = true;
+  
+  using namespace std;
+
+  long x1 = ios::xalloc();
+  long x2 = ios::xalloc();
+  long x3 = ios::xalloc();
+  long x4 = ios::xalloc();
+
+  ostringstream out("the element of crime, lars von trier");
+  out.pword(++x4); // should not crash
+}
+
+int main(void)
+{
+  __gnu_cxx_test::set_memory_limits();
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/ios_base/storage/2.cc b/libstdc++-v3/testsuite/27_io/ios_base/storage/2.cc
new file mode 100644 (file)
index 0000000..751b6be
--- /dev/null
@@ -0,0 +1,129 @@
+// 2000-12-19 bkoz
+
+// Copyright (C) 2000, 2002, 2003 Free Software Foundation
+//
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.4.2.5 ios_base storage functions
+
+// XXX This test will not work for some versions of irix6 because of
+// XXX bug(s) in libc malloc for very large allocations.  However
+// XXX -lmalloc seems to work.
+// See http://gcc.gnu.org/ml/gcc/2002-05/msg01012.html
+// { dg-options "-lmalloc" { target mips*-*-irix6* } }
+
+#include <sstream>
+#include <iostream>
+#include <testsuite_hooks.h>
+
+// libstdc++/3129
+void test02()
+{
+  bool test = true;
+  int max = std::numeric_limits<int>::max() - 1;
+  std::stringbuf        strbuf;
+  std::ios              ios(&strbuf);
+
+  ios.exceptions(std::ios::badbit);
+
+  long l = 0;
+  void* v = 0;
+
+  // pword
+  ios.pword(1) = v;
+  VERIFY( ios.pword(1) == v );
+  
+  try 
+    {
+      v = ios.pword(max);
+    }
+  catch(std::ios_base::failure& obj)
+    {
+      // Ok.
+      VERIFY( ios.bad() );
+    }
+  catch(...)
+    {
+      VERIFY( test = false );
+    }
+  VERIFY( v == 0 );
+
+  VERIFY( ios.pword(1) == v );
+  
+  // max is different code path from max-1
+  v = &test;
+  try 
+    {
+      v = ios.pword(std::numeric_limits<int>::max());
+    }
+  catch(std::ios_base::failure& obj)
+    {
+      // Ok.
+      VERIFY( ios.bad() );
+    }
+  catch(...)
+    {
+      VERIFY( test = false );
+    }
+  VERIFY( v == &test );
+
+  // iword
+  ios.iword(1) = 1;
+  VERIFY( ios.iword(1) == 1 );
+  
+  try 
+    {
+      l = ios.iword(max);
+    }
+  catch(std::ios_base::failure& obj)
+    {
+      // Ok.
+      VERIFY( ios.bad() );
+    }
+  catch(...)
+    {
+      VERIFY( test = false );
+    }
+  VERIFY( l == 0 );
+
+  VERIFY( ios.iword(1) == 1 );
+
+  // max is different code path from max-1
+  l = 1;
+  try 
+    {
+      l = ios.iword(std::numeric_limits<int>::max());
+    }
+  catch(std::ios_base::failure& obj)
+    {
+      // Ok.
+      VERIFY( ios.bad() );
+    }
+  catch(...)
+    {
+      VERIFY( test = false );
+    }
+  VERIFY( l == 1 );
+
+}
+
+int main(void)
+{
+  __gnu_cxx_test::set_memory_limits();
+  test02();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/ios_base/storage/3.cc b/libstdc++-v3/testsuite/27_io/ios_base/storage/3.cc
new file mode 100644 (file)
index 0000000..2c9816a
--- /dev/null
@@ -0,0 +1,52 @@
+// 2000-12-19 bkoz
+
+// Copyright (C) 2000, 2002, 2003 Free Software Foundation
+//
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.4.2.5 ios_base storage functions
+
+// XXX This test will not work for some versions of irix6 because of
+// XXX bug(s) in libc malloc for very large allocations.  However
+// XXX -lmalloc seems to work.
+// See http://gcc.gnu.org/ml/gcc/2002-05/msg01012.html
+// { dg-options "-lmalloc" { target mips*-*-irix6* } }
+
+#include <sstream>
+#include <iostream>
+#include <testsuite_hooks.h>
+
+class derived : public std::ios_base
+{
+public:
+  derived() {}
+};
+
+void test03()
+{
+  derived d;
+
+  d.pword(0) = &d;
+  d.iword(0) = 1;
+}
+
+int main(void)
+{
+  __gnu_cxx_test::set_memory_limits();
+  test03();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/ios_base/sync_with_stdio/1.cc b/libstdc++-v3/testsuite/27_io/ios_base/sync_with_stdio/1.cc
new file mode 100644 (file)
index 0000000..dcc0d5f
--- /dev/null
@@ -0,0 +1,58 @@
+// 1999-05-21 bkoz
+// 2000-05-21 Benjamin Kosnik  <bkoz@redhat.com>
+// 2001-01-17 Loren J. Rittle  <ljrittle@acm.org>
+
+// Copyright (C) 1999, 2000, 2001, 2003 Free Software Foundation
+//
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.4.2.4 ios_base static members
+// @require@ %-*.tst
+// @diff@ %-*.tst %-*.txt
+
+#include <cstdio>
+#include <sstream>
+#include <iostream>
+#include <testsuite_hooks.h>
+
+// N.B. Once we have called sync_with_stdio(false), we can never go back.
+
+void
+test01()
+{
+  std::ios_base::sync_with_stdio();
+  std::freopen("ios_base_members_static-1.txt", "w", stdout);
+  for (int i = 0; i < 2; i++)
+    {
+      std::printf("1");
+      std::cout << "2";
+      std::putc('3', stdout); 
+      std::cout << '4';
+      std::fputs("5", stdout);
+      std::cout << 6;
+      std::putchar('7');
+      std::cout << 8 << '9';
+      std::printf("0\n");
+    }
+}
+
+int main(void)
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/ios_base/sync_with_stdio/2.cc b/libstdc++-v3/testsuite/27_io/ios_base/sync_with_stdio/2.cc
new file mode 100644 (file)
index 0000000..b645b4a
--- /dev/null
@@ -0,0 +1,57 @@
+// 1999-05-21 bkoz
+// 2000-05-21 Benjamin Kosnik  <bkoz@redhat.com>
+// 2001-01-17 Loren J. Rittle  <ljrittle@acm.org>
+
+// Copyright (C) 1999, 2000, 2001, 2003 Free Software Foundation
+//
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.4.2.4 ios_base static members
+// @require@ %-*.tst
+// @diff@ %-*.tst %-*.txt
+
+#include <cstdio>
+#include <sstream>
+#include <iostream>
+#include <testsuite_hooks.h>
+
+// N.B. Once we have called sync_with_stdio(false), we can never go back.
+
+void test02() 
+{
+  bool test = true;
+  
+  std::stringbuf       strbuf01;
+  std::ios             ios01(&strbuf01);
+
+  // 1: basic invocation
+  VERIFY( ios01.sync_with_stdio() );
+  VERIFY( ios01.sync_with_stdio(false) ); //returns previous state
+
+  // 2: need to test interleaving of C and C++ io on a file object.
+  VERIFY( std::cout.good() );
+  VERIFY( !std::cout.sync_with_stdio(0) );
+  VERIFY( std::cout.good() );
+  VERIFY( !std::cout.sync_with_stdio(0) );
+  VERIFY( std::cout.good() );
+}
+
+int main(void)
+{
+  test02();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/ios_base_callbacks.cc b/libstdc++-v3/testsuite/27_io/ios_base_callbacks.cc
deleted file mode 100644 (file)
index aabb778..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-// 1999-11-10 bkoz
-
-// Copyright (C) 1999 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// 27.4.2.6 ios_base callbacks
-
-#include <string>
-#include <sstream>
-#include <testsuite_hooks.h>
-
-const std::string str01("the nubians of plutonia");
-std::string str02;
-
-void 
-callb01(std::ios_base::event e,  std::ios_base& b, int i)
-{ str02 += "the nubians"; }
-
-void 
-callb02(std::ios_base::event e,  std::ios_base& b, int i)
-{ str02 += " of "; }
-
-void 
-callb03(std::ios_base::event e,  std::ios_base& b, int i)
-{ str02 += "plutonia"; }
-
-bool test01() 
-{
-  bool test = true;
-  std::locale loc("C");
-  std::stringbuf       strbuf01;
-  std::ios             ios01(&strbuf01);
-
-  ios01.register_callback(callb03, 1);
-  ios01.register_callback(callb02, 1);
-  ios01.register_callback(callb01, 1);
-  ios01.imbue(loc);
-  VERIFY( str01 == str02 );
-
-#ifdef DEBUG_ASSERT
-  assert(test);
-#endif
-
-  return test;
-}
-
-
-int main(void)
-{
-  test01();
-
-  return 0;
-}
-
diff --git a/libstdc++-v3/testsuite/27_io/ios_base_members_static-1.tst b/libstdc++-v3/testsuite/27_io/ios_base_members_static-1.tst
deleted file mode 100644 (file)
index 8d1e93a..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-1234567890
-1234567890
diff --git a/libstdc++-v3/testsuite/27_io/ios_base_members_static.cc b/libstdc++-v3/testsuite/27_io/ios_base_members_static.cc
deleted file mode 100644 (file)
index 1e7df6a..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-// 1999-05-21 bkoz
-// 2000-05-21 Benjamin Kosnik  <bkoz@redhat.com>
-// 2001-01-17 Loren J. Rittle  <ljrittle@acm.org>
-
-// Copyright (C) 1999, 2000, 2001 Free Software Foundation
-//
-// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// 27.4.2.4 ios_base static members
-// @require@ %-*.tst
-// @diff@ %-*.tst %-*.txt
-
-#include <cstdio>
-#include <sstream>
-#include <iostream>
-
-#include <testsuite_hooks.h>
-
-// N.B. Once we have called sync_with_stdio(false), we can never go back.
-
-void
-test01()
-{
-  std::ios_base::sync_with_stdio();
-  std::freopen("ios_base_members_static-1.txt", "w", stdout);
-  for (int i = 0; i < 2; i++)
-    {
-      std::printf("1");
-      std::cout << "2";
-      std::putc('3', stdout); 
-      std::cout << '4';
-      std::fputs("5", stdout);
-      std::cout << 6;
-      std::putchar('7');
-      std::cout << 8 << '9';
-      std::printf("0\n");
-    }
-}
-
-bool test02() 
-{
-  bool test = true;
-  
-  std::stringbuf       strbuf01;
-  std::ios             ios01(&strbuf01);
-
-  // 1: basic invocation
-  VERIFY( ios01.sync_with_stdio() );
-  VERIFY( ios01.sync_with_stdio(false) ); //returns previous state
-
-  // 2: need to test interleaving of C and C++ io on a file object.
-  VERIFY( std::cout.good() );
-  VERIFY( !std::cout.sync_with_stdio(0) );
-  VERIFY( std::cout.good() );
-  VERIFY( !std::cout.sync_with_stdio(0) );
-  VERIFY( std::cout.good() );
-
-#ifdef DEBUG_ASSERT
-  assert(test);
-#endif
-
-  return test;
-}
-
-int main(void)
-{
-  test01();
-  test02();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/27_io/ios_base_storage.cc b/libstdc++-v3/testsuite/27_io/ios_base_storage.cc
deleted file mode 100644 (file)
index 7033466..0000000
+++ /dev/null
@@ -1,162 +0,0 @@
-// 2000-12-19 bkoz
-
-// Copyright (C) 2000, 2002, 2003 Free Software Foundation
-//
-// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// 27.4.2.5 ios_base storage functions
-
-// XXX This test will not work for some versions of irix6 because of
-// XXX bug(s) in libc malloc for very large allocations.  However
-// XXX -lmalloc seems to work.
-// See http://gcc.gnu.org/ml/gcc/2002-05/msg01012.html
-// { dg-options "-lmalloc" { target mips*-*-irix6* } }
-
-#include <sstream>
-#include <iostream>
-
-#include <testsuite_hooks.h>
-
-// http://gcc.gnu.org/ml/gcc-bugs/2000-12/msg00413.html
-void test01() 
-{
-  bool test = true;
-  
-  using namespace std;
-
-  long x1 = ios::xalloc();
-  long x2 = ios::xalloc();
-  long x3 = ios::xalloc();
-  long x4 = ios::xalloc();
-
-  ostringstream out("the element of crime, lars von trier");
-  out.pword(++x4); // should not crash
-}
-
-// libstdc++/3129
-void test02()
-{
-  bool test = true;
-  int max = std::numeric_limits<int>::max() - 1;
-  std::stringbuf        strbuf;
-  std::ios              ios(&strbuf);
-
-  ios.exceptions(std::ios::badbit);
-
-  long l = 0;
-  void* v = 0;
-
-  // pword
-  ios.pword(1) = v;
-  VERIFY( ios.pword(1) == v );
-  
-  try 
-    {
-      v = ios.pword(max);
-    }
-  catch(std::ios_base::failure& obj)
-    {
-      // Ok.
-      VERIFY( ios.bad() );
-    }
-  catch(...)
-    {
-      VERIFY( test = false );
-    }
-  VERIFY( v == 0 );
-
-  VERIFY( ios.pword(1) == v );
-  
-  // max is different code path from max-1
-  v = &test;
-  try 
-    {
-      v = ios.pword(std::numeric_limits<int>::max());
-    }
-  catch(std::ios_base::failure& obj)
-    {
-      // Ok.
-      VERIFY( ios.bad() );
-    }
-  catch(...)
-    {
-      VERIFY( test = false );
-    }
-  VERIFY( v == &test );
-
-  // iword
-  ios.iword(1) = 1;
-  VERIFY( ios.iword(1) == 1 );
-  
-  try 
-    {
-      l = ios.iword(max);
-    }
-  catch(std::ios_base::failure& obj)
-    {
-      // Ok.
-      VERIFY( ios.bad() );
-    }
-  catch(...)
-    {
-      VERIFY( test = false );
-    }
-  VERIFY( l == 0 );
-
-  VERIFY( ios.iword(1) == 1 );
-
-  // max is different code path from max-1
-  l = 1;
-  try 
-    {
-      l = ios.iword(std::numeric_limits<int>::max());
-    }
-  catch(std::ios_base::failure& obj)
-    {
-      // Ok.
-      VERIFY( ios.bad() );
-    }
-  catch(...)
-    {
-      VERIFY( test = false );
-    }
-  VERIFY( l == 1 );
-
-}
-
-class derived : public std::ios_base
-{
-public:
-  derived() {}
-};
-
-void test03()
-{
-  derived d;
-
-  d.pword(0) = &d;
-  d.iword(0) = 1;
-}
-
-int main(void)
-{
-  __gnu_cxx_test::set_memory_limits();
-  test01();
-  test02();
-  test03();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/27_io/ios_base_types.cc b/libstdc++-v3/testsuite/27_io/ios_base_types.cc
deleted file mode 100644 (file)
index 73d92c6..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright (C) 2002 Free Software Foundation
-//
-// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// 27.4.2.1 - Types [lib.ios.types]
-
-#include <ios>
-
-#include <testsuite_hooks.h>
-
-// libstdc++/7219
-// Annex D, deprecated.
-void test01()
-{
-#if _GLIBCPP_DEPRECATED
-  std::ios_base::streampos spos;
-  std::ios_base::streamoff soff;
-#endif
-}
-
-int main(void)
-{
-  test01();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/27_io/ios_ctor.cc b/libstdc++-v3/testsuite/27_io/ios_ctor.cc
deleted file mode 100644 (file)
index 5736aeb..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-// 1999-07-23 bkoz
-
-// Copyright (C) 1999 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// As a special exception, you may use this file as part of a free software
-// library without restriction.  Specifically, if other files instantiate
-// templates or use macros or inline functions from this file, or you compile
-// this file and link it with other files to produce an executable, this
-// file does not by itself cause the resulting executable to be covered by
-// the GNU General Public License.  This exception does not however
-// invalidate any other reasons why the executable file might be covered by
-// the GNU General Public License.
-
-// 27.4.4.1 basic_ios constructors
-
-#include <ios>
-#include <sstream>
-#include <testsuite_hooks.h>
-
-void test01()
-{
-  bool test = true;
-  std::string str_01("jade cove, big sur");
-  std::string str_05;
-  std::stringbuf strb_01;
-  std::stringbuf strb_02(str_01, std::ios_base::in);
-  std::stringbuf strb_03(str_01, std::ios_base::out);
-  const std::ios_base::fmtflags flag01 = std::ios_base::skipws | 
-                                        std::ios_base::dec;
-  std::ios_base::fmtflags flag02, flag03;
-  const std::locale glocale = std::locale();
-
-  // explicit basic_ios(streambuf* sb)
-  std::ios ios_00(0);
-  std::ios ios_01(&strb_01);
-  std::ios ios_02(&strb_02);
-  std::ios ios_03(&strb_03);
-
-  // basic_ios()
-  // NB: This is protected so need to go through fstream 
-
-  // void init(sreambuf* sb)
-  // NB: This is protected so need to go through fstream/stringstream
-  // Can double-check the accuracy of the above initializations though.
-  VERIFY( ios_00.rdbuf() == 0 );
-  VERIFY( ios_00.tie() == 0 );
-  VERIFY( ios_00.rdstate() == std::ios_base::badbit );
-  VERIFY( ios_00.exceptions() == std::ios_base::goodbit );
-  flag02 = ios_00.flags();
-  VERIFY( flag02 == flag01 );
-  VERIFY( ios_00.width() == 0 );  
-  VERIFY( ios_00.precision() == 6 );  
-  VERIFY( ios_00.fill() == ios_00.widen(' ') );
-  VERIFY( ios_00.getloc() == glocale );    
-
-  VERIFY( ios_01.rdbuf() == &strb_01 );
-  VERIFY( ios_01.tie() == 0 );
-  VERIFY( ios_01.rdstate() == std::ios_base::goodbit );
-  VERIFY( ios_01.exceptions() == std::ios_base::goodbit );
-  flag02 = ios_01.flags();
-  VERIFY( flag02 == flag01 );
-  VERIFY( ios_01.width() == 0 );  
-  VERIFY( ios_01.precision() == 6 );  
-  VERIFY( ios_01.fill() == ios_01.widen(' ') );
-  VERIFY( ios_01.getloc() == glocale );    
-
-#ifdef DEBUG_ASSERT
-  assert(test);
-#endif
-}
-
-int main() {
-  test01();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/27_io/ios_init.cc b/libstdc++-v3/testsuite/27_io/ios_init.cc
deleted file mode 100644 (file)
index 33a52de..0000000
+++ /dev/null
@@ -1,405 +0,0 @@
-// 2001-06-05 Benjamin Kosnik  <bkoz@redhat.com>
-
-// Copyright (C) 2001, 2002 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// As a special exception, you may use this file as part of a free software
-// library without restriction.  Specifically, if other files instantiate
-// templates or use macros or inline functions from this file, or you compile
-// this file and link it with other files to produce an executable, this
-// file does not by itself cause the resulting executable to be covered by
-// the GNU General Public License.  This exception does not however
-// invalidate any other reasons why the executable file might be covered by
-// the GNU General Public License.
-
-// 27.4.2.1.6 class ios_base::init
-
-#include <fstream>
-#include <sstream>
-#include <iostream>
-#include <testsuite_hooks.h>
-
-// char_traits specialization
-namespace std
-{
-  template<>
-    struct char_traits<unsigned short>
-    {
-      typedef unsigned short   char_type;
-      // Unsigned as wint_t in unsigned.
-      typedef unsigned long    int_type;
-      typedef streampos        pos_type;
-      typedef streamoff        off_type;
-      typedef mbstate_t        state_type;
-      
-      static void 
-      assign(char_type& __c1, const char_type& __c2)
-      { __c1 = __c2; }
-
-      static bool 
-      eq(const char_type& __c1, const char_type& __c2)
-      { return __c1 == __c2; }
-
-      static bool 
-      lt(const char_type& __c1, const char_type& __c2)
-      { return __c1 < __c2; }
-
-      static int 
-      compare(const char_type* __s1, const char_type* __s2, size_t __n)
-      { 
-       for (size_t __i = 0; __i < __n; ++__i)
-         if (!eq(__s1[__i], __s2[__i]))
-           return lt(__s1[__i], __s2[__i]) ? -1 : 1;
-       return 0; 
-      }
-
-      static size_t
-      length(const char_type* __s)
-      { 
-       const char_type* __p = __s; 
-       while (__p) 
-         ++__p; 
-       return (__p - __s); 
-      }
-
-      static const char_type* 
-      find(const char_type* __s, size_t __n, const char_type& __a)
-      { 
-       for (const char_type* __p = __s; size_t(__p - __s) < __n; ++__p)
-         if (*__p == __a) return __p;
-       return 0;
-      }
-
-      static char_type* 
-      move(char_type* __s1, const char_type* __s2, size_t __n)
-      { return (char_type*) memmove(__s1, __s2, __n * sizeof(char_type)); }
-
-      static char_type* 
-      copy(char_type* __s1, const char_type* __s2, size_t __n)
-      { return (char_type*) memcpy(__s1, __s2, __n * sizeof(char_type)); }
-
-      static char_type* 
-      assign(char_type* __s, size_t __n, char_type __a)
-      { 
-       for (char_type* __p = __s; __p < __s + __n; ++__p) 
-         assign(*__p, __a);
-        return __s; 
-      }
-
-      static char_type 
-      to_char_type(const int_type& __c)
-      { return char_type(); }
-
-      static int_type 
-      to_int_type(const char_type& __c) { return int_type(); }
-
-      static bool 
-      eq_int_type(const int_type& __c1, const int_type& __c2)
-      { return __c1 == __c2; }
-
-      static int_type 
-      eof() { return static_cast<int_type>(-1); }
-
-      static int_type 
-      not_eof(const int_type& __c)
-      { return eq_int_type(__c, eof()) ? int_type(0) : __c; }
-    };
-
-  template<>
-    struct char_traits<unsigned char>
-    {
-      typedef unsigned char    char_type;
-      // Unsigned as wint_t in unsigned.
-      typedef unsigned long    int_type;
-      typedef streampos        pos_type;
-      typedef streamoff        off_type;
-      typedef mbstate_t        state_type;
-      
-      static void 
-      assign(char_type& __c1, const char_type& __c2)
-      { __c1 = __c2; }
-
-      static bool 
-      eq(const char_type& __c1, const char_type& __c2)
-      { return __c1 == __c2; }
-
-      static bool 
-      lt(const char_type& __c1, const char_type& __c2)
-      { return __c1 < __c2; }
-
-      static int 
-      compare(const char_type* __s1, const char_type* __s2, size_t __n)
-      { 
-       for (size_t __i = 0; __i < __n; ++__i)
-         if (!eq(__s1[__i], __s2[__i]))
-           return lt(__s1[__i], __s2[__i]) ? -1 : 1;
-       return 0; 
-      }
-
-      static size_t
-      length(const char_type* __s)
-      { 
-       const char_type* __p = __s; 
-       while (__p && *__p) 
-         ++__p; 
-       return (__p - __s); 
-      }
-
-      static const char_type* 
-      find(const char_type* __s, size_t __n, const char_type& __a)
-      { 
-       for (const char_type* __p = __s; size_t(__p - __s) < __n; ++__p)
-         if (*__p == __a) return __p;
-       return 0;
-      }
-
-      static char_type* 
-      move(char_type* __s1, const char_type* __s2, size_t __n)
-      { return (char_type*) memmove(__s1, __s2, __n * sizeof(char_type)); }
-
-      static char_type* 
-      copy(char_type* __s1, const char_type* __s2, size_t __n)
-      { return (char_type*) memcpy(__s1, __s2, __n * sizeof(char_type)); }
-
-      static char_type* 
-      assign(char_type* __s, size_t __n, char_type __a)
-      { 
-       for (char_type* __p = __s; __p < __s + __n; ++__p) 
-         assign(*__p, __a);
-        return __s; 
-      }
-
-      static char_type 
-      to_char_type(const int_type& __c)
-      { return char_type(); }
-
-      static int_type 
-      to_int_type(const char_type& __c) { return int_type(); }
-
-      static bool 
-      eq_int_type(const int_type& __c1, const int_type& __c2)
-      { return __c1 == __c2; }
-
-      static int_type 
-      eof() { return static_cast<int_type>(-1); }
-
-      static int_type 
-      not_eof(const int_type& __c)
-      { return eq_int_type(__c, eof()) ? int_type(0) : __c; }
-    };
-} // namespace std
-
-class gnu_filebuf: public std::filebuf
-{
-  int i;
-public:
-  gnu_filebuf(int j = 1): i(j) { }
-  ~gnu_filebuf() { --i; }
-  int get_i() { return i;}
-};
-
-const int initial = 4;
-gnu_filebuf buf(initial);
-
-// libstdc++/3045, in a vague way.
-void test01()
-{
-  bool test = true;
-  int k1;
-
-  // 1 normal
-  k1 = buf.get_i();
-  VERIFY( k1 == initial );
-  {
-    std::cout.rdbuf(&buf);
-  }
-  k1 = buf.get_i();
-  VERIFY( k1 == initial );
-
-  // 2 syncd off
-  k1 = buf.get_i();
-  VERIFY( k1 == initial );
-  {
-    std::cout.rdbuf(&buf);
-    std::ios_base::sync_with_stdio(false); // make sure doesn't clobber buf
-  }
-  k1 = buf.get_i();
-  VERIFY( k1 == initial );
-
-  // 3 callling init
-  k1 = buf.get_i();
-  VERIFY( k1 == initial );
-  {
-    std::cout.rdbuf(&buf);
-    std::ios_base::Init make_sure_initialized;
-  }
-  k1 = buf.get_i();
-  VERIFY( k1 == initial );
-}
-
-// Non-required instantiations don't have the required facets inbued,
-// by default, into the locale object.
-// See 27.4.4.1
-class gnu_ios: public std::basic_ios<char> { };
-
-void test02() 
-{
-  bool test = true;
-
-  // 01: Doesn't call basic_ios::init, which uses ctype<char_type>..
-  // This should be unambiguously correct.
-  try
-    {
-      gnu_ios gios;
-    }
-  catch(...)
-    { 
-      test = false; 
-    }
-
-  // 02: Calls basic_ios::init, which may call ctype<char_type>...
-  try
-    {
-      std::basic_string<unsigned short>                str;
-      std::basic_ostringstream<unsigned short>         oss(str);
-      
-      // Try each member functions for unformatted io.
-      // put
-      oss.put(324);
-
-      // write
-      const unsigned short us[4] = {1246, 433, 520, 0};
-      oss.write(us, 4);
-
-      // flush
-      oss.flush();
-    }
-  catch(const std::bad_cast& obj)
-    {
-      // Should be able to do the above without calling fill() and
-      // forcing a call to widen...
-      test = false;
-    }
-  catch(...)
-    {
-      test = false;
-    }
-  VERIFY( test );
-}
-
-// libstdc++/3983
-void test03()
-{
-  using namespace std;
-  bool test = true;
-
-  // input streams
-  basic_istringstream<unsigned char> iss_uc;
-  unsigned char arr[6] = { 'a', 'b', 'c', 'd', 'e' };
-
-  // Sentry uses locale info, so have to try one formatted input.
-  try 
-    { 
-      int i;
-      iss_uc >> i;
-    }
-  catch (bad_cast& obj)
-    { }
-  catch (exception& obj)
-    { test = false; }
-  
-  try 
-    { 
-      iss_uc >> arr;
-    }
-  catch (bad_cast& obj)
-    { }
-  catch (exception& obj)
-    { test = false; }
-  
-  try 
-    { 
-      iss_uc >> ws;
-    }
-  catch (bad_cast& obj)
-    { }
-  catch (exception& obj)
-    { test = false; }
-  try 
-    { 
-      basic_string<unsigned char> s_uc(arr);
-      iss_uc >> s_uc;
-    }
-  catch (bad_cast& obj)
-    { }
-  catch (exception& obj)
-    { test = false; }
-
-  // output streams
-  basic_ostringstream<unsigned char> oss_uc;
-
-  try 
-    { 
-      bool b = true;
-      oss_uc << b;
-    }
-  catch (bad_cast& obj)
-    { }
-  catch (exception& obj)
-    { test = false; }
-   
-  VERIFY( test );
-}
-
-// libstdc++/5268
-int test04()
-{
-  std::stringbuf b1;
-  std::cout.rdbuf( &b1 );
-  std::cout << "hello\n";
-  return 0;
-}
-
-#if !__GXX_WEAK__
-// Explicitly instantiate for systems with no COMDAT or weak support.
-template 
-  std::basic_string<unsigned short>::size_type 
-  std::basic_string<unsigned short>::_Rep::_S_max_size;
-
-template 
-  unsigned short
-  std::basic_string<unsigned short>::_Rep::_S_terminal;
-
-template 
-  std::basic_string<unsigned char>::size_type 
-  std::basic_string<unsigned char>::_Rep::_S_max_size;
-
-template 
-  unsigned char
-  std::basic_string<unsigned char>::_Rep::_S_terminal;
-#endif
-
-int main()
-{
-  test01();
-  test02();
-  test03();
-  test04();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/27_io/ios_manip_basefield.cc b/libstdc++-v3/testsuite/27_io/ios_manip_basefield.cc
deleted file mode 100644 (file)
index 82aeeaa..0000000
+++ /dev/null
@@ -1,157 +0,0 @@
-// 981027 ncm work with libstdc++v3
-
-// Copyright (C) 1997, 1998, 1999, 2002 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// As a special exception, you may use this file as part of a free software
-// library without restriction.  Specifically, if other files instantiate
-// templates or use macros or inline functions from this file, or you compile
-// this file and link it with other files to produce an executable, this
-// file does not by itself cause the resulting executable to be covered by
-// the GNU General Public License.  This exception does not however
-// invalidate any other reasons why the executable file might be covered by
-// the GNU General Public License.
-
-#include <sstream>
-#include <locale>
-#include <iomanip>
-#include <testsuite_hooks.h>
-                       
-struct MyNP : std::numpunct<char>
-{
-  std::string do_grouping() const;
-  char   do_thousands_sep() const;
-};
-
-std::string MyNP::do_grouping() const { std::string s("\3"); return s; }
-char   MyNP::do_thousands_sep() const { return ' '; }
-
-int
-test01()
-{
-  bool test = true;
-
-  const char lit[] = "0123 456\n: 01 234 567:\n:0123 456   :\n"
-                     ":    012 345:\n:     01 234:\n:0726 746 425:\n"
-                     ":04 553 207 :\n:   0361 100:\n:       0173:\n"
-                     "0x12 345 678\n|0x000012 345 678|\n|0x12 345 6780000|\n"
-                     "|00000x12 345 678|\n|0x000012 345 678|\n";
-
-  std::ostringstream oss;
-  oss.imbue(std::locale(std::locale(), new MyNP));
-
-  // Octals
-  oss << std::oct << std::showbase;
-  oss << 0123456l << std::endl;
-
-  oss << ":" << std::setw(11);
-  oss << 01234567l << ":" << std::endl;
-
-  oss << ":" << std::setw(11) << std::left;
-  oss << 0123456l << ":" << std::endl;
-
-  oss << ":" << std::setw(11) << std::right;
-  oss << 012345l << ":" << std::endl;
-
-  oss << ":" << std::setw(11) << std::internal;
-  oss << 01234l << ":" << std::endl;
-
-  oss << ":" << std::setw(11);
-  oss << 123456789l << ":" << std::endl;
-
-  oss << ":" << std::setw(11) << std::left;
-  oss << 1234567l << ":" << std::endl;
-
-  oss << ":" << std::setw(11) << std::right;
-  oss << 123456l << ":" << std::endl;
-
-  oss << ":" << std::setw(11) << std::internal;
-  oss << 123l << ":" << std::endl;
-
-  // Hexadecimals
-  oss << std::hex << std::setfill('0');
-  oss << 0x12345678l << std::endl;
-
-  oss << "|" << std::setw(16);
-  oss << 0x12345678l << "|" << std::endl;
-
-  oss << "|" << std::setw(16) << std::left;
-  oss << 0x12345678l << "|" << std::endl;
-
-  oss << "|" << std::setw(16) << std::right;
-  oss << 0x12345678l << "|" << std::endl;
-
-  oss << "|" << std::setw(16) << std::internal;
-  oss << 0x12345678l << "|" << std::endl;
-
-  VERIFY( oss.good() );
-  VERIFY( oss.str() == lit );
-
-  return 0;
-}
-
-int
-test02()
-{
-  bool                 test = true;
-  const std::string    str_blank;
-  std::string  str_tmp;
-  std::stringbuf       strbuf;
-  std::ostream         o(&strbuf);
-
-  o <<  std::setw(6) <<  std::right << "san";
-  VERIFY( strbuf.str() == "   san" ); 
-  strbuf.str(str_blank);
-
-  o <<  std::setw(6) <<  std::internal << "fran";
-  VERIFY( strbuf.str() == "  fran" ); 
-  strbuf.str(str_blank);
-
-  o << std::setw(6) <<  std::left << "cisco";
-  VERIFY( strbuf.str() == "cisco " ); 
-  strbuf.str(str_blank);
-
-  VERIFY( test );
-  return 0;
-}
-
-int 
-main() 
-{
-  test01();
-  test02();
-  return 0;
-}
-
-// Projected output:
-/*
-0123 456
-: 01 234 567:
-:0123 456   :
-:    012 345:
-:     01 234:
-:0726 746 425:
-:04 553 207 :
-:   0361 100:
-:       0173:
-0x12 345 678
-|0x000012 345 678|
-|0x12 345 6780000|
-|00000x12 345 678|
-|0x000012 345 678|
-*/
diff --git a/libstdc++-v3/testsuite/27_io/ios_manip_fmtflags.cc b/libstdc++-v3/testsuite/27_io/ios_manip_fmtflags.cc
deleted file mode 100644 (file)
index 3173dc3..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-// 981027 ncm work with libstdc++v3
-
-// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002
-// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// As a special exception, you may use this file as part of a free software
-// library without restriction.  Specifically, if other files instantiate
-// templates or use macros or inline functions from this file, or you compile
-// this file and link it with other files to produce an executable, this
-// file does not by itself cause the resulting executable to be covered by
-// the GNU General Public License.  This exception does not however
-// invalidate any other reasons why the executable file might be covered by
-// the GNU General Public License.
-
-#include <sstream>
-#include <locale>
-#include <iomanip>
-#include <testsuite_hooks.h>
-
-struct MyNP : std::numpunct<char>
-{
-  std::string do_truename() const;
-  std::string do_falsename() const;
-};
-
-std::string MyNP::do_truename()  const 
-{ 
-  std::string s("yea"); 
-  return s; 
-}
-
-std::string MyNP::do_falsename() const 
-{ 
-  std::string s("nay"); 
-  return s; 
-}
-
-void
-test01()
-{
-  bool test = true;
-  const char lit[] = "1 0\ntrue false\n:  true:\n:true  :\n: false:\n:  1:"
-                    "\n:1  :\n:  0:\nyea nay\n:   yea:\n:yea   :\n:   nay:\n";
-  std::ostringstream oss;
-  oss << true << " " << false << std::endl;
-  oss << std::boolalpha;
-  oss << true << " " << false << std::endl;
-
-  oss << ":" << std::setw(6) << std::internal << true << ":" << std::endl;
-  oss << ":" << std::setw(6) << std::left << true << ":" << std::endl;
-  oss << ":" << std::setw(6) << std::right << false << ":" << std::endl;
-  oss << std::noboolalpha;
-  oss << ":" << std::setw(3) << std::internal << true << ":" << std::endl;
-  oss << ":" << std::setw(3) << std::left << true << ":" << std::endl;
-  oss << ":" << std::setw(3) << std::right << false << ":" << std::endl;
-
-  std::locale loc = std::locale (std::locale::classic(), new MyNP);
-  oss.imbue(loc);
-
-  oss << std::boolalpha;
-  oss << true << " " << false << std::endl;
-
-  oss << ":" << std::setw(6) << std::internal << true << ":" << std::endl;
-  oss << ":" << std::setw(6) << std::left << true << ":" << std::endl;
-  oss << ":" << std::setw(6) << std::right << false << ":" << std::endl;
-
-  VERIFY( oss.good() );
-  VERIFY( oss.str() == lit );
-}
-
-void
-test02()
-{
-  bool test = true;
-  const std::string strue("true");
-  const std::string sfalse("false");
-  std::string str01;
-  std::string str02;
-
-  std::locale loc("");
-  std::ostringstream ostr01;
-  ostr01.imbue(loc);
-  std::ios_base::fmtflags ff = ostr01.flags(std::ios_base::boolalpha);
-
-  ostr01 << true;
-  str02 = ostr01.str();
-  VERIFY( str02 == strue );
-
-  ostr01.str(str01);
-  ostr01 << false;
-  str02 = ostr01.str();
-  VERIFY( str02 == sfalse );
-
-  VERIFY( test );
-}
-
-int 
-main() 
-{
-  test01();
-  test02();
-  return 0;
-}
-
-// Projected output:
-/*
-1 0
-true false
-:  true:
-:true  :
-: false:
-:  1:
-:1  :
-:  0:
-yea nay
-:   yea:
-:yea   :
-:   nay:
-*/
diff --git a/libstdc++-v3/testsuite/27_io/ios_members.cc b/libstdc++-v3/testsuite/27_io/ios_members.cc
deleted file mode 100644 (file)
index 3b7dc24..0000000
+++ /dev/null
@@ -1,173 +0,0 @@
-// 1999-09-20 bkoz
-
-// Copyright (C) 1999, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// As a special exception, you may use this file as part of a free software
-// library without restriction.  Specifically, if other files instantiate
-// templates or use macros or inline functions from this file, or you compile
-// this file and link it with other files to produce an executable, this
-// file does not by itself cause the resulting executable to be covered by
-// the GNU General Public License.  This exception does not however
-// invalidate any other reasons why the executable file might be covered by
-// the GNU General Public License.
-
-// 27.4.4.2 basic_ios member functions
-
-#include <ios>
-// NB: Don't include any other headers in this file.
-#include <testsuite_hooks.h>
-
-void test01()
-{
-  bool test = true;
-
-  std::ios_base::fmtflags flag02, flag03;
-  const std::ios_base::fmtflags flag01 = std::ios_base::skipws 
-                                        | std::ios_base::dec;
-  const std::locale c_loc = std::locale::classic();
-
-  std::ios ios_01(NULL);
-  std::ios::char_type ct01;
-  std::ios::char_type ct02('x');;
-
-  // 27.4.2.3 locales
-  ios_01.imbue(c_loc);
-
-  // char narrow(char_type c, char dfault) const;
-  char c1 = ios_01.narrow(ct02, 0);
-  VERIFY( c1 == 'x' );
-
-  // char_type widen(char c) const;
-  ct01 = ios_01.widen('c');
-  VERIFY( ct01 == 'c' );
-}
-
-// 27.4.4.3 basic_ios iostate flags function
-void test02()
-{
-  bool test = true;
-
-  typedef std::ios_base::fmtflags fmtflags;
-  typedef std::ios_base::iostate iostate;
-  using std::ios_base;
-
-  iostate iostate02, iostate03;
-  const iostate iostate01 = std::ios_base::badbit | std::ios_base::eofbit;
-  const iostate iostate04 = std::ios_base::badbit;
-
-  std::ios ios_01(NULL);
-  std::ios::char_type ct01;
-  std::ios::char_type ct02('x');;
-
-  // bool fail() const
-  VERIFY( ios_01.fail() );
-
-  // bool operator!() const
-  VERIFY( !ios_01 );
-  
-  // iostate rdstate() const
-  iostate03 = ios_01.rdstate();
-  VERIFY( static_cast<bool>(iostate03 & std::ios_base::badbit) );
-
-  // void clear(iostate state = goodbit)
-  try {
-    ios_01.clear(std::ios_base::eofbit);
-    iostate02 = ios_01.rdstate();
-    VERIFY( static_cast<bool>(iostate02 & iostate01) );
-  }             
-  catch(std::ios_base::failure& fail) {
-    VERIFY( false );
-  }
-  catch(...) {
-    VERIFY( false );
-  }
-
-  // iostate exceptions() const
-  VERIFY( ios_01.exceptions() == std::ios_base::goodbit );
-
-  // void exceptions(iostate except)
-  try {
-    ios_01.exceptions(std::ios_base::eofbit);
-    VERIFY( false );
-  }             
-  catch(std::ios_base::failure& fail) {
-    iostate02 = ios_01.exceptions();
-    VERIFY( static_cast<bool>(iostate02 & std::ios_base::eofbit) );
-  }
-  catch(...) {
-    VERIFY( false );
-  }
-
-  // basic_ios& copyfmt(const basic_ios& rhs)
-  std::ios ios_02(NULL);  
-  ios_02.exceptions(std::ios_base::eofbit);
-  VERIFY( static_cast<bool>(ios_02.exceptions() & std::ios_base::eofbit) );
-  try {
-    ios_01.copyfmt(ios_02);
-    VERIFY( false );
-  }             
-  catch(std::ios_base::failure& fail) {
-    VERIFY( true );
-  }
-  catch(...) {
-    VERIFY( false );
-  }
-}
-
-// copyfmt and locales.
-void test03()
-{
-  bool test = true;
-
-  using namespace std;
-
-  typedef std::ios_base::fmtflags fmtflags;
-  typedef std::ios_base::iostate iostate;
-  locale loc_c = locale::classic();
-  locale loc_de("de_DE");
-  std::ios ios_01(NULL);
-  std::ios ios_02(NULL);
-  ios_01.imbue(loc_c);
-  ios_02.imbue(loc_de);
-  ios_02.setstate(ios_base::badbit);
-  VERIFY( loc_c == ios_01.getloc() );
-  VERIFY( loc_de == ios_02.getloc() );
-
-  iostate ios1 = ios_01.rdstate();
-  iostate ios2 = ios_02.rdstate();
-  streambuf* sb1 = ios_01.rdbuf();
-  streambuf* sb2 = ios_02.rdbuf();
-  ios_01.copyfmt(ios_02);
-
-  VERIFY( loc_de == ios_01.getloc() );
-  VERIFY( ios_01.getloc() == ios_02.getloc() );
-  VERIFY( ios1 == ios_01.rdstate() );
-  VERIFY( ios2 == ios_02.rdstate() );
-  VERIFY( sb1 == ios_01.rdbuf() );
-  VERIFY( sb2 == ios_02.rdbuf() );
-}
-
-int main() 
-{
-  test01();
-  test02();
-  __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test03);
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/27_io/iostream.cc b/libstdc++-v3/testsuite/27_io/iostream.cc
deleted file mode 100644 (file)
index 943819b..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-// 2002-01-08 bkoz
-
-// Copyright (C) 2002 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// As a special exception, you may use this file as part of a free software
-// library without restriction.  Specifically, if other files instantiate
-// templates or use macros or inline functions from this file, or you compile
-// this file and link it with other files to produce an executable, this
-// file does not by itself cause the resulting executable to be covered by
-// the GNU General Public License.  This exception does not however
-// invalidate any other reasons why the executable file might be covered by
-// the GNU General Public License.
-
-// 27.6.1.5 - Template class basic_iostream
-// NB: This file is for testing iostream with NO OTHER INCLUDES.
-
-// { dg-do compile }
-
-#include <istream>
-
-// libstdc++/7216
-void test01()
-{
-  // Check for required typedefs
-  typedef std::iostream test_type;
-  typedef test_type::char_type char_type;
-  typedef test_type::traits_type traits_type;
-  typedef test_type::int_type int_type;
-  typedef test_type::pos_type pos_type;
-  typedef test_type::off_type off_type;
-}
-
-namespace test 
-{
-  using namespace std;
-  typedef short type_t;
-  template class basic_iostream<type_t, char_traits<type_t> >;
-} // test
-
-int main() 
-{
-  test01();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/27_io/iostream_members.cc b/libstdc++-v3/testsuite/27_io/iostream_members.cc
deleted file mode 100644 (file)
index 4cdcc82..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-// 2002-01-08 bkoz
-
-// Copyright (C) 2002 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// As a special exception, you may use this file as part of a free software
-// library without restriction.  Specifically, if other files instantiate
-// templates or use macros or inline functions from this file, or you compile
-// this file and link it with other files to produce an executable, this
-// file does not by itself cause the resulting executable to be covered by
-// the GNU General Public License.  This exception does not however
-// invalidate any other reasons why the executable file might be covered by
-// the GNU General Public License.
-
-// 27.6.1.5 - Template class basic_iostream
-// NB: This file is for testing iostream with NO OTHER INCLUDES.
-
-#include <iostream>
-
-// libstdc++/3647
-void test07()
-{
-  // Should not block.
-  std::cout << std::cin.rdbuf()->in_avail() << std::endl;
-}
-
-int main() 
-{
-  test07();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/27_io/istream.cc b/libstdc++-v3/testsuite/27_io/istream.cc
deleted file mode 100644 (file)
index c8146ea..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-// 1999-09-20 bkoz
-
-// Copyright (C) 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// As a special exception, you may use this file as part of a free software
-// library without restriction.  Specifically, if other files instantiate
-// templates or use macros or inline functions from this file, or you compile
-// this file and link it with other files to produce an executable, this
-// file does not by itself cause the resulting executable to be covered by
-// the GNU General Public License.  This exception does not however
-// invalidate any other reasons why the executable file might be covered by
-// the GNU General Public License.
-
-// 27.6.1.1 basic_istream
-// NB: This file is for testing istream with NO OTHER INCLUDES.
-
-#include <istream>
-#include <testsuite_hooks.h>
-
-// { dg-do compile }
-
-// libstdc++/7216
-void test01()
-{
-  // Check for required typedefs
-  typedef std::istream test_type;
-  typedef test_type::char_type char_type;
-  typedef test_type::traits_type traits_type;
-  typedef test_type::int_type int_type;
-  typedef test_type::pos_type pos_type;
-  typedef test_type::off_type off_type;
-}
-
-namespace test 
-{
-  using namespace std;
-  using __gnu_cxx_test::pod_char;
-  typedef short type_t;
-  template class basic_istream<type_t, char_traits<type_t> >;
-  template class basic_istream<pod_char, char_traits<pod_char> >;
-} // test
-
-int main() 
-{
-  test01();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/27_io/istream_exception.cc b/libstdc++-v3/testsuite/27_io/istream_exception.cc
deleted file mode 100644 (file)
index 055c4fb..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-// 2003-03-08  Jerry Quinn  <jlquinn@optonline.net>
-
-// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-#include <istream>
-#include <streambuf>
-#include <testsuite_hooks.h>
-
-// libstdc++/9561
-struct foobar: std::exception { };
-
-struct buf: std::streambuf
-{
-    virtual int_type underflow () {
-        throw foobar ();
-        return -1;
-    }
-    virtual int_type uflow () {
-        throw foobar ();
-        return -1;
-    }
-};
-
-void test01()
-{
-  using namespace std;
-  bool test = true;
-
-  buf b;
-  std::istream strm (&b);
-  strm.exceptions (std::ios::badbit);
-  int i = 0;
-
-  try {
-    i = strm.get();
-  }
-  catch (foobar) {
-    // strm should throw foobar and not do anything else
-    VERIFY(strm.bad());
-  }
-  catch (...) {
-    VERIFY(false);
-  }
-
-  VERIFY(i == 0);
-}
-
-
-int main()
-{
-  test01();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/27_io/istream_extractor_arith/01.cc b/libstdc++-v3/testsuite/27_io/istream_extractor_arith/01.cc
deleted file mode 100644 (file)
index b2fdd26..0000000
+++ /dev/null
@@ -1,134 +0,0 @@
-// 1999-04-12 bkoz
-
-// Copyright (C) 1999, 2000, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// 27.6.1.2.2 arithmetic extractors
-
-#include <cstdio> // for printf
-#include <istream>
-#include <ostream>
-#include <sstream>
-#include <locale>
-#include <testsuite_hooks.h>
-
-std::string str_01;
-std::string str_02("true false 0 1 110001");
-std::string str_03("-19999999 777777 -234234 233 -234 33 1 66300.25 .315 1.5");
-std::string str_04("0123");
-
-std::stringbuf isbuf_01(std::ios_base::in);
-std::stringbuf isbuf_02(str_02, std::ios_base::in);
-std::stringbuf isbuf_03(str_03, std::ios_base::in);
-std::stringbuf isbuf_04(str_04, std::ios_base::in);
-
-std::istream is_01(NULL);
-std::istream is_02(&isbuf_02);
-std::istream is_03(&isbuf_03);
-std::istream is_04(&isbuf_04);
-std::stringstream ss_01(str_01);
-// minimal sanity check
-bool test01() {
-
-  bool test = true;
-
-  // Integral Types:
-  bool                         b1  = false;
-  bool                         b2  = false;
-  short                s1  = 0;
-  int                  i1  = 0;
-  long                 l1  = 0;
-  unsigned short       us1 = 0;
-  unsigned int                 ui1 = 0;
-  unsigned long        ul1 = 0;
-
-  // Floating-point Types:
-  float                f1  = 0;
-  double               d1  = 0;
-  long double          ld1 = 0;
-
-  // process alphanumeric versions of bool values
-  std::ios_base::fmtflags fmt = is_02.flags();
-  bool testfmt = fmt & std::ios_base::boolalpha;
-  is_02.setf(std::ios_base::boolalpha);
-  fmt = is_02.flags();
-  testfmt = fmt & std::ios_base::boolalpha;
-  is_02 >> b1;
-  VERIFY( b1 == 1 );
-  is_02 >> b1;
-  VERIFY( b1 == 0 );
-
-  // process numeric versions of of bool values
-  is_02.unsetf(std::ios_base::boolalpha);
-  fmt = is_02.flags();
-  testfmt = fmt & std::ios_base::boolalpha;
-  is_02 >> b1;
-  VERIFY( b1 == 0 );
-  is_02 >> b1;
-  VERIFY( b1 == 1 );
-
-  // is_03 == "-19999999 777777 -234234 233 -234 33 1 66300.25 .315 1.5"
-  is_03 >> l1;
-  VERIFY( l1 == -19999999 );
-  is_03 >> ul1;
-  VERIFY( ul1 == 777777 );
-  is_03 >> i1;
-  VERIFY( i1 == -234234 );
-  is_03 >> ui1;
-  VERIFY( ui1 == 233 );
-  is_03 >> s1;
-  VERIFY( s1 == -234 );
-  is_03 >> us1;
-  VERIFY( us1 == 33 );
-  is_03 >> b1;
-  VERIFY( b1 == 1 );
-  is_03 >> ld1;
-  VERIFY( ld1 == 66300.25 );
-  is_03 >> d1;
-  VERIFY( d1 == .315 );
-  is_03 >> f1;
-  VERIFY( f1 == 1.5 );
-
-  is_04 >> std::hex >> i1;
-  std::printf ("%d %d %d\n", i1, i1 == 0x123, test);
-  VERIFY( i1 == 0x123 );
-  std::printf ("%d %d %d\n", i1, i1 == 0x123, test);
-
-  // test void pointers
-  int i = 55;
-  void* po = &i;
-  void* pi;
-
-  ss_01 << po;
-  ss_01 >> pi;
-  std::printf ("%x %x\n", pi, po);
-  VERIFY( po == pi );
-  
-#ifdef DEBUG_ASSERT
-  assert(test);
-#endif
-  return test;
-}
-
-int main()
-{
-  test01();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/27_io/istream_extractor_arith/02.cc b/libstdc++-v3/testsuite/27_io/istream_extractor_arith/02.cc
deleted file mode 100644 (file)
index 374fbd8..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-// 1999-04-12 bkoz
-
-// Copyright (C) 1999, 2000, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// 27.6.1.2.2 arithmetic extractors
-
-#include <cstdio> // for printf
-#include <istream>
-#include <ostream>
-#include <sstream>
-#include <locale>
-#include <testsuite_hooks.h>
-
-std::string str_01;
-std::string str_02("true false 0 1 110001");
-std::string str_03("-19999999 777777 -234234 233 -234 33 1 66300.25 .315 1.5");
-std::string str_04("0123");
-
-std::stringbuf isbuf_01(std::ios_base::in);
-std::stringbuf isbuf_02(str_02, std::ios_base::in);
-std::stringbuf isbuf_03(str_03, std::ios_base::in);
-std::stringbuf isbuf_04(str_04, std::ios_base::in);
-
-std::istream is_01(NULL);
-std::istream is_02(&isbuf_02);
-std::istream is_03(&isbuf_03);
-std::istream is_04(&isbuf_04);
-std::stringstream ss_01(str_01);
-// elaborated test for ints
-bool test02() {
-
-  bool test = true;
-  const std::string str_01("20000AB");
-  std::stringbuf strb_01(str_01, std::ios_base::in);
-  std::istream is(&strb_01);
-
-  int n = 15;
-  is >> n;
-  VERIFY( n == 20000 );
-  char c = is.peek();
-  VERIFY( c == 65 );
-
-#ifdef DEBUG_ASSERT
-  assert(test);
-#endif
-  return test;
-}
-
-int main()
-{
-  test02();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/27_io/istream_extractor_arith/03.cc b/libstdc++-v3/testsuite/27_io/istream_extractor_arith/03.cc
deleted file mode 100644 (file)
index 869d828..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-// 1999-04-12 bkoz
-
-// Copyright (C) 1999, 2000, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// 27.6.1.2.2 arithmetic extractors
-
-#include <cstdio> // for printf
-#include <istream>
-#include <ostream>
-#include <sstream>
-#include <locale>
-#include <testsuite_hooks.h>
-
-std::string str_01;
-std::string str_02("true false 0 1 110001");
-std::string str_03("-19999999 777777 -234234 233 -234 33 1 66300.25 .315 1.5");
-std::string str_04("0123");
-
-std::stringbuf isbuf_01(std::ios_base::in);
-std::stringbuf isbuf_02(str_02, std::ios_base::in);
-std::stringbuf isbuf_03(str_03, std::ios_base::in);
-std::stringbuf isbuf_04(str_04, std::ios_base::in);
-
-std::istream is_01(NULL);
-std::istream is_02(&isbuf_02);
-std::istream is_03(&isbuf_03);
-std::istream is_04(&isbuf_04);
-std::stringstream ss_01(str_01);
-bool test03()
-{
-  std::stringbuf sbuf;
-  std::istream istr(&sbuf);
-  std::ostream ostr(&sbuf);
-
-  bool test = true;
-  long l01;
-  ostr <<  "12220101";
-  istr >>  l01; // _M_in_end set completely incorrectly here.
-  VERIFY( l01 == 12220101 );
-  VERIFY( istr.rdstate() == std::ios_base::eofbit );
-
-#ifdef DEBUG_ASSERT
-  assert(test);
-#endif
-
-  return test;
-}
-
-int main()
-{
-  test03();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/27_io/istream_extractor_arith/06.cc b/libstdc++-v3/testsuite/27_io/istream_extractor_arith/06.cc
deleted file mode 100644 (file)
index de92bcd..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-// 1999-04-12 bkoz
-
-// Copyright (C) 1999, 2000, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// 27.6.1.2.2 arithmetic extractors
-
-#include <cstdio> // for printf
-#include <istream>
-#include <ostream>
-#include <sstream>
-#include <locale>
-#include <testsuite_hooks.h>
-
-std::string str_01;
-std::string str_02("true false 0 1 110001");
-std::string str_03("-19999999 777777 -234234 233 -234 33 1 66300.25 .315 1.5");
-std::string str_04("0123");
-
-std::stringbuf isbuf_01(std::ios_base::in);
-std::stringbuf isbuf_02(str_02, std::ios_base::in);
-std::stringbuf isbuf_03(str_03, std::ios_base::in);
-std::stringbuf isbuf_04(str_04, std::ios_base::in);
-
-std::istream is_01(NULL);
-std::istream is_02(&isbuf_02);
-std::istream is_03(&isbuf_03);
-std::istream is_04(&isbuf_04);
-std::stringstream ss_01(str_01);
-// http://gcc.gnu.org/ml/libstdc++/2000-q1/msg00081.html
-// Jim Parsons
-void test06()
-{
-  // default locale, grouping is turned off
-  bool test = true;
-  unsigned int h4, h3, h2;
-  char c;
-  std::string s("205,199,144");
-  std::istringstream is(s);
-  
-  is >> h4; // 205
-  VERIFY( h4 == 205 );
-  is >> c; // ','
-  VERIFY( c == ',' );
-
-  is >> h4; // 199
-  VERIFY( h4 == 199 );
-  is >> c; // ','
-  VERIFY( c == ',' );
-
-  is >> h4; // 144
-  VERIFY( is.rdstate() == std::ios_base::eofbit );
-  VERIFY( h4 == 144 );
-  is >> c; // EOF
-  VERIFY( c == ',' );
-  VERIFY( static_cast<bool>(is.rdstate() & std::ios_base::failbit) );
-
-#ifdef DEBUG_ASSERT
-  assert(test);
-#endif
-}
-
-int main()
-{
-  test06();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/27_io/istream_extractor_arith/07.cc b/libstdc++-v3/testsuite/27_io/istream_extractor_arith/07.cc
deleted file mode 100644 (file)
index 118668e..0000000
+++ /dev/null
@@ -1,169 +0,0 @@
-// 1999-04-12 bkoz
-
-// Copyright (C) 1999, 2000, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// 27.6.1.2.2 arithmetic extractors
-
-#include <cstdio> // for printf
-#include <istream>
-#include <ostream>
-#include <sstream>
-#include <locale>
-#include <testsuite_hooks.h>
-
-std::string str_01;
-std::string str_02("true false 0 1 110001");
-std::string str_03("-19999999 777777 -234234 233 -234 33 1 66300.25 .315 1.5");
-std::string str_04("0123");
-
-std::stringbuf isbuf_01(std::ios_base::in);
-std::stringbuf isbuf_02(str_02, std::ios_base::in);
-std::stringbuf isbuf_03(str_03, std::ios_base::in);
-std::stringbuf isbuf_04(str_04, std::ios_base::in);
-
-std::istream is_01(NULL);
-std::istream is_02(&isbuf_02);
-std::istream is_03(&isbuf_03);
-std::istream is_04(&isbuf_04);
-std::stringstream ss_01(str_01);
-namespace std {
-  class test_numpunct1 : public numpunct<char>
-  {
-  protected:
-    string
-    do_grouping() const 
-    { return string(1, '\003'); }
-  };
-} // namespace std
-
-void test07()
-{
-  // manufactured locale, grouping is turned on
-  bool test = true;
-  unsigned int h4 = 0, h3 = 0, h2 = 0;
-  float f1 = 0.0;
-  const std::string s1("205,199 23,445.25 1,024,365 123,22,24");
-  std::istringstream is(s1);
-  is.imbue(std::locale(std::locale(), new std::test_numpunct1));  
-
-  // Basic operation.
-  is >> h4; 
-  VERIFY( h4 == 205199 );
-  VERIFY( is.good() );
-
-  is.clear();
-  is >> f1; 
-  VERIFY( f1 == 23445.25 );
-  VERIFY( is.good() );
-
-  is.clear();
-  is >> h3; 
-  VERIFY( h3 == 1024365 );
-  VERIFY( is.good() );
-
-  is.clear();
-  is >> h2; 
-  VERIFY( h2 == 0 );
-  VERIFY( static_cast<bool>(is.rdstate() & std::ios_base::failbit) );
-  VERIFY( static_cast<bool>(is.rdstate() & std::ios_base::eofbit) );
-
-  // Stress tests for explicit errors in grouping corner cases.  The
-  // validity of these tests and results have been hammered out in
-  // private email between bkoz and ncm between Jan 25 and Jan 27, 2000.
-  // Thanks nate -- benjamin
-  const std::string s2(",111 4,,4 0.25,345 5..25 156,, 1,000000 1000000 1234,567");
-  h3 = h4 = h2 = 0;
-  f1 = 0.0;
-  const char c_control = '?';
-  char c = c_control;
-  is.clear();
-  is.str(s2);
-
-  is >> h4; 
-  VERIFY( h4 == 0 );
-  VERIFY( static_cast<bool>(is.rdstate() & std::ios_base::failbit) );
-  is.clear();
-  is >> c;
-  VERIFY( c == ',' );
-  VERIFY( is.good() );
-
-  is.ignore(3);
-  is >> f1; 
-  VERIFY( f1 == 0.0 );
-  VERIFY( static_cast<bool>(is.rdstate() & std::ios_base::failbit) );
-  is.clear();
-  is >> c;
-  VERIFY( c == ',' );
-  is >> c;
-  VERIFY( c == '4' );
-  VERIFY( is.good() );
-
-  is >> f1; 
-  VERIFY( f1 == 0.25 );
-  VERIFY( is.good() );
-  is >> c;
-  VERIFY( c == ',' );
-  is >> h2;
-  VERIFY( h2 == 345 );
-  VERIFY( is.good() );
-  f1 = 0.0;
-  h2 = 0;
-
-  is >> f1; 
-  VERIFY( f1 == 5.0 );
-  VERIFY( is.good() );
-  is >> f1; 
-  VERIFY( f1 == .25 );
-  VERIFY( is.good() );
-
-  is >> h3; 
-  VERIFY( h3 == 0 );
-  VERIFY( static_cast<bool>(is.rdstate() & std::ios_base::failbit) );
-  is.clear();
-  is >> c;
-  VERIFY( c == ',' ); // second one
-  VERIFY( is.good() );
-
-  is >> h2; 
-  VERIFY( h2 == 0 );
-  VERIFY( static_cast<bool>(is.rdstate() & std::ios_base::failbit) );
-  is.clear();
-
-  is >> h2; 
-  VERIFY( h2 == 1000000 );
-  VERIFY( is.good() );
-  h2 = 0;
-
-  is >> h2; 
-  VERIFY( h2 == 0 );
-  VERIFY( static_cast<bool>(is.rdstate() & std::ios_base::failbit) );
-  VERIFY( static_cast<bool>(is.rdstate() & std::ios_base::eofbit) );
-  is.clear();
-
-#ifdef DEBUG_ASSERT
-  assert(test);
-#endif
-}
-
-int main()
-{
-  test07();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/27_io/istream_extractor_arith/08.cc b/libstdc++-v3/testsuite/27_io/istream_extractor_arith/08.cc
deleted file mode 100644 (file)
index f849161..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-// 1999-04-12 bkoz
-
-// Copyright (C) 1999, 2000, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// 27.6.1.2.2 arithmetic extractors
-
-#include <cstdio> // for printf
-#include <istream>
-#include <ostream>
-#include <sstream>
-#include <locale>
-#include <testsuite_hooks.h>
-
-std::string str_01;
-std::string str_02("true false 0 1 110001");
-std::string str_03("-19999999 777777 -234234 233 -234 33 1 66300.25 .315 1.5");
-std::string str_04("0123");
-
-std::stringbuf isbuf_01(std::ios_base::in);
-std::stringbuf isbuf_02(str_02, std::ios_base::in);
-std::stringbuf isbuf_03(str_03, std::ios_base::in);
-std::stringbuf isbuf_04(str_04, std::ios_base::in);
-
-std::istream is_01(NULL);
-std::istream is_02(&isbuf_02);
-std::istream is_03(&isbuf_03);
-std::istream is_04(&isbuf_04);
-std::stringstream ss_01(str_01);
-namespace std {
-  class test_numpunct2 : public numpunct<char>
-  {
-  protected:
-    string
-    do_grouping() const 
-    { return string("\002\003"); }
-  };
-} // namespace std
-
-void test08()
-{
-  // manufactured locale, grouping is turned on
-  bool test = true;
-  unsigned int h4 = 0, h3 = 0, h2 = 0;
-  float f1 = 0.0;
-  const std::string s1("1,22 205,19 22,123,22");
-  const std::string s2("1,220 2050,19 202,123,22");
-
-  std::istringstream is(s1);
-  is.imbue(std::locale(std::locale(), new std::test_numpunct2));  
-
-  // Basic operation.
-  is >> h4; 
-  VERIFY( h4 == 122 );
-  VERIFY( is.good() );
-
-  is.clear();
-  is >> h3; 
-  VERIFY( h3 == 20519 );
-  VERIFY( is.good() );
-
-  is.clear();
-  is >> h2; 
-  VERIFY( h2 == 2212322 );
-  VERIFY( static_cast<bool>(is.rdstate() & std::ios_base::eofbit) );
-
-
-#ifdef DEBUG_ASSERT
-  assert(test);
-#endif
-}
-
-int main()
-{
-  test08();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/27_io/istream_extractor_arith/09.cc b/libstdc++-v3/testsuite/27_io/istream_extractor_arith/09.cc
deleted file mode 100644 (file)
index 37e175e..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-// 1999-04-12 bkoz
-
-// Copyright (C) 1999, 2000, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// 27.6.1.2.2 arithmetic extractors
-
-#include <cstdio> // for printf
-#include <istream>
-#include <ostream>
-#include <sstream>
-#include <locale>
-#include <testsuite_hooks.h>
-
-std::string str_01;
-std::string str_02("true false 0 1 110001");
-std::string str_03("-19999999 777777 -234234 233 -234 33 1 66300.25 .315 1.5");
-std::string str_04("0123");
-
-std::stringbuf isbuf_01(std::ios_base::in);
-std::stringbuf isbuf_02(str_02, std::ios_base::in);
-std::stringbuf isbuf_03(str_03, std::ios_base::in);
-std::stringbuf isbuf_04(str_04, std::ios_base::in);
-
-std::istream is_01(NULL);
-std::istream is_02(&isbuf_02);
-std::istream is_03(&isbuf_03);
-std::istream is_04(&isbuf_04);
-std::stringstream ss_01(str_01);
-bool test09()
-{
-   bool test = true;
-
-   std::string st("2.456e3-+0.567e-2");
-   std::stringbuf sb(st);
-   std::istream is(&sb);
-   double f1 = 0, f2 = 0;
-   char c;
-   (is>>std::ws) >> f1;
-   (is>>std::ws) >> c;
-   (is>>std::ws) >> f2;
-   test = f1 == 2456;
-   VERIFY( f2 == 0.00567 );
-   VERIFY( c == '-' );
-#ifdef DEBUG_ASSERT
-  assert(test);
-#endif
-  return test;
-}
-
-int main()
-{
-  test09();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/27_io/istream_extractor_arith/10.cc b/libstdc++-v3/testsuite/27_io/istream_extractor_arith/10.cc
deleted file mode 100644 (file)
index bc67190..0000000
+++ /dev/null
@@ -1,154 +0,0 @@
-// 1999-04-12 bkoz
-
-// Copyright (C) 1999, 2000, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// 27.6.1.2.2 arithmetic extractors
-
-#include <cstdio> // for printf
-#include <istream>
-#include <ostream>
-#include <sstream>
-#include <locale>
-#include <testsuite_hooks.h>
-
-std::string str_01;
-std::string str_02("true false 0 1 110001");
-std::string str_03("-19999999 777777 -234234 233 -234 33 1 66300.25 .315 1.5");
-std::string str_04("0123");
-
-std::stringbuf isbuf_01(std::ios_base::in);
-std::stringbuf isbuf_02(str_02, std::ios_base::in);
-std::stringbuf isbuf_03(str_03, std::ios_base::in);
-std::stringbuf isbuf_04(str_04, std::ios_base::in);
-
-std::istream is_01(NULL);
-std::istream is_02(&isbuf_02);
-std::istream is_03(&isbuf_03);
-std::istream is_04(&isbuf_04);
-std::stringstream ss_01(str_01);
-bool test10() {
-  std::string str_01("0 00 000 +0 +0 -0");
-  std::stringbuf isbuf_01(str_01);
-  std::istream is_01(&isbuf_01);
-
-  bool test = true;
-
-  int n = 365;
-  is_01 >> n;
-  VERIFY( n == 0 );
-  n = 364;
-  is_01 >> n;
-  VERIFY( n == 0 );
-  n = 363;
-  is_01 >> n;
-  VERIFY( n == 0 );
-  n = 362;
-  is_01 >> n;
-  VERIFY( n == 0 );
-  n = 361;
-  is_01 >> n;
-  VERIFY( n == 0 );
-  n = 360;
-  is_01 >> n;
-  VERIFY( n == 0 );
-  VERIFY( is_01.rdstate() == std::ios_base::eofbit );
-
-  std::string str_02("0x32 0X33 033 33");
-  std::stringbuf isbuf_02(str_02);
-  std::istream is_02(&isbuf_02);
-  is_02.unsetf(std::ios_base::basefield);
-  is_02 >> n;
-  VERIFY( n == 50 );
-  is_02 >> n;
-  VERIFY( n == 51 );
-  is_02 >> n;
-  VERIFY( n == 27 );
-  is_02 >> n;
-  VERIFY( n == 33 );
-  VERIFY( is_02.rdstate() == std::ios_base::eofbit );
-
-  std::stringbuf isbuf_03(str_02);
-  std::istream is_03(&isbuf_03);
-  char c;
-  int m;
-
-  is_03 >> std::dec >> n >> c >> m;
-  VERIFY( n == 0 );
-  VERIFY( c == 'x' );
-  VERIFY( m == 32 );
-
-  is_03 >> std::oct >> m >> c >> n;
-  VERIFY( m == 0 );
-  VERIFY( c == 'X' );
-  VERIFY( n == 27 );
-
-  is_03 >> std::dec >> m >> n;
-  VERIFY( m == 33 );
-  VERIFY( n == 33 );
-  VERIFY( is_03.rdstate() == std::ios_base::eofbit );
-
-  std::string str_04("3. 4.5E+2a5E-3 .6E1");
-  std::stringbuf isbuf_04(str_04);
-  std::istream is_04(&isbuf_04);
-
-  double f;
-  is_04 >> f;
-  VERIFY( f == 3.0 );
-  is_04 >> f;
-  VERIFY( f == 450.0 );
-  is_04.ignore();
-  is_04 >> f;
-  VERIFY( f == 0.005 );
-  is_04 >> f;
-  VERIFY( f == 6 );
-  VERIFY( is_03.rdstate() == std::ios_base::eofbit );
-
-  std::string str_05("0E20 5Ea E16");
-  std::stringbuf isbuf_05(str_05);
-  std::istream is_05(&isbuf_05);
-
-  is_05 >> f;
-  VERIFY( f == 0 );
-  is_05 >> f;
-  VERIFY( f == 0 );
-  VERIFY( is_05.rdstate() == std::ios_base::failbit );
-  is_05.clear();
-  is_05 >> c;
-  VERIFY( c == 'a' );
-  is_05 >> f;
-  VERIFY( f == 0 );
-  VERIFY( is_05.rdstate() == std::ios_base::failbit );
-  is_05.clear();
-  is_05.ignore();
-  is_05 >> n;
-  VERIFY( n == 16 );
-
-#ifdef DEBUG_ASSERT
-  assert(test);
-#endif
-
-  return test;
-}
-
-int main()
-{
-  test10();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/27_io/istream_extractor_arith/11.cc b/libstdc++-v3/testsuite/27_io/istream_extractor_arith/11.cc
deleted file mode 100644 (file)
index 309875d..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-// 1999-04-12 bkoz
-
-// Copyright (C) 1999, 2000, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// 27.6.1.2.2 arithmetic extractors
-
-#include <cstdio> // for printf
-#include <istream>
-#include <ostream>
-#include <sstream>
-#include <locale>
-#include <testsuite_hooks.h>
-
-std::string str_01;
-std::string str_02("true false 0 1 110001");
-std::string str_03("-19999999 777777 -234234 233 -234 33 1 66300.25 .315 1.5");
-std::string str_04("0123");
-
-std::stringbuf isbuf_01(std::ios_base::in);
-std::stringbuf isbuf_02(str_02, std::ios_base::in);
-std::stringbuf isbuf_03(str_03, std::ios_base::in);
-std::stringbuf isbuf_04(str_04, std::ios_base::in);
-
-std::istream is_01(NULL);
-std::istream is_02(&isbuf_02);
-std::istream is_03(&isbuf_03);
-std::istream is_04(&isbuf_04);
-std::stringstream ss_01(str_01);
-// In the presence of no fmtflags, the input operator should behave
-// like strtol(x, y, 0)
-// libstdc++/90
-bool test11()
-{
-  bool test = true;
-  const char* cstrlit = "0x2a";
-
-  // sanity check via 'C' library call
-  char* err;
-  long l = std::strtol(cstrlit, &err, 0);
-
-  std::istringstream iss(cstrlit);
-  iss.setf(std::ios::fmtflags(0), std::ios::basefield);
-  int i;
-  iss >> i;
-
-  VERIFY (!iss.fail());
-  VERIFY (l == i);
-
-  return test;
-}
-
-int main()
-{
-  test11();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/27_io/istream_extractor_arith/12.cc b/libstdc++-v3/testsuite/27_io/istream_extractor_arith/12.cc
deleted file mode 100644 (file)
index 64795c0..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-// 1999-04-12 bkoz
-
-// Copyright (C) 1999, 2000, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// 27.6.1.2.2 arithmetic extractors
-
-// XXX This test fails on sparc-solaris2 because of a bug in libc
-// XXX sscanf for very long input.  See:
-// XXX http://gcc.gnu.org/ml/gcc/2002-12/msg01422.html
-// { dg-do run { xfail sparc*-*-solaris2* } }
-
-#include <cstdio> // for printf
-#include <istream>
-#include <ostream>
-#include <sstream>
-#include <locale>
-#include <testsuite_hooks.h>
-
-std::string str_01;
-std::string str_02("true false 0 1 110001");
-std::string str_03("-19999999 777777 -234234 233 -234 33 1 66300.25 .315 1.5");
-std::string str_04("0123");
-
-std::stringbuf isbuf_01(std::ios_base::in);
-std::stringbuf isbuf_02(str_02, std::ios_base::in);
-std::stringbuf isbuf_03(str_03, std::ios_base::in);
-std::stringbuf isbuf_04(str_04, std::ios_base::in);
-
-std::istream is_01(NULL);
-std::istream is_02(&isbuf_02);
-std::istream is_03(&isbuf_03);
-std::istream is_04(&isbuf_04);
-std::stringstream ss_01(str_01);
-// libstdc++/3720
-// excess input should not cause a core dump
-template<typename T>
-bool test12_aux(bool integer_type)
-{
-  bool test = true;
-  
-  int digits_overflow;
-  if (integer_type)
-    // This many digits will overflow integer types in base 10.
-    digits_overflow = std::numeric_limits<T>::digits10 + 2;
-  else
-    // This might do it, unsure.
-    digits_overflow = std::numeric_limits<T>::max_exponent10 + 1;
-  
-  std::string st;
-  std::string part = "1234567890123456789012345678901234567890";
-  for (int i = 0; i < digits_overflow / part.size() + 1; ++i)
-    st += part;
-  std::stringbuf sb(st);
-  std::istream is(&sb);
-  T t;
-  is >> t;
-  VERIFY(is.fail());
-  return test;
-}
-
-bool test12()
-{
-  bool test = true;
-  VERIFY(test12_aux<short>(true));
-  VERIFY(test12_aux<int>(true));
-  VERIFY(test12_aux<long>(true));
-  VERIFY(test12_aux<float>(false));
-  VERIFY(test12_aux<double>(false));
-  VERIFY(test12_aux<long double>(false));
-  return test;
-}
-
-int main()
-{
-  test12();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/27_io/istream_extractor_arith/13.cc b/libstdc++-v3/testsuite/27_io/istream_extractor_arith/13.cc
deleted file mode 100644 (file)
index 935d456..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-// 1999-04-12 bkoz
-
-// Copyright (C) 1999, 2000, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// 27.6.1.2.2 arithmetic extractors
-
-#include <cstdio> // for printf
-#include <istream>
-#include <ostream>
-#include <sstream>
-#include <locale>
-#include <testsuite_hooks.h>
-
-std::string str_01;
-std::string str_02("true false 0 1 110001");
-std::string str_03("-19999999 777777 -234234 233 -234 33 1 66300.25 .315 1.5");
-std::string str_04("0123");
-
-std::stringbuf isbuf_01(std::ios_base::in);
-std::stringbuf isbuf_02(str_02, std::ios_base::in);
-std::stringbuf isbuf_03(str_03, std::ios_base::in);
-std::stringbuf isbuf_04(str_04, std::ios_base::in);
-
-std::istream is_01(NULL);
-std::istream is_02(&isbuf_02);
-std::istream is_03(&isbuf_03);
-std::istream is_04(&isbuf_04);
-std::stringstream ss_01(str_01);
-// libstdc++/3720 part two
-void test13()
-{
-  using namespace std;
-  bool test = true;
-  const char* l1 = "12345678901234567890123456789012345678901234567890123456";
-  const char* l2 = "1.2345678901234567890123456789012345678901234567890123456"
-                   "  "
-                   "1246.9";
-
-  // 1 
-  // used to core.
-  double d;
-  istringstream iss1(l2);
-  iss1 >> d;
-  iss1 >> d;
-  VERIFY (d > 1246 && d < 1247);
-
-  // 2
-  // quick test for failbit on maximum length extraction.
-  int i;
-  int max_digits = numeric_limits<int>::digits10 + 1;
-  string digits;
-  for (int j = 0; j < max_digits; ++j)
-    digits += '1';
-  istringstream iss2(digits);
-  iss2 >> i;
-  VERIFY( !iss2.fail() );
-
-  digits += '1';
-  i = 0;
-  iss2.str(digits);
-  iss2.clear();
-  iss2 >> i; 
-  VERIFY( i == 0 );
-  VERIFY( iss2.fail() );
-}
-
-int main()
-{
-  test13();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/27_io/istream_extractor_char.cc b/libstdc++-v3/testsuite/27_io/istream_extractor_char.cc
deleted file mode 100644 (file)
index 87ab77d..0000000
+++ /dev/null
@@ -1,229 +0,0 @@
-// 1999-07-26 bkoz
-
-// Copyright (C) 1999 Free Software Foundation
-//
-// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// 27.6.1.2.3 character extractors
-
-#include <istream>
-#include <sstream>
-#include <testsuite_hooks.h>
-
-bool test01() {
-
-  bool test = true;
-  std::string str_01;
-  const std::string str_02("coltrane playing 'softly as a morning sunrise'");
-  const std::string str_03("coltrane");
-
-  std::stringbuf isbuf_01(std::ios_base::in);
-  std::stringbuf isbuf_02(str_02, std::ios_base::in);
-  std::istream is_01(NULL);
-  std::istream is_02(&isbuf_02);
-
-  std::ios_base::iostate state1, state2, statefail;
-  statefail = std::ios_base::failbit;
-
-  // template<_CharT, _Traits>
-  //  basic_istream& operator>>(istream&, _CharT*)
-  int n = 20;
-  char array1[n];
-  typedef std::ios::traits_type ctraits_type;
-  ctraits_type::int_type i1, i2;
-
-  state1 = is_01.rdstate();
-  i1 = ctraits_type::length(array1);
-  is_01 >> array1;   // should snake 0 characters, not alter stream state
-  i2 = ctraits_type::length(array1);
-  state2 = is_01.rdstate();
-  VERIFY( i1 == i2 );
-  VERIFY( state1 != state2 );
-  VERIFY( static_cast<bool>(state2 & statefail) );
-
-  state1 = is_02.rdstate();
-  is_02 >> array1;   // should snake "coltrane"
-  state2 = is_02.rdstate();
-  VERIFY( state1 == state2 );
-  VERIFY( !static_cast<bool>(state2 & statefail) );
-  VERIFY( array1[str_03.size() - 1] == 'e' );
-  array1[str_03.size()] = '\0';
-  VERIFY( !str_03.compare(0, str_03.size(), array1) );
-  std::istream::int_type int1 = is_02.peek(); // should be ' '
-  VERIFY( int1 == ' ' );
-
-  state1 = is_02.rdstate();
-  is_02 >> array1;   // should snake "playing" as sentry "eats" ws
-  state2 = is_02.rdstate();
-  int1 = is_02.peek(); // should be ' '
-  VERIFY( int1 == ' ' );
-  VERIFY( state1 == state2 );
-  VERIFY( !static_cast<bool>(state2 & statefail) );
-
-
-  // template<_CharT, _Traits>
-  //  basic_istream& operator>>(istream&, unsigned char*)
-  unsigned char array2[n];
-  state1 = is_02.rdstate();
-  is_02 >> array2;   // should snake 'softly
-  state2 = is_02.rdstate();
-  VERIFY( state1 == state2 );
-  VERIFY( !static_cast<bool>(state2 & statefail) );
-  VERIFY( array2[0] == '\'' );
-  VERIFY( array2[1] == 's' );
-  VERIFY( array2[6] == 'y' );
-  int1 = is_02.peek(); // should be ' '
-  VERIFY( int1 == ' ' );
-
-
-   // template<_CharT, _Traits>
-  //  basic_istream& operator>>(istream&, signed char*)
-  signed char array3[n];
-  state1 = is_02.rdstate();
-  is_02 >> array3;   // should snake "as"
-  state2 = is_02.rdstate();
-  VERIFY( state1 == state2 );
-  VERIFY( !static_cast<bool>(state2 & statefail) );
-  VERIFY( array3[0] == 'a' );
-  VERIFY( array3[1] == 's' );
-  int1 = is_02.peek(); // should be ' '
-  VERIFY( int1 == ' ' );
-
-  // testing with width() control enabled.
-  is_02.width(8);
-  state1 = is_02.rdstate();
-  is_02 >> array1;   // should snake a
-  state2 = is_02.rdstate();
-  VERIFY( state1 == state2 );
-  VERIFY( !ctraits_type::compare(array1, "a", 2) );
-
-  is_02.width(1);
-  state1 = is_02.rdstate();
-  is_02 >> array1;   // should snake nothing, set failbit
-  state2 = is_02.rdstate();
-  VERIFY( state1 != state2 );
-  VERIFY( state2 == statefail );
-  VERIFY( array1[0] == '\0' );
-
-  is_02.width(8);
-  is_02.clear();
-  state1 = is_02.rdstate();
-  VERIFY( !state1 );
-  is_02 >> array1;   // should snake "morning"
-  state2 = is_02.rdstate();
-  VERIFY( state1 == state2 );
-  VERIFY( !ctraits_type::compare(array1, "morning", 8) );
-
-  // testing for correct exception setting
-  const std::string str_04("   impulse!!");
-  std::stringbuf isbuf_03(str_04, std::ios_base::in);
-  std::stringbuf isbuf_04(str_04, std::ios_base::in);
-  std::istream is_03(&isbuf_03);
-  std::istream is_04(&isbuf_04);
-
-  is_03 >> array1;
-  VERIFY( !ctraits_type::compare(array1,"impulse!!", 10) );
-  VERIFY( is_03.rdstate() == std::ios_base::eofbit );
-
-  is_04.width(9);
-  is_04 >> array1;
-  VERIFY( ! std::ios::traits_type::compare(array1,"impulse!", 9) );
-  VERIFY( !is_04.rdstate() ); 
-
-#ifdef DEBUG_ASSERT
-  assert(test);
-#endif
-  return test;
-}
-
-bool test02() {
-
-  typedef std::ios::traits_type ctraits_type;
-
-  bool test = true;
-  std::string str_01;
-  const std::string str_02("or coltrane playing tunji with jimmy garrison");
-  const std::string str_03("coltrane");
-
-  std::stringbuf isbuf_01(std::ios_base::in);
-  std::stringbuf isbuf_02(str_02, std::ios_base::in);
-  std::istream is_01(NULL);
-  std::istream is_02(&isbuf_02);
-  std::ios_base::iostate state1, state2, statefail;
-  statefail = std::ios_base::failbit;
-
-  // template<_CharT, _Traits>
-  //  basic_istream& operator>>(istream&, _CharT&)
-  char c1 = 'c', c2 = 'c';
-  state1 = is_01.rdstate();
-  is_01 >> c1;   
-  state2 = is_01.rdstate();
-  VERIFY( state1 != state2 );
-  VERIFY( c1 == c2 );
-  VERIFY( static_cast<bool>(state2 & statefail) );
-
-  state1 = is_02.rdstate();
-  is_02 >> c1;   
-  state2 = is_02.rdstate();
-  VERIFY( state1 == state2 );
-  VERIFY( c1 == 'o' );
-  is_02 >> c1;   
-  is_02 >> c1;   
-  VERIFY( c1 == 'c' );
-  VERIFY( !static_cast<bool>(state2 & statefail) );
-
-  // template<_CharT, _Traits>
-  //  basic_istream& operator>>(istream&, unsigned char&)
-  unsigned char uc1 = 'c';
-  state1 = is_02.rdstate();
-  is_02 >> uc1;   
-  state2 = is_02.rdstate();
-  VERIFY( state1 == state2 );
-  VERIFY( uc1 == 'o' );
-  is_02 >> uc1;   
-  is_02 >> uc1;   
-  VERIFY( uc1 == 't' );
-
-  // template<_CharT, _Traits>
-  //  basic_istream& operator>>(istream&, signed char&)
-  signed char sc1 = 'c';
-  state1 = is_02.rdstate();
-  is_02 >> sc1;   
-  state2 = is_02.rdstate();
-  VERIFY( state1 == state2 );
-  VERIFY( sc1 == 'r' );
-  is_02 >> sc1;   
-  is_02 >> sc1;   
-  VERIFY( sc1 == 'n' );
-
-#ifdef DEBUG_ASSERT
-  assert(test);
-#endif
-  return test;
-}
-
-
-int main()
-{
-  test01();
-  test02();
-
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/27_io/istream_extractor_other-1.tst b/libstdc++-v3/testsuite/27_io/istream_extractor_other-1.tst
deleted file mode 100644 (file)
index 717a04c..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-// 990811 bkoz
-
-// Copyright (C) 1999 Cygnus Solutions
-//
-// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-/mnt/cdrom/yabbyyou_jesusdread/disk_2/King Tubby's - Repatriation
-/mnt/cdrom/yabbyyou_jesusdread/disk_2/Vivian Jackson and the Prop
-/mnt/cdrom/yabbyyou_jesusdread/disk_2/Michael Rose - Born Free (d
-/mnt/cdrom/yabbyyou_jesusdread/disk_2/King Tubby's - Love Thy Nei
-/mnt/cdrom/yabbyyou_jesusdread/disk_1/Vivian Jackson and the Defe
-/mnt/cdrom/yabbyyou_jesusdread/disk_1/Vivian Jackson and the Ralp
-/mnt/cdrom/yabbyyou_jesusdread/disk_1/Tommy McCook and Don D. Jnr
-/mnt/cdrom/yabbyyou_jesusdread/disk_1/Big Youth and Vivian Jackso
-/mnt/cdrom/yabbyyou_jesusdread/disk_1/King Tubby's - Big Youth Fi
-/mnt/cdrom/yabbyyou_jesusdread/disk_1/Upsetter Mix - Rally Dub
-/mnt/cdrom/yabbyyou_jesusdread/disk_1/Dicky Burton - God Is Watch
-/mnt/cdrom/yabbyyou_jesusdread/disk_1/Pablo and Vivian Jackson - 
-/mnt/cdrom/yabbyyou_jesusdread/disk_1/King Tubby's - Rock King Tu
-/mnt/cdrom/TORTOISE_millions_now_living/tortoise_5
-/mnt/cdrom/TORTOISE_millions_now_living/tortoise_6
-/mnt/cdrom/bettycarter_i'myours,you'remine/This time
-/mnt/cdrom/bettycarter_i'myours,you'remine/I'm Yours, You're Mine
-/mnt/cdrom/bettycarter_i'myours,you'remine/Lonely House
-/mnt/cdrom/bettycarter_i'myours,you'remine/Close Your Eyes
-/mnt/cdrom/bettycarter_i'myours,you'remine/Useless Landscape
-/mnt/cdrom/bettycarter_i'myours,you'remine/East of the Sun
-/mnt/cdrom/bettycarter_i'myours,you'remine/September Song
-/mnt/cdrom/bettycarter_it'snotaboutthemelo/Naima's Love Song
-/mnt/cdrom/bettycarter_it'snotaboutthemelo/Stay As Sweet As You Are
-/mnt/cdrom/bettycarter_it'snotaboutthemelo/Make Him Believe
-/mnt/cdrom/bettycarter_it'snotaboutthemelo/I Should Care
-/mnt/cdrom/bettycarter_it'snotaboutthemelo/Once Upon a Summertime
-/mnt/cdrom/bettycarter_it'snotaboutthemelo/You Go To My Head
-/mnt/cdrom/bettycarter_it'snotaboutthemelo/In the Still Of the Night
-/mnt/cdrom/bettycarter_it'snotaboutthemelo/When It's Sleepy Time Down 
-/mnt/cdrom/bettycarter_it'snotaboutthemelo/The Love We Had Yesterday
-/mnt/cdrom/bettycarter_it'snotaboutthemelo/Dip Bag
-/mnt/cdrom/bettycarter_it'snotaboutthemelo/You're Mine, Too
-/mnt/cdrom/c_adderly_somethin'_else/Autumn Leaves
-/mnt/cdrom/c_adderly_somethin'_else/Love For Sale
-/mnt/cdrom/c_adderly_somethin'_else/Somethin' Else
-/mnt/cdrom/c_adderly_somethin'_else/One For Daddy-O
-
-
-
-
-
-
-
-
diff --git a/libstdc++-v3/testsuite/27_io/istream_extractor_other-1.txt b/libstdc++-v3/testsuite/27_io/istream_extractor_other-1.txt
deleted file mode 100644 (file)
index 717a04c..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-// 990811 bkoz
-
-// Copyright (C) 1999 Cygnus Solutions
-//
-// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-/mnt/cdrom/yabbyyou_jesusdread/disk_2/King Tubby's - Repatriation
-/mnt/cdrom/yabbyyou_jesusdread/disk_2/Vivian Jackson and the Prop
-/mnt/cdrom/yabbyyou_jesusdread/disk_2/Michael Rose - Born Free (d
-/mnt/cdrom/yabbyyou_jesusdread/disk_2/King Tubby's - Love Thy Nei
-/mnt/cdrom/yabbyyou_jesusdread/disk_1/Vivian Jackson and the Defe
-/mnt/cdrom/yabbyyou_jesusdread/disk_1/Vivian Jackson and the Ralp
-/mnt/cdrom/yabbyyou_jesusdread/disk_1/Tommy McCook and Don D. Jnr
-/mnt/cdrom/yabbyyou_jesusdread/disk_1/Big Youth and Vivian Jackso
-/mnt/cdrom/yabbyyou_jesusdread/disk_1/King Tubby's - Big Youth Fi
-/mnt/cdrom/yabbyyou_jesusdread/disk_1/Upsetter Mix - Rally Dub
-/mnt/cdrom/yabbyyou_jesusdread/disk_1/Dicky Burton - God Is Watch
-/mnt/cdrom/yabbyyou_jesusdread/disk_1/Pablo and Vivian Jackson - 
-/mnt/cdrom/yabbyyou_jesusdread/disk_1/King Tubby's - Rock King Tu
-/mnt/cdrom/TORTOISE_millions_now_living/tortoise_5
-/mnt/cdrom/TORTOISE_millions_now_living/tortoise_6
-/mnt/cdrom/bettycarter_i'myours,you'remine/This time
-/mnt/cdrom/bettycarter_i'myours,you'remine/I'm Yours, You're Mine
-/mnt/cdrom/bettycarter_i'myours,you'remine/Lonely House
-/mnt/cdrom/bettycarter_i'myours,you'remine/Close Your Eyes
-/mnt/cdrom/bettycarter_i'myours,you'remine/Useless Landscape
-/mnt/cdrom/bettycarter_i'myours,you'remine/East of the Sun
-/mnt/cdrom/bettycarter_i'myours,you'remine/September Song
-/mnt/cdrom/bettycarter_it'snotaboutthemelo/Naima's Love Song
-/mnt/cdrom/bettycarter_it'snotaboutthemelo/Stay As Sweet As You Are
-/mnt/cdrom/bettycarter_it'snotaboutthemelo/Make Him Believe
-/mnt/cdrom/bettycarter_it'snotaboutthemelo/I Should Care
-/mnt/cdrom/bettycarter_it'snotaboutthemelo/Once Upon a Summertime
-/mnt/cdrom/bettycarter_it'snotaboutthemelo/You Go To My Head
-/mnt/cdrom/bettycarter_it'snotaboutthemelo/In the Still Of the Night
-/mnt/cdrom/bettycarter_it'snotaboutthemelo/When It's Sleepy Time Down 
-/mnt/cdrom/bettycarter_it'snotaboutthemelo/The Love We Had Yesterday
-/mnt/cdrom/bettycarter_it'snotaboutthemelo/Dip Bag
-/mnt/cdrom/bettycarter_it'snotaboutthemelo/You're Mine, Too
-/mnt/cdrom/c_adderly_somethin'_else/Autumn Leaves
-/mnt/cdrom/c_adderly_somethin'_else/Love For Sale
-/mnt/cdrom/c_adderly_somethin'_else/Somethin' Else
-/mnt/cdrom/c_adderly_somethin'_else/One For Daddy-O
-
-
-
-
-
-
-
-
diff --git a/libstdc++-v3/testsuite/27_io/istream_extractor_other-2.tst b/libstdc++-v3/testsuite/27_io/istream_extractor_other-2.tst
deleted file mode 100644 (file)
index 717a04c..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-// 990811 bkoz
-
-// Copyright (C) 1999 Cygnus Solutions
-//
-// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-/mnt/cdrom/yabbyyou_jesusdread/disk_2/King Tubby's - Repatriation
-/mnt/cdrom/yabbyyou_jesusdread/disk_2/Vivian Jackson and the Prop
-/mnt/cdrom/yabbyyou_jesusdread/disk_2/Michael Rose - Born Free (d
-/mnt/cdrom/yabbyyou_jesusdread/disk_2/King Tubby's - Love Thy Nei
-/mnt/cdrom/yabbyyou_jesusdread/disk_1/Vivian Jackson and the Defe
-/mnt/cdrom/yabbyyou_jesusdread/disk_1/Vivian Jackson and the Ralp
-/mnt/cdrom/yabbyyou_jesusdread/disk_1/Tommy McCook and Don D. Jnr
-/mnt/cdrom/yabbyyou_jesusdread/disk_1/Big Youth and Vivian Jackso
-/mnt/cdrom/yabbyyou_jesusdread/disk_1/King Tubby's - Big Youth Fi
-/mnt/cdrom/yabbyyou_jesusdread/disk_1/Upsetter Mix - Rally Dub
-/mnt/cdrom/yabbyyou_jesusdread/disk_1/Dicky Burton - God Is Watch
-/mnt/cdrom/yabbyyou_jesusdread/disk_1/Pablo and Vivian Jackson - 
-/mnt/cdrom/yabbyyou_jesusdread/disk_1/King Tubby's - Rock King Tu
-/mnt/cdrom/TORTOISE_millions_now_living/tortoise_5
-/mnt/cdrom/TORTOISE_millions_now_living/tortoise_6
-/mnt/cdrom/bettycarter_i'myours,you'remine/This time
-/mnt/cdrom/bettycarter_i'myours,you'remine/I'm Yours, You're Mine
-/mnt/cdrom/bettycarter_i'myours,you'remine/Lonely House
-/mnt/cdrom/bettycarter_i'myours,you'remine/Close Your Eyes
-/mnt/cdrom/bettycarter_i'myours,you'remine/Useless Landscape
-/mnt/cdrom/bettycarter_i'myours,you'remine/East of the Sun
-/mnt/cdrom/bettycarter_i'myours,you'remine/September Song
-/mnt/cdrom/bettycarter_it'snotaboutthemelo/Naima's Love Song
-/mnt/cdrom/bettycarter_it'snotaboutthemelo/Stay As Sweet As You Are
-/mnt/cdrom/bettycarter_it'snotaboutthemelo/Make Him Believe
-/mnt/cdrom/bettycarter_it'snotaboutthemelo/I Should Care
-/mnt/cdrom/bettycarter_it'snotaboutthemelo/Once Upon a Summertime
-/mnt/cdrom/bettycarter_it'snotaboutthemelo/You Go To My Head
-/mnt/cdrom/bettycarter_it'snotaboutthemelo/In the Still Of the Night
-/mnt/cdrom/bettycarter_it'snotaboutthemelo/When It's Sleepy Time Down 
-/mnt/cdrom/bettycarter_it'snotaboutthemelo/The Love We Had Yesterday
-/mnt/cdrom/bettycarter_it'snotaboutthemelo/Dip Bag
-/mnt/cdrom/bettycarter_it'snotaboutthemelo/You're Mine, Too
-/mnt/cdrom/c_adderly_somethin'_else/Autumn Leaves
-/mnt/cdrom/c_adderly_somethin'_else/Love For Sale
-/mnt/cdrom/c_adderly_somethin'_else/Somethin' Else
-/mnt/cdrom/c_adderly_somethin'_else/One For Daddy-O
-
-
-
-
-
-
-
-
diff --git a/libstdc++-v3/testsuite/27_io/istream_extractor_other.cc b/libstdc++-v3/testsuite/27_io/istream_extractor_other.cc
deleted file mode 100644 (file)
index fbf8f42..0000000
+++ /dev/null
@@ -1,208 +0,0 @@
-// 1999-07-28 bkoz
-
-// Copyright (C) 1999, 2001 Free Software Foundation
-//
-// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// 27.6.1.2.3 basic_istream::operator>>
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %-*.txt
-
-#include <istream>
-#include <sstream>
-#include <fstream>
-#include <testsuite_hooks.h>
-
-
-// stringbufs.
-bool test01() {
-
-  typedef std::ios::traits_type ctraits_type;
-
-  bool test = true;
-  const std::string str_01;
-  const std::string str_02("art taylor kickin it on DAKAR");
-  std::string strtmp;
-
-  std::stringbuf isbuf_00(std::ios_base::in);
-  std::stringbuf isbuf_01(std::ios_base::in | std::ios_base::out);
-  std::stringbuf isbuf_02(str_01, std::ios_base::in);
-  std::stringbuf isbuf_03(str_01, std::ios_base::in | std::ios_base::out);
-  std::stringbuf isbuf_04(str_02, std::ios_base::in);
-  std::stringbuf isbuf_05(str_02, std::ios_base::in | std::ios_base::out);
-
-  std::istream is_00(NULL);
-  std::istream is_01(&isbuf_01);
-  std::istream is_02(&isbuf_02);
-  std::istream is_03(&isbuf_03);
-  std::istream is_04(&isbuf_04);
-  std::istream is_05(&isbuf_05);
-  std::ios_base::iostate state1, state2, statefail, stateeof;
-  statefail = std::ios_base::failbit;
-  stateeof = std::ios_base::eofbit;
-
-
-  // template<_CharT, _Traits>
-  //  basic_istream& operator>>(basic_streambuf*)
-
-  // null istream to empty in_buf
-  state1 = is_00.rdstate();
-  is_00 >> &isbuf_00;   
-  state2 = is_00.rdstate();
-  VERIFY( state1 != state2 );
-  VERIFY( static_cast<bool>(state2 & statefail) );
-  VERIFY( isbuf_00.str() == str_01 ); 
-
-  // null istream to empty in_out_buf
-  is_00.clear(std::ios_base::goodbit);
-  state1 = is_00.rdstate();
-  is_00 >> &isbuf_01;   
-  state2 = is_00.rdstate();
-  VERIFY( state1 != state2 );
-  VERIFY( static_cast<bool>(state2 & statefail) );
-  VERIFY( isbuf_01.str() == str_01 ); 
-
-  // null istream to full in_buf
-  is_00.clear(std::ios_base::goodbit);
-  state1 = is_00.rdstate();
-  is_00 >> &isbuf_04;   
-  state2 = is_00.rdstate();
-  VERIFY( state1 != state2 );
-  VERIFY( static_cast<bool>(state2 & statefail) );
-  VERIFY( isbuf_04.str() == str_02 ); 
-
-  // null istream to full in_out_buf
-  is_00.clear(std::ios_base::goodbit);
-  state1 = is_00.rdstate();
-  is_00 >> &isbuf_05;   
-  state2 = is_00.rdstate();
-  VERIFY( state1 != state2 );
-  VERIFY( static_cast<bool>(state2 & statefail) );
-  VERIFY( isbuf_05.str() == str_02 ); 
-
-  // empty but non-null istream to full in_buf
-  state1 = is_02.rdstate();
-  is_02 >> &isbuf_04;   
-  state2 = is_02.rdstate();
-  VERIFY( state1 != state2 );
-  VERIFY( static_cast<bool>(state2 & statefail) );
-  VERIFY( isbuf_04.str() == str_02 ); // as only an "in" buffer
-  VERIFY( isbuf_04.sgetc() == 'a' );
-
-  // empty but non-null istream to full in_out_buf
-  is_02.clear(std::ios_base::goodbit);
-  state1 = is_02.rdstate();
-  is_02 >> &isbuf_05;   
-  state2 = is_02.rdstate();
-  VERIFY( state1 != state2 );
-  VERIFY( static_cast<bool>(state2 & statefail) );
-  VERIFY( isbuf_05.str() == str_02 ); // as only an "in" buffer
-  VERIFY( isbuf_05.sgetc() == 'a' );
-
-  // full istream to empty in_buf (need out_buf, you know?)
-  state1 = is_04.rdstate();
-  is_04 >> &isbuf_02;   
-  state2 = is_04.rdstate();
-  VERIFY( state1 != state2 );
-  VERIFY( static_cast<bool>(state2 & statefail) );
-  VERIFY( isbuf_02.str() == str_01 ); // as only an "in" buffer
-  VERIFY( isbuf_02.sgetc() == ctraits_type::eof() );
-  VERIFY( is_04.peek() == ctraits_type::eof() ); // as failed
-
-  // full istream to empty in_out_buf
-  is_04.clear(std::ios_base::goodbit);
-  state1 = is_04.rdstate();
-  is_04 >> &isbuf_03;   
-  state2 = is_04.rdstate();
-  VERIFY( state1 == state2 );
-  VERIFY( !static_cast<bool>(state2 & statefail) );
-  VERIFY( state2 != stateeof );
-  strtmp = isbuf_03.str();
-  VERIFY( strtmp == str_02 ); // as only an "in" buffer
-  VERIFY( isbuf_03.sgetc() == 'a' );
-  VERIFY( is_04.peek() == ctraits_type::eof() );
-
-#ifdef DEBUG_ASSERT
-  assert(test);
-#endif
-  return test;
-}
-
-// filebufs.
-bool test02() {
-
-  bool test = true;
-  typedef std::ios::traits_type ctraits_type;
-  const char name_01[] = "istream_extractor_other-1.txt"; //read 
-  const char name_02[] = "istream_extractor_other-2.txt"; //write
-
-  std::filebuf fbin, fbout;
-  fbin.open(name_01, std::ios_base::in);
-  fbout.open(name_02, std::ios_base::out | std::ios_base::trunc);
-  VERIFY( fbin.is_open() );
-  VERIFY( fbout.is_open() );
-
-  if (test)
-    {
-      std::istream is(&fbin);
-      is.unsetf(std::ios_base::skipws);
-      is >> &fbout;
-    }
-
-  fbout.close();
-  fbin.close();
-  VERIFY( !fbin.is_open() );
-  VERIFY( !fbout.is_open() );
-
-#ifdef DEBUG_ASSERT
-  assert(test);
-#endif
-  return test;
-}
-
-void test03() 
-{
-  using namespace std;  
-  bool test = true;
-
-  // template<_CharT, _Traits>
-  //  basic_istream& operator>>(ios_base& (*pf) (ios_base&))
-  {
-    int i = 0;
-    std::istringstream iss(" 43");
-    iss >> std::noskipws >> i;
-    std::ios::iostate i3 = iss.rdstate();
-    VERIFY ( !iss ); //should set failbit
-  }
-
-  // template<_CharT, _Traits>
-  //  basic_istream& operator>>(basic_ios& (*pf) (basic_ios&))
-
-  // template<_CharT, _Traits>
-  //  basic_istream& operator>>(basic_istream& (*pf) (basic_istream&))
-}
-
-
-int main()
-{
-  test01();
-  test02();
-  test03();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/27_io/istream_manip.cc b/libstdc++-v3/testsuite/27_io/istream_manip.cc
deleted file mode 100644 (file)
index 75eb79f..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-// 1999-07-22 bkoz
-
-// Copyright (C) 1994, 1999, 2001 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// 27.6.1.4 standard basic_istream manipulators
-
-#include <istream>
-#include <sstream>
-#include <stdexcept>
-#include <testsuite_hooks.h>
-
-bool test01(void)
-{
-  bool test = true;
-
-  const char str_lit01[] = "  venice ";
-  const std::string str01(" santa barbara ");
-  std::string str02(str_lit01);
-  std::string str04;
-  std::string str05;
-  std::ios_base::iostate flag1, flag2, flag3, flag4, flag5;
-
-  // template<_CharT, _Traits>
-  //  basic_istream<_CharT, _Traits>& ws(basic_istream<_Char, _Traits>& is)
-  std::istringstream iss01(str01);
-  std::istringstream iss02(str01);
-  
-  iss01 >> str04;
-  VERIFY( str04.size() != str01.size() );
-  VERIFY( str04 == "santa" );
-
-  iss02 >> std::ws;
-  iss02 >> str05;
-  VERIFY( str05.size() != str01.size() );
-  VERIFY( str05 == "santa" );
-  VERIFY( str05 == str04 );
-
-  iss01 >> str04;
-  VERIFY( str04.size() != str01.size() );
-  VERIFY( str04 == "barbara" );
-  
-  iss02 >> std::ws;
-  iss02 >> str05;
-  VERIFY( str05.size() != str01.size() );
-  VERIFY( str05 == "barbara" );
-  VERIFY( str05 == str04 );
-
-  flag3 = std::ios_base::eofbit;
-  flag4 = std::ios_base::badbit;
-  flag5 = std::ios_base::failbit;
-  VERIFY( !iss01.fail() );
-  VERIFY( !iss02.fail() );
-  VERIFY( !iss01.eof() );
-  VERIFY( !iss02.eof() );
-
-  iss01 >> std::ws;
-  VERIFY( !iss01.fail() );
-  VERIFY( iss01.eof() );
-
-#ifdef DEBUG_ASSERT
-  assert(test);
-#endif
-
-  return test;
-}
-
-int main()
-{ 
-  test01();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/27_io/istream_seeks-1.tst b/libstdc++-v3/testsuite/27_io/istream_seeks-1.tst
deleted file mode 100644 (file)
index 5d9eafa..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-bd2
-456x
-9mzuv>?@ABCDEFGHIJKLMNOPQRSTUVWXYZracadabras, i wannaz
-because because
-because. . 
-of the wonderful things he does!!
-ok
\ No newline at end of file
diff --git a/libstdc++-v3/testsuite/27_io/istream_seeks-1.txt b/libstdc++-v3/testsuite/27_io/istream_seeks-1.txt
deleted file mode 100644 (file)
index 5d9eafa..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-bd2
-456x
-9mzuv>?@ABCDEFGHIJKLMNOPQRSTUVWXYZracadabras, i wannaz
-because because
-because. . 
-of the wonderful things he does!!
-ok
\ No newline at end of file
diff --git a/libstdc++-v3/testsuite/27_io/istream_seeks-2.tst b/libstdc++-v3/testsuite/27_io/istream_seeks-2.tst
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/libstdc++-v3/testsuite/27_io/istream_seeks-3.tst b/libstdc++-v3/testsuite/27_io/istream_seeks-3.tst
deleted file mode 100644 (file)
index dc45fc9..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-0-0 lootpack, peanut butter wolf, rob swift, madlib, quasimoto
-0-1 lootpack, peanut butter wolf, rob swift, madlib, quasimoto
-0-2 lootpack, peanut butter wolf, rob swift, madlib, quasimoto
-0-3 lootpack, peanut butter wolf, rob swift, madlib, quasimoto
-0-4 lootpack, peanut butter wolf, rob swift, madlib, quasimoto
-0-5 lootpack, peanut butter wolf, rob swift, madlib, quasimoto
-0-6 lootpack, peanut butter wolf, rob swift, madlib, quasimoto
-0-7 lootpack, peanut butter wolf, rob swift, madlib, quasimoto
-0-8 lootpack, peanut butter wolf, rob swift, madlib, quasimoto
-0-9 lootpack, peanut butter wolf, rob swift, madlib, quasimoto
diff --git a/libstdc++-v3/testsuite/27_io/istream_seeks.cc b/libstdc++-v3/testsuite/27_io/istream_seeks.cc
deleted file mode 100644 (file)
index 892e10b..0000000
+++ /dev/null
@@ -1,405 +0,0 @@
-// 2000-06-29 bkoz
-
-// Copyright (C) 2000, 2001, 2002 Free Software Foundation
-//
-// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// 27.6.1.3 unformatted input functions
-// NB: ostream has a particular "seeks" category. Adopt this for istreams too.
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %-*.txt
-
-#include <istream>
-#include <sstream>
-#include <fstream>
-#include <testsuite_hooks.h>
-
-bool test01()
-{
-  using namespace std;
-  typedef ios::pos_type pos_type;
-
-  bool test = true;
-  const char str_lit01[] = "istream_seeks-1.tst";
-
-  // in
-  // test default ctors leave things in the same positions...
-  istringstream ist1;
-  pos_type p3 = ist1.tellg();
-
-  ifstream ifs1;
-  pos_type p4 = ifs1.tellg();
-
-  VERIFY( p3 == p4 );
-
-  // in
-  // test ctors leave things in the same positions...
-  istringstream ist2("bob_marley:kaya");
-  p3 = ist2.tellg();
-
-  ifstream ifs2(str_lit01);
-  p4 = ifs2.tellg();
-
-  VERIFY( p3 == p4 );
-  return test;
-}
-
-const char* s = " lootpack, peanut butter wolf, rob swift, madlib, quasimoto";
-const int times = 10;
-
-void write_rewind(std::iostream& stream)
-{
-  for (int j = 0; j < times; j++) 
-    {
-      bool test = true;
-      std::streampos begin = stream.tellg();
-      
-      for (int i = 0; i < times; ++i)
-       stream << j << '-' << i << s << '\n';
-      
-      stream.seekg(begin);
-      std::streampos end = stream.tellg(); 
-      std::streampos badpos = std::streampos(std::streambuf::off_type(-1));
-    }
-}
-
-void check_contents(std::iostream& stream)
-{
-  bool test = true;
-
-  stream.clear();
-  stream.seekg(0, std::ios::beg);
-  int i = 0;
-  int loop = times * times + 2;
-  while (i < loop)
-    {
-      stream.ignore(80, '\n');
-      if (stream.good())
-       ++i;
-      else
-       break;
-    }
-  VERIFY( i == times );
-}
-
-// fstream
-// libstdc++/2346
-void test02()
-{       
-  std::fstream ofstrm;
-  ofstrm.open("istream_seeks-3.txt", std::ios::out);
-  if (!ofstrm)
-    std::abort();
-  write_rewind(ofstrm);
-  ofstrm.close();
-
-  std::fstream ifstrm;
-  ifstrm.open("istream_seeks-3.txt", std::ios::in);
-  check_contents(ifstrm);
-  ifstrm.close();
-}
-
-// stringstream
-// libstdc++/2346
-void test03()
-{       
-  std::stringstream sstrm;
-
-  write_rewind(sstrm);
-  check_contents(sstrm);
-}
-
-// fstreams
-void test04(void)
-{
-  typedef std::istream::off_type off_type;
-
-  bool test = true;
-  std::istream::pos_type pos01, pos02, pos03, pos04, pos05, pos06;
-  std::ios_base::iostate state01, state02;
-  const char str_lit01[] = "istream_seeks-1.txt";
-  const char str_lit02[] = "istream_seeks-2.txt";
-  std::ifstream if01(str_lit01, std::ios_base::in | std::ios_base::out);
-  std::ifstream if02(str_lit01, std::ios_base::in);
-  std::ifstream if03(str_lit02, std::ios_base::out | std::ios_base::trunc); 
-  VERIFY( if01.good() );
-  VERIFY( if02.good() );
-  VERIFY( if03.good() );
-
-  std::istream is01(if01.rdbuf());
-  std::istream is02(if02.rdbuf());
-  std::istream is03(if03.rdbuf());
-
-  // pos_type tellg()
-  // in | out
-  pos01 = is01.tellg();
-  pos02 = is01.tellg();
-  VERIFY( pos01 == pos02 );
-  //  VERIFY( istream::pos_type(0) != pos01 ); //deprecated
-
-  // in
-  pos03 = is02.tellg();
-  pos04 = is02.tellg();
-  VERIFY( pos03 == pos04 );
-  //  VERIFY( istream::pos_type(0) != pos03 ); //deprecated
-
-  // out
-  pos05 = is03.tellg();
-  pos06 = is03.tellg();
-  VERIFY( pos05 == pos06 );
-  //  VERIFY( istream::pos_type(0) != pos01 ); //deprecated
-
-  // istream& seekg(pos_type)
-  // istream& seekg(off_type, ios_base::seekdir)
-
-  // cur 
-  // NB: see library issues list 136. It's the v-3 interp that seekg
-  // only sets the input buffer, or else istreams with buffers that
-  // have _M_mode == ios_base::out will fail to have consistency
-  // between seekg and tellg.
-  state01 = is01.rdstate();
-  is01.seekg(10, std::ios_base::cur);
-  state02 = is01.rdstate();
-  pos01 = is01.tellg(); 
-  VERIFY( pos01 == pos02 + off_type(10) ); 
-  VERIFY( state01 == state02 );
-  pos02 = is01.tellg(); 
-  VERIFY( pos02 == pos01 ); 
-
-  state01 = is02.rdstate();
-  is02.seekg(10, std::ios_base::cur);
-  state02 = is02.rdstate();
-  pos03 = is02.tellg(); 
-  VERIFY( pos03 == pos04 + off_type(10) ); 
-  VERIFY( state01 == state02 );
-  pos04 = is02.tellg(); 
-  VERIFY( pos03 == pos04 ); 
-
-  state01 = is03.rdstate();
-  is03.seekg(10, std::ios_base::cur);
-  state02 = is03.rdstate();
-  pos05 = is03.tellg(); 
-  VERIFY( pos05 == pos06 + off_type(10) ); 
-  VERIFY( state01 == state02 );
-  pos06 = is03.tellg(); 
-  VERIFY( pos05 == pos06 ); 
-
-  // beg
-  state01 = is01.rdstate();
-  is01.seekg(20, std::ios_base::beg);
-  state02 = is01.rdstate();
-  pos01 = is01.tellg(); 
-  VERIFY( pos01 == pos02 + off_type(10) ); 
-  VERIFY( state01 == state02 );
-  pos02 = is01.tellg(); 
-  VERIFY( pos02 == pos01 ); 
-
-  state01 = is02.rdstate();
-  is02.seekg(20, std::ios_base::beg);
-  state02 = is02.rdstate();
-  pos03 = is02.tellg(); 
-  VERIFY( pos03 == pos04 + off_type(10) ); 
-  VERIFY( state01 == state02 );
-  pos04 = is02.tellg(); 
-  VERIFY( pos03 == pos04 ); 
-
-  state01 = is03.rdstate();
-  is03.seekg(20, std::ios_base::beg);
-  state02 = is03.rdstate();
-  pos05 = is03.tellg(); 
-  VERIFY( pos05 == pos06 + off_type(10) );
-  VERIFY( state01 == state02 );
-  pos06 = is03.tellg(); 
-  VERIFY( pos05 == pos06 );
-
-  // libstdc++/6414
-  if01.seekg(0, std::ios_base::beg);
-  pos01 = if01.tellg();
-  if01.peek();
-  pos02 = if01.tellg();
-  VERIFY( pos02 == pos01 );
-}
-
-// stringstreams
-void test05(void)
-{
-  typedef std::istream::off_type off_type;
-
-  bool test = true;
-  std::istream::pos_type pos01, pos02, pos03, pos04, pos05, pos06;
-  std::ios_base::iostate state01, state02;
-  const char str_lit01[] = "istream_seeks-1.tst";
-  std::ifstream if01(str_lit01);
-  std::ifstream if02(str_lit01);
-  std::ifstream if03(str_lit01);
-  VERIFY( if01.good() );
-  VERIFY( if02.good() );
-  VERIFY( if03.good() );
-
-  std::stringbuf strbuf01(std::ios_base::in | std::ios_base::out);
-  if01 >> &strbuf01; 
-  // initialize stringbufs that are ios_base::out
-  std::stringbuf strbuf03(strbuf01.str(), std::ios_base::out);
-  // initialize stringbufs that are ios_base::in
-  std::stringbuf strbuf02(strbuf01.str(), std::ios_base::in);
-
-  std::istream is01(&strbuf01);
-  std::istream is02(&strbuf02);
-  std::istream is03(&strbuf03);
-
-  // pos_type tellg()
-  // in | out
-  pos01 = is01.tellg();
-  pos02 = is01.tellg();
-  VERIFY( pos01 == pos02 );
-  // VERIFY( istream::pos_type(0) != pos01 ); // deprecated
-
-  // in
-  pos03 = is02.tellg();
-  pos04 = is02.tellg();
-  VERIFY( pos03 == pos04 );
-  //  VERIFY( istream::pos_type(0) != pos03 ); // deprecated
-
-  // out
-  pos05 = is03.tellg();
-  pos06 = is03.tellg();
-  VERIFY( pos05 == pos06 );
-  //  VERIFY( istream::pos_type(0) != pos01 ); //deprecated
-
-  // istream& seekg(pos_type)
-  // istream& seekg(off_type, ios_base::seekdir)
-
-  // cur 
-  // NB: see library issues list 136. It's the v-3 interp that seekg
-  // only sets the input buffer, or else istreams with buffers that
-  // have _M_mode == ios_base::out will fail to have consistency
-  // between seekg and tellg.
-  state01 = is01.rdstate();
-  is01.seekg(10, std::ios_base::cur);
-  state02 = is01.rdstate();
-  pos01 = is01.tellg(); 
-  VERIFY( pos01 == pos02 + off_type(10) ); 
-  VERIFY( state01 == state02 );
-  pos02 = is01.tellg(); 
-  VERIFY( pos02 == pos01 ); 
-
-  state01 = is02.rdstate();
-  is02.seekg(10, std::ios_base::cur);
-  state02 = is02.rdstate();
-  pos03 = is02.tellg(); 
-  VERIFY( pos03 == pos04 + off_type(10) ); 
-  VERIFY( state01 == state02 );
-  pos04 = is02.tellg(); 
-  VERIFY( pos03 == pos04 ); 
-
-  state01 = is03.rdstate();
-  is03.seekg(10, std::ios_base::cur);
-  state02 = is03.rdstate();
-  pos05 = is03.tellg(); 
-  VERIFY( pos05 == pos06 ); // as only out buffer 
-  VERIFY( state01 != state02 );
-  pos06 = is03.tellg(); 
-  VERIFY( pos05 == pos06 ); 
-
-  // beg
-  state01 = is01.rdstate();
-  is01.seekg(20, std::ios_base::beg);
-  state02 = is01.rdstate();
-  pos01 = is01.tellg(); 
-  VERIFY( pos01 == pos02 + off_type(10) ); 
-  VERIFY( state01 == state02 );
-  pos02 = is01.tellg(); 
-  VERIFY( pos02 == pos01 ); 
-
-  state01 = is02.rdstate();
-  is02.seekg(20, std::ios_base::beg);
-  state02 = is02.rdstate();
-  pos03 = is02.tellg(); 
-  VERIFY( pos03 == pos04 + off_type(10) ); 
-  VERIFY( state01 == state02 );
-  pos04 = is02.tellg(); 
-  VERIFY( pos03 == pos04 ); 
-
-  state01 = is03.rdstate();
-  is03.seekg(20, std::ios_base::beg);
-  state02 = is03.rdstate();
-  pos05 = is03.tellg(); 
-  VERIFY( pos05 == pos06 ); // as only out buffer 
-  VERIFY( state01 == state02 );
-  pos06 = is03.tellg(); 
-  VERIFY( pos05 == pos06 ); 
-}
-
-// libstdc++/8348
-void test06(void)
-{
-  using namespace std;
-  bool test = true;
-  string num1("555");
-
-  // tellg
-  {
-    istringstream iss(num1);
-    istream::pos_type pos1 = iss.tellg();
-    int asNum = 0;
-    iss >> asNum;
-    VERIFY( test = iss.eof() );
-    VERIFY( test = !iss.fail() );
-    iss.tellg();
-    VERIFY( test = !iss.fail() );
-  }
-
-  // seekg
-  {
-    istringstream iss(num1);
-    istream::pos_type pos1 = iss.tellg();
-    int asNum = 0;
-    iss >> asNum;
-    VERIFY( test = iss.eof() );
-    VERIFY( test = !iss.fail() );
-    iss.seekg(0, ios_base::beg);
-    VERIFY( test = !iss.fail() );
-  }
-
-  // seekg
-  {
-    istringstream iss(num1);
-    istream::pos_type pos1 = iss.tellg();
-    int asNum = 0;
-    iss >> asNum;
-    VERIFY( test = iss.eof() );
-    VERIFY( test = !iss.fail() );
-    iss.seekg(pos1);
-    VERIFY( test = !iss.fail() );
-  }
-}
-
-int main()
-{
-  test01();
-
-  test02();
-  test03();
-
-  test04();
-  test05();
-
-  test06();
-  return 0;
-}
-
-
diff --git a/libstdc++-v3/testsuite/27_io/istream_sentry.cc b/libstdc++-v3/testsuite/27_io/istream_sentry.cc
deleted file mode 100644 (file)
index faf8cfe..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-// 1999-10-14 bkoz
-
-// Copyright (C) 1999, 2001 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// As a special exception, you may use this file as part of a free software
-// library without restriction.  Specifically, if other files instantiate
-// templates or use macros or inline functions from this file, or you compile
-// this file and link it with other files to produce an executable, this
-// file does not by itself cause the resulting executable to be covered by
-// the GNU General Public License.  This exception does not however
-// invalidate any other reasons why the executable file might be covered by
-// the GNU General Public License.
-
-// 27.6.1.1.2 class basic_istream::sentry
-
-#include <istream>
-#include <sstream>
-#include <testsuite_hooks.h>
-
-void test01()
-{
-  bool test = true;
-  const char* lit01 = "stereolab on the bolsinga tip";
-  const std::string str01(lit01);
-
-  std::stringbuf strbuf01;
-  std::stringbuf strbuf02(str01);
-  std::istream istr01(&strbuf01);
-  std::istream istr02(&strbuf02);
-  
-  // test negatives
-  std::istream::sentry sentry01(istr01);       
-  VERIFY( bool(sentry01) == false ); 
-
-  std::istream::sentry sentry02(istr01, true);
-  VERIFY( bool(sentry02) == false ); 
-
-  // positive tests
-  std::istream::sentry sentry03(istr02);       
-  VERIFY( bool(sentry03) == true ); 
-
-  std::istream::sentry sentry04(istr02, true);
-  VERIFY( bool(sentry04) == true ); 
-}
-
-// libstdc++/944
-void 
-test02()
-{
-  using namespace std;
-  istringstream in("80.21 56.89 12.3");
-  bool test = true;
-  int i = 0;
-  double x;
-
-  // ios_base::eof == 2
-  while (in >> x)
-    {
-      ++i;
-      if (i > 3) 
-       break;
-    }
-  VERIFY( i == 3 );
-}    
-
-// libstdc++/9562
-void
-test03()
-{
-  bool test = true;
-
-  std::stringbuf strbuf01;
-  std::istream strm1(&strbuf01);
-  const std::istream::sentry sentry1(strm1);
-
-  VERIFY( bool(sentry1) == false );
-}
-
-int main() 
-{
-  test01();
-  test02();
-  test03();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/27_io/istream_unformatted-1.tst b/libstdc++-v3/testsuite/27_io/istream_unformatted-1.tst
deleted file mode 100644 (file)
index 9b770a5..0000000
+++ /dev/null
@@ -1,1500 +0,0 @@
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
diff --git a/libstdc++-v3/testsuite/27_io/istream_unformatted-1.txt b/libstdc++-v3/testsuite/27_io/istream_unformatted-1.txt
deleted file mode 100644 (file)
index 9b770a5..0000000
+++ /dev/null
@@ -1,1500 +0,0 @@
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
diff --git a/libstdc++-v3/testsuite/27_io/istream_unformatted.cc b/libstdc++-v3/testsuite/27_io/istream_unformatted.cc
deleted file mode 100644 (file)
index e7676ec..0000000
+++ /dev/null
@@ -1,639 +0,0 @@
-// 1999-08-11 bkoz
-
-// Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation
-//
-// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// 27.6.1.3 unformatted input functions
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %-*.txt
-
-#include <cstring> // for strncmp,...
-#include <istream>
-#include <sstream>
-#include <fstream>
-#include <testsuite_hooks.h>
-
-int
-test01()
-{
-  typedef std::ios::traits_type traits_type;
-
-  bool test = true;
-  const std::string str_01;
-  const std::string str_02("soul eyes: john coltrane quartet");
-  std::string strtmp;
-
-  std::stringbuf isbuf_03(str_02, std::ios_base::in);
-  std::stringbuf isbuf_04(str_02, std::ios_base::in);
-
-  std::istream is_00(NULL);
-  std::istream is_03(&isbuf_03);
-  std::istream is_04(&isbuf_04);
-  std::ios_base::iostate state1, state2, statefail, stateeof;
-  statefail = std::ios_base::failbit;
-  stateeof = std::ios_base::eofbit;
-
-  // istream& read(char_type* s, streamsize n)
-  char carray[60] = "";
-  state1 = is_04.rdstate();
-  is_04.read(carray, 0);
-  state2 = is_04.rdstate();
-  VERIFY( state1 == state2 );
-
-  state1 = is_04.rdstate();
-  is_04.read(carray, 9);
-  state2 = is_04.rdstate();
-  VERIFY( state1 == state2 );
-  VERIFY( !std::strncmp(carray, "soul eyes", 9) );
-  VERIFY( is_04.peek() == ':' );
-
-  state1 = is_03.rdstate();
-  is_03.read(carray, 60);
-  state2 = is_03.rdstate();
-  VERIFY( state1 != state2 );
-  VERIFY( static_cast<bool>(state2 & stateeof) ); 
-  VERIFY( static_cast<bool>(state2 & statefail) ); 
-  VERIFY( !std::strncmp(carray, "soul eyes: john coltrane quartet", 35) );
-
-
-  // istream& ignore(streamsize n = 1, int_type delim = traits::eof())
-  state1 = is_04.rdstate();
-  is_04.ignore();
-  VERIFY( is_04.gcount() == 1 );
-  state2 = is_04.rdstate();
-  VERIFY( state1 == state2 );
-  VERIFY( is_04.peek() == ' ' );
-
-  state1 = is_04.rdstate();
-  is_04.ignore(0);
-  VERIFY( is_04.gcount() == 0 );
-  state2 = is_04.rdstate();
-  VERIFY( state1 == state2 );
-  VERIFY( is_04.peek() == ' ' );
-
-  state1 = is_04.rdstate();
-  is_04.ignore(5, traits_type::to_int_type(' '));
-  VERIFY( is_04.gcount() == 1 );
-  state2 = is_04.rdstate();
-  VERIFY( state1 == state2 );
-  VERIFY( is_04.peek() == 'j' );
-
-  // int_type peek()
-  state1 = is_04.rdstate();
-  VERIFY( is_04.peek() == 'j' );
-  VERIFY( is_04.gcount() == 0 );
-  state2 = is_04.rdstate();
-  VERIFY( state1 == state2 );
-
-  is_04.ignore(30);
-  state1 = is_04.rdstate();
-  VERIFY( is_04.peek() == traits_type::eof() );
-  VERIFY( is_04.gcount() == 0 );
-  state2 = is_04.rdstate();
-  VERIFY( state1 != state2 );
-
-
-  // istream& putback(char c)
-  is_04.clear();
-  state1 = is_04.rdstate();
-  is_04.putback('|');
-  VERIFY( is_04.gcount() == 0 );
-  state2 = is_04.rdstate();
-  VERIFY( state1 == state2 );
-  VERIFY( is_04.peek() == '|' );
-
-  // istream& unget()
-  is_04.clear();
-  state1 = is_04.rdstate();
-  is_04.unget();
-  VERIFY( is_04.gcount() == 0 );
-  state2 = is_04.rdstate();
-  VERIFY( state1 == state2 );
-  VERIFY( is_04.peek() == 'e' );
-  
-  // int sync()
-  int i = is_00.sync();
-
-#ifdef DEBUG_ASSERT
-  assert(test);
-#endif
-  return 0;
-}
-
-int
-test02()
-{
-  typedef std::char_traits<char>       traits_type;
-
-  bool test = true;
-  const char str_lit01[] = "\t\t\t    sun*ra \n"
-  "                            "
-  "and his myth science arkestra present\n"
-  "                            "
-  "angles and demons @ play\n"
-  "                            "
-  "the nubians of plutonia";
-  std::string str01(str_lit01);
-  std::string strtmp;
-
-  std::stringbuf sbuf_04(str01, std::ios_base::in);
-
-  std::istream is_00(NULL);
-  std::istream is_04(&sbuf_04);
-  std::ios_base::iostate state1, state2, statefail, stateeof;
-  statefail = std::ios_base::failbit;
-  stateeof = std::ios_base::eofbit;
-  std::streamsize count1, count2;
-  char carray1[400] = "";
-
-  // istream& getline(char* s, streamsize n, char delim)
-  // istream& getline(char* s, streamsize n)
-  state1 = is_00.rdstate();
-  is_00.getline(carray1, 20, '*');
-  state2 = is_00.rdstate();
-  // make sure failbit was set, since we couldn't extract
-  // from the NULL streambuf...
-  VERIFY( state1 != state2 );
-  VERIFY( static_cast<bool>(state2 & statefail) );
-  
-  VERIFY( is_04.gcount() == 0 );
-  state1 = is_04.rdstate();
-  is_04.getline(carray1, 1, '\t'); // extracts, throws away
-  state2 = is_04.rdstate();  
-  VERIFY( is_04.gcount() == 1 );
-  VERIFY( state1 == state2 );
-  VERIFY( state1 == 0 );
-  VERIFY( !traits_type::compare("", carray1, 1) );
-
-  state1 = is_04.rdstate();
-  is_04.getline(carray1, 20, '*');
-  state2 = is_04.rdstate();  
-  VERIFY( is_04.gcount() == 10 );
-  VERIFY( state1 == state2 );
-  VERIFY( state1 == 0 );
-  VERIFY( !traits_type::compare("\t\t    sun", carray1, 10) );
-
-  state1 = is_04.rdstate();
-  is_04.getline(carray1, 20);
-  state2 = is_04.rdstate();  
-  VERIFY( is_04.gcount() == 4 );
-  VERIFY( state1 == state2 );
-  VERIFY( state1 == 0 );
-  VERIFY( !traits_type::compare("ra ", carray1, 4) );
-
-  state1 = is_04.rdstate();
-  is_04.getline(carray1, 65);
-  state2 = is_04.rdstate();  
-  VERIFY( is_04.gcount() == 64 );
-  VERIFY( state1 != state2 );
-  VERIFY( state2 == statefail );
-  VERIFY( !traits_type::compare(
-  "                            and his myth science arkestra presen",
-                               carray1, 65) );
-
-  is_04.clear();
-  state1 = is_04.rdstate();
-  is_04.getline(carray1, 120, '|');
-  state2 = is_04.rdstate();  
-  VERIFY( is_04.gcount() == 106 );
-  VERIFY( state1 != state2 );
-  VERIFY( state2 == stateeof );
-
-  is_04.clear();
-  state1 = is_04.rdstate();
-  is_04.getline(carray1, 100, '|');
-  state2 = is_04.rdstate();  
-  VERIFY( is_04.gcount() == 0 ); 
-  VERIFY( state1 != state2 );
-  VERIFY( static_cast<bool>(state2 & stateeof) );
-  VERIFY( static_cast<bool>(state2 & statefail) );
-
-#ifdef DEBUG_ASSERT
-  assert(test);
-#endif
-  return 0;
-}
-
-int
-test03()
-{
-  typedef std::char_traits<char>       traits_type;
-
-  bool test = true;
-  const char str_lit01[] = 
-  "   sun*ra \n\t\t\t   & his arkestra, featuring john gilmore: \n"
-  "                         "
-    "jazz in silhouette: images and forecasts of tomorrow";
-
-  std::string str01(str_lit01);
-  std::string strtmp;
-
-  std::stringbuf sbuf_03;
-  std::stringbuf sbuf_04(str01, std::ios_base::in);
-  std::stringbuf sbuf_05(str01, std::ios_base::in);
-
-  std::istream is_00(NULL);
-  std::istream is_04(&sbuf_04);
-  std::istream is_05(&sbuf_05);
-  std::ios_base::iostate state1, state2, statefail, stateeof;
-  statefail = std::ios_base::failbit;
-  stateeof = std::ios_base::eofbit;
-  std::streamsize count1, count2;
-  char carray1[400] = "";
-
-  // int_type get()
-  // istream& get(char*, streamsize, char delim)
-  // istream& get(char*, streamsize)
-  // istream& get(streambuf&, char delim)
-  // istream& get(streambuf&)
-  is_00.get(carray1, 2);
-  VERIFY( static_cast<bool>(is_00.rdstate() & statefail) ); 
-  VERIFY( is_00.gcount() == 0 );
-
-  is_04.get(carray1, 4);
-  VERIFY( !(is_04.rdstate() & statefail) );
-  VERIFY( !traits_type::compare(carray1, "   ", 4) );
-  VERIFY( is_04.gcount() == 3 );
-
-  is_04.clear();
-  is_04.get(carray1 + 3, 200);
-  VERIFY( !(is_04.rdstate() & statefail) );
-  VERIFY( !(is_04.rdstate() & stateeof) );
-  VERIFY( !traits_type::compare(carray1, str_lit01, 10) );
-  VERIFY( is_04.gcount() == 7 );
-
-  is_04.clear();
-  is_04.get(carray1, 200);
-  VERIFY( !(is_04.rdstate() & stateeof) );
-  VERIFY( static_cast<bool>(is_04.rdstate() & statefail) ); // delimiter
-  VERIFY( is_04.gcount() == 0 );
-  is_04.clear();
-  is_04.get(carray1, 200, '[');
-  VERIFY( static_cast<bool>(is_04.rdstate() & stateeof) );
-  VERIFY( !(is_04.rdstate() & statefail) );
-  VERIFY( is_04.gcount() == 125 );
-  is_04.clear();  
-  is_04.get(carray1, 200);
-  VERIFY( static_cast<bool>(is_04.rdstate() & stateeof) );
-  VERIFY( static_cast<bool>(is_04.rdstate() & statefail) ); 
-  VERIFY( is_04.gcount() == 0 );
-
-  std::stringbuf sbuf_02(std::ios_base::in);
-  is_05.clear();
-  is_05.get(sbuf_02);
-  VERIFY( is_05.gcount() == 0 );
-  VERIFY( static_cast<bool>(is_05.rdstate() & statefail) ); 
-  VERIFY( !(is_05.rdstate() & stateeof) ); 
-
-  is_05.clear();
-  is_05.get(sbuf_03);
-  VERIFY( is_05.gcount() == 10 );
-  VERIFY( sbuf_03.str() == "   sun*ra " );
-  VERIFY( !(is_05.rdstate() & statefail) ); 
-  VERIFY( !(is_05.rdstate() & stateeof) ); 
-
-  is_05.clear();
-  is_05.get(sbuf_03, '|');
-  VERIFY( is_05.gcount() == 125 );
-  VERIFY( sbuf_03.str() == str_lit01 );
-  VERIFY( !(is_05.rdstate() & statefail) ); 
-  VERIFY( static_cast<bool>(is_05.rdstate() & stateeof) ); 
-
-  is_05.clear();
-  is_05.get(sbuf_03, '|');
-  VERIFY( is_05.gcount() == 0 );
-  VERIFY( static_cast<bool>(is_05.rdstate() & stateeof) ); 
-  VERIFY( static_cast<bool>(is_05.rdstate() & statefail) ); 
-
-#ifdef DEBUG_ASSERT
-  assert(test);
-#endif
-  return 0;
-}
-
-// http://gcc.gnu.org/ml/libstdc++/2000-q1/msg00177.html
-int
-test04()
-{
-  bool test = true;
-
-  const std::string str_00("Red_Garland_Qunitet-Soul_Junction");
-  std::string strtmp;
-  char c_array[str_00.size() + 4];
-
-  std::stringbuf isbuf_00(str_00, std::ios_base::in);
-  std::istream is_00(&isbuf_00);
-  std::ios_base::iostate state1, state2, statefail, stateeof;
-  statefail = std::ios_base::failbit;
-  stateeof = std::ios_base::eofbit;
-
-  state1 = stateeof | statefail;
-  VERIFY( is_00.gcount() == 0 );
-  is_00.read(c_array, str_00.size() + 1);
-  VERIFY( is_00.gcount() == str_00.size() );
-  VERIFY( is_00.rdstate() == state1 );
-
-  is_00.read(c_array, str_00.size());
-  VERIFY( is_00.rdstate() == state1 );
-
-#ifdef DEBUG_ASSERT
-  assert(test);
-#endif
-  return 0;
-}
-
-// http://gcc.gnu.org/ml/libstdc++/2000-07/msg00003.html
-int
-test05()
-{
-  const char* charray = "\n"
-"a\n"
-"aa\n"
-"aaa\n"
-"aaaa\n"
-"aaaaa\n"
-"aaaaaa\n"
-"aaaaaaa\n"
-"aaaaaaaa\n"
-"aaaaaaaaa\n"
-"aaaaaaaaaa\n"
-"aaaaaaaaaaa\n"
-"aaaaaaaaaaaa\n"
-"aaaaaaaaaaaaa\n"
-"aaaaaaaaaaaaaa\n";
-
-  bool test = true;
-  const std::streamsize it = 5;
-  std::streamsize br = 0;
-  char tmp[it];
-  std::stringbuf sb(charray, std::ios_base::in);
-  std::istream ifs(&sb);
-  std::streamsize blen = std::strlen(charray);
-  VERIFY(!(!ifs));
-  while(ifs.getline(tmp, it) || ifs.gcount())
-    {
-      br += ifs.gcount();
-      if(ifs.eof())
-        {
-          // Just sanity checks to make sure we've extracted the same
-          // number of chars that were in the streambuf
-          VERIFY(br == blen);
-          // Also, we should only set the failbit if we could
-          // _extract_ no chars from the stream, i.e. the first read
-          // returned EOF. 
-          VERIFY(ifs.fail() && ifs.gcount() == 0);
-        }
-      else if(ifs.fail())
-        {
-         // delimiter not read
-         //
-         // either
-         // -> extracted no characters
-         // or
-         // -> n - 1 characters are stored
-          ifs.clear(ifs.rdstate() & ~std::ios::failbit);
-          VERIFY((ifs.gcount() == 0) || (std::strlen(tmp) == it - 1));
-          VERIFY(!(!ifs));
-          continue;
-        }
-      else 
-        {
-         // delimiter was read.
-         //
-         // -> strlen(__s) < n - 1 
-         // -> delimiter was seen -> gcount() > strlen(__s)
-          VERIFY(ifs.gcount() == std::strlen(tmp) + 1);
-          continue;
-        }
-    }
-
-  return 0;
-}
-
-
-// http://gcc.gnu.org/ml/libstdc++/2000-07/msg00126.html
-int
-test06()
-{
-  using namespace std;
-
-  bool test = true;
-  const streamsize it = 5;
-  char tmp[it];
-  const char* str_lit = "abcd\n";
-
-  stringbuf strbuf(str_lit, std::ios_base::in);
-  istream istr(&strbuf);
-  
-  istr.getline(tmp,it); 
-  VERIFY( istr.gcount() == it );  // extracted whole string
-  VERIFY( strlen(tmp) == 4 );     // stored all but '\n'
-  VERIFY( !istr.eof() );          // extracted up to but not eof
-  VERIFY( !istr.fail() );         // failbit not set
-  
-  char c = 'z';
-  istr.get(c);
-  VERIFY( c == 'z' );
-  VERIFY( istr.eof() );
-
-#ifdef DEBUG_ASSERT
-  assert(test);
-#endif
-  
-  return 0;
-}
-
-// bug reported by bgarcia@laurelnetworks.com
-// http://gcc.gnu.org/ml/libstdc++-prs/2000-q3/msg00041.html
-void
-test07()
-{
-  bool test = true;
-  const char* tfn = "istream_unformatted-1.txt";
-  std::ifstream infile;
-  infile.open(tfn);
-  VERIFY( !(!infile) );
-  while (infile)
-    {
-      std::string line;
-      std::ostringstream line_ss;
-      while (infile.peek() == '\n')
-       infile.get();
-      infile.get(*(line_ss.rdbuf()));
-      line = line_ss.str();
-      VERIFY( line == "1234567890" || line == "" );
-    }
-}
-
-// 2002-04-19 PR libstdc++ 6360
-void
-test08()
-{
-  using namespace std;
-  bool test = true;
-
-  stringstream ss("abcd" "\xFF" "1234ina donna coolbrith");  
-  char c;
-  ss >> c;
-  VERIFY( c == 'a' );
-  ss.ignore(8);
-  ss >> c;
-  VERIFY( c == 'i' );
-}
-    
-// Theodore Papadopoulo 
-void 
-test09()
-{
-  using namespace std;
-  bool test = true;
-
-  istringstream iss("Juana Briones");
-  char tab[13];
-  iss.read(tab, 13);
-  if (!iss)
-    test = false;
-  VERIFY( test );
-}
-
-// libstdc++/70220
-void
-test10()
-{
-  using namespace std;
-  bool test = true;
-  typedef string string_type;
-  typedef stringbuf stringbuf_type;
-  typedef istream istream_type;
-
-  int res = 0;
-  streamsize n;
-  string_type  input("abcdefg\n");
-  stringbuf_type sbuf(input);
-  istream_type  istr(&sbuf);
-  
-  istr.ignore(0);
-  if (istr.gcount() != 0) 
-    test = false;
-  VERIFY( test );
-  
-  istr.ignore(0, 'b');
-  if (istr.gcount() != 0) 
-    test = false;
-  VERIFY( test );
-  
-  istr.ignore();       // Advance to next position.
-  istr.ignore(0, 'b');
-  if ((n=istr.gcount()) != 0) 
-    test = false;
-  VERIFY( test );
-  
-  if (istr.peek() != 'b')
-    test = false;
-  VERIFY( test );
-}
-
-
-// libstdc++/8258
-class mybuf : public std::basic_streambuf<char> 
-{ };
-
-void test11()
-{
-  bool test = true;
-  using namespace std;
-  char arr[10];
-  mybuf sbuf;
-  basic_istream<char, char_traits<char> > istr(&sbuf);
-  
-  VERIFY(istr.rdstate() == ios_base::goodbit);
-  VERIFY(istr.readsome(arr, 10) == 0);
-  VERIFY(istr.rdstate() == ios_base::goodbit);
-}
-
-// libstdc++/6746   
-void test12()
-{
-  using namespace std;
-  bool test = true;
-  streamsize sum = 0;
-  istringstream iss("shamma shamma");
-      
-  // test01
-  size_t i = iss.rdbuf()->in_avail();
-  VERIFY( i != 0 );
-    
-  // test02
-  streamsize extracted;
-  do
-    {
-      char buf[1024];
-      extracted = iss.readsome(buf, sizeof buf);
-      sum += extracted;
-    }
-  while (iss.good() && extracted);
-  VERIFY( sum != 0 );  
-}
-    
-// libstdc++/6746   
-void test13()
-{
-  using namespace std;
-  bool test = true;
-  streamsize sum = 0;
-  ifstream ifs("istream_unformatted-1.tst");
-      
-  // test01
-  size_t i = ifs.rdbuf()->in_avail();
-  VERIFY( i != 0 );
-    
-  // test02
-  streamsize extracted;
-  do
-    {
-      char buf[1024];
-      extracted = ifs.readsome(buf, sizeof buf);
-      sum += extracted;
-    }
-  while (ifs.good() && extracted);
-  VERIFY( sum != 0 );  
-}
-int 
-main()
-{
-  test01();
-  test02();
-  test03();
-  test04();
-  test05();
-  test06();
-  test07();
-  test08();
-  test09();
-  test10();
-  test11();
-
-  test12();
-  test13();
-
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/27_io/istringstream.cc b/libstdc++-v3/testsuite/27_io/istringstream.cc
deleted file mode 100644 (file)
index d119f67..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-// 2002-07-25 Benjamin Kosnik <bkoz@redhat.com>
-
-// Copyright (C) 2002 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// As a special exception, you may use this file as part of a free software
-// library without restriction.  Specifically, if other files instantiate
-// templates or use macros or inline functions from this file, or you compile
-// this file and link it with other files to produce an executable, this
-// file does not by itself cause the resulting executable to be covered by
-// the GNU General Public License.  This exception does not however
-// invalidate any other reasons why the executable file might be covered by
-// the GNU General Public License.
-
-// 27.7.2 - Template class basic_istringstream
-// NB: This file is for testing basic_istringstream with NO OTHER INCLUDES.
-
-#include <sstream>
-
-// { dg-do compile }
-
-// libstdc++/7216
-void test01()
-{
-  // Check for required typedefs
-  typedef std::istringstream test_type;
-  typedef test_type::char_type char_type;
-  typedef test_type::traits_type traits_type;
-  typedef test_type::int_type int_type;
-  typedef test_type::pos_type pos_type;
-  typedef test_type::off_type off_type;
-}
-
-namespace test 
-{
-  using namespace std;
-  typedef short type_t;
-  template class basic_istringstream<type_t, char_traits<type_t> >;
-} // test
-
-int main() 
-{
-  test01();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/27_io/istringstream_members.cc b/libstdc++-v3/testsuite/27_io/istringstream_members.cc
deleted file mode 100644 (file)
index cfc4736..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-// 2000-01-10 bkoz
-
-// Copyright (C) 2000, 2001 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// 27.7.2.2 member functions (istringstream_members)
-
-#include <sstream>
-#include <testsuite_hooks.h>
-
-void test01()
-{
-  bool test = true;
-  std::istringstream is01;
-  const std::string str00; 
-  const std::string str01 = "123";
-  std::string str02;
-  const int i01 = 123;
-  int a,b;
-
-  std::ios_base::iostate state1, state2, statefail, stateeof;
-  statefail = std::ios_base::failbit;
-  stateeof = std::ios_base::eofbit;
-
-  // string str() const
-  str02 = is01.str();
-  VERIFY( str00 == str02 );
-
-  // void str(const basic_string&)
-  is01.str(str01);
-  str02 = is01.str();
-  VERIFY( str01 == str02 );
-  state1 = is01.rdstate();
-  is01 >> a;
-  state2 = is01.rdstate();
-  VERIFY( a = i01 );
-  // 22.2.2.1.2 num_get virtual functions
-  // p 13
-  // in any case, if stage 2 processing was terminated by the test for
-  // in == end then err != ios_base::eofbit is performed.
-  VERIFY( state1 != state2 );
-  VERIFY( state2 == stateeof ); 
-
-  is01.str(str01);
-  is01 >> b;
-  VERIFY( b != a ); 
-  // as is01.good() is false, istream::sentry blocks extraction.
-
-  is01.clear();
-  state1 = is01.rdstate();
-  is01 >> b;
-  state2 = is01.rdstate();
-  VERIFY( b == a ); 
-  VERIFY( state1 != state2 );
-  VERIFY( state2 == stateeof ); 
-
- #ifdef DEBUG_ASSERT
-  assert(test);
-#endif
-}
-
-void 
-redirect_buffer(std::ios& stream, std::streambuf* new_buf) 
-{ stream.rdbuf(new_buf); }
-
-std::streambuf*
-active_buffer(std::ios& stream)
-{ return stream.rdbuf(); }
-
-// libstdc++/2832
-void test02()
-{
-  bool test = true;
-  const char* strlit01 = "fuck war";
-  const char* strlit02 = "two less cars abstract riot crew, critical mass/SF";
-  const std::string str00;
-  const std::string str01(strlit01);
-  std::string str02;
-  std::stringbuf sbuf(str01);
-  std::streambuf* pbasebuf0 = &sbuf;
-
-  std::istringstream sstrm1;
-  VERIFY( sstrm1.str() == str00 );
-  // derived rdbuf() always returns original streambuf, even though
-  // it's no longer associated with the stream.
-  std::stringbuf* const buf1 = sstrm1.rdbuf();
-  // base rdbuf() returns the currently associated streambuf
-  std::streambuf* pbasebuf1 = active_buffer(sstrm1);
-  redirect_buffer(sstrm1, &sbuf);
-  std::stringbuf* const buf2 = sstrm1.rdbuf();
-  std::streambuf* pbasebuf2 = active_buffer(sstrm1);
-  VERIFY( buf1 == buf2 ); 
-  VERIFY( pbasebuf1 != pbasebuf2 );
-  VERIFY( pbasebuf2 == pbasebuf0 );
-
-  // derived rdbuf() returns the original buf, so str() doesn't change.
-  VERIFY( sstrm1.str() != str01 );
-  VERIFY( sstrm1.str() == str00 );
-  // however, casting the active streambuf to a stringbuf shows what's up:
-  std::stringbuf* psbuf = dynamic_cast<std::stringbuf*>(pbasebuf2);
-  str02 = psbuf->str();
-  VERIFY( str02 == str01 );
-
-  // How confusing and non-intuitive is this?
-  // These semantics are a joke, a serious defect, and incredibly lame.
-}
-
-int main()
-{
-  test01();
-  test02();
-  return 0;
-}
-
-
-
diff --git a/libstdc++-v3/testsuite/27_io/manipulators/adjustfield/char/1.cc b/libstdc++-v3/testsuite/27_io/manipulators/adjustfield/char/1.cc
new file mode 100644 (file)
index 0000000..b3901d8
--- /dev/null
@@ -0,0 +1,108 @@
+// 981027 ncm work with libstdc++v3
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+#include <sstream>
+#include <locale>
+#include <iomanip>
+#include <testsuite_hooks.h>
+
+struct MyNP : std::numpunct<char>
+{
+  std::string do_truename() const;
+  std::string do_falsename() const;
+};
+
+std::string MyNP::do_truename()  const 
+{ 
+  std::string s("yea"); 
+  return s; 
+}
+
+std::string MyNP::do_falsename() const 
+{ 
+  std::string s("nay"); 
+  return s; 
+}
+
+void
+test01()
+{
+  bool test = true;
+  const char lit[] = "1 0\ntrue false\n:  true:\n:true  :\n: false:\n:  1:"
+                    "\n:1  :\n:  0:\nyea nay\n:   yea:\n:yea   :\n:   nay:\n";
+  std::ostringstream oss;
+  oss << true << " " << false << std::endl;
+  oss << std::boolalpha;
+  oss << true << " " << false << std::endl;
+
+  oss << ":" << std::setw(6) << std::internal << true << ":" << std::endl;
+  oss << ":" << std::setw(6) << std::left << true << ":" << std::endl;
+  oss << ":" << std::setw(6) << std::right << false << ":" << std::endl;
+  oss << std::noboolalpha;
+  oss << ":" << std::setw(3) << std::internal << true << ":" << std::endl;
+  oss << ":" << std::setw(3) << std::left << true << ":" << std::endl;
+  oss << ":" << std::setw(3) << std::right << false << ":" << std::endl;
+
+  std::locale loc = std::locale (std::locale::classic(), new MyNP);
+  oss.imbue(loc);
+
+  oss << std::boolalpha;
+  oss << true << " " << false << std::endl;
+
+  oss << ":" << std::setw(6) << std::internal << true << ":" << std::endl;
+  oss << ":" << std::setw(6) << std::left << true << ":" << std::endl;
+  oss << ":" << std::setw(6) << std::right << false << ":" << std::endl;
+
+  VERIFY( oss.good() );
+  VERIFY( oss.str() == lit );
+}
+
+int 
+main() 
+{
+  test01();
+  return 0;
+}
+
+// Projected output:
+/*
+1 0
+true false
+:  true:
+:true  :
+: false:
+:  1:
+:1  :
+:  0:
+yea nay
+:   yea:
+:yea   :
+:   nay:
+*/
diff --git a/libstdc++-v3/testsuite/27_io/manipulators/adjustfield/char/2.cc b/libstdc++-v3/testsuite/27_io/manipulators/adjustfield/char/2.cc
new file mode 100644 (file)
index 0000000..12b52aa
--- /dev/null
@@ -0,0 +1,59 @@
+// Copyright (C) 1997, 1998, 1999, 2002 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+#include <sstream>
+#include <locale>
+#include <iomanip>
+#include <testsuite_hooks.h>
+
+void test02()
+{
+  bool                 test = true;
+  const std::string    str_blank;
+  std::string  str_tmp;
+  std::stringbuf       strbuf;
+  std::ostream         o(&strbuf);
+
+  o <<  std::setw(6) <<  std::right << "san";
+  VERIFY( strbuf.str() == "   san" ); 
+  strbuf.str(str_blank);
+
+  o <<  std::setw(6) <<  std::internal << "fran";
+  VERIFY( strbuf.str() == "  fran" ); 
+  strbuf.str(str_blank);
+
+  o << std::setw(6) <<  std::left << "cisco";
+  VERIFY( strbuf.str() == "cisco " ); 
+  strbuf.str(str_blank);
+}
+
+int 
+main() 
+{
+  test02();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/manipulators/basefield/char/1.cc b/libstdc++-v3/testsuite/27_io/manipulators/basefield/char/1.cc
new file mode 100644 (file)
index 0000000..10336f5
--- /dev/null
@@ -0,0 +1,128 @@
+// 981027 ncm work with libstdc++v3
+
+// Copyright (C) 1997, 1998, 1999, 2002 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+#include <sstream>
+#include <locale>
+#include <iomanip>
+#include <testsuite_hooks.h>
+                       
+struct MyNP : std::numpunct<char>
+{
+  std::string do_grouping() const;
+  char   do_thousands_sep() const;
+};
+
+std::string MyNP::do_grouping() const { std::string s("\3"); return s; }
+char   MyNP::do_thousands_sep() const { return ' '; }
+
+
+void test01()
+{
+  bool test = true;
+
+  const char lit[] = "0123 456\n: 01 234 567:\n:0123 456   :\n"
+                     ":    012 345:\n:     01 234:\n:0726 746 425:\n"
+                     ":04 553 207 :\n:   0361 100:\n:       0173:\n"
+                     "0x12 345 678\n|0x000012 345 678|\n|0x12 345 6780000|\n"
+                     "|00000x12 345 678|\n|0x000012 345 678|\n";
+
+  std::ostringstream oss;
+  oss.imbue(std::locale(std::locale(), new MyNP));
+
+  // Octals
+  oss << std::oct << std::showbase;
+  oss << 0123456l << std::endl;
+
+  oss << ":" << std::setw(11);
+  oss << 01234567l << ":" << std::endl;
+
+  oss << ":" << std::setw(11) << std::left;
+  oss << 0123456l << ":" << std::endl;
+
+  oss << ":" << std::setw(11) << std::right;
+  oss << 012345l << ":" << std::endl;
+
+  oss << ":" << std::setw(11) << std::internal;
+  oss << 01234l << ":" << std::endl;
+
+  oss << ":" << std::setw(11);
+  oss << 123456789l << ":" << std::endl;
+
+  oss << ":" << std::setw(11) << std::left;
+  oss << 1234567l << ":" << std::endl;
+
+  oss << ":" << std::setw(11) << std::right;
+  oss << 123456l << ":" << std::endl;
+
+  oss << ":" << std::setw(11) << std::internal;
+  oss << 123l << ":" << std::endl;
+
+  // Hexadecimals
+  oss << std::hex << std::setfill('0');
+  oss << 0x12345678l << std::endl;
+
+  oss << "|" << std::setw(16);
+  oss << 0x12345678l << "|" << std::endl;
+
+  oss << "|" << std::setw(16) << std::left;
+  oss << 0x12345678l << "|" << std::endl;
+
+  oss << "|" << std::setw(16) << std::right;
+  oss << 0x12345678l << "|" << std::endl;
+
+  oss << "|" << std::setw(16) << std::internal;
+  oss << 0x12345678l << "|" << std::endl;
+
+  VERIFY( oss.good() );
+  VERIFY( oss.str() == lit );
+}
+int 
+main() 
+{
+  test01();
+  return 0;
+}
+
+// Projected output:
+/*
+0123 456
+: 01 234 567:
+:0123 456   :
+:    012 345:
+:     01 234:
+:0726 746 425:
+:04 553 207 :
+:   0361 100:
+:       0173:
+0x12 345 678
+|0x000012 345 678|
+|0x12 345 6780000|
+|00000x12 345 678|
+|0x000012 345 678|
+*/
diff --git a/libstdc++-v3/testsuite/27_io/manipulators/standard/char/1.cc b/libstdc++-v3/testsuite/27_io/manipulators/standard/char/1.cc
new file mode 100644 (file)
index 0000000..7182237
--- /dev/null
@@ -0,0 +1,84 @@
+// Copyright (C) 2002 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.3 - Standard manipulators
+
+#include <sstream>
+#include <iomanip>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+  using namespace std;
+  bool test = true;
+
+  string s("john coltrane, a love supreme");
+  istringstream  iss(s);
+  ostringstream  oss;
+
+  // resetiosflags
+  resetiosflags(ios_base::boolalpha);
+  iss >> resetiosflags(ios_base::boolalpha);
+  VERIFY(iss.good());
+  oss << resetiosflags(ios_base::boolalpha);
+  VERIFY(oss.good());
+
+  // setiosflags
+  setiosflags(ios_base::skipws);
+  iss >> setiosflags(ios_base::skipws);
+  VERIFY(iss.good());
+  oss << setiosflags(ios_base::skipws);
+  VERIFY(oss.good());
+
+  // setbase
+  setbase(8);
+  iss >> setbase(8);
+  VERIFY(iss.good());
+  oss << setbase(8);
+  VERIFY(oss.good());
+
+  // setfil
+  setfill('a');
+  iss >>  setfill('a');
+  VERIFY(iss.good());
+  oss << setfill('a');
+  VERIFY(oss.good());
+  // setprecision
+  setprecision(4);
+  iss >> setprecision(4);
+  VERIFY(iss.good());
+  oss << setprecision(4);
+  VERIFY(oss.good());
+  
+  // setprecision
+  setw(7);
+  iss >> setw(7);
+  VERIFY(iss.good());
+  oss << setw(7);
+  VERIFY(oss.good());
+}
+
+
+int
+main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/manipulators/standard/char/2.cc b/libstdc++-v3/testsuite/27_io/manipulators/standard/char/2.cc
new file mode 100644 (file)
index 0000000..b7ee2b4
--- /dev/null
@@ -0,0 +1,69 @@
+// Copyright (C) 2001, 2002 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// Some members need to be explicitly instantiated, so that users can build
+// their own code with -fno-implicit-templates and not suffer from a zillion
+// link errors.
+
+// { dg-options "-fno-implicit-templates" }
+
+#include <fstream>
+#include <istream>
+#include <ostream>
+#include <sstream>
+#include <iomanip>
+#include <testsuite_hooks.h>
+
+
+// PR libstdc++/3829
+void
+test01()
+{
+  using namespace std;
+  bool test = true;
+  string x ("   this is text");
+  istringstream  sin (x);
+  ostringstream  sout;
+
+  // same order as in bits/std_iomanip.h
+  sin >> resetiosflags(ios_base::dec)
+      >> setiosflags(ios_base::dec)
+      >> setbase(ios_base::dec)
+      >> setfill('c')
+      >> setprecision(5)
+      >> setw(20)
+      >> ws;
+  VERIFY(sin.good());
+
+  sout << resetiosflags(ios_base::dec)
+       << setiosflags(ios_base::dec)
+       << setbase(ios_base::dec)
+       << setfill('c')
+       << setprecision(5)
+       << setw(20)
+       << ends << flush << endl;
+  VERIFY(sout.good());
+}
+
+
+int
+main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/narrow_stream_objects.cc b/libstdc++-v3/testsuite/27_io/narrow_stream_objects.cc
deleted file mode 100644 (file)
index 4572530..0000000
+++ /dev/null
@@ -1,239 +0,0 @@
-// 2000-08-02 bkoz
-
-// Copyright (C) 2000, 2001, 2002 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// Include all the headers except for iostream.
-#include <algorithm>
-#include <bitset>
-#include <complex>
-#include <deque>
-#include <exception>
-#include <fstream>
-#include <functional>
-#include <iomanip>
-#include <ios>
-#include <iosfwd>
-#include <istream>
-#include <iterator>
-#include <limits>
-#include <list>
-#include <locale>
-#include <map>
-#include <memory>
-#include <new>
-#include <numeric>
-#include <ostream>
-#include <queue>
-#include <set>
-#include <sstream>
-#include <stack>
-#include <stdexcept>
-#include <streambuf>
-#include <string>
-#include <typeinfo>
-#include <utility>
-#include <valarray>
-#include <vector>
-#include <cassert>
-#include <cctype>
-#include <cerrno>
-#include <cfloat>
-#include <ciso646>
-#include <climits>
-#include <clocale>
-#include <cmath>
-#include <csetjmp>
-#include <csignal>
-#include <cstdarg>
-#include <cstddef>
-#include <cstdio>
-#include <cstdlib>
-#include <cstring>
-#include <ctime>
-#include <testsuite_hooks.h>
-
-// Include iostream last, just to make is as difficult as possible to
-// properly initialize the standard iostream objects.
-#include <iostream>
-
-// Make sure all the standard streams are defined.
-int
-test01()
-{
-  bool test = true;
-
-  char array1[20];
-  typedef std::ios::traits_type ctraits_type;
-  ctraits_type::int_type i = 15;
-  ctraits_type::copy(array1, "testing istream", i);
-  array1[i] = '\0';
-  std::cout << "testing cout" << std::endl;
-  std::cerr << "testing cerr" << std::endl;
-  VERIFY( std::cerr.flags() & std::ios_base::unitbuf );
-  std::clog << "testing clog" << std::endl;
-  // std::cin >> array1; // requires somebody to type something in.
-  VERIFY( std::cin.tie() == &std::cout );
-
-  return 0;
-}
-
-// libstdc++/2523
-void test02()
-{
-  using namespace std;
-  int i;
-  cin >> i;
-  cout << "i == " << i << endl;
-}
-
-// libstdc++/2523
-void test03()
-{
-  using namespace std;
-  ios_base::sync_with_stdio(false);
-
-  int i;
-  cin >> i;
-  cout << "i == " << i << endl;
-}
-
-// Interactive test, to be exercised as follows:
-// assign stderr to stdout in shell command line,
-// pipe stdout to cat process and/or redirect stdout to file.
-// a.out >& output
-// "hello fine world\n" should be written to stdout, and output, in
-// proper order.  This is a version of the scott snyder test taken
-// from: http://gcc.gnu.org/ml/libstdc++/1999-q4/msg00108.html
-void test04()
-{
-  using namespace std;
-
-  cout << "hello ";
-  cout.flush();
-  cerr << "fine ";
-  cerr.flush();
-  cout << "world" << endl;
-  cout.flush();
-}
-
-// Interactive test, to be exercised as follows:
-// run test under truss(1) or strace(1).  Look at
-// size and pattern of write system calls.
-// Should be 2 or 3 write(1,[...]) calls when run interactively
-// depending upon buffering mode enforced.
-void test05()
-{
-  std::cout << "hello" << ' ' << "world" << std::endl;
-  std::cout << "Enter your name: ";
-  std::string s;
-  std::cin >> s;
-  std::cout << "hello " << s << std::endl;
-}
-
-// libstdc++/5280
-// Interactive test: input "1234^D^D" for i should terminate for EOF.
-void test06()
-{
-  using namespace std;
-  int i;
-  cin >> i;
-  if (!cin.good()) 
-    {
-      cerr << endl;
-      cerr << "i == " << i << endl;
-      cerr << "cin.rdstate() == " << cin.rdstate() << endl;
-      cerr << "cin.bad() == " << cin.bad() << endl;      
-      cerr << "cin.fail() == " << cin.fail() << endl;      
-      cerr << "cin.eof() == " << cin.eof() << endl;
-    }   
-  else
-    cerr << "i == " << i << endl;
-}
-
-// libstdc++/6548
-void test07()
-{
-  bool test = true;
-  std::cout << "Enter 'test':";
-  std::string s;
-  std::getline(std::cin, s, '\n');
-  VERIFY( s == "test" );
-}
-
-// libstdc++/6648
-// Interactive tests: each one (run alone) must terminate upon a single '\n'.
-void test08()
-{
-  bool test = true;
-  char buff[2048];
-  std::cout << "Enter name: ";
-  std::cin.getline(buff, 2048);
-}
-
-void test09()
-{
-  bool test = true;
-  std::cout << "Enter favorite beach: ";
-  std::cin.ignore(2048, '\n');
-}
-
-// http://gcc.gnu.org/ml/libstdc++/2002-08/msg00060.html
-// Should only have to hit enter once.
-void
-test10()
-{
-  using namespace std;
-  cout << "Press ENTER once\n";
-  cin.ignore(1);
-  cout << "_M_gcount: "<< cin.gcount() << endl;
-}
-
-// libstdc++/7744
-void test11()
-{
-  std::ios::sync_with_stdio(false);
-
-  std::cout
-    << "\n:: f2() ::\n"
-    << "Type in the characters 'abc' and press <ENTER>: ";
-  std::cin.peek();
-  std::cout
-    << "The number of unread characters should be 4 (a, b, c, \\n): "
-    << std::cin.rdbuf()->in_avail()
-    << '\n';
-}
-
-int 
-main()
-{
-  test01();
-
-  // test02();
-  // test03();
-  // test04();
-  // test05();
-  // test06();
-  // test07();
-  // test08();
-  // test09();
-  // test10();
-  // test11();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/27_io/objects/char/1.cc b/libstdc++-v3/testsuite/27_io/objects/char/1.cc
new file mode 100644 (file)
index 0000000..6ab05e8
--- /dev/null
@@ -0,0 +1,98 @@
+// 2000-08-02 bkoz
+
+// Copyright (C) 2000, 2001, 2002 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// Include all the headers except for iostream.
+#include <algorithm>
+#include <bitset>
+#include <complex>
+#include <deque>
+#include <exception>
+#include <fstream>
+#include <functional>
+#include <iomanip>
+#include <ios>
+#include <iosfwd>
+#include <istream>
+#include <iterator>
+#include <limits>
+#include <list>
+#include <locale>
+#include <map>
+#include <memory>
+#include <new>
+#include <numeric>
+#include <ostream>
+#include <queue>
+#include <set>
+#include <sstream>
+#include <stack>
+#include <stdexcept>
+#include <streambuf>
+#include <string>
+#include <typeinfo>
+#include <utility>
+#include <valarray>
+#include <vector>
+#include <cassert>
+#include <cctype>
+#include <cerrno>
+#include <cfloat>
+#include <ciso646>
+#include <climits>
+#include <clocale>
+#include <cmath>
+#include <csetjmp>
+#include <csignal>
+#include <cstdarg>
+#include <cstddef>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <ctime>
+#include <testsuite_hooks.h>
+
+// Include iostream last, just to make is as difficult as possible to
+// properly initialize the standard iostream objects.
+#include <iostream>
+
+// Make sure all the standard streams are defined.
+void test01()
+{
+  bool test = true;
+
+  char array1[20];
+  typedef std::ios::traits_type ctraits_type;
+  ctraits_type::int_type i = 15;
+  ctraits_type::copy(array1, "testing istream", i);
+  array1[i] = '\0';
+  std::cout << "testing cout" << std::endl;
+  std::cerr << "testing cerr" << std::endl;
+  VERIFY( std::cerr.flags() & std::ios_base::unitbuf );
+  std::clog << "testing clog" << std::endl;
+  // std::cin >> array1; // requires somebody to type something in.
+  VERIFY( std::cin.tie() == &std::cout );
+}
+
+int 
+main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/objects/char/2.cc b/libstdc++-v3/testsuite/27_io/objects/char/2.cc
new file mode 100644 (file)
index 0000000..912d3cc
--- /dev/null
@@ -0,0 +1,47 @@
+// 2000-08-02 bkoz
+
+// Copyright (C) 2000, 2001, 2002 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+#include <iostream>
+
+// Interactive test, to be exercised as follows:
+// assign stderr to stdout in shell command line,
+// pipe stdout to cat process and/or redirect stdout to file.
+// a.out >& output
+// "hello fine world\n" should be written to stdout, and output, in
+// proper order.  This is a version of the scott snyder test taken
+// from: http://gcc.gnu.org/ml/libstdc++/1999-q4/msg00108.html
+void test04()
+{
+  using namespace std;
+
+  cout << "hello ";
+  cout.flush();
+  cerr << "fine ";
+  cerr.flush();
+  cout << "world" << endl;
+  cout.flush();
+}
+
+int 
+main()
+{
+  test04();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/objects/char/2523-1_xin.cc b/libstdc++-v3/testsuite/27_io/objects/char/2523-1_xin.cc
new file mode 100644 (file)
index 0000000..32acbb2
--- /dev/null
@@ -0,0 +1,89 @@
+// 2000-08-02 bkoz
+
+// Copyright (C) 2000, 2001, 2002 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// Include all the headers except for iostream.
+#include <algorithm>
+#include <bitset>
+#include <complex>
+#include <deque>
+#include <exception>
+#include <fstream>
+#include <functional>
+#include <iomanip>
+#include <ios>
+#include <iosfwd>
+#include <istream>
+#include <iterator>
+#include <limits>
+#include <list>
+#include <locale>
+#include <map>
+#include <memory>
+#include <new>
+#include <numeric>
+#include <ostream>
+#include <queue>
+#include <set>
+#include <sstream>
+#include <stack>
+#include <stdexcept>
+#include <streambuf>
+#include <string>
+#include <typeinfo>
+#include <utility>
+#include <valarray>
+#include <vector>
+#include <cassert>
+#include <cctype>
+#include <cerrno>
+#include <cfloat>
+#include <ciso646>
+#include <climits>
+#include <clocale>
+#include <cmath>
+#include <csetjmp>
+#include <csignal>
+#include <cstdarg>
+#include <cstddef>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <ctime>
+#include <testsuite_hooks.h>
+
+// Include iostream last, just to make is as difficult as possible to
+// properly initialize the standard iostream objects.
+#include <iostream>
+
+// libstdc++/2523
+void test02()
+{
+  using namespace std;
+  int i;
+  cin >> i;
+  cout << "i == " << i << endl;
+}
+
+int 
+main()
+{
+  test02();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/objects/char/2523-1_xin.in b/libstdc++-v3/testsuite/27_io/objects/char/2523-1_xin.in
new file mode 100644 (file)
index 0000000..ec30809
--- /dev/null
@@ -0,0 +1 @@
+5588885 
diff --git a/libstdc++-v3/testsuite/27_io/objects/char/2523-2_xin.cc b/libstdc++-v3/testsuite/27_io/objects/char/2523-2_xin.cc
new file mode 100644 (file)
index 0000000..6a2429a
--- /dev/null
@@ -0,0 +1,39 @@
+// 2000-08-02 bkoz
+
+// Copyright (C) 2000, 2001, 2002 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+#include <iostream>
+
+// libstdc++/2523
+void test03()
+{
+  using namespace std;
+  ios_base::sync_with_stdio(false);
+
+  int i;
+  cin >> i;
+  cout << "i == " << i << endl;
+}
+
+int 
+main()
+{
+  test03();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/objects/char/2523-2_xin.in b/libstdc++-v3/testsuite/27_io/objects/char/2523-2_xin.in
new file mode 100644 (file)
index 0000000..aaee5e5
--- /dev/null
@@ -0,0 +1 @@
+33332
diff --git a/libstdc++-v3/testsuite/27_io/objects/char/3045.cc b/libstdc++-v3/testsuite/27_io/objects/char/3045.cc
new file mode 100644 (file)
index 0000000..ad190d0
--- /dev/null
@@ -0,0 +1,86 @@
+// 2001-06-05 Benjamin Kosnik  <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+#include <fstream>
+#include <iostream>
+#include <testsuite_hooks.h>
+
+class gnu_filebuf: public std::filebuf
+{
+  int i;
+public:
+  gnu_filebuf(int j = 1): i(j) { }
+  ~gnu_filebuf() { --i; }
+  int get_i() { return i;}
+};
+
+const int initial = 4;
+gnu_filebuf buf(initial);
+
+// libstdc++/3045, in a vague way.
+void test01()
+{
+  bool test = true;
+  int k1;
+
+  // 1 normal
+  k1 = buf.get_i();
+  VERIFY( k1 == initial );
+  {
+    std::cout.rdbuf(&buf);
+  }
+  k1 = buf.get_i();
+  VERIFY( k1 == initial );
+
+  // 2 syncd off
+  k1 = buf.get_i();
+  VERIFY( k1 == initial );
+  {
+    std::cout.rdbuf(&buf);
+    std::ios_base::sync_with_stdio(false); // make sure doesn't clobber buf
+  }
+  k1 = buf.get_i();
+  VERIFY( k1 == initial );
+
+  // 3 callling init
+  k1 = buf.get_i();
+  VERIFY( k1 == initial );
+  {
+    std::cout.rdbuf(&buf);
+    std::ios_base::Init make_sure_initialized;
+  }
+  k1 = buf.get_i();
+  VERIFY( k1 == initial );
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/objects/char/3647.cc b/libstdc++-v3/testsuite/27_io/objects/char/3647.cc
new file mode 100644 (file)
index 0000000..4cdcc82
--- /dev/null
@@ -0,0 +1,46 @@
+// 2002-01-08 bkoz
+
+// Copyright (C) 2002 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 27.6.1.5 - Template class basic_iostream
+// NB: This file is for testing iostream with NO OTHER INCLUDES.
+
+#include <iostream>
+
+// libstdc++/3647
+void test07()
+{
+  // Should not block.
+  std::cout << std::cin.rdbuf()->in_avail() << std::endl;
+}
+
+int main() 
+{
+  test07();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/objects/char/3_xin.cc b/libstdc++-v3/testsuite/27_io/objects/char/3_xin.cc
new file mode 100644 (file)
index 0000000..b40b4c4
--- /dev/null
@@ -0,0 +1,42 @@
+// 2000-08-02 bkoz
+
+// Copyright (C) 2000, 2001, 2002 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+#include <iostream>
+
+// Interactive test, to be exercised as follows:
+// run test under truss(1) or strace(1).  Look at
+// size and pattern of write system calls.
+// Should be 2 or 3 write(1,[...]) calls when run interactively
+// depending upon buffering mode enforced.
+void test05()
+{
+  std::cout << "hello" << ' ' << "world" << std::endl;
+  std::cout << "Enter your name: ";
+  std::string s;
+  std::cin >> s;
+  std::cout << "hello " << s << std::endl;
+}
+
+int 
+main()
+{
+  test05();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/objects/char/3_xin.in b/libstdc++-v3/testsuite/27_io/objects/char/3_xin.in
new file mode 100644 (file)
index 0000000..a26c126
--- /dev/null
@@ -0,0 +1 @@
+JOHN HUME and DAVID TRIMBLE
diff --git a/libstdc++-v3/testsuite/27_io/objects/char/4_xin.cc b/libstdc++-v3/testsuite/27_io/objects/char/4_xin.cc
new file mode 100644 (file)
index 0000000..ae0d863
--- /dev/null
@@ -0,0 +1,39 @@
+// 2000-08-02 bkoz
+
+// Copyright (C) 2000, 2001, 2002 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+#include <iostream>
+
+// http://gcc.gnu.org/ml/libstdc++/2002-08/msg00060.html
+// Should only have to hit enter once.
+void
+test10()
+{
+  using namespace std;
+  cout << "Press ENTER once\n";
+  cin.ignore(1);
+  cout << "_M_gcount: "<< cin.gcount() << endl;
+}
+
+int 
+main()
+{
+  test10();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/objects/char/4_xin.in b/libstdc++-v3/testsuite/27_io/objects/char/4_xin.in
new file mode 100644 (file)
index 0000000..8b13789
--- /dev/null
@@ -0,0 +1 @@
+
diff --git a/libstdc++-v3/testsuite/27_io/objects/char/5268.cc b/libstdc++-v3/testsuite/27_io/objects/char/5268.cc
new file mode 100644 (file)
index 0000000..36f9019
--- /dev/null
@@ -0,0 +1,45 @@
+// 2001-06-05 Benjamin Kosnik  <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+#include <sstream>
+#include <iostream>
+
+// libstdc++/5268
+void test04()
+{
+  std::stringbuf b1;
+  std::cout.rdbuf( &b1 );
+  std::cout << "hello\n";
+}
+
+int main()
+{
+  test04();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/objects/char/5280_xin.cc b/libstdc++-v3/testsuite/27_io/objects/char/5280_xin.cc
new file mode 100644 (file)
index 0000000..82830a9
--- /dev/null
@@ -0,0 +1,48 @@
+// 2000-08-02 bkoz
+
+// Copyright (C) 2000, 2001, 2002 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+#include <iostream>
+
+// libstdc++/5280
+// Interactive test: input "1234^D^D" for i should terminate for EOF.
+void test06()
+{
+  using namespace std;
+  int i;
+  cin >> i;
+  if (!cin.good()) 
+    {
+      cerr << endl;
+      cerr << "i == " << i << endl;
+      cerr << "cin.rdstate() == " << cin.rdstate() << endl;
+      cerr << "cin.bad() == " << cin.bad() << endl;      
+      cerr << "cin.fail() == " << cin.fail() << endl;      
+      cerr << "cin.eof() == " << cin.eof() << endl;
+    }   
+  else
+    cerr << "i == " << i << endl;
+}
+
+int 
+main()
+{
+  test06();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/objects/char/5280_xin.in b/libstdc++-v3/testsuite/27_io/objects/char/5280_xin.in
new file mode 100644 (file)
index 0000000..274c005
--- /dev/null
@@ -0,0 +1 @@
+1234
\ No newline at end of file
diff --git a/libstdc++-v3/testsuite/27_io/objects/char/6548_xin.cc b/libstdc++-v3/testsuite/27_io/objects/char/6548_xin.cc
new file mode 100644 (file)
index 0000000..ce6133b
--- /dev/null
@@ -0,0 +1,39 @@
+// 2000-08-02 bkoz
+
+// Copyright (C) 2000, 2001, 2002 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+#include <iostream>
+#include <testsuite_hooks.h>
+
+// libstdc++/6548
+void test07()
+{
+  bool test = true;
+  std::cout << "Enter 'test':";
+  std::string s;
+  std::getline(std::cin, s, '\n');
+  VERIFY( s == "test" );
+}
+
+int 
+main()
+{
+  test07();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/objects/char/6548_xin.in b/libstdc++-v3/testsuite/27_io/objects/char/6548_xin.in
new file mode 100644 (file)
index 0000000..9daeafb
--- /dev/null
@@ -0,0 +1 @@
+test
diff --git a/libstdc++-v3/testsuite/27_io/objects/char/6648-1_xin.cc b/libstdc++-v3/testsuite/27_io/objects/char/6648-1_xin.cc
new file mode 100644 (file)
index 0000000..9802f09
--- /dev/null
@@ -0,0 +1,38 @@
+// 2000-08-02 bkoz
+
+// Copyright (C) 2000, 2001, 2002 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+#include <iostream>
+
+// libstdc++/6648
+// Interactive tests: each one (run alone) must terminate upon a single '\n'.
+void test08()
+{
+  bool test = true;
+  char buff[2048];
+  std::cout << "Enter name: ";
+  std::cin.getline(buff, 2048);
+}
+
+int 
+main()
+{
+  test08();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/objects/char/6648-1_xin.in b/libstdc++-v3/testsuite/27_io/objects/char/6648-1_xin.in
new file mode 100644 (file)
index 0000000..9dd5f1f
--- /dev/null
@@ -0,0 +1 @@
+Kofi A. Annan
diff --git a/libstdc++-v3/testsuite/27_io/objects/char/6648-2_xin.cc b/libstdc++-v3/testsuite/27_io/objects/char/6648-2_xin.cc
new file mode 100644 (file)
index 0000000..e25a8c3
--- /dev/null
@@ -0,0 +1,35 @@
+// 2000-08-02 bkoz
+
+// Copyright (C) 2000, 2001, 2002 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+#include <iostream>
+
+void test09()
+{
+  bool test = true;
+  std::cout << "Enter favorite beach: ";
+  std::cin.ignore(2048, '\n');
+}
+
+int 
+main()
+{
+  test09();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/objects/char/6648-2_xin.in b/libstdc++-v3/testsuite/27_io/objects/char/6648-2_xin.in
new file mode 100644 (file)
index 0000000..0b2c7cf
--- /dev/null
@@ -0,0 +1 @@
+Oak St. Beach, Chicago
diff --git a/libstdc++-v3/testsuite/27_io/objects/char/7744_xin.cc b/libstdc++-v3/testsuite/27_io/objects/char/7744_xin.cc
new file mode 100644 (file)
index 0000000..977af9a
--- /dev/null
@@ -0,0 +1,42 @@
+// 2000-08-02 bkoz
+
+// Copyright (C) 2000, 2001, 2002 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+#include <iostream>
+#include <testsuite_hooks.h>
+
+// libstdc++/7744
+void test11()
+{
+  bool test = true;
+  std::ios::sync_with_stdio(false);
+
+  std::cout << "Type in the characters 'abc' and press <ENTER>: ";
+  std::cin.peek();
+  // The number of unread characters should be 4 (a, b, c, \\n)
+  VERIFY( 4 == std::cin.rdbuf()->in_avail() );
+}
+
+int 
+main()
+{
+  test11();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/objects/char/7744_xin.in b/libstdc++-v3/testsuite/27_io/objects/char/7744_xin.in
new file mode 100644 (file)
index 0000000..8baef1b
--- /dev/null
@@ -0,0 +1 @@
+abc
diff --git a/libstdc++-v3/testsuite/27_io/objects/wchar_t/1.cc b/libstdc++-v3/testsuite/27_io/objects/wchar_t/1.cc
new file mode 100644 (file)
index 0000000..bd946ed
--- /dev/null
@@ -0,0 +1,101 @@
+// 2000-08-02 bkoz
+
+// Copyright (C) 2000, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// Include all the headers except for iostream.
+#include <algorithm>
+#include <bitset>
+#include <complex>
+#include <deque>
+#include <exception>
+#include <fstream>
+#include <functional>
+#include <iomanip>
+#include <ios>
+#include <iosfwd>
+#include <istream>
+#include <iterator>
+#include <limits>
+#include <list>
+#include <locale>
+#include <map>
+#include <memory>
+#include <new>
+#include <numeric>
+#include <ostream>
+#include <queue>
+#include <set>
+#include <sstream>
+#include <stack>
+#include <stdexcept>
+#include <streambuf>
+#include <string>
+#include <typeinfo>
+#include <utility>
+#include <valarray>
+#include <vector>
+#include <cassert>
+#include <cctype>
+#include <cerrno>
+#include <cfloat>
+#include <ciso646>
+#include <climits>
+#include <clocale>
+#include <cmath>
+#include <csetjmp>
+#include <csignal>
+#include <cstdarg>
+#include <cstddef>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <ctime>
+#include <cwchar>
+#include <cwctype>
+#include <testsuite_hooks.h>
+
+// Include iostream last, just to make is as difficult as possible to
+// properly initialize the standard iostream objects.
+#include <iostream>
+
+// Make sure all the standard streams are defined.
+void
+test01()
+{
+  bool test = true;
+
+  wchar_t array2[20];
+  typedef std::wios::traits_type wtraits_type;
+  wtraits_type::int_type wi = 15;
+  wtraits_type::copy(array2, L"testing istream", wi);
+  std::wcout << L"testing wcout" << std::endl;
+  std::wcerr << L"testing wcerr" << std::endl;
+  VERIFY( std::wcerr.flags() & std::ios_base::unitbuf );
+  std::wclog << L"testing wclog" << std::endl;
+  // std::wcin >> array2; // requires somebody to type something in.
+  VERIFY( std::wcin.tie() == &std::wcout );
+}
+
+
+int 
+main()
+{
+  test01();  
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/ofstream.cc b/libstdc++-v3/testsuite/27_io/ofstream.cc
deleted file mode 100644 (file)
index 6b9d07d..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-// 2002-07-25 Benjamin Kosnik <bkoz@redhat.com>
-
-// Copyright (C) 2002 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// As a special exception, you may use this file as part of a free software
-// library without restriction.  Specifically, if other files instantiate
-// templates or use macros or inline functions from this file, or you compile
-// this file and link it with other files to produce an executable, this
-// file does not by itself cause the resulting executable to be covered by
-// the GNU General Public License.  This exception does not however
-// invalidate any other reasons why the executable file might be covered by
-// the GNU General Public License.
-
-// 27.8.1.8 - Template class basic_ofstream
-// NB: This file is for testing basic_ofstream with NO OTHER INCLUDES.
-
-#include <fstream>
-
-// { dg-do compile }
-
-// libstdc++/7216
-void test01()
-{
-  // Check for required typedefs
-  typedef std::ifstream test_type;
-  typedef test_type::char_type char_type;
-  typedef test_type::traits_type traits_type;
-  typedef test_type::int_type int_type;
-  typedef test_type::pos_type pos_type;
-  typedef test_type::off_type off_type;
-}
-
-namespace test 
-{
-  using namespace std;
-  typedef short type_t;
-  template class basic_ifstream<type_t, char_traits<type_t> >;
-} // test
-
-int main() 
-{
-  test01();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/27_io/ofstream_members-1.tst b/libstdc++-v3/testsuite/27_io/ofstream_members-1.tst
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/libstdc++-v3/testsuite/27_io/ofstream_members.cc b/libstdc++-v3/testsuite/27_io/ofstream_members.cc
deleted file mode 100644 (file)
index 79c86e1..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-// Copyright (C) 2000, 2001 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// 27.8.1.10 ofstream member functions
-// @require@ %-*.tst
-// @diff@ %-*.tst %-*.txt
-
-#include <ostream>
-#include <fstream>
-#include <testsuite_hooks.h>
-
-const char name_01[] = "ofstream_members-1.tst";
-const char name_02[] = "ofstream_members-1.txt";
-
-// http://gcc.gnu.org/ml/libstdc++/2000-06/msg00136.html
-bool test00()
-{
-  bool test = true;
-  std::ofstream ofs1;
-  ofs1.close();
-  
-  // false as expected:
-  VERIFY( !ofs1.is_open() );
-   // this is now true:
-  VERIFY( !(ofs1) );
-  
-  ofs1.open(name_02);
-  VERIFY( ofs1.is_open() );
-  // fail bit still true
-  VERIFY( !(ofs1) );
-  VERIFY( ofs1.rdstate() == std::ios_base::failbit );
-
-  ofs1.close();
-
-#ifdef DEBUG_ASSERT
-  assert(test);
-#endif
-  
-  return test;
-}
-
-
-// http://gcc.gnu.org/ml/libstdc++/2000-07/msg00004.html
-bool test01()
-{
-  bool test = true;
-  const int more_than_max_open_files = 8200;
-  
-  for(int i = 0; ++i < more_than_max_open_files;)
-    {
-      std::ofstream ifs(name_02);
-      VERIFY( static_cast<bool>(ifs) );
-    }
-
-#ifdef DEBUG_ASSERT
-  assert(test);
-#endif
-  return test;
-}
-
-void 
-redirect_buffer(std::ios& stream, std::streambuf* new_buf) 
-{ stream.rdbuf(new_buf); }
-
-std::streambuf*
-active_buffer(std::ios& stream)
-{ return stream.rdbuf(); }
-
-// libstdc++/2832
-void test02()
-{
-  bool test = true;
-  const char* strlit01 = "fuck war";
-  const char* strlit02 = "two less cars abstract riot crew, critical mass/SF";
-  const std::string str00;
-  const std::string str01(strlit01);
-  std::string str02;
-  std::filebuf fbuf;
-  std::streambuf* pbasebuf0 = &fbuf;
-
-  std::ofstream sstrm1;
-  // derived rdbuf() always returns original streambuf, even though
-  // it's no longer associated with the stream.
-  std::filebuf* const buf1 = sstrm1.rdbuf();
-  // base rdbuf() returns the currently associated streambuf
-  std::streambuf* pbasebuf1 = active_buffer(sstrm1);
-  redirect_buffer(sstrm1, &fbuf);
-  std::filebuf* const buf2 = sstrm1.rdbuf();
-  std::streambuf* pbasebuf2 = active_buffer(sstrm1);
-  VERIFY( buf1 == buf2 ); 
-  VERIFY( pbasebuf1 != pbasebuf2 );
-  VERIFY( pbasebuf2 == pbasebuf0 );
-
-  // How confusing and non-intuitive is this?
-  // These semantics are a joke, a serious defect, and incredibly lame.
-}
-
-int main()
-{
-  test00();
-  test01();
-
-  test02();
-  return 0;
-}
-
-
-
diff --git a/libstdc++-v3/testsuite/27_io/ostream.cc b/libstdc++-v3/testsuite/27_io/ostream.cc
deleted file mode 100644 (file)
index 7efd653..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-// 1999-09-20 bkoz
-
-// Copyright (C) 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// As a special exception, you may use this file as part of a free software
-// library without restriction.  Specifically, if other files instantiate
-// templates or use macros or inline functions from this file, or you compile
-// this file and link it with other files to produce an executable, this
-// file does not by itself cause the resulting executable to be covered by
-// the GNU General Public License.  This exception does not however
-// invalidate any other reasons why the executable file might be covered by
-// the GNU General Public License.
-
-// 27.6.2.1 basic_ostream
-// NB: This file is for testing ostream with NO OTHER INCLUDES.
-
-#include <ostream>
-#include <testsuite_hooks.h>
-
-// { dg-do compile }
-
-// libstdc++/7216
-void test01()
-{
-  // Check for required typedefs
-  typedef std::ostream test_type;
-  typedef test_type::char_type char_type;
-  typedef test_type::traits_type traits_type;
-  typedef test_type::int_type int_type;
-  typedef test_type::pos_type pos_type;
-  typedef test_type::off_type off_type;
-}
-
-namespace test 
-{
-  using namespace std;
-  using __gnu_cxx_test::pod_char;
-  typedef short type_t;
-  template class basic_ostream<type_t, char_traits<type_t> >;
-  template class basic_ostream<pod_char, char_traits<pod_char> >;
-} // test
-
-int main() 
-{
-  test01();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/27_io/ostream_exception.cc b/libstdc++-v3/testsuite/27_io/ostream_exception.cc
deleted file mode 100644 (file)
index 8c2b340..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-// 2003-03-08  Jerry Quinn  <jlquinn@optonline.net>
-
-// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-#include <ostream>
-#include <streambuf>
-#include <testsuite_hooks.h>
-
-// libstdc++/9561
-struct foobar: std::exception { };
-
-struct buf: std::streambuf
-{
-    virtual int_type overflow (int_type) {
-        throw foobar ();
-        return -1;
-    }
-};
-
-void test01()
-{
-  using namespace std;
-  bool test = true;
-
-  buf b;
-  std::ostream strm (&b);
-  strm.exceptions (std::ios::badbit);
-
-  try {
-    strm << std::endl;
-  }
-  catch (foobar) {
-    // strm should throw foobar and not do anything else
-    VERIFY(strm.bad());
-    return;
-  }
-  catch (...) {
-    VERIFY(false);
-    return;
-  }
-
-  VERIFY(false);
-}
-
-
-int main()
-{
-  test01();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/27_io/ostream_fail.cc b/libstdc++-v3/testsuite/27_io/ostream_fail.cc
deleted file mode 100644 (file)
index 77b29ea..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-// 2003-02-24 Petur Runolfsson <peturr02 at ru dot is>
-
-// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-#include <ostream>
-#include <streambuf>
-#include <testsuite_hooks.h>
-
-// libstdc++/9827
-class Buf : public std::streambuf
-{
-};
-
-bool test01()
-{
-  using namespace std;
-  bool test = true;
-
-  Buf buf;
-  ostream stream (&buf);
-
-  stream << 1;
-  VERIFY(!stream.good());
-
-#ifdef DEBUG_ASSERT
-  assert(test);
-#endif
-
-  return test;
-}
-
-
-int main()
-{
-  test01();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/27_io/ostream_inserter_arith.cc b/libstdc++-v3/testsuite/27_io/ostream_inserter_arith.cc
deleted file mode 100644 (file)
index 2523ab6..0000000
+++ /dev/null
@@ -1,409 +0,0 @@
-// 1999-11-15 Kevin Ediger  <kediger@licor.com>
-// test the floating point inserters (facet num_put)
-
-// Copyright (C) 1999, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-#include <cstdio> // for sprintf
-#include <cmath> // for abs
-#include <cfloat> // for DBL_EPSILON
-#include <iostream>
-#include <iomanip>
-#include <locale>
-#include <sstream>
-#include <limits>
-#include <testsuite_hooks.h>
-
-using namespace std;
-
-#ifndef DEBUG_ASSERT
-#  define TEST_NUMPUT_VERBOSE 1
-#endif
-
-struct _TestCase
-{
-  double val;
-    
-  int precision;
-  int width;
-  char decimal;
-  char fill;
-
-  bool fixed;
-  bool scientific;
-  bool showpos;
-  bool showpoint;
-  bool uppercase;
-  bool internal;
-  bool left;
-  bool right;
-
-  const char* result;
-#if _GLIBCPP_USE_WCHAR_T
-  const wchar_t* wresult;
-#endif
-};
-
-static bool T=true;
-static bool F=false;
-
-static _TestCase testcases[] =
-{
-#if _GLIBCPP_USE_WCHAR_T
-  // standard output (no formatting applied) 1-4
-  { 1.2, 6,0,'.',' ', F,F,F,F,F,F,F,F, "1.2",L"1.2" },
-  { 54, 6,0,'.',' ', F,F,F,F,F,F,F,F, "54",L"54" },
-  { -.012, 6,0,'.',' ', F,F,F,F,F,F,F,F, "-0.012",L"-0.012" },
-  { -.00000012, 6,0,'.',' ', F,F,F,F,F,F,F,F, "-1.2e-07",L"-1.2e-07" },
-    
-  // fixed formatting 5-11
-  { 10.2345, 0,0,'.',' ', T,F,F,F,F,F,F,F, "10",L"10" },
-  { 10.2345, 0,0,'.',' ', T,F,F,T,F,F,F,F, "10.",L"10." },
-  { 10.2345, 1,0,'.',' ', T,F,F,F,F,F,F,F, "10.2",L"10.2" },
-  { 10.2345, 4,0,'.',' ', T,F,F,F,F,F,F,F, "10.2345",L"10.2345" },
-  { 10.2345, 6,0,'.',' ', T,F,T,F,F,F,F,F, "+10.234500",L"+10.234500" },
-  { -10.2345, 6,0,'.',' ', T,F,F,F,F,F,F,F, "-10.234500",L"-10.234500" },
-  { -10.2345, 6,0,',',' ', T,F,F,F,F,F,F,F, "-10,234500",L"-10,234500" },
-
-  // fixed formatting with width 12-22
-  { 10.2345, 4,5,'.',' ', T,F,F,F,F,F,F,F, "10.2345",L"10.2345" },
-  { 10.2345, 4,6,'.',' ', T,F,F,F,F,F,F,F, "10.2345",L"10.2345" },
-  { 10.2345, 4,7,'.',' ', T,F,F,F,F,F,F,F, "10.2345",L"10.2345" },
-  { 10.2345, 4,8,'.',' ', T,F,F,F,F,F,F,F, " 10.2345",L" 10.2345" },
-  { 10.2345, 4,10,'.',' ', T,F,F,F,F,F,F,F, "   10.2345",L"   10.2345" },
-  { 10.2345, 4,10,'.',' ', T,F,F,F,F,F,T,F, "10.2345   ",L"10.2345   " },
-  { 10.2345, 4,10,'.',' ', T,F,F,F,F,F,F,T, "   10.2345",L"   10.2345" },
-  { 10.2345, 4,10,'.',' ', T,F,F,F,F,T,F,F, "   10.2345",L"   10.2345" },
-  { -10.2345, 4,10,'.',' ', T,F,F,F,F,T,F,F, "-  10.2345",L"-  10.2345" },
-  { -10.2345, 4,10,'.','A', T,F,F,F,F,T,F,F, "-AA10.2345",L"-AA10.2345" },
-  { 10.2345, 4,10,'.','#', T,F,T,F,F,T,F,F, "+##10.2345",L"+##10.2345" },
-
-  // scientific formatting 23-29
-  { 1.23e+12, 1,0,'.',' ', F,T,F,F,F,F,F,F, "1.2e+12",L"1.2e+12" },
-  { 1.23e+12, 1,0,'.',' ', F,T,F,F,T,F,F,F, "1.2E+12",L"1.2E+12" },
-  { 1.23e+12, 2,0,'.',' ', F,T,F,F,F,F,F,F, "1.23e+12",L"1.23e+12" },
-  { 1.23e+12, 3,0,'.',' ', F,T,F,F,F,F,F,F, "1.230e+12",L"1.230e+12" },
-  { 1.23e+12, 3,0,'.',' ', F,T,T,F,F,F,F,F, "+1.230e+12",L"+1.230e+12" },
-  { -1.23e-12, 3,0,'.',' ', F,T,F,F,F,F,F,F, "-1.230e-12",L"-1.230e-12" },
-  { 1.23e+12, 3,0,',',' ', F,T,F,F,F,F,F,F, "1,230e+12",L"1,230e+12" },
-#else
-  // standard output (no formatting applied)
-  { 1.2, 6,0,'.',' ', F,F,F,F,F,F,F,F, "1.2" },
-  { 54, 6,0,'.',' ', F,F,F,F,F,F,F,F, "54" },
-  { -.012, 6,0,'.',' ', F,F,F,F,F,F,F,F, "-0.012" },
-  { -.00000012, 6,0,'.',' ', F,F,F,F,F,F,F,F, "-1.2e-07" },
-    
-  // fixed formatting
-  { 10.2345, 0,0,'.',' ', T,F,F,F,F,F,F,F, "10" },
-  { 10.2345, 0,0,'.',' ', T,F,F,T,F,F,F,F, "10." },
-  { 10.2345, 1,0,'.',' ', T,F,F,F,F,F,F,F, "10.2" },
-  { 10.2345, 4,0,'.',' ', T,F,F,F,F,F,F,F, "10.2345" },
-  { 10.2345, 6,0,'.',' ', T,F,T,F,F,F,F,F, "+10.234500" },
-  { -10.2345, 6,0,'.',' ', T,F,F,F,F,F,F,F, "-10.234500" },
-  { -10.2345, 6,0,',',' ', T,F,F,F,F,F,F,F, "-10,234500" },
-
-  // fixed formatting with width
-  { 10.2345, 4,5,'.',' ', T,F,F,F,F,F,F,F, "10.2345" },
-  { 10.2345, 4,6,'.',' ', T,F,F,F,F,F,F,F, "10.2345" },
-  { 10.2345, 4,7,'.',' ', T,F,F,F,F,F,F,F, "10.2345" },
-  { 10.2345, 4,8,'.',' ', T,F,F,F,F,F,F,F, " 10.2345" },
-  { 10.2345, 4,10,'.',' ', T,F,F,F,F,F,F,F, "   10.2345" },
-  { 10.2345, 4,10,'.',' ', T,F,F,F,F,F,T,F, "10.2345   " },
-  { 10.2345, 4,10,'.',' ', T,F,F,F,F,F,F,T, "   10.2345" },
-  { 10.2345, 4,10,'.',' ', T,F,F,F,F,T,F,F, "   10.2345" },
-  { -10.2345, 4,10,'.',' ', T,F,F,F,F,T,F,F, "-  10.2345" },
-  { -10.2345, 4,10,'.','A', T,F,F,F,F,T,F,F, "-AA10.2345" },
-  { 10.2345, 4,10,'.','#', T,F,T,F,F,T,F,F, "+##10.2345" },
-
-  // scientific formatting
-  { 1.23e+12, 1,0,'.',' ', F,T,F,F,F,F,F,F, "1.2e+12" },
-  { 1.23e+12, 1,0,'.',' ', F,T,F,F,T,F,F,F, "1.2E+12" },
-  { 1.23e+12, 2,0,'.',' ', F,T,F,F,F,F,F,F, "1.23e+12" },
-  { 1.23e+12, 3,0,'.',' ', F,T,F,F,F,F,F,F, "1.230e+12" },
-  { 1.23e+12, 3,0,'.',' ', F,T,T,F,F,F,F,F, "+1.230e+12" },
-  { -1.23e-12, 3,0,'.',' ', F,T,F,F,F,F,F,F, "-1.230e-12" },
-  { 1.23e+12, 3,0,',',' ', F,T,F,F,F,F,F,F, "1,230e+12" },
-#endif
-};
-
-template<typename _CharT>
-class testpunct : public numpunct<_CharT>
-{
-public:
-  typedef _CharT  char_type;
-  const char_type dchar;
-
-  explicit
-  testpunct(char_type decimal_char) : numpunct<_CharT>(), dchar(decimal_char)
-  { }
-
-protected:
-  char_type 
-  do_decimal_point() const
-  { return dchar; }
-    
-  char_type 
-  do_thousands_sep() const
-  { return ','; }
-
-  string 
-  do_grouping() const
-  { return string(); }
-};
-template<typename _CharT>  
-void apply_formatting(const _TestCase & tc, basic_ostream<_CharT> & os)
-{
-  os.precision(tc.precision);
-  os.width(tc.width);
-  os.fill(static_cast<_CharT>(tc.fill));
-  if (tc.fixed)
-    os.setf(ios::fixed);
-  if (tc.scientific)
-    os.setf(ios::scientific);
-  if (tc.showpos)
-    os.setf(ios::showpos);
-  if (tc.showpoint)
-    os.setf(ios::showpoint);
-  if (tc.uppercase)
-    os.setf(ios::uppercase);
-  if (tc.internal)
-    os.setf(ios::internal);
-  if (tc.left)
-    os.setf(ios::left);
-  if (tc.right)
-    os.setf(ios::right);
-}
-
-int
-test01()
-{
-  bool test = true;
-  for (int j=0; j<sizeof(testcases)/sizeof(testcases[0]); j++)
-    {
-      _TestCase & tc = testcases[j];
-#ifdef TEST_NUMPUT_VERBOSE
-      cout << "expect: " << tc.result << endl;
-#endif
-      // test double with char type
-      {
-        testpunct<char>* __tp = new testpunct<char>(tc.decimal);
-        ostringstream os;
-        locale __loc(os.getloc(), __tp);
-        os.imbue(__loc);
-        apply_formatting(tc, os);
-        os << tc.val;
-#ifdef TEST_NUMPUT_VERBOSE
-        cout << j << "result 1: " << os.str() << endl;
-#endif
-        VERIFY( os && os.str() == tc.result );
-      }
-      // test long double with char type
-      {
-        testpunct<char>* __tp = new testpunct<char>(tc.decimal);
-        ostringstream os;
-        locale __loc(os.getloc(), __tp);
-        os.imbue(__loc);
-        apply_formatting(tc, os);
-        os << (long double)tc.val;
-#ifdef TEST_NUMPUT_VERBOSE
-        cout << j << "result 2: " << os.str() << endl;
-#endif
-        VERIFY( os && os.str() == tc.result );
-      }
-#if _GLIBCPP_USE_WCHAR_T
-      // test double with wchar_t type
-      {
-        testpunct<wchar_t>* __tp = new testpunct<wchar_t>(tc.decimal);
-        wostringstream os;
-        locale __loc(os.getloc(), __tp);
-        os.imbue(__loc);
-        apply_formatting(tc, os);
-        os << tc.val;
-        VERIFY( os && os.str() == tc.wresult );
-      }
-      // test long double with wchar_t type
-      {
-        testpunct<wchar_t>* __tp = new testpunct<wchar_t>(tc.decimal);
-        wostringstream os;
-        locale __loc(os.getloc(), __tp);
-        os.imbue(__loc);
-        apply_formatting(tc, os);
-        os << (long double)tc.val;
-        VERIFY( os && os.str() == tc.wresult );
-      }
-#endif
-    }
-    
-  return 0;
-}
-
-void
-test02()
-{
-  bool test = true;
-  // make sure we can output a very long float
-  long double val = 1.2345678901234567890123456789e+1000L;
-  int prec = numeric_limits<long double>::digits10;
-
-  ostringstream os;
-  os.precision(prec);
-  os.setf(ios::scientific);
-  os << val;
-
-  char largebuf[512];
-  sprintf(largebuf, "%.*Le", prec, val);
-#ifdef TEST_NUMPUT_VERBOSE
-  cout << "expect: " << largebuf << endl;
-  cout << "result: " << os.str() << endl;
-#endif
-  VERIFY(os && os.str() == largebuf);
-
-  // Make sure we can output a long float in fixed format
-  // without seg-faulting (libstdc++/4402)
-  double val2 = 3.5e230;
-
-  ostringstream os2;
-  os2.precision(3);
-  os2.setf(ios::fixed);
-  os2 << val2;
-
-  sprintf(largebuf, "%.*f", 3, val2);
-#ifdef TEST_NUMPUT_VERBOSE
-  cout << "expect: " << largebuf << endl;
-  cout << "result: " << os2.str() << endl;
-#endif
-  VERIFY(os2 && os2.str() == largebuf);
-
-  // Check it can be done in a locale with grouping on.
-  locale loc2("de_DE");
-  os2.imbue(loc2);
-  os2 << fixed << setprecision(3) << val2 << endl;
-  os2 << endl;
-  os2 << fixed << setprecision(1) << val2 << endl;
-
-  return;
-}
-
-template<typename T>
-bool
-test03_check(T n)
-{
-  stringbuf strbuf;
-  ostream o(&strbuf);
-  const char *expect;
-  bool test = true;
-
-  if (numeric_limits<T>::digits + 1 == 16)
-    expect = "177777 ffff";
-  else if (numeric_limits<T>::digits + 1 == 32)
-    expect = "37777777777 ffffffff";
-  else if (numeric_limits<T>::digits + 1 == 64)
-    expect = "1777777777777777777777 ffffffffffffffff";
-  else
-    expect = "wow, you've got some big numbers here";
-
-  o << oct << n << ' ' << hex << n;
-  VERIFY ( strbuf.str() == expect );
-
-  return test;
-}
-
-int 
-test03()
-{
-  short s = -1;
-  int i = -1;
-  long l = -1;
-  bool test = true;
-
-  test &= test03_check (s);
-  test &= test03_check (i);
-  test &= test03_check (l);
-
-  return 0;
-}
-
-// libstdc++/3655
-int
-test04()
-{
-  stringbuf strbuf1, strbuf2;
-  ostream o1(&strbuf1), o2(&strbuf2);
-  bool test = true;
-
-  o1 << hex << showbase << setw(6) << internal << 0xff;
-  VERIFY( strbuf1.str() == "0x  ff" );
-  
-  // ... vs internal-adjusted const char*-type objects
-  o2 << hex << showbase << setw(6) << internal << "0xff";
-  VERIFY( strbuf2.str() == "  0xff" );
-
-  return 0;
-}
-
-int
-test05()
-{
-  bool test = true;
-  double pi = 3.14159265358979323846;
-  ostringstream ostr;
-  ostr.precision(20);
-  ostr << pi;
-  string sval = ostr.str();
-  istringstream istr (sval);
-  double d;
-  istr >> d;
-  VERIFY( abs(pi-d)/pi < DBL_EPSILON );
-  return 0;
-}
-
-
-// libstdc++/9151
-int
-test06()
-{
-  bool test = true;
-  int prec = numeric_limits<double>::digits10 + 2;
-  double oval = numeric_limits<double>::min();
-
-  stringstream ostr;
-  ostr.precision(prec);
-  ostr << oval;
-  string sval = ostr.str();
-  istringstream istr (sval);
-  double ival;
-  istr >> ival;
-  VERIFY( abs(oval-ival)/oval < DBL_EPSILON ); 
-  return 0;
-}
-
-int 
-main()
-{
-  test01();
-  __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test02);
-  test03();
-  test04();
-  test05();
-  test06();
-#ifdef TEST_NUMPUT_VERBOSE
-  cout << "Test passed!" << endl;
-#endif
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/27_io/ostream_inserter_char-1.tst b/libstdc++-v3/testsuite/27_io/ostream_inserter_char-1.tst
deleted file mode 100644 (file)
index 0b0acc8..0000000
+++ /dev/null
@@ -1,1000 +0,0 @@
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
diff --git a/libstdc++-v3/testsuite/27_io/ostream_inserter_char-1.txt b/libstdc++-v3/testsuite/27_io/ostream_inserter_char-1.txt
deleted file mode 100644 (file)
index 0b0acc8..0000000
+++ /dev/null
@@ -1,1000 +0,0 @@
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
-123456789
diff --git a/libstdc++-v3/testsuite/27_io/ostream_inserter_char.cc b/libstdc++-v3/testsuite/27_io/ostream_inserter_char.cc
deleted file mode 100644 (file)
index 2fe88f5..0000000
+++ /dev/null
@@ -1,342 +0,0 @@
-// 1999-08-16 bkoz
-
-// Copyright (C) 1999, 2000, 2002 Free Software Foundation
-//
-// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// 27.6.2.5.4 basic_ostream character inserters
-
-#include <string>
-#include <ostream>
-#include <sstream>
-#include <fstream>
-#include <testsuite_hooks.h>
-
-// ofstream
-bool test01()
-{
-  bool test = true;
-  std::string str01;
-  const int size = 1000;
-  const char name_02[] = "ostream_inserter_char-1.txt";
-
-  // initialize string
-  for(int i=0 ; i < size; i++) {
-    str01 += '1';
-    str01 += '2';
-    str01 += '3';
-    str01 += '4';
-    str01 += '5';
-    str01 += '6';
-    str01 += '7';
-    str01 += '8';
-    str01 += '9';
-    str01 += '\n';
-  }
-  std::ofstream f(name_02);
-
-  f << str01;
-  f.close();
-
-  VERIFY( test );
-  return test;
-}
-
-// ostringstream width() != zero
-// left
-bool test02(void) 
-{
-  bool test = true;
-  std::string tmp;
-  
-  std::string str01 = "";
-  std::ostringstream oss01;
-  oss01.width(5);
-  oss01.fill('0');
-  oss01.flags(std::ios_base::left);
-  oss01 << str01;
-  tmp = oss01.str();
-  VERIFY( tmp == "00000" );
-
-  std::string str02 = "1";
-  std::ostringstream oss02;
-  oss02.width(5);
-  oss02.fill('0');
-  oss02.flags(std::ios_base::left);
-  oss02 << str02;
-  tmp = oss02.str();
-  VERIFY( tmp == "10000" );
-
-  std::string str03 = "909909";
-  std::ostringstream oss03;
-  oss03.width(5);
-  oss03.fill('0');
-  oss03.flags(std::ios_base::left);
-  oss03 << str03;
-  tmp = oss03.str();
-  VERIFY( tmp == "909909" );
-  return test;
-}
-
-// width() != zero
-// right
-bool test03(void) 
-{
-  bool test = true;
-  std::string tmp;
-
-  std::string str01 = "";
-  std::ostringstream oss01;
-  oss01.width(5);
-  oss01.fill('0');
-  oss01.flags(std::ios_base::right);
-  oss01 << str01;
-  tmp = oss01.str();
-  VERIFY( tmp == "00000" );
-
-  std::string str02 = "1";
-  std::ostringstream oss02;
-  oss02.width(5);
-  oss02.fill('0');
-  oss02.flags(std::ios_base::right);
-  oss02 << str02;
-  tmp = oss02.str();
-  VERIFY( tmp == "00001" );
-
-  std::string str03 = "909909";
-  std::ostringstream oss03;
-  oss03.width(5);
-  oss03.fill('0');
-  oss03.flags(std::ios_base::right);
-  oss03 << str03;
-  tmp = oss03.str();
-  VERIFY( tmp == "909909" );
-  return test;
-}
-
-// stringstream and large strings
-bool test04() 
-{
-  bool test = true;
-  std::string str_01;
-  const std::string str_02("coltrane playing 'softly as a morning sunrise'");
-  const std::string str_03("coltrane");
-  std::string str_tmp;
-  const int i_max=250;
-
-  std::ostringstream oss_01(std::ios_base::out);
-  std::ostringstream oss_02(str_01, std::ios_base::out);
-
-  std::ios_base::iostate state1, state2, statefail;
-  statefail = std::ios_base::failbit;
-
-  // template<_CharT, _Traits>
-  //  basic_ostream& operator<<(ostream&, const char*)
-  for (int i = 0; i < i_max; ++i) 
-    oss_02 << "Test: " << i << std::endl;
-  str_tmp = oss_02.str();
-  VERIFY( !oss_02.bad() );
-  VERIFY( oss_02.good() );
-  VERIFY( str_tmp != str_01 );
-  VERIFY( str_tmp.size() == 2390 );
-  return test;
-}
-
-// ostringstream and large strings number 2
-bool test05()
-{
-  bool test = true;
-  std::string str05, str10;
-
-  typedef std::ostream::pos_type       pos_type;
-  typedef std::ostream::off_type       off_type;
-  std::string str01;
-  const int size = 1000;
-
-  // initialize string
-  for(int i=0 ; i < size; i++) {
-    str01 += '1';
-    str01 += '2';
-    str01 += '3';
-    str01 += '4';
-    str01 += '5';
-    str01 += '6';
-    str01 += '7';
-    str01 += '8';
-    str01 += '9';
-    str01 += '\n';
-  }
-
-  // test 1: out
-  std::ostringstream sstr01(str01, std::ios_base::out);
-  std::ostringstream sstr02;
-  sstr02 << str01;
-  str05 = sstr01.str();
-  str10 = sstr02.str();
-  VERIFY( str05 == str01 );
-  VERIFY( str10 == str01 );
-
-  // test 2: in | out 
-  std::ostringstream sstr04(str01,  std::ios_base::out | std::ios_base::in);
-  std::ostringstream sstr05(std::ios_base::in | std::ios_base::out);
-  sstr05 << str01;
-  str05 = sstr04.str();
-  str10 = sstr05.str();
-  VERIFY( str05 == str01 );
-  VERIFY( str10 == str01 );
-  return test;
-}
-
-
-// ostringstream and positioning, multiple writes
-// http://gcc.gnu.org/ml/libstdc++/2000-q1/msg00326.html
-void test06()
-{
-  bool test = true;
-  const char carray01[] = "mos def & talib kweli are black star";
-
-  // normal
-  std::ostringstream ostr1("mos def");
-  VERIFY( ostr1.str() == "mos def" ); 
-  ostr1 << " & talib kweli";  // should overwrite first part of buffer
-  VERIFY( ostr1.str() == " & talib kweli" );
-  ostr1 << " are black star";  // should append to string from above
-  VERIFY( ostr1.str() != carray01 );
-  VERIFY( ostr1.str() == " & talib kweli are black star" );
-
-  // appending
-  std::ostringstream ostr2("blackalicious", 
-                          std::ios_base::out | std::ios_base::ate);
-  VERIFY( ostr2.str() == "blackalicious" ); 
-  ostr2 << " NIA ";  // should not overwrite first part of buffer
-  VERIFY( ostr2.str() == "blackalicious NIA " );
-  ostr2 << "4: deception (5:19)";  // should append to full string from above
-  VERIFY( ostr2.str() == "blackalicious NIA 4: deception (5:19)" );
-}
-
-// Global counter, needs to be reset after use.
-bool used;
-
-class gnu_ctype : public std::ctype<wchar_t>
-{
-protected:
-  char_type        
-  do_widen(char c) const
-  { 
-    used = true;
-    return std::ctype<wchar_t>::do_widen(c);
-  }
-
-  const char*  
-  do_widen(const char* low, const char* high, char_type* dest) const
-  { 
-    used = true;
-    return std::ctype<wchar_t>::do_widen(low, high, dest);
-  }
-};
-
-// 27.6.2.5.4 - Character inserter template functions 
-// [lib.ostream.inserters.character]
-void test07()
-{
-#if _GLIBCPP_USE_WCHAR_T
-  using namespace std;
-  bool test = true;
-
-  const char* buffer = "SFPL 5th floor, outside carrol, the Asian side";
-
-  wostringstream oss;
-  oss.imbue(locale(locale::classic(), new gnu_ctype));
-  
-  // 1
-  // template<class charT, class traits>
-  // basic_ostream<charT,traits>& operator<<(basic_ostream<charT,traits>& out,
-  //                                           const char* s);
-  used = false;
-  oss << buffer;
-  VERIFY( used ); // Only required for char_type != char
-  wstring str = oss.str();
-  wchar_t c1 = oss.widen(buffer[0]);
-  VERIFY( str[0] == c1 );
-  wchar_t c2 = oss.widen(buffer[1]);
-  VERIFY( str[1] == c2 );
-
-  // 2
-  // template<class charT, class traits>
-  // basic_ostream<charT,traits>& operator<<(basic_ostream<charT,traits>& out,
-  //                                         char c);
-  used = false;
-  oss.str(wstring());
-  oss << 'b';
-  VERIFY( used ); // Only required for char_type != char
-  str = oss.str();
-  wchar_t c3 = oss.widen('b');
-  VERIFY( str[0] == c3 );
-#endif
-}
-
-void test08()
-{
-  bool test = true;
-  char* pt = NULL;
-
-  // 1
-  std::ostringstream oss;
-  oss << pt;
-  VERIFY( oss.bad() );
-  VERIFY( oss.str().size() == 0 );
-
-  oss.clear();
-  oss << "";
-  VERIFY( oss.good() );
-
-#if _GLIBCPP_USE_WCHAR_T
-  // 2
-  std::wostringstream woss;
-  woss << pt;
-  VERIFY( woss.bad() );
-  VERIFY( woss.str().size() == 0 );
-
-  woss.clear();
-  woss << "";
-  VERIFY( woss.good() );
-
-  // 3
-  wchar_t* wt = NULL;
-  woss.clear();
-  woss << wt;
-  VERIFY( woss.bad() );
-  VERIFY( woss.str().size() == 0 );
-
-  woss.clear();
-  woss << L"";
-  VERIFY( woss.good() );
-#endif
-}
-
-int main()
-{
-  test01();
-  test02();
-  test03();
-  test04();
-  test05();
-  test06();
-  test07();
-  test08();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/27_io/ostream_inserter_other-1.tst b/libstdc++-v3/testsuite/27_io/ostream_inserter_other-1.tst
deleted file mode 100644 (file)
index cb3c57f..0000000
+++ /dev/null
@@ -1,158 +0,0 @@
-// 990117 bkoz
-// test functionality of basic_filebuf for char_type == char
-// this is a data file for 27filebuf.cc
-
-// Copyright (C) 1997-1999 Cygnus Solutions
-//
-// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-/mnt/cdrom/sarah_vaughan/sarah_vaughan.allofme
-/mnt/cdrom/sarah_vaughan/sarah_vaughan.speaklow
-
-/mnt/cdrom/nikkigiovanni_thewayifeel/ng_01_the_way_i_feel
-/mnt/cdrom/nikkigiovanni_thewayifeel/ng_02_seduction_kidnap
-/mnt/cdrom/nikkigiovanni_thewayifeel/ng_03_just_a_ny_poem
-/mnt/cdrom/nikkigiovanni_thewayifeel/ng_04_butterflies_i_remem
-/mnt/cdrom/nikkigiovanni_thewayifeel/ng_05_luxury_poem
-/mnt/cdrom/nikkigiovanni_thewayifeel/ng_06_my_house
-/mnt/cdrom/nikkigiovanni_thewayifeel/ng_07_the_women_gather
-/mnt/cdrom/nikkigiovanni_thewayifeel/ng_08_the_life_i_led
-/mnt/cdrom/nikkigiovanni_thewayifeel/ng_09_when_i_die
-/mnt/cdrom/nikkigiovanni_thewayifeel/ng_10_revolutionary_dreams
-/mnt/cdrom/nikkigiovanni_thewayifeel/ng_11_winter_poem
-/mnt/cdrom/nikkigiovanni_thewayifeel/ng_12_a_certain_peace_i_nap
-/mnt/cdrom/nikkigiovanni_thewayifeel/ng_13_poem_for_a_lady_whose
-
-/mnt/cdrom/marley-songs_of_freedom/disk_1/
-/mnt/cdrom/marley-songs_of_freedom/disk_2/
-/mnt/cdrom/marley-songs_of_freedom/disk_4/
-
-/mnt/cdrom/marley-songs_of_freedom/disk_1/back out
-/mnt/cdrom/marley-songs_of_freedom/disk_1/bend down low
-/mnt/cdrom/marley-songs_of_freedom/disk_1/bus dem shut (pyaka)
-/mnt/cdrom/marley-songs_of_freedom/disk_1/caution
-/mnt/cdrom/marley-songs_of_freedom/disk_1/do it twice
-/mnt/cdrom/marley-songs_of_freedom/disk_1/don't rock the boat
-/mnt/cdrom/marley-songs_of_freedom/disk_1/duppy conqueror
-/mnt/cdrom/marley-songs_of_freedom/disk_1/hammer
-/mnt/cdrom/marley-songs_of_freedom/disk_1/hypocrites
-/mnt/cdrom/marley-songs_of_freedom/disk_1/i'm still waiting
-/mnt/cdrom/marley-songs_of_freedom/disk_1/judge not
-/mnt/cdrom/marley-songs_of_freedom/disk_1/mellow mood
-/mnt/cdrom/marley-songs_of_freedom/disk_1/mr brown
-/mnt/cdrom/marley-songs_of_freedom/disk_1/nice time
-/mnt/cdrom/marley-songs_of_freedom/disk_1/one cup of coffee
-/mnt/cdrom/marley-songs_of_freedom/disk_1/one love_people get ready
-/mnt/cdrom/marley-songs_of_freedom/disk_1/put it on
-/mnt/cdrom/marley-songs_of_freedom/disk_1/simmer down
-/mnt/cdrom/marley-songs_of_freedom/disk_1/small axe
-/mnt/cdrom/marley-songs_of_freedom/disk_1/soul rebel
-/mnt/cdrom/marley-songs_of_freedom/disk_1/soul shake down party
-/mnt/cdrom/marley-songs_of_freedom/disk_1/stir it up (original)
-/mnt/cdrom/marley-songs_of_freedom/disk_1/sun is shining
-/mnt/cdrom/marley-songs_of_freedom/disk_1/thank you lord (original)
-/mnt/cdrom/marley-songs_of_freedom/disk_2/acoustic medley
-/mnt/cdrom/marley-songs_of_freedom/disk_2/burnin' and lootin'
-/mnt/cdrom/marley-songs_of_freedom/disk_2/concrete jungle
-/mnt/cdrom/marley-songs_of_freedom/disk_2/craven choke puppy
-/mnt/cdrom/marley-songs_of_freedom/disk_2/get up stand up
-/mnt/cdrom/marley-songs_of_freedom/disk_2/guava jelly
-/mnt/cdrom/marley-songs_of_freedom/disk_2/high tide or low tide
-/mnt/cdrom/marley-songs_of_freedom/disk_2/i shot the sheriff
-/mnt/cdrom/marley-songs_of_freedom/disk_2/i'm hurting inside
-/mnt/cdrom/marley-songs_of_freedom/disk_2/iron lion zion
-/mnt/cdrom/marley-songs_of_freedom/disk_2/lick samba
-/mnt/cdrom/marley-songs_of_freedom/disk_2/lively up yourself
-/mnt/cdrom/marley-songs_of_freedom/disk_2/natty dread
-/mnt/cdrom/marley-songs_of_freedom/disk_2/no more trouble
-/mnt/cdrom/marley-songs_of_freedom/disk_2/rastaman chant
-/mnt/cdrom/marley-songs_of_freedom/disk_2/screw face
-/mnt/cdrom/marley-songs_of_freedom/disk_2/slave driver
-/mnt/cdrom/marley-songs_of_freedom/disk_2/trenchtown rock
-/mnt/cdrom/marley-songs_of_freedom/disk_4/africa unite
-/mnt/cdrom/marley-songs_of_freedom/disk_4/babylon system
-/mnt/cdrom/marley-songs_of_freedom/disk_4/bad card
-/mnt/cdrom/marley-songs_of_freedom/disk_4/coming in from the cold (12
-/mnt/cdrom/marley-songs_of_freedom/disk_4/could you be loved (12  mix
-/mnt/cdrom/marley-songs_of_freedom/disk_4/forever loving jah
-/mnt/cdrom/marley-songs_of_freedom/disk_4/give thanks and praise
-/mnt/cdrom/marley-songs_of_freedom/disk_4/one drop
-/mnt/cdrom/marley-songs_of_freedom/disk_4/one dub
-/mnt/cdrom/marley-songs_of_freedom/disk_4/rastaman live up
-/mnt/cdrom/marley-songs_of_freedom/disk_4/real situation
-/mnt/cdrom/marley-songs_of_freedom/disk_4/redemption song (live in pi
-/mnt/cdrom/marley-songs_of_freedom/disk_4/ride natty ride (12  mix)
-/mnt/cdrom/marley-songs_of_freedom/disk_4/so much trouble in the worl
-/mnt/cdrom/marley-songs_of_freedom/disk_4/survival
-/mnt/cdrom/marley-songs_of_freedom/disk_4/why should i (previously un
-/mnt/cdrom/marley-songs_of_freedom/disk_4/zimbabwe
-
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_01_pandemonium
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_02_sync_disjecta
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_03_object_unknown
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_04_it's_nice_not
-/mnt/cdrom/dj_spooky_rid-2dim_warefare/djspooky_05_dialectical_tra
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_06_post-human_soph
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_07_quilombo_ex
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_08_rekonstruction
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_09_scientifik
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_10_a_conversation
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_11_peace_in_zaire
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_13_degree_zero
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_14_roman_planeta
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_15_bass_digitalis
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_16_polyphony_of
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_17_riddim_warfare
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_18_the_nerd
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_20_theme_of_the
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_21_twilight_fugue
-
-/mnt/cdrom/stuff_smith_mosaic/disk3/01_desert_sands
-/mnt/cdrom/stuff_smith_mosaic/disk3/02_soft_winds
-/mnt/cdrom/stuff_smith_mosaic/disk3/03_time_and_again
-/mnt/cdrom/stuff_smith_mosaic/disk3/04_it_don't_mean_a_thing
-/mnt/cdrom/stuff_smith_mosaic/disk3/05_in_a_mellotone
-/mnt/cdrom/stuff_smith_mosaic/disk3/06_i_know_that_you_know
-/mnt/cdrom/stuff_smith_mosaic/disk3/07_heat_wave
-/mnt/cdrom/stuff_smith_mosaic/disk3/08_things_ain't_what_they_used_to_be
-/mnt/cdrom/stuff_smith_mosaic/disk3/09_body_and_soul
-
-So I take a break, wander down to the park to stand, then lean into
-the concrete railing demarking the beginnings of space, oceanic
-space. I watch the waves break, and form, and ease back out to sea and
-wrap my arms around myself and hug tightly because it's early in the
-morning and windy, and the sun is late getting out of bed today, which
-is good because if there was brilliant light illuminating all the
-beauty around me I would be shocked, stunned, forced to retreat back
-into my cabana in a daze, blinded by hummingbirds and callilillies and
-un-named red, yellow, and blue flowers. Green envelopes me, waves
-sooth me. I can see the wind flip the top of the waves seaward, right
-before they break. The sea seems so calm from my perch above the fray
-that I wonder if maybe there is just some part of the deepest, most
-abstract ocean where there is a large creature who happily chews
-plankton and wags its tail in gentle, adulating waves that spread and
-move and gracefully glide thousands of miles, to crash upon a beach,
-one after the other, politely waiting for a turn to dance with the
-seashore.
-
-I know: it is what the Mexican schoolchildren call "la vibora de la
-mer," the serpent of the sea.
-
-
-
-
-
diff --git a/libstdc++-v3/testsuite/27_io/ostream_inserter_other-2.tst b/libstdc++-v3/testsuite/27_io/ostream_inserter_other-2.tst
deleted file mode 100644 (file)
index cb3c57f..0000000
+++ /dev/null
@@ -1,158 +0,0 @@
-// 990117 bkoz
-// test functionality of basic_filebuf for char_type == char
-// this is a data file for 27filebuf.cc
-
-// Copyright (C) 1997-1999 Cygnus Solutions
-//
-// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-/mnt/cdrom/sarah_vaughan/sarah_vaughan.allofme
-/mnt/cdrom/sarah_vaughan/sarah_vaughan.speaklow
-
-/mnt/cdrom/nikkigiovanni_thewayifeel/ng_01_the_way_i_feel
-/mnt/cdrom/nikkigiovanni_thewayifeel/ng_02_seduction_kidnap
-/mnt/cdrom/nikkigiovanni_thewayifeel/ng_03_just_a_ny_poem
-/mnt/cdrom/nikkigiovanni_thewayifeel/ng_04_butterflies_i_remem
-/mnt/cdrom/nikkigiovanni_thewayifeel/ng_05_luxury_poem
-/mnt/cdrom/nikkigiovanni_thewayifeel/ng_06_my_house
-/mnt/cdrom/nikkigiovanni_thewayifeel/ng_07_the_women_gather
-/mnt/cdrom/nikkigiovanni_thewayifeel/ng_08_the_life_i_led
-/mnt/cdrom/nikkigiovanni_thewayifeel/ng_09_when_i_die
-/mnt/cdrom/nikkigiovanni_thewayifeel/ng_10_revolutionary_dreams
-/mnt/cdrom/nikkigiovanni_thewayifeel/ng_11_winter_poem
-/mnt/cdrom/nikkigiovanni_thewayifeel/ng_12_a_certain_peace_i_nap
-/mnt/cdrom/nikkigiovanni_thewayifeel/ng_13_poem_for_a_lady_whose
-
-/mnt/cdrom/marley-songs_of_freedom/disk_1/
-/mnt/cdrom/marley-songs_of_freedom/disk_2/
-/mnt/cdrom/marley-songs_of_freedom/disk_4/
-
-/mnt/cdrom/marley-songs_of_freedom/disk_1/back out
-/mnt/cdrom/marley-songs_of_freedom/disk_1/bend down low
-/mnt/cdrom/marley-songs_of_freedom/disk_1/bus dem shut (pyaka)
-/mnt/cdrom/marley-songs_of_freedom/disk_1/caution
-/mnt/cdrom/marley-songs_of_freedom/disk_1/do it twice
-/mnt/cdrom/marley-songs_of_freedom/disk_1/don't rock the boat
-/mnt/cdrom/marley-songs_of_freedom/disk_1/duppy conqueror
-/mnt/cdrom/marley-songs_of_freedom/disk_1/hammer
-/mnt/cdrom/marley-songs_of_freedom/disk_1/hypocrites
-/mnt/cdrom/marley-songs_of_freedom/disk_1/i'm still waiting
-/mnt/cdrom/marley-songs_of_freedom/disk_1/judge not
-/mnt/cdrom/marley-songs_of_freedom/disk_1/mellow mood
-/mnt/cdrom/marley-songs_of_freedom/disk_1/mr brown
-/mnt/cdrom/marley-songs_of_freedom/disk_1/nice time
-/mnt/cdrom/marley-songs_of_freedom/disk_1/one cup of coffee
-/mnt/cdrom/marley-songs_of_freedom/disk_1/one love_people get ready
-/mnt/cdrom/marley-songs_of_freedom/disk_1/put it on
-/mnt/cdrom/marley-songs_of_freedom/disk_1/simmer down
-/mnt/cdrom/marley-songs_of_freedom/disk_1/small axe
-/mnt/cdrom/marley-songs_of_freedom/disk_1/soul rebel
-/mnt/cdrom/marley-songs_of_freedom/disk_1/soul shake down party
-/mnt/cdrom/marley-songs_of_freedom/disk_1/stir it up (original)
-/mnt/cdrom/marley-songs_of_freedom/disk_1/sun is shining
-/mnt/cdrom/marley-songs_of_freedom/disk_1/thank you lord (original)
-/mnt/cdrom/marley-songs_of_freedom/disk_2/acoustic medley
-/mnt/cdrom/marley-songs_of_freedom/disk_2/burnin' and lootin'
-/mnt/cdrom/marley-songs_of_freedom/disk_2/concrete jungle
-/mnt/cdrom/marley-songs_of_freedom/disk_2/craven choke puppy
-/mnt/cdrom/marley-songs_of_freedom/disk_2/get up stand up
-/mnt/cdrom/marley-songs_of_freedom/disk_2/guava jelly
-/mnt/cdrom/marley-songs_of_freedom/disk_2/high tide or low tide
-/mnt/cdrom/marley-songs_of_freedom/disk_2/i shot the sheriff
-/mnt/cdrom/marley-songs_of_freedom/disk_2/i'm hurting inside
-/mnt/cdrom/marley-songs_of_freedom/disk_2/iron lion zion
-/mnt/cdrom/marley-songs_of_freedom/disk_2/lick samba
-/mnt/cdrom/marley-songs_of_freedom/disk_2/lively up yourself
-/mnt/cdrom/marley-songs_of_freedom/disk_2/natty dread
-/mnt/cdrom/marley-songs_of_freedom/disk_2/no more trouble
-/mnt/cdrom/marley-songs_of_freedom/disk_2/rastaman chant
-/mnt/cdrom/marley-songs_of_freedom/disk_2/screw face
-/mnt/cdrom/marley-songs_of_freedom/disk_2/slave driver
-/mnt/cdrom/marley-songs_of_freedom/disk_2/trenchtown rock
-/mnt/cdrom/marley-songs_of_freedom/disk_4/africa unite
-/mnt/cdrom/marley-songs_of_freedom/disk_4/babylon system
-/mnt/cdrom/marley-songs_of_freedom/disk_4/bad card
-/mnt/cdrom/marley-songs_of_freedom/disk_4/coming in from the cold (12
-/mnt/cdrom/marley-songs_of_freedom/disk_4/could you be loved (12  mix
-/mnt/cdrom/marley-songs_of_freedom/disk_4/forever loving jah
-/mnt/cdrom/marley-songs_of_freedom/disk_4/give thanks and praise
-/mnt/cdrom/marley-songs_of_freedom/disk_4/one drop
-/mnt/cdrom/marley-songs_of_freedom/disk_4/one dub
-/mnt/cdrom/marley-songs_of_freedom/disk_4/rastaman live up
-/mnt/cdrom/marley-songs_of_freedom/disk_4/real situation
-/mnt/cdrom/marley-songs_of_freedom/disk_4/redemption song (live in pi
-/mnt/cdrom/marley-songs_of_freedom/disk_4/ride natty ride (12  mix)
-/mnt/cdrom/marley-songs_of_freedom/disk_4/so much trouble in the worl
-/mnt/cdrom/marley-songs_of_freedom/disk_4/survival
-/mnt/cdrom/marley-songs_of_freedom/disk_4/why should i (previously un
-/mnt/cdrom/marley-songs_of_freedom/disk_4/zimbabwe
-
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_01_pandemonium
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_02_sync_disjecta
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_03_object_unknown
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_04_it's_nice_not
-/mnt/cdrom/dj_spooky_rid-2dim_warefare/djspooky_05_dialectical_tra
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_06_post-human_soph
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_07_quilombo_ex
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_08_rekonstruction
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_09_scientifik
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_10_a_conversation
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_11_peace_in_zaire
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_13_degree_zero
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_14_roman_planeta
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_15_bass_digitalis
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_16_polyphony_of
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_17_riddim_warfare
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_18_the_nerd
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_20_theme_of_the
-/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_21_twilight_fugue
-
-/mnt/cdrom/stuff_smith_mosaic/disk3/01_desert_sands
-/mnt/cdrom/stuff_smith_mosaic/disk3/02_soft_winds
-/mnt/cdrom/stuff_smith_mosaic/disk3/03_time_and_again
-/mnt/cdrom/stuff_smith_mosaic/disk3/04_it_don't_mean_a_thing
-/mnt/cdrom/stuff_smith_mosaic/disk3/05_in_a_mellotone
-/mnt/cdrom/stuff_smith_mosaic/disk3/06_i_know_that_you_know
-/mnt/cdrom/stuff_smith_mosaic/disk3/07_heat_wave
-/mnt/cdrom/stuff_smith_mosaic/disk3/08_things_ain't_what_they_used_to_be
-/mnt/cdrom/stuff_smith_mosaic/disk3/09_body_and_soul
-
-So I take a break, wander down to the park to stand, then lean into
-the concrete railing demarking the beginnings of space, oceanic
-space. I watch the waves break, and form, and ease back out to sea and
-wrap my arms around myself and hug tightly because it's early in the
-morning and windy, and the sun is late getting out of bed today, which
-is good because if there was brilliant light illuminating all the
-beauty around me I would be shocked, stunned, forced to retreat back
-into my cabana in a daze, blinded by hummingbirds and callilillies and
-un-named red, yellow, and blue flowers. Green envelopes me, waves
-sooth me. I can see the wind flip the top of the waves seaward, right
-before they break. The sea seems so calm from my perch above the fray
-that I wonder if maybe there is just some part of the deepest, most
-abstract ocean where there is a large creature who happily chews
-plankton and wags its tail in gentle, adulating waves that spread and
-move and gracefully glide thousands of miles, to crash upon a beach,
-one after the other, politely waiting for a turn to dance with the
-seashore.
-
-I know: it is what the Mexican schoolchildren call "la vibora de la
-mer," the serpent of the sea.
-
-
-
-
-
diff --git a/libstdc++-v3/testsuite/27_io/ostream_inserter_other.cc b/libstdc++-v3/testsuite/27_io/ostream_inserter_other.cc
deleted file mode 100644 (file)
index 4ae1f3b..0000000
+++ /dev/null
@@ -1,281 +0,0 @@
-// 1999-08-16 bkoz
-// 1999-11-01 bkoz
-
-// Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation
-//
-// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// 27.6.2.5.4 basic_ostream character inserters
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %-*.txt
-
-#include <ostream>
-#include <sstream>
-#include <fstream>
-#include <testsuite_hooks.h>
-
-const int size = 1000;
-const char name_01[] = "ostream_inserter_other-1.tst";
-const char name_02[] = "ostream_inserter_other-1.txt";
-const char name_03[] = "ostream_inserter_other-2.tst";
-const char name_04[] = "ostream_inserter_other-2.txt";
-
-
-// stringstream
-int 
-test01() 
-{
-  bool test = true;
-#ifdef DEBUG_ASSERT
-  assert(test);
-#endif
-  return 0;
-}
-
-// fstream
-int
-test02() 
-{
-  typedef std::ios_base::iostate iostate;
-  bool test = true;
-
-  // basic_ostream<_CharT, _Traits>::operator<<(__streambuf_type* __sb)
-  // filebuf-> NULL 
-  std::ifstream f_in1(name_01);
-  std::ofstream f_out1(name_02);
-  std::stringbuf* strbuf01 = NULL;
-  iostate state01 = f_in1.rdstate();
-  f_in1 >> strbuf01;
-  iostate state02 = f_in1.rdstate();
-  VERIFY( state01 != state02 );
-  VERIFY( (state02 & std::ios_base::failbit) != 0 );
-  state01 = f_out1.rdstate();
-  f_out1 << strbuf01;
-  state02 = f_out1.rdstate();
-  VERIFY( state01 != state02 );
-  VERIFY( (state02 & std::ios_base::badbit) != 0 );
-
-  // filebuf->filebuf
-  std::ifstream f_in(name_01);
-  std::ofstream f_out(name_02);
-  f_out << f_in.rdbuf();
-  f_in.close();
-  f_out.close();
-
-  // filebuf->stringbuf->filebuf
-  std::ifstream f_in2(name_03);
-  std::ofstream f_out2(name_04); // should be different name
-  std::stringbuf strbuf02;
-  f_in2 >> &strbuf02;
-  f_out2 << &strbuf02;
-  f_in2.close();
-  f_out2.close();
-
-  // no characters inserted
-
-#ifdef DEBUG_ASSERT
-  assert(test);
-#endif
-  
-  return 0;
-}
-
-// via Brent Verner <brent@rcfile.org>
-// http://gcc.gnu.org/ml/libstdc++/2000-06/msg00005.html
-int
-test03(void)
-{
-  using namespace std;
-
-  typedef ios::pos_type        pos_type;
-
-  const char* TEST_IN = "ostream_inserter_other_in";
-  const char* TEST_OUT = "ostream_inserter_other_out";
-  pos_type i_read, i_wrote, rs, ws;
-  double tf_size = BUFSIZ * 2.5;
-  ofstream testfile(TEST_IN);
-
-  for (int i = 0; i < tf_size; ++i)
-    testfile.put('.');
-  testfile.close();
-
-  ifstream in(TEST_IN);
-  ofstream out(TEST_OUT);
-  out << in.rdbuf();
-  in.seekg(0,ios_base::beg);
-  out.seekp(0,ios_base::beg);
-  rs = in.tellg();
-  ws = out.tellp();
-  in.seekg(0,ios_base::end);
-  out.seekp(0,ios_base::end);
-  i_read = in.tellg() - rs;
-  i_wrote = out.tellp() - ws;
-  in.close();
-  out.close();
-  
-#ifdef DEBUG_ASSERT
-  assert(i_read == i_wrote);
-#endif
-
-  return 0;
-}
-
-// libstdc++/3272
-void test04()
-{
-  using namespace std;
-  bool test = true;
-  istringstream istr("inside betty carter");
-  ostringstream ostr;
-  ostr << istr.rdbuf() << endl;
-
-  if (ostr.rdstate() & ios_base::eofbit) 
-    test = false;
-
-  VERIFY( test );
-}
-
-
-class test_buffer_1 : public std::streambuf 
-{
-public:
-  test_buffer_1(const std::string& s) : str(s), it(str.begin()) { }
-  
-protected:
-  virtual int underflow() { return (it != str.end() ? *it : EOF); }
-  virtual int uflow() { return (it != str.end() ? *it++ : EOF); }
-
-private:
-  const std::string str;
-  std::string::const_iterator it;
-};
-
-
-class test_buffer_2 : public std::streambuf 
-{
-public:
-  test_buffer_2(const std::string& s) : str(s), it(str.begin()) { }
-  
-protected:
-  virtual int underflow() { return (it != str.end() ? *it : EOF); }
-  virtual int uflow() { return (it != str.end() ? *it++ : EOF); }
-  virtual std::streamsize showmanyc() { return std::distance(it, str.end()); }
-private:
-  const std::string str;
-  std::string::const_iterator it;
-};
-
-
-class test_buffer_3 : public std::streambuf 
-{
-public:
-  test_buffer_3(const std::string& s) : str(s), it(str.begin()) { }
-
-protected:
-  virtual int underflow() { return (it != str.end() ? *it : EOF); }
-  virtual int uflow() { return (it != str.end() ? *it++ : EOF); }
-  virtual std::streamsize showmanyc() 
-  {
-    std::streamsize ret = std::distance(it, str.end());
-    return ret > 0 ? ret : -1;
-  }
-private:
-  const std::string str;
-  std::string::const_iterator it;
-};
-
-class test_buffer_4 : public std::streambuf {
-public:
-  test_buffer_4(const std::string& s) : str(s), it(str.begin())
-  {
-    if (it != str.end()) {
-      buf[0] = *it++;
-      setg(buf, buf, buf+1);
-    }
-  }
-
-protected:
-  virtual int underflow() { return (it != str.end() ? *it : EOF); }
-  virtual int uflow() { return (it != str.end() ? *it++ : EOF); }
-  virtual std::streamsize showmanyc() {
-    std::streamsize ret = std::distance(it, str.end());
-    return ret > 0 ? ret : -1;
-  }
-private:
-  const std::string str;
-  std::string::const_iterator it;
-  char buf[1];
-};
-
-void test(const std::string& str, std::streambuf& buf)
-{
-  bool test = true;
-
-  std::ostringstream out;
-  std::istream in(&buf);
-
-  out << in.rdbuf();
-
-  if (out.str() != str) 
-    VERIFY( false );
-}
-
-// libstdc++/6745
-// libstdc++/8071
-// libstdc++/8127
-// Jonathan Lennox  <lennox@cs.columbia.edu>
-void test05()
-{
-  std::string string_a("Hello, world!");
-  std::string string_b("");
-
-  test_buffer_1 buf1a(string_a);
-  test_buffer_1 buf1b(string_b);
-
-  test_buffer_2 buf2a(string_a);
-  test_buffer_2 buf2b(string_b);
-
-  test_buffer_3 buf3a(string_a);
-  test_buffer_3 buf3b(string_b);
-
-  test_buffer_4 buf4a(string_a);
-  test_buffer_4 buf4b(string_b);
-
-  test(string_a, buf1a);
-  test(string_b, buf1b);
-
-  test(string_a, buf2a);
-  test(string_b, buf2b);
-
-  test(string_a, buf3a);
-  test(string_b, buf3b);
-
-  test(string_a, buf4a);
-  test(string_b, buf4b);
-}
-
-int 
-main()
-{
-  test01();
-  test02();
-  test03();
-  test04();
-  
-  test05();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/27_io/ostream_manip.cc b/libstdc++-v3/testsuite/27_io/ostream_manip.cc
deleted file mode 100644 (file)
index d0837f5..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-// 1999-07-22 bkoz
-
-// Copyright (C) 1994, 1999, 2000 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// 27.6.2.7 standard basic_ostream manipulators
-
-#include <ostream>
-#include <sstream>
-#include <stdexcept>
-#include <testsuite_hooks.h>
-
-bool test01(void)
-{
-  bool test = true;
-
-  const char str_lit01[] = "  venice ";
-  const std::string str01(" santa barbara ");
-  std::string str02(str_lit01);
-  std::string str04;
-  std::string str05;
-  std::ios_base::iostate flag1, flag2, flag3, flag4, flag5;
-
-  // template<_CharT, _Traits>
-  //  basic_ostream<_CharT, _Traits>& endl(basic_ostream<_Char, _Traits>& os)
-  std::ostringstream oss01(str01);
-  std::ostringstream oss02;
-  std::ostringstream::int_type i01, i02;
-  typedef std::ostringstream::traits_type traits_type;
-
-  oss01 << std::endl;
-  str04 = oss01.str();
-  VERIFY( str04.size() == str01.size() );
-
-  oss02 << std::endl;
-  str05 = oss02.str();
-  VERIFY( str05.size() == 1 );
-
-  // template<_CharT, _Traits>
-  //  basic_ostream<_CharT, _Traits>& ends(basic_ostream<_Char, _Traits>& os)
-  oss01 << std::ends;
-  str04 = oss01.str();
-  VERIFY( str04.size() == str01.size() );
-  VERIFY( str04[1] == char() );
-
-  oss02 << std::ends;
-  str05 = oss02.str();
-  VERIFY( str05.size() == 2 );
-  VERIFY( str05[1] == char() );
-
-  // template<_CharT, _Traits>
-  //  basic_ostream<_CharT, _Traits>& flush(basic_ostream<_Char, _Traits>& os)
-  oss01.flush();
-  str04 = oss01.str();
-  VERIFY( str04.size() == str01.size() );
-
-  oss02.flush();
-  str05 = oss02.str();
-  VERIFY( str05.size() == 2 );
-
-#ifdef DEBUG_ASSERT
-  assert(test);
-#endif
-  return test;
-}
-
-
-// based vaguely on this:
-// http://gcc.gnu.org/ml/libstdc++/2000-q2/msg00109.html
-bool test02()
-{
-  using namespace std;
-  typedef ostringstream::int_type int_type;
-
-  bool test = true;
-  ostringstream osst_01;
-  const string str_00("herbie_hancock");
-  int_type len1 = str_00.size();
-  osst_01 << str_00;
-  VERIFY( osst_01.str().size() == len1 );
-
-  osst_01 << ends;
-
-  const string str_01("speak like a child");
-  int_type len2 = str_01.size();
-  osst_01 << str_01;
-  int_type len3 = osst_01.str().size();
-  VERIFY( len1 < len3 );
-  VERIFY( len3 == len1 + len2 + 1 );
-
-  osst_01 << ends;
-
-  const string str_02("+ inventions and dimensions");
-  int_type len4 = str_02.size();
-  osst_01 << str_02;
-  int_type len5 = osst_01.str().size();
-  VERIFY( len3 < len5 );
-  VERIFY( len5 == len3 + len4 + 1 );
-
-#ifdef DEBUG_ASSERT
-  assert(test);
-#endif
-  return test;
-}
-
-int main()
-{ 
-  test01();
-  test02();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/27_io/ostream_seeks-1.tst b/libstdc++-v3/testsuite/27_io/ostream_seeks-1.tst
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/libstdc++-v3/testsuite/27_io/ostream_seeks.cc b/libstdc++-v3/testsuite/27_io/ostream_seeks.cc
deleted file mode 100644 (file)
index 5afc675..0000000
+++ /dev/null
@@ -1,301 +0,0 @@
-// 2000-06-29 bkoz
-
-// Copyright (C) 2000 Free Software Foundation
-//
-// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// 27.6.2.4 basic_ostream seek members
-
-#include <ostream>
-#include <sstream>
-#include <fstream>
-#include <testsuite_hooks.h>
-
-
-bool test01()
-{
-  using namespace std;
-  typedef ios::pos_type pos_type;
-
-  bool test = true;
-  const char str_lit01[] = "ostream_seeks-1.txt";
-
-  // out
-  // test default ctors leave things in the same positions...
-  ostringstream ost1;
-  pos_type p1 = ost1.tellp();
-
-  ofstream ofs1;
-  pos_type p2 = ofs1.tellp();
-
-  VERIFY( p1 == p2 );
-
-  // out
-  // test ctors leave things in the same positions...
-  ostringstream ost2("bob_marley:kaya");
-  p1 = ost2.tellp();
-
-  ofstream ofs2(str_lit01);
-  p2 = ofs2.tellp();
-  VERIFY( p1 == p2 );
-
-#ifdef DEBUG_ASSERT
-  assert(test);
-#endif
-
-  return test;
-}
-
-#if 0
-// XXX FIX ME
-// basically this is the istreams_seeks.cc code. We need to fix it up
-// for ostreams......
-
-// fstreams
-void test04(void)
-{
-  bool test = true;
-  std::istream::pos_type pos01, pos02, pos03, pos04, pos05, pos06;
-  std::ios_base::iostate state01, state02;
-  const char str_lit01[] = "istream_unformatted-1.txt";
-  const char str_lit02[] = "istream_unformatted-2.txt";
-  std::ifstream if01(str_lit01, std::ios_base::in | std::ios_base::out);
-  std::ifstream if02(str_lit01, std::ios_base::in);
-  std::ifstream if03(str_lit02, std::ios_base::out | std::ios_base::trunc); 
-  VERIFY( if01.good() );
-  VERIFY( if02.good() );
-  VERIFY( if03.good() );
-
-  std::istream is01(if01.rdbuf());
-  std::istream is02(if02.rdbuf());
-  std::istream is03(if03.rdbuf());
-
-  // pos_type tellp()
-  // in | out
-  pos01 = is01.tellp();
-  pos02 = is01.tellp();
-  VERIFY( pos01 == pos02 );
-  //  VERIFY( istream::pos_type(0) != pos01 ); //deprecated
-
-  // in
-  pos03 = is02.tellp();
-  pos04 = is02.tellp();
-  VERIFY( pos03 == pos04 );
-  //  VERIFY( istream::pos_type(0) != pos03 ); //deprecated
-
-  // out
-  pos05 = is03.tellp();
-  pos06 = is03.tellp();
-  VERIFY( pos05 == pos06 );
-  //  VERIFY( istream::pos_type(0) != pos01 ); //deprecated
-
-  // istream& seekg(pos_type)
-  // istream& seekg(off_type, ios_base::seekdir)
-
-  // cur 
-  // NB: see library issues list 136. It's the v-3 interp that seekg
-  // only sets the input buffer, or else istreams with buffers that
-  // have _M_mode == ios_base::out will fail to have consistency
-  // between seekg and tellp.
-  state01 = is01.rdstate();
-  is01.seekg(10, std::ios_base::cur);
-  state02 = is01.rdstate();
-  pos01 = is01.tellp(); 
-  VERIFY( pos01 == pos02 + 10 ); 
-  VERIFY( state01 == state02 );
-  pos02 = is01.tellp(); 
-  VERIFY( pos02 == pos01 ); 
-
-  state01 = is02.rdstate();
-  is02.seekg(10, std::ios_base::cur);
-  state02 = is02.rdstate();
-  pos03 = is02.tellp(); 
-  VERIFY( pos03 == pos04 + 10 ); 
-  VERIFY( state01 == state02 );
-  pos04 = is02.tellp(); 
-  VERIFY( pos03 == pos04 ); 
-
-  state01 = is03.rdstate();
-  is03.seekg(10, std::ios_base::cur);
-  state02 = is03.rdstate();
-  pos05 = is03.tellp(); 
-  VERIFY( pos05 == pos06 + 10 ); 
-  VERIFY( state01 == state02 );
-  pos06 = is03.tellp(); 
-  VERIFY( pos05 == pos06 ); 
-
-  // beg
-  state01 = is01.rdstate();
-  is01.seekg(20, std::ios_base::beg);
-  state02 = is01.rdstate();
-  pos01 = is01.tellp(); 
-  VERIFY( pos01 == pos02 + 10 ); 
-  VERIFY( state01 == state02 );
-  pos02 = is01.tellp(); 
-  VERIFY( pos02 == pos01 ); 
-
-  state01 = is02.rdstate();
-  is02.seekg(20, std::ios_base::beg);
-  state02 = is02.rdstate();
-  pos03 = is02.tellp(); 
-  VERIFY( pos03 == pos04 + 10 ); 
-  VERIFY( state01 == state02 );
-  pos04 = is02.tellp(); 
-  VERIFY( pos03 == pos04 ); 
-
-  state01 = is03.rdstate();
-  is03.seekg(20, std::ios_base::beg);
-  state02 = is03.rdstate();
-  pos05 = is03.tellp(); 
-  VERIFY( pos05 == pos06 + 10 );
-  VERIFY( state01 == state02 );
-  pos06 = is03.tellp(); 
-  VERIFY( pos05 == pos06 ); 
-
-  // libstdc++/6414
-  if01.seekg(0, std::ios_base::beg);
-  pos01 = if01.tellg();
-  if01.peek();
-  pos02 = if01.tellg();
-  VERIFY( pos02 == pos01 );
-
-#ifdef DEBUG_ASSERT
-  assert(test);
-#endif
-}
-
-// stringstreams
-void test05(void)
-{
-  bool test = true;
-  std::istream::pos_type pos01, pos02, pos03, pos04, pos05, pos06;
-  std::ios_base::iostate state01, state02;
-  const char str_lit01[] = "istream_unformatted-1.tst";
-  std::ifstream if01(str_lit01);
-  std::ifstream if02(str_lit01);
-  std::ifstream if03(str_lit01);
-  VERIFY( if01.good() );
-  VERIFY( if02.good() );
-  VERIFY( if03.good() );
-
-  std::stringbuf strbuf01(std::ios_base::in | std::ios_base::out);
-  if01 >> &strbuf01; 
-  // initialize stringbufs that are ios_base::out
-  std::stringbuf strbuf03(strbuf01.str(), std::ios_base::out);
-  // initialize stringbufs that are ios_base::in
-  std::stringbuf strbuf02(strbuf01.str(), std::ios_base::in);
-
-  std::istream is01(&strbuf01);
-  std::istream is02(&strbuf02);
-  std::istream is03(&strbuf03);
-
-  // pos_type tellp()
-  // in | out
-  pos01 = is01.tellp();
-  pos02 = is01.tellp();
-  VERIFY( pos01 == pos02 );
-  // VERIFY( istream::pos_type(0) != pos01 ); // deprecated
-
-  // in
-  pos03 = is02.tellp();
-  pos04 = is02.tellp();
-  VERIFY( pos03 == pos04 );
-  //  VERIFY( istream::pos_type(0) != pos03 ); // deprecated
-
-  // out
-  pos05 = is03.tellp();
-  pos06 = is03.tellp();
-  VERIFY( pos05 == pos06 );
-  //  VERIFY( istream::pos_type(0) != pos01 ); //deprecated
-
-  // istream& seekg(pos_type)
-  // istream& seekg(off_type, ios_base::seekdir)
-
-  // cur 
-  // NB: see library issues list 136. It's the v-3 interp that seekg
-  // only sets the input buffer, or else istreams with buffers that
-  // have _M_mode == ios_base::out will fail to have consistency
-  // between seekg and tellp.
-  state01 = is01.rdstate();
-  is01.seekg(10, std::ios_base::cur);
-  state02 = is01.rdstate();
-  pos01 = is01.tellp(); 
-  VERIFY( pos01 == pos02 + 10 ); 
-  VERIFY( state01 == state02 );
-  pos02 = is01.tellp(); 
-  VERIFY( pos02 == pos01 ); 
-
-  state01 = is02.rdstate();
-  is02.seekg(10, std::ios_base::cur);
-  state02 = is02.rdstate();
-  pos03 = is02.tellp(); 
-  VERIFY( pos03 == pos04 + 10 ); 
-  VERIFY( state01 == state02 );
-  pos04 = is02.tellp(); 
-  VERIFY( pos03 == pos04 ); 
-
-  state01 = is03.rdstate();
-  is03.seekg(10, std::ios_base::cur);
-  state02 = is03.rdstate();
-  pos05 = is03.tellp(); 
-  VERIFY( pos05 == pos06 ); // as only out buffer 
-  VERIFY( state01 == state02 );
-  pos06 = is03.tellp(); 
-  VERIFY( pos05 == pos06 ); 
-
-  // beg
-  state01 = is01.rdstate();
-  is01.seekg(20, std::ios_base::beg);
-  state02 = is01.rdstate();
-  pos01 = is01.tellp(); 
-  VERIFY( pos01 == pos02 + 10 ); 
-  VERIFY( state01 == state02 );
-  pos02 = is01.tellp(); 
-  VERIFY( pos02 == pos01 ); 
-
-  state01 = is02.rdstate();
-  is02.seekg(20, std::ios_base::beg);
-  state02 = is02.rdstate();
-  pos03 = is02.tellp(); 
-  VERIFY( pos03 == pos04 + 10 ); 
-  VERIFY( state01 == state02 );
-  pos04 = is02.tellp(); 
-  VERIFY( pos03 == pos04 ); 
-
-  state01 = is03.rdstate();
-  is03.seekg(20, std::ios_base::beg);
-  state02 = is03.rdstate();
-  pos05 = is03.tellp(); 
-  VERIFY( pos05 == pos06 ); // as only out buffer 
-  VERIFY( state01 == state02 );
-  pos06 = is03.tellp(); 
-  VERIFY( pos05 == pos06 ); 
-
-#ifdef DEBUG_ASSERT
-  assert(test);
-#endif
-}
-#endif // XXX
-
-int main()
-{
-  test01();
-  //  test04();
-  //  test05();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/27_io/ostream_sentry.cc b/libstdc++-v3/testsuite/27_io/ostream_sentry.cc
deleted file mode 100644 (file)
index 322dbc5..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-// 2003-02-06  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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// As a special exception, you may use this file as part of a free software
-// library without restriction.  Specifically, if other files instantiate
-// templates or use macros or inline functions from this file, or you compile
-// this file and link it with other files to produce an executable, this
-// file does not by itself cause the resulting executable to be covered by
-// the GNU General Public License.  This exception does not however
-// invalidate any other reasons why the executable file might be covered by
-// the GNU General Public License.
-
-// 27.6.2.3 class basic_ostream::sentry
-
-#include <ostream>
-#include <sstream>
-#include <testsuite_hooks.h>
-
-// libstdc++/9562
-void
-test01()
-{
-  bool test = true;
-
-  std::stringbuf strbuf01;
-  std::ostream strm1(&strbuf01);
-  const std::ostream::sentry sentry1(strm1);
-
-  VERIFY( bool(sentry1) == true );
-}
-
-// libstdc++/9563
-struct buf: std::streambuf
-{
-  std::ios *io_;
-  
-  buf (std::ios *io): io_ (io) { }
-  
-  virtual int sync ()
-  {
-    io_->setstate (std::ios::failbit);
-    return 0;
-  }
-};
-
-void
-test02()
-{
-  bool test = true;
-
-  buf b(0);
-  std::ostream strm(&b);
-  
-  buf tb(&strm);
-  std::ostream tied(&tb);
-
-  strm.tie(&tied);
-  std::ostream::sentry s(strm);
-
-  VERIFY( !s );
-}
-
-int main() 
-{
-  test01();
-  test02();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/27_io/ostream_unformatted.cc b/libstdc++-v3/testsuite/27_io/ostream_unformatted.cc
deleted file mode 100644 (file)
index a55ac3c..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-// 2000-03-23 bkoz
-
-// Copyright (C) 2000 Free Software Foundation
-//
-// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-//
-
-#include <sstream>
-#include <ostream>
-#include <testsuite_hooks.h>
-
-
-void test01()
-{
-  using namespace std;
-  typedef std::stringbuf::pos_type        pos_type;
-  typedef std::stringbuf::off_type        off_type;
-  bool test = true;
-
-  // tellp
-  ostringstream ost;
-  pos_type pos1;
-  pos1 = ost.tellp();
-  VERIFY( pos1 == pos_type(-1) );
-  ost << "RZA ";
-  pos1 = ost.tellp();
-  VERIFY( pos1 == pos_type(4) );
-  ost << "ghost dog: way of the samurai";
-  pos1 = ost.tellp();
-  VERIFY( pos1 == pos_type(33) );
-
-#ifdef DEBUG_ASSERT
-  assert(test);
-#endif
-}                                    
-
-int main()
-{
-  test01();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/27_io/ostringstream.cc b/libstdc++-v3/testsuite/27_io/ostringstream.cc
deleted file mode 100644 (file)
index c8a9dfc..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-// 2002-07-25 Benjamin Kosnik <bkoz@redhat.com>
-
-// Copyright (C) 2002 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// As a special exception, you may use this file as part of a free software
-// library without restriction.  Specifically, if other files instantiate
-// templates or use macros or inline functions from this file, or you compile
-// this file and link it with other files to produce an executable, this
-// file does not by itself cause the resulting executable to be covered by
-// the GNU General Public License.  This exception does not however
-// invalidate any other reasons why the executable file might be covered by
-// the GNU General Public License.
-
-// 27.7.3 - Class basic_ostringstream
-// NB: This file is for testing basic_ostringstream with NO OTHER INCLUDES.
-
-#include <sstream>
-
-// { dg-do compile }
-
-// libstdc++/7216
-void test01()
-{
-  // Check for required typedefs
-  typedef std::ostringstream test_type;
-  typedef test_type::char_type char_type;
-  typedef test_type::traits_type traits_type;
-  typedef test_type::int_type int_type;
-  typedef test_type::pos_type pos_type;
-  typedef test_type::off_type off_type;
-}
-
-namespace test 
-{
-  using namespace std;
-  typedef short type_t;
-  template class basic_ostringstream<type_t, char_traits<type_t> >;
-} // test
-
-int main() 
-{
-  test01();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/27_io/ostringstream_members.cc b/libstdc++-v3/testsuite/27_io/ostringstream_members.cc
deleted file mode 100644 (file)
index bf82369..0000000
+++ /dev/null
@@ -1,157 +0,0 @@
-// 2001-05-23 Benjamin Kosnik  <bkoz@redhat.com>
-
-// Copyright (C) 2001, 2002 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// 27.7.3.2 member functions (ostringstream_members)
-
-#include <sstream>
-#include <testsuite_hooks.h>
-
-void test01()
-{
-  bool test = true;
-  std::ostringstream os01;
-  const std::string str00; 
-  const std::string str01 = "123";
-  std::string str02;
-  const int i01 = 123;
-  int a,b;
-
-  std::ios_base::iostate state1, state2, statefail, stateeof;
-  statefail = std::ios_base::failbit;
-  stateeof = std::ios_base::eofbit;
-
-  // string str() const
-  str02 = os01.str();
-  VERIFY( str00 == str02 );
-
-  // void str(const basic_string&)
-  os01.str(str01);
-  str02 = os01.str();
-  VERIFY( str01 == str02 );
-
- #ifdef DEBUG_ASSERT
-  assert(test);
-#endif
-}
-
-void 
-redirect_buffer(std::ios& stream, std::streambuf* new_buf) 
-{ stream.rdbuf(new_buf); }
-
-std::streambuf*
-active_buffer(std::ios& stream)
-{ return stream.rdbuf(); }
-
-// libstdc++/2832
-void test02()
-{
-  bool test = true;
-  const char* strlit01 = "fuck war";
-  const char* strlit02 = "two less cars abstract riot crew, critical mass/SF";
-  const std::string str00;
-  const std::string str01(strlit01);
-  std::string str02;
-  std::stringbuf sbuf(str01);
-  std::streambuf* pbasebuf0 = &sbuf;
-
-  std::ostringstream sstrm1;
-  VERIFY( sstrm1.str() == str00 );
-  // derived rdbuf() always returns original streambuf, even though
-  // it's no longer associated with the stream.
-  std::stringbuf* const buf1 = sstrm1.rdbuf();
-  // base rdbuf() returns the currently associated streambuf
-  std::streambuf* pbasebuf1 = active_buffer(sstrm1);
-  redirect_buffer(sstrm1, &sbuf);
-  std::stringbuf* const buf2 = sstrm1.rdbuf();
-  std::streambuf* pbasebuf2 = active_buffer(sstrm1);
-  VERIFY( buf1 == buf2 ); 
-  VERIFY( pbasebuf1 != pbasebuf2 );
-  VERIFY( pbasebuf2 == pbasebuf0 );
-
-  // derived rdbuf() returns the original buf, so str() doesn't change.
-  VERIFY( sstrm1.str() != str01 );
-  VERIFY( sstrm1.str() == str00 );
-  // however, casting the active streambuf to a stringbuf shows what's up:
-  std::stringbuf* psbuf = dynamic_cast<std::stringbuf*>(pbasebuf2);
-  str02 = psbuf->str();
-  VERIFY( str02 == str01 );
-
-  // How confusing and non-intuitive is this?
-  // These semantics are a joke, a serious defect, and incredibly lame.
-}
-
-// 03: sanity checks for strings, stringbufs
-void
-test03()
-{
-  bool test = false;
-
-  // Empty string sanity check.
-  std::string str01;
-  std::string::iterator __i_start = str01.begin();
-  std::string::iterator __i_end = str01.end();
-  std::string::size_type len = str01.size();
-  test = __i_start == __i_end;
-  VERIFY( len == 0 );
-
-  // Full string sanity check.
-  std::string str02("these golden days, i spend waiting for you:\n"
-                   "Betty Carter on Verve with I'm Yours and You're Mine.");
-  __i_start = str02.begin();
-  __i_end = str02.end();
-  len = str02.size();
-  VERIFY( __i_start != __i_end );
-  VERIFY( len != 0 );
-  // Test an empty ostringstream for sanity.
-  std::ostringstream ostrstream0;
-  std::string str03 = ostrstream0.str();
-  __i_start = str03.begin();
-  __i_end = str03.end();
-  len = str03.size();
-  VERIFY( __i_start == __i_end );
-  VERIFY( len == 0 );
-  VERIFY( str01 == str03 );
-}
-
-// user-reported error
-class derived_oss: public std::ostringstream 
-{
-public:
-  derived_oss() : std::ostringstream() { }
-};
-
-void
-test04()
-{
-  bool test = true;
-  derived_oss yy;
-  yy << "buena vista social club\n";
-  VERIFY( yy.str() == std::string("buena vista social club\n") );
-}
-
-int main()
-{
-  test01();
-  test02();
-  test03();
-  test04();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/27_io/standard_manipulators.cc b/libstdc++-v3/testsuite/27_io/standard_manipulators.cc
deleted file mode 100644 (file)
index 7182237..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-// Copyright (C) 2002 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// 27.6.3 - Standard manipulators
-
-#include <sstream>
-#include <iomanip>
-#include <testsuite_hooks.h>
-
-void
-test01()
-{
-  using namespace std;
-  bool test = true;
-
-  string s("john coltrane, a love supreme");
-  istringstream  iss(s);
-  ostringstream  oss;
-
-  // resetiosflags
-  resetiosflags(ios_base::boolalpha);
-  iss >> resetiosflags(ios_base::boolalpha);
-  VERIFY(iss.good());
-  oss << resetiosflags(ios_base::boolalpha);
-  VERIFY(oss.good());
-
-  // setiosflags
-  setiosflags(ios_base::skipws);
-  iss >> setiosflags(ios_base::skipws);
-  VERIFY(iss.good());
-  oss << setiosflags(ios_base::skipws);
-  VERIFY(oss.good());
-
-  // setbase
-  setbase(8);
-  iss >> setbase(8);
-  VERIFY(iss.good());
-  oss << setbase(8);
-  VERIFY(oss.good());
-
-  // setfil
-  setfill('a');
-  iss >>  setfill('a');
-  VERIFY(iss.good());
-  oss << setfill('a');
-  VERIFY(oss.good());
-  // setprecision
-  setprecision(4);
-  iss >> setprecision(4);
-  VERIFY(iss.good());
-  oss << setprecision(4);
-  VERIFY(oss.good());
-  
-  // setprecision
-  setw(7);
-  iss >> setw(7);
-  VERIFY(iss.good());
-  oss << setw(7);
-  VERIFY(oss.good());
-}
-
-
-int
-main()
-{
-  test01();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/27_io/streambuf.cc b/libstdc++-v3/testsuite/27_io/streambuf.cc
deleted file mode 100644 (file)
index 29c771b..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-// 2002-07-25 Benjamin Kosnik <bkoz@redhat.com>
-
-// Copyright (C) 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// As a special exception, you may use this file as part of a free software
-// library without restriction.  Specifically, if other files instantiate
-// templates or use macros or inline functions from this file, or you compile
-// this file and link it with other files to produce an executable, this
-// file does not by itself cause the resulting executable to be covered by
-// the GNU General Public License.  This exception does not however
-// invalidate any other reasons why the executable file might be covered by
-// the GNU General Public License.
-
-// 27.5.2 - Template class basic_streambuf
-// NB: This file is for testing basic_streambuf with NO OTHER INCLUDES.
-
-#include <streambuf>
-#include <testsuite_hooks.h>
-
-// { dg-do compile }
-
-// libstdc++/7216
-void test01()
-{
-  // Check for required typedefs
-  typedef std::streambuf test_type;
-  typedef test_type::char_type char_type;
-  typedef test_type::traits_type traits_type;
-  typedef test_type::int_type int_type;
-  typedef test_type::pos_type pos_type;
-  typedef test_type::off_type off_type;
-}
-
-namespace test 
-{
-  using namespace std;
-  using __gnu_cxx_test::pod_char;
-  typedef short type_t;
-  template class basic_streambuf<type_t, char_traits<type_t> >;
-  template class basic_streambuf<pod_char, char_traits<pod_char> >;
-} // test
-
-int main() 
-{
-  test01();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/27_io/streambuf_members.cc b/libstdc++-v3/testsuite/27_io/streambuf_members.cc
deleted file mode 100644 (file)
index 263a95f..0000000
+++ /dev/null
@@ -1,536 +0,0 @@
-// 1999-10-11 bkoz
-
-// Copyright (C) 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// As a special exception, you may use this file as part of a free software
-// library without restriction.  Specifically, if other files instantiate
-// templates or use macros or inline functions from this file, or you compile
-// this file and link it with other files to produce an executable, this
-// file does not by itself cause the resulting executable to be covered by
-// the GNU General Public License.  This exception does not however
-// invalidate any other reasons why the executable file might be covered by
-// the GNU General Public License.
-
-// 27.5.2 template class basic_streambuf
-
-#include <cstring> // for memset, memcmp
-#include <streambuf>
-#include <sstream>
-#include <ostream>
-#include <testsuite_hooks.h>
-
-class testbuf : public std::streambuf
-{
-public:
-
-  // Typedefs:
-  typedef std::streambuf::traits_type traits_type;
-  typedef std::streambuf::char_type char_type;
-
-  testbuf(): std::streambuf() 
-  { _M_mode = (std::ios_base::in | std::ios_base::out); }
-
-  bool
-  check_pointers()
-  { 
-    bool test = true;
-    VERIFY( this->eback() == NULL );
-    VERIFY( this->gptr() == NULL );
-    VERIFY( this->egptr() == NULL );
-    VERIFY( this->pbase() == NULL );
-    VERIFY( this->pptr() == NULL );
-    VERIFY( this->epptr() == NULL );
-    return test;
-  }
-
-  int_type 
-  pub_uflow() 
-  { return (this->uflow()); }
-
-  int_type 
-  pub_overflow(int_type __c = traits_type::eof()) 
-  { return (this->overflow(__c)); }
-
-  int_type 
-  pub_pbackfail(int_type __c) 
-  { return (this->pbackfail(__c)); }
-
-  void 
-  pub_setg(char* beg, char* cur, char *end) 
-  { this->setg(beg, cur, end); }
-
-  void 
-  pub_setp(char* beg, char* end) 
-  { this->setp(beg, end); }
-
-protected:
-  int_type 
-  underflow() 
-  { 
-    int_type __retval = traits_type::eof();
-    if (this->gptr() < this->egptr())
-      __retval = traits_type::not_eof(0); 
-    return __retval;
-  }
-};
-
-void test01()
-{
-  typedef testbuf::traits_type traits_type;
-  typedef testbuf::int_type int_type;
-
-  bool test = true;
-  char* lit01 = "chicago underground trio/possible cube on delmark";
-  testbuf buf01;
-
-  // 27.5.2.1 basic_streambuf ctors
-  // default ctor initializes 
-  // - all pointer members to null pointers
-  // - locale to current global locale
-  VERIFY( buf01.check_pointers() );
-  VERIFY( buf01.getloc() == std::locale() );
-
-  // 27.5.2.3.1 get area
-  // 27.5.2.2.3 get area
-  // 27.5.2.4.3 get area
-  int i01 = 3;
-  buf01.pub_setg(lit01, lit01, (lit01 + i01));
-  VERIFY( i01 == buf01.in_avail() );
-
-  VERIFY( buf01.pub_uflow() == lit01[0] );
-  VERIFY( buf01.sgetc() == traits_type::to_int_type(lit01[1]) );
-  VERIFY( buf01.pub_uflow() == lit01[1] );
-  VERIFY( buf01.sgetc() == traits_type::to_int_type(lit01[2]) );
-  VERIFY( buf01.pub_uflow() == lit01[2] );
-  VERIFY( buf01.sgetc() == traits_type::eof() );
-
-  // pbackfail
-  buf01.pub_setg(lit01, lit01, (lit01 + i01));
-  VERIFY( i01 == buf01.in_avail() );
-  int_type intt01 = traits_type::to_int_type('b');
-  VERIFY( traits_type::eof() == buf01.pub_pbackfail(intt01) );
-
-  // overflow
-  VERIFY( traits_type::eof() == buf01.pub_overflow(intt01) );
-  VERIFY( traits_type::eof() == buf01.pub_overflow() );
-  VERIFY( buf01.sgetc() == traits_type::to_int_type(lit01[0]) );
-
-  // sputn/xsputn
-  char* lit02 = "isotope 217: the unstable molecule on thrill jockey";
-  int i02 = std::strlen(lit02);
-  char carray[i02 + 1];
-  std::memset(carray, 0, i02 + 1);
-
-  buf01.pub_setp(carray, (carray + i02));
-  buf01.sputn(lit02, 0);
-  VERIFY( carray[0] == 0 );
-  VERIFY( lit02[0] == 'i' );
-  buf01.sputn(lit02, 1);
-  VERIFY( lit02[0] == carray[0] );
-  VERIFY( lit02[1] == 's' );
-  VERIFY( carray[1] == 0 );
-  buf01.sputn(lit02 + 1, 10);
-  VERIFY( std::memcmp(lit02, carray, 10) == 0 );
-  buf01.sputn(lit02 + 11, 20);
-  VERIFY( std::memcmp(lit02, carray, 30) == 0 );
-
-#ifdef DEBUG_ASSERT
-  assert(test);
-#endif
-}
-
-void test02()
-{
-  typedef testbuf::traits_type traits_type;
-  typedef testbuf::int_type int_type;
-
-  bool test = true;
-  char* lit01 = "chicago underground trio/possible cube on delmark";
-  testbuf buf01;
-
-  // 27.5.2.1 basic_streambuf ctors
-  // default ctor initializes 
-  // - all pointer members to null pointers
-  // - locale to current global locale
-  VERIFY( buf01.check_pointers() );
-  VERIFY( buf01.getloc() == std::locale() );
-
-  // 27.5.2.2.5 Put area
-  size_t i01 = traits_type::length(lit01);
-  char carray01[i01];
-  std::memset(carray01, 0, i01);
-  
-  buf01.pub_setg(lit01, lit01, lit01 + i01);
-  buf01.sgetn(carray01, 0);
-  VERIFY( carray01[0] == 0 );
-  buf01.sgetn(carray01, 1);
-  VERIFY( carray01[0] == 'c' );
-  buf01.sgetn(carray01 + 1, i01 - 1);
-  VERIFY( carray01[0] == 'c' );
-  VERIFY( carray01[1] == 'h' );
-  VERIFY( carray01[i01 - 1] == 'k' );
-
-#ifdef DEBUG_ASSERT
-  assert(test);
-#endif
-}
-// test03
-// http://gcc.gnu.org/ml/libstdc++/2000-q1/msg00151.html
-template<typename charT, typename traits = std::char_traits<charT> >
-  class basic_nullbuf : public std::basic_streambuf<charT, traits>
-  {
-  protected:
-    typedef typename
-      std::basic_streambuf<charT, traits>::int_type int_type;
-    virtual int_type 
-    overflow(int_type c) 
-    {  return traits::not_eof(c); }
-  };
-
-typedef basic_nullbuf<char> nullbuf;
-typedef basic_nullbuf<wchar_t> wnullbuf;
-
-template<typename T>
-  char
-  print(const T& x) 
-  {
-   nullbuf ob;
-   std::ostream out(&ob); 
-   out << x << std::endl;
-   return (!out ? '0' : '1');
- }
-
-void test03() 
-{
-  bool test = true;
-  const std::string control01("11111");
-  std::string test01;
-
-  test01 += print(true);
-  test01 += print(3.14159);
-  test01 += print(10);
-  test01 += print('x');
-  test01 += print("pipo");
-
-  VERIFY( test01 == control01 );
-#ifdef DEBUG_ASSERT
-  assert(test);
-#endif
-}
-
-class setpbuf : public std::streambuf
-{
-  char                 buffer[4];
-  std::string  result;
-
-public:
-
-  std::string&
-  get_result()
-  { return result; }
-
-  setpbuf()
-  {
-    char foo [32];
-    setp(foo, foo + 32);
-    setp(buffer, buffer + 4);
-  }
-
-  ~setpbuf()
-  { sync(); }
-
-  virtual int_type 
-  overflow(int_type n)
-  {
-    if (sync() != 0)
-      return traits_type::eof();
-    
-    result += traits_type::to_char_type(n);
-    
-    return n;
-  }
-  
-  virtual int 
-  sync()
-  {
-    result.append(pbase(), pptr());
-    setp(buffer, buffer + 4);
-    return 0;
-  }
-};
-
-// libstdc++/1057
-void test04()
-{
-  bool test = true;
-  std::string text = "abcdefghijklmn";
-  
-  // 01
-  setpbuf sp1;
-  // Here xsputn writes over sp1.result
-  sp1.sputn(text.c_str(), text.length());
-
-  // This crashes when result is accessed
-  sp1.pubsync();
-  VERIFY( sp1.get_result() == text );
-  
-
-  // 02
-  setpbuf sp2;
-  for (std::string::size_type i = 0; i < text.length(); ++i)
-    {
-      // sputc also writes over result
-      sp2.sputc(text[i]);
-    }
-  
-  // Crash here
-  sp2.pubsync();
-  VERIFY( sp2.get_result() == text );
-}
-
-class nullsetpbuf : public std::streambuf
-{
-  char foo[64];
-public:
-  nullsetpbuf()
-  {
-    setp(foo, foo + 64);
-    setp(NULL, NULL);
-  }
-};
-
-// libstdc++/1057
-void test05()
-{
-    std::string text1 = "abcdefghijklmn";
-
-    nullsetpbuf nsp;
-    // Immediate crash as xsputn writes to null pointer
-    nsp.sputn(text1.c_str(), text1.length());
-    // ditto
-    nsp.sputc('a');
-}
-
-// test06
-namespace gnu 
-{
-  class something_derived;
-}
-
-class gnu::something_derived : std::streambuf { };
-
-// libstdc++/3599
-class testbuf2 : public std::streambuf
-{
-public:
-  typedef std::streambuf::traits_type traits_type;
-
-  testbuf2() : std::streambuf() { }
-protected:
-  int_type 
-  overflow(int_type c = traits_type::eof()) 
-  { return traits_type::not_eof(0); }
-};
-
-void
-test07()
-{
-  bool test = true;
-  testbuf2 ob;
-  std::ostream out(&ob); 
-
-  out << "gasp";
-  VERIFY(out.good());
-
-  out << std::endl;
-  VERIFY(out.good());
-}
-
-// libstdc++/9322
-void test08()
-{
-  using std::locale;
-  bool test = true;
-
-  locale loc;
-  testbuf2 ob;
-  VERIFY( ob.getloc() == loc );
-
-  locale::global(locale("en_US"));
-  VERIFY( ob.getloc() == loc );
-
-  locale loc_de ("de_DE");
-  locale ret = ob.pubimbue(loc_de);
-  VERIFY( ob.getloc() == loc_de );
-  VERIFY( ret == loc );
-
-  locale::global(loc);
-  VERIFY( ob.getloc() == loc_de );
-}
-
-// libstdc++/9318
-class Outbuf : public std::streambuf
-{
-public:
-  typedef std::streambuf::traits_type traits_type;
-
-  std::string result() const { return str; }
-
-protected:
-  virtual int_type overflow(int_type c = traits_type::eof())
-  {
-    if (!traits_type::eq_int_type(c, traits_type::eof()))
-      str.push_back(traits_type::to_char_type(c));
-    return traits_type::not_eof(c);
-  }
-
-private:
-  std::string str;
-};
-
-// <1>
-void test09()
-{
-  bool test = true;
-  
-  std::istringstream stream("Bad Moon Rising");
-  Outbuf buf;
-  stream >> &buf;
-
-  VERIFY( buf.result() == "Bad Moon Rising" );
-}
-
-// <2>
-void test10()
-{
-  bool test = true;
-
-  std::stringbuf sbuf("Bad Moon Rising", std::ios::in);
-  Outbuf buf;
-  std::ostream stream(&buf);
-  stream << &sbuf;
-
-  VERIFY( buf.result() == "Bad Moon Rising" );
-}
-
-// libstdc++/9424
-class Outbuf_2 : public std::streambuf
-{
-  char buf[1];
-
-public:
-  Outbuf_2()
-  {
-    setp(buf, buf + 1);
-  }
-
-  int_type overflow(int_type c)
-  {
-    int_type eof = traits_type::eof();
-    
-    if (pptr() < epptr())
-      {
-       if (traits_type::eq_int_type(c, eof))
-         return traits_type::not_eof(c);
-       
-       *pptr() = traits_type::to_char_type(c);
-       pbump(1);
-       return c;
-      }
-
-    return eof;
-  }
-};
-
-class Inbuf_2 : public std::streambuf
-{
-  static const char buf[];
-  const char* current;
-  int size;
-
-public:
-  Inbuf_2()
-  {
-    current = buf;
-    size = std::strlen(buf);
-  }
-  
-  int_type underflow()
-  {
-    if (current < buf + size)
-      return traits_type::to_int_type(*current);
-    return traits_type::eof();
-  }
-  
-  int_type uflow()
-  {
-    if (current < buf + size)
-      return traits_type::to_int_type(*current++);
-    return traits_type::eof();
-  }
-};
-
-const char Inbuf_2::buf[] = "Atteivlis";
-
-// <1>
-void test11()
-{
-  bool test = true;
-
-  Inbuf_2 inbuf1;
-  std::istream is(&inbuf1);
-  Outbuf_2 outbuf1;
-  is >> &outbuf1;
-  VERIFY( inbuf1.sgetc() == 't' );
-  VERIFY( is.good() );
-}
-
-// <2>
-void test12()
-{ 
-  bool test = true;
-  Outbuf_2 outbuf2;
-  std::ostream os (&outbuf2);
-  Inbuf_2 inbuf2;
-  os << &inbuf2;
-  VERIFY( inbuf2.sgetc() == 't' );
-  VERIFY( os.good() );
-}
-
-int main() 
-{
-  test01();
-  test02();
-  test03();
-
-  test04();
-  test05();
-
-  test07();
-  __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test08);
-
-  test09();
-  test10();
-  test11();
-  test12();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/27_io/stringbuf.cc b/libstdc++-v3/testsuite/27_io/stringbuf.cc
deleted file mode 100644 (file)
index a91deab..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-// 2002-07-25 Benjamin Kosnik <bkoz@redhat.com>
-
-// Copyright (C) 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// As a special exception, you may use this file as part of a free software
-// library without restriction.  Specifically, if other files instantiate
-// templates or use macros or inline functions from this file, or you compile
-// this file and link it with other files to produce an executable, this
-// file does not by itself cause the resulting executable to be covered by
-// the GNU General Public License.  This exception does not however
-// invalidate any other reasons why the executable file might be covered by
-// the GNU General Public License.
-
-// 27.7.1 - Template class basic_stringbuf
-// NB: This file is for testing basic_stringbuf with NO OTHER INCLUDES.
-
-#include <sstream>
-#include <testsuite_hooks.h>
-
-// { dg-do compile }
-
-// libstdc++/7216
-void test01()
-{
-  // Check for required typedefs
-  typedef std::stringbuf test_type;
-  typedef test_type::char_type char_type;
-  typedef test_type::traits_type traits_type;
-  typedef test_type::int_type int_type;
-  typedef test_type::pos_type pos_type;
-  typedef test_type::off_type off_type;
-}
-
-namespace test 
-{
-  using namespace std;
-  using __gnu_cxx_test::pod_char;
-  typedef short type_t;
-  template class basic_stringbuf<type_t, char_traits<type_t> >;
-  template class basic_stringbuf<pod_char, char_traits<pod_char> >;
-} // test
-
-int main() 
-{
-  test01();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/27_io/stringbuf_members.cc b/libstdc++-v3/testsuite/27_io/stringbuf_members.cc
deleted file mode 100644 (file)
index 5e49330..0000000
+++ /dev/null
@@ -1,517 +0,0 @@
-// 981208 bkoz test functionality of basic_stringbuf for char_type == char
-
-// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-#include <sstream>
-#include <testsuite_hooks.h>
-
-std::string str_01("mykonos. . . or what?");
-std::string str_02("paris, or sainte-maxime?");
-std::string str_03;
-std::stringbuf strb_01(str_01);
-std::stringbuf strb_02(str_02, std::ios_base::in);
-std::stringbuf strb_03(str_03, std::ios_base::out);
-
-
-// test the underlying allocator
-bool test01() {
-  bool test = false;
-  std::allocator<char> alloc_01;
-  std::allocator<char>::size_type size_01 = alloc_01.max_size();
-  std::allocator<char>::pointer p_01 = alloc_01.allocate(32);
-
-  return true;
-}
-
-
-// test the streambuf/stringbuf locale settings
-bool test02() {
-  std::locale loc_tmp;
-  loc_tmp = strb_01.getloc();
-  strb_01.pubimbue(loc_tmp); //This should initialize _M_init to true
-  strb_01.getloc(); //This should just return _M_locale
-
-  return true;
-}
-
-
-// test member functions
-bool test03() {
-  bool test = true;
-
-  //stringbuf::str()
-  VERIFY( strb_01.str() == str_01 );
-  VERIFY( strb_02.str() == str_02 );
-  VERIFY( strb_03.str() == str_03 );
-  //stringbuf::str(string&)
-  strb_03.str("none of the above, go to the oberoi in cairo, egypt.");
-  strb_03.str(str_01);
-  std::streamsize d1 = strb_01.in_avail();
-  std::streamsize d2 = strb_03.in_avail();
-  VERIFY( d1 ); // non-zero
-  VERIFY( !d2 ); // zero, cuz ios_base::out
-  VERIFY( d1 != d2 ); //these should be the same
-  VERIFY( str_01.length() == d1 );  
-  VERIFY( strb_01.str() == strb_03.str() ); //ditto
-
-  // stringbuf::str(string&) and stringbuf::stringbuf(string&), where the
-  // string in question contains embedded NUL characters.  Note that in this
-  // embedded-NUL situation, the size must be passed to the string ctor.
-  std::string str_nulls ("eschew \0 obfuscation", 20);  // tested in 21_strings
-  std::stringbuf strb_normal (str_01);
-  std::stringbuf strb_nulls (str_nulls);
-  strb_normal.str(str_nulls);  // tried using 'strb_01' rather than declaring
-                               // another variable, but then test04 broke!
-  VERIFY( strb_nulls.in_avail() == str_nulls.size()  );
-  VERIFY( strb_nulls.str().size() == 20              );
-  VERIFY( strb_normal.in_avail() == str_nulls.size() );
-
-#ifdef DEBUG_ASSERT
-  assert(test);
-#endif
-  return test;
-}
-
-
-// test overloaded virtual functions
-bool test04() {
-  bool                         test = true;
-  std::string          str_tmp;
-  std::stringbuf               strb_tmp;
-  std::streamsize              strmsz_1, strmsz_2;
-  std::streamoff               strmof_1(-1), strmof_2;
-  typedef std::stringbuf::int_type int_type;
-  typedef std::stringbuf::traits_type traits_type;
-  typedef std::stringbuf::pos_type pos_type;
-  typedef std::stringbuf::off_type off_type;
-
-  // GET
-  // int in_avail()
-  strmof_1 = strb_01.in_avail();
-  strmof_2 = strb_02.in_avail();
-  VERIFY( strmof_1 != strmof_2 );
-  VERIFY( strmof_1 == str_01.length() );
-  VERIFY( strmof_2 == str_02.length() );
-  strmof_1 = strb_03.in_avail(); 
-  VERIFY( strmof_1 == 0 ); // zero cuz write-only, or eof()? zero, from showmany
-
-  // int_type sbumpc()
-  // if read_cur not avail, return uflow(), else return *read_cur & increment
-  int_type c1 = strb_01.sbumpc();
-  int_type c2 = strb_02.sbumpc();
-  VERIFY( c1 != c2 );
-  VERIFY( c1 == str_01[0] );
-  VERIFY( c2 == str_02[0] ); //should equal first letter at this point
-  int_type c3 = strb_01.sbumpc();
-  int_type c4 = strb_02.sbumpc();
-  VERIFY( c1 != c2 );
-  VERIFY( c1 != c3 );
-  VERIFY( c2 != c4 );
-  int_type c5 = strb_03.sbumpc();
-  VERIFY( c5 == traits_type::eof() );
-
-  // int_type sgetc()
-  // if read_cur not avail, return uflow(), else return *read_cur  
-  int_type c6 = strb_01.sgetc();
-  int_type c7 = strb_02.sgetc();
-  VERIFY( c6 != c3 );
-  VERIFY( c7 != c4 );
-  int_type c8 = strb_01.sgetc();
-  int_type c9 = strb_02.sgetc();
-  VERIFY( c6 == c8 );
-  VERIFY( c7 == c9 );
-  c5 = strb_03.sgetc();
-  VERIFY( c5 == traits_type::eof() );
-
-  // int_type snextc()
-  // calls sbumpc and if sbumpc != eof, return sgetc
-  c6 = strb_01.snextc();
-  c7 = strb_02.snextc();
-  VERIFY( c6 != c8 );
-  VERIFY( c7 != c9 );
-  VERIFY( c6 == str_01[3] );
-  VERIFY( c7 == str_02[3] ); //should equal fourth letter at this point
-  c5 = strb_03.snextc();
-  VERIFY( c5 == traits_type::eof() );
-
-  // int showmanyc
-  // streamsize sgetn(char_type *s, streamsize n)
-  // streamsize xsgetn(char_type *s, streamsize n)
-  // assign up to n chars to s from input sequence, indexing in_cur as
-  // approp and returning the number of chars assigned
-  strmsz_1 = strb_01.in_avail();
-  strmsz_2 = strb_02.in_avail();
-  test = strmsz_1 != strmsz_2;
-  VERIFY( strmsz_1 != str_01.length() );
-  VERIFY( strmsz_2 != str_02.length() ); //because now we've moved into string
-  char carray1[11] = "";
-  strmsz_1 = strb_01.sgetn(carray1, 10);
-  char carray2[20] = "";
-  strmsz_2 = strb_02.sgetn(carray2, 10);
-  VERIFY( strmsz_1 == strmsz_2 );
-  VERIFY( strmsz_1 == 10 );
-  c1 = strb_01.sgetc();
-  c2 = strb_02.sgetc();
-  VERIFY( c6 == c1 ); //just by co-incidence both o's
-  VERIFY( c7 != c2 ); // n != i
-  VERIFY( c1 == str_01[13] );
-  VERIFY( c2 == str_02[13] ); //should equal fourteenth letter at this point
-  strmsz_1 = strb_03.sgetn(carray1, 10);
-  VERIFY( !strmsz_1 ); //zero
-  strmsz_1 = strb_02.in_avail();
-  strmsz_2 = strb_02.sgetn(carray2, strmsz_1 + 5);
-  VERIFY( strmsz_1 == strmsz_2 ); //write off the end
-  c4 = strb_02.sgetc(); // should be EOF
-  VERIFY( c4 == traits_type::eof() );
-
-  // PUT
-  // int_type sputc(char_type c)
-  // if out_cur not avail, return overflow. Else, stores c at out_cur,
-  // increments out_cur, and returns c as int_type
-  strb_03.str(str_01); //reset
-  std::string::size_type sz1 = strb_03.str().length();
-  c1 = strb_03.sputc('a'); 
-  std::string::size_type sz2 = strb_03.str().length();
-  VERIFY( sz1 == sz2 ); //cuz inserting at out_cur, which is at beg to start
-  c2 = strb_03.sputc('b'); 
-  VERIFY( c1 != c2 );
-  VERIFY( strb_03.str() != str_01 );
-  c3 = strb_02.sputc('a'); // should be EOF because this is read-only
-  VERIFY( c3 == traits_type::eof() );
-  
-  // streamsize sputn(const char_typs* s, streamsize n)
-  // write up to n chars to out_cur from s, returning number assigned
-  // NB *sputn will happily put '\0' into your stream if you give it a chance*
-  str_tmp = strb_03.str();
-  sz1 = str_tmp.length();
-  strmsz_1 = strb_03.sputn("racadabras", 10);//"abracadabras or what?"
-  sz2 = strb_03.str().length();
-  VERIFY( sz1 == sz2 ); //shouldn't have changed length
-  VERIFY( strmsz_1 == 10 );
-  VERIFY( str_tmp != strb_03.str() );
-  strmsz_2 = strb_03.sputn(", i wanna reach out and", 10);
-  VERIFY( strmsz_1 == strmsz_2 ); // should re-allocate, copy 10 chars.
-  VERIFY( strmsz_1 == 10 );
-  VERIFY( strmsz_2 == 10 );
-  sz2 = strb_03.str().length();
-  VERIFY( sz1 != sz2 ); // need to change length
-  VERIFY( str_tmp != strb_03.str() );
-  str_tmp = strb_02.str();
-  strmsz_1 = strb_02.sputn("racadabra", 10);
-  VERIFY( strmsz_1 == 0 );  
-  VERIFY( str_tmp == strb_02.str() );
-
-  // PUTBACK
-  // int_type pbfail(int_type c)
-  // called when gptr() null, gptr() == eback(), or traits::eq(*gptr, c) false
-  // "pending sequence" is:
-  //   1) everything as defined in underflow
-  //   2) + if (traits::eq_int_type(c, traits::eof()), then input
-  //   sequence is backed up one char before the pending sequence is
-  //   determined.
-  //   3) + if (not 2) then c is prepended. Left unspecified is
-  //   whether the input sequence is backedup or modified in any way
-  // returns traits::eof() for failure, unspecified other value for success
-
-  // int_type sputbackc(char_type c)
-  // if in_cur not avail || ! traits::eq(c, gptr() [-1]), return pbfail
-  // otherwise decrements in_cur and returns *gptr()
-  strmsz_1 = strb_01.in_avail();
-  str_tmp = strb_01.str();
-  c1 = strb_01.sgetc(); //"mykonos. . . 'o'r what?"
-  c2 = strb_01.sputbackc('z');//"mykonos. . .zor what?"
-  c3 = strb_01.sgetc();
-  VERIFY( c1 != c2 );
-  VERIFY( c3 == c2 );
-  VERIFY( strb_01.str() == std::string("mykonos. . .zor what?") );
-  VERIFY( str_tmp.size() == strb_01.str().size() );
-  //test for _in_cur == _in_beg
-  strb_01.str(str_tmp);
-  strmsz_1 = strb_01.in_avail();
-  c1 = strb_01.sgetc(); //"'m'ykonos. . . or what?"
-  c2 = strb_01.sputbackc('z');//"mykonos. . . or what?"
-  c3 = strb_01.sgetc();
-  VERIFY( c1 != c2 );
-  VERIFY( c3 != c2 );
-  VERIFY( c1 == c3 );
-  VERIFY( c2 == traits_type::eof() );
-  VERIFY( strb_01.str() == str_tmp );
-  VERIFY( str_tmp.size() == strb_01.str().size() );
-  // test for replacing char with identical one
-  strb_01.str(str_01); //reset
-  strmsz_1 = strb_01.in_avail();
-  strb_01.sbumpc();
-  strb_01.sbumpc();
-  c1 = strb_01.sgetc(); //"my'k'onos. . . or what?"
-  c2 = strb_01.sputbackc('y');//"mykonos. . . or what?"
-  c3 = strb_01.sgetc();
-  VERIFY( c1 != c2 );
-  VERIFY( c3 == c2 );
-  VERIFY( c1 != c3 );
-  VERIFY( strb_01.str() == str_01 );
-  VERIFY( str_01.size() == strb_01.str().size() );
-  //test for ios_base::out
-  strmsz_2 = strb_03.in_avail();
-  c4 = strb_03.sputbackc('x');
-  VERIFY( c4 == traits_type::eof() );
-
-  // int_type sungetc()
-  // if in_cur not avail, return pbackfail(), else decrement and
-  // return to_int_type(*gptr())
-  for (int i = 0; i<12; ++i)
-    strb_01.sbumpc();
-  strmsz_1 = strb_01.in_avail();
-  str_tmp = strb_01.str();
-  c1 = strb_01.sgetc(); //"mykonos. . . 'o'r what?"
-  c2 = strb_01.sungetc();//"mykonos. . . or what?"
-  c3 = strb_01.sgetc();
-  VERIFY( c1 != c2 );
-  VERIFY( c3 == c2 );
-  VERIFY( c1 != c3 );
-  VERIFY( c2 == ' ' );
-  VERIFY( strb_01.str() == str_01 );
-  VERIFY( str_01.size() == strb_01.str().size() );
-  //test for _in_cur == _in_beg
-  strb_01.str(str_tmp);
-  strmsz_1 = strb_01.in_avail();
-  c1 = strb_01.sgetc(); //"'m'ykonos. . . or what?"
-  c2 = strb_01.sungetc();//"mykonos. . . or what?"
-  c3 = strb_01.sgetc();
-  VERIFY( c1 != c2 );
-  VERIFY( c3 != c2 );
-  VERIFY( c1 == c3 );
-  VERIFY( c2 == traits_type::eof() );
-  VERIFY( strb_01.str() == str_01 );
-  VERIFY( str_01.size() == strb_01.str().size() );
-  // test for replacing char with identical one
-  strb_01.str(str_01); //reset
-  strmsz_1 = strb_01.in_avail();
-  strb_01.sbumpc();
-  strb_01.sbumpc();
-  c1 = strb_01.sgetc(); //"my'k'onos. . . or what?"
-  c2 = strb_01.sungetc();//"mykonos. . . or what?"
-  c3 = strb_01.sgetc();
-  VERIFY( c1 != c2 );
-  VERIFY( c3 == c2 );
-  VERIFY( c1 != c3 );
-  VERIFY( strb_01.str() == str_01 );
-  VERIFY( str_01.size() == strb_01.str().size() );
-  //test for ios_base::out
-  strmsz_2 = strb_03.in_avail();
-  c4 = strb_03.sungetc();
-  VERIFY( c4 == traits_type::eof() );
-
-  // BUFFER MANAGEMENT & POSITIONING
-  // sync
-  // pubsync
-  strb_01.pubsync();
-  strb_02.pubsync();
-  strb_03.pubsync();
-
-  // setbuf
-  // pubsetbuf(char_type* s, streamsize n)
-  str_tmp = std::string("naaaah, go to cebu");
-  strb_01.pubsetbuf(const_cast<char*> (str_tmp.c_str()), str_tmp.size());
-  VERIFY( strb_01.str() == str_tmp );
-  strb_01.pubsetbuf(0,0);
-  VERIFY( strb_01.str() == str_tmp );
-
-  // seekoff
-  // pubseekoff(off_type off, ios_base::seekdir way, ios_base::openmode which)
-  // alters the stream position to off
-  pos_type pt_1(off_type(-1));
-  pos_type pt_2(off_type(0));
-  off_type off_1 = 0;
-  off_type off_2 = 0;
-  strb_01.str(str_01); //in|out ("mykonos. . . or what?");
-  strb_02.str(str_02); //in ("paris, or sainte-maxime?");
-  strb_03.str(str_03); //out ("")
-  //IN|OUT
-  //beg
-  pt_1 = strb_01.pubseekoff(2, std::ios_base::beg);
-  off_1 = pt_1;
-  VERIFY( off_1 >= 0 );
-  c1 = strb_01.snextc(); //current in pointer +1
-  VERIFY( c1 == 'o' );
-  c2 = strb_01.sputc('x');  //test current out pointer
-  str_tmp = std::string("myxonos. . . or what?");
-  VERIFY( strb_01.str() == str_tmp );
-  //cur
-  pt_1 = strb_01.pubseekoff(2, std::ios_base::cur);
-  off_1 = pt_1;
-  VERIFY( off_1 == -1 ); // can't seekoff for in and out + cur in sstreams
-  pt_1 = strb_01.pubseekoff(2, std::ios_base::cur, std::ios_base::in);
-  off_1 = pt_1;
-  pt_2 = strb_01.pubseekoff(2, std::ios_base::cur, std::ios_base::in);
-  off_2 = pt_2;
-  VERIFY( off_2 == off_1 + 2 );
-  c1 = strb_01.snextc(); //current in pointer + 1
-  VERIFY( c1 == ' ' );
-  c2 = strb_01.sputc('x');  //test current out pointer
-  str_tmp = std::string("myxxnos. . . or what?");
-  VERIFY( strb_01.str() == str_tmp );
-  //end
-  pt_2 = strb_01.pubseekoff(2, std::ios_base::end);
-  off_1 = pt_2;
-  VERIFY( off_1 == -1 ); // not a valid position
-  VERIFY( strb_01.str() == str_tmp );
-  // end part two (from the filebuf tests)
-  strb_01.pubseekoff(0, std::ios_base::end);
-  strmsz_1 = strb_01.in_avail(); // 0 cuz at the end
-  c1 = strb_01.sgetc(); 
-  c2 = strb_01.sungetc();
-  strmsz_2 = strb_01.in_avail(); // 1
-  c3 = strb_01.sgetc();
-  VERIFY( c1 != c2 );
-  VERIFY( strmsz_2 != strmsz_1 );
-  VERIFY( strmsz_2 == 1 );
-  // end part three
-  strmsz_1 = strb_01.str().size();
-  strmsz_2 = strb_01.sputn(" ravi shankar meets carlos santana in LoHa", 90);
-  strb_01.pubseekoff(0, std::ios_base::end);
-  strb_01.sputc('<');
-  str_tmp = strb_01.str();
-  VERIFY( str_tmp.size() == strmsz_1 + strmsz_2 + 1 );
-  // IN
-  // OUT
-
-  // seekpos
-  // pubseekpos(pos_type sp, ios_base::openmode)
-  // alters the stream position to sp
-  strb_01.str(str_01); //in|out ("mykonos. . . or what?");
-  strb_02.str(str_02); //in ("paris, or sainte-maxime?");
-  strb_03.str(str_03); //out ("")
-  //IN|OUT
-  //beg
-  pt_1 = strb_01.pubseekoff(2, std::ios_base::beg);
-  off_1 = pt_1;
-  VERIFY( off_1 >= 0 );
-  pt_1 = strb_01.pubseekoff(0, std::ios_base::cur, std::ios_base::out);
-  off_1 = pt_1;
-  c1 = strb_01.snextc(); //current in pointer +1
-  VERIFY( c1 == 'o' );
-  c2 = strb_01.sputc('x');  //test current out pointer
-  str_tmp = std::string("myxonos. . . or what?");
-  VERIFY( strb_01.str() == str_tmp );
-  strb_01.pubsync(); //resets pointers
-  pt_2 = strb_01.pubseekpos(pt_1, std::ios_base::in|std::ios_base::out);
-  off_2 = pt_2;
-  VERIFY( off_1 == off_2 );
-  c3 = strb_01.snextc(); //current in pointer +1
-  VERIFY( c1 == c3 );
-  c2 = strb_01.sputc('x');  //test current out pointer
-  str_tmp = std::string("myxonos. . . or what?");
-  VERIFY( strb_01.str() == str_tmp );
-
-  // VIRTUALS (indirectly tested)
-  // underflow
-  // if read position avail, returns *gptr()
-
-  // pbackfail(int_type c)
-  // put c back into input sequence
-
-  // overflow
-  // appends c to output seq
-
-#ifdef DEBUG_ASSERT
-  assert(test);
-#endif
-
-  return test;
-}
-
-
-// libstdc++/3955 -- ios_base::app overwrites from the beginning
-bool test05()
-{
-  bool test = true;
-
-  std::ostringstream os ("foo");
-  os << "bar";
-
-  test = os.str() == "bar";
-
-#ifdef DEBUG_ASSERT
-  assert(test);
-#endif
-
-  return test;
-}
-
-bool test06()
-{
-  bool test = true;
-
-  std::ostringstream os ("foo", std::ios_base::app);
-  os << "bar";
-
-  test = os.str() == "foobar";
-
-#ifdef DEBUG_ASSERT
-  assert(test);
-#endif
-
-  return test;
-}
-
-// http://gcc.gnu.org/ml/libstdc++/2003-02/msg00269.html
-// Growing and then seeking to ios_base::beg triggered a bug in str(),
-// which didn't notice the grow.
-bool test07()
-{
-  bool test = true;
-
-  std::stringbuf strb_01;
-  strb_01.sputc('s');
-  strb_01.pubseekoff(0, std::ios_base::beg);
-  VERIFY( strb_01.str() == "s" );
-
-  std::string str("strivi,");
-  std::stringbuf strb_02(str);
-  strb_02.pubseekoff(0, std::ios_base::end);
-  strb_02.sputn(" no better!", 11);
-  strb_02.pubseekoff(0, std::ios_base::beg);
-  VERIFY( strb_02.str() == "strivi, no better!" );
-
-#ifdef DEBUG_ASSERT
-  assert(test);
-#endif
-
-  return test;
-}
-
-int main()
-{
-  test01();
-  test02();
-  test03();
-  test04();
-  test05();
-  test06();
-  test07();
-
-  return 0;
-}
-
-
-
-// more candy!!!
diff --git a/libstdc++-v3/testsuite/27_io/stringbuf_virtuals.cc b/libstdc++-v3/testsuite/27_io/stringbuf_virtuals.cc
deleted file mode 100644 (file)
index 40e95ba..0000000
+++ /dev/null
@@ -1,167 +0,0 @@
-// 2001-05-21 Benjamin Kosnik  <bkoz@redhat.com>
-
-// Copyright (C) 2001, 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// 27.7.1.3 Overridden virtual functions
-
-#include <sstream>
-#include <testsuite_hooks.h>
-
-void test01()
-{
-  using namespace std;
-
-  bool test = true;
-  char buf[512];
-  const char* strlit = "how to tell a story and other essays: mark twain";
-  const size_t strlitsize = std::strlen(strlit);
-  stringbuf sbuf(ios_base::out);
-
-  sbuf.pubsetbuf(buf, strlitsize);
-  sbuf.sputn(strlit, strlitsize);
-  VERIFY( std::strncmp(strlit, buf, strlitsize) != 0 );
-}
-
-void test02(std::stringbuf& in, bool pass)
-{
-  bool test = true;
-  using namespace std;
-  typedef streambuf::pos_type pos_type;
-  typedef streambuf::off_type off_type;
-  pos_type bad = pos_type(off_type(-1));
-  pos_type p = 0;
-
-  // seekoff
-  p = in.pubseekoff(0, ios_base::beg, ios_base::in);
-  if (pass)
-    VERIFY( p != bad );
-
-  p = in.pubseekoff(0, ios_base::beg, ios_base::out); 
-  VERIFY( p == bad );
-
-  p = in.pubseekoff(0, ios_base::beg); 
-  VERIFY( p == bad );
-
-
-  // seekpos
-  p = in.pubseekpos(0, ios_base::in);
-  if (pass)
-    VERIFY( p != bad );
-
-  p = in.pubseekpos(0, ios_base::out); 
-  VERIFY( p == bad );
-
-  p = in.pubseekpos(0); 
-  VERIFY( p == bad );
-}
-
-// libstdc++/9322
-void test08()
-{
-  using std::locale;
-  bool test = true;
-
-  locale loc;
-  std::stringbuf ob;
-  VERIFY( ob.getloc() == loc );
-
-  locale::global(locale("en_US"));
-  VERIFY( ob.getloc() == loc );
-
-  locale loc_de ("de_DE");
-  locale ret = ob.pubimbue(loc_de);
-  VERIFY( ob.getloc() == loc_de );
-  VERIFY( ret == loc );
-
-  locale::global(loc);
-  VERIFY( ob.getloc() == loc_de );
-}
-
-bool over_called;
-
-class Derived_stringbuf : public std::stringbuf
-{
-public:
-  int_type overflow(int_type c)
-  {
-    over_called = true;
-    return std::stringbuf::overflow(c);
-  }
-  
-  const char_type* pub_epptr() const
-  {
-    return epptr();
-  }
-  
-  const char_type* pub_pptr() const
-  {
-    return pptr();
-  }
-};
-
-// libstdc++/9404
-void test09()
-{
-  bool test = true;
-
-  bool over_expected;
-
-  // sputc
-  Derived_stringbuf dsbuf_01;
-  over_called = false;
-  dsbuf_01.sputc('i');
-  VERIFY( over_called );
-  over_expected = dsbuf_01.pub_epptr() == dsbuf_01.pub_pptr();
-  over_called = false;
-  dsbuf_01.sputc('v');
-  VERIFY( (!over_expected && !over_called)
-         || (over_expected && over_called) );
-  dsbuf_01.sputc('i');
-  VERIFY( dsbuf_01.str() == "ivi" ); // Sanity check.
-
-  // sputn
-  Derived_stringbuf dsbuf_02;
-  over_called = false;
-  dsbuf_02.sputn("sonne's", 7);
-  VERIFY( over_called );
-  over_expected = dsbuf_02.pub_epptr() == dsbuf_02.pub_pptr();
-  over_called = false;
-  dsbuf_02.sputn(" peak", 5);
-  VERIFY( (!over_expected && !over_called)
-         || (over_expected && over_called) );
-  VERIFY( dsbuf_02.str() == "sonne's peak" ); // Sanity check.
-}
-
-int main() 
-{
-  using namespace std;
-  test01();
-
-  // movie star, submarine scientist!
-  stringbuf in1("Hedy Lamarr", ios_base::in);
-  stringbuf in2(ios_base::in);
-  stringbuf in3("", ios_base::in);
-  test02(in1, true);
-  test02(in2, false);
-  test02(in3, false);
-
-  __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test08);
-  test09();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/27_io/stringstream.cc b/libstdc++-v3/testsuite/27_io/stringstream.cc
deleted file mode 100644 (file)
index a977895..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-// 2002-07-25 Benjamin Kosnik <bkoz@redhat.com>
-
-// Copyright (C) 2002, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// As a special exception, you may use this file as part of a free software
-// library without restriction.  Specifically, if other files instantiate
-// templates or use macros or inline functions from this file, or you compile
-// this file and link it with other files to produce an executable, this
-// file does not by itself cause the resulting executable to be covered by
-// the GNU General Public License.  This exception does not however
-// invalidate any other reasons why the executable file might be covered by
-// the GNU General Public License.
-
-// 27.7.4 - Template class basic_stringstream
-// NB: This file is for testing basic_stringstream with NO OTHER INCLUDES.
-
-#include <sstream>
-#include <testsuite_hooks.h>
-
-// { dg-do compile }
-
-// libstdc++/7216
-void test01()
-{
-  // Check for required typedefs
-  typedef std::stringstream test_type;
-  typedef test_type::char_type char_type;
-  typedef test_type::traits_type traits_type;
-  typedef test_type::int_type int_type;
-  typedef test_type::pos_type pos_type;
-  typedef test_type::off_type off_type;
-}
-
-namespace test 
-{
-  using namespace std;
-  using __gnu_cxx_test::pod_char;
-  typedef short type_t;
-  template class basic_stringstream<type_t, char_traits<type_t> >;
-  template class basic_stringstream<pod_char, char_traits<pod_char> >;
-} // test
-
-// libstdc++/9826
-void test02()
-{
-  using namespace std;
-  using __gnu_cxx_test::pod_char;
-
-  basic_stringstream<pod_char, char_traits<pod_char> > sstr;
-  // 1
-  basic_string<pod_char, char_traits<pod_char> > str;
-  sstr >> str;
-  // 2
-  pod_char*  chr;
-  sstr >> chr;
-  // 3
-  sstr >> ws;
-}
-
-int main() 
-{
-  test01();
-  test02();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/27_io/stringstream_members.cc b/libstdc++-v3/testsuite/27_io/stringstream_members.cc
deleted file mode 100644 (file)
index 51635f7..0000000
+++ /dev/null
@@ -1,202 +0,0 @@
-// 2001-05-24 Benjamin Kosnik  <bkoz@redhat.com>
-
-// Copyright (C) 2001, 2002 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// 27.7.6 member functions (stringstream_members)
-
-#include <sstream>
-#include <testsuite_hooks.h>
-
-void test01()
-{
-  bool test = true;
-  std::stringstream is01;
-  const std::string str00; 
-  const std::string str01 = "123";
-  std::string str02;
-  const int i01 = 123;
-  int a,b;
-
-  std::ios_base::iostate state1, state2, statefail, stateeof;
-  statefail = std::ios_base::failbit;
-  stateeof = std::ios_base::eofbit;
-
-  // string str() const
-  str02 = is01.str();
-  VERIFY( str00 == str02 );
-
-  // void str(const basic_string&)
-  is01.str(str01);
-  str02 = is01.str();
-  VERIFY( str01 == str02 );
-  state1 = is01.rdstate();
-  is01 >> a;
-  state2 = is01.rdstate();
-  VERIFY( a = i01 );
-  // 22.2.2.1.2 num_get virtual functions
-  // p 13
-  // in any case, if stage 2 processing was terminated by the test for
-  // in == end then err != ios_base::eofbit is performed.
-  VERIFY( state1 != state2 );
-  VERIFY( state2 == stateeof ); 
-
-  is01.str(str01);
-  is01 >> b;
-  VERIFY( b != a ); 
-  // as is01.good() is false, istream::sentry blocks extraction.
-
-  is01.clear();
-  state1 = is01.rdstate();
-  is01 >> b;
-  state2 = is01.rdstate();
-  VERIFY( b == a ); 
-  VERIFY( state1 != state2 );
-  VERIFY( state2 == stateeof ); 
-
- #ifdef DEBUG_ASSERT
-  assert(test);
-#endif
-}
-
-void 
-redirect_buffer(std::ios& stream, std::streambuf* new_buf) 
-{ stream.rdbuf(new_buf); }
-
-std::streambuf*
-active_buffer(std::ios& stream)
-{ return stream.rdbuf(); }
-
-// libstdc++/2832
-void test02()
-{
-  bool test = true;
-  const char* strlit01 = "fuck war";
-  const char* strlit02 = "two less cars abstract riot crew, critical mass/SF";
-  const std::string str00;
-  const std::string str01(strlit01);
-  std::string str02;
-  std::stringbuf sbuf(str01);
-  std::streambuf* pbasebuf0 = &sbuf;
-
-  std::stringstream sstrm1;
-  VERIFY( sstrm1.str() == str00 );
-  // derived rdbuf() always returns original streambuf, even though
-  // it's no longer associated with the stream.
-  std::stringbuf* const buf1 = sstrm1.rdbuf();
-  // base rdbuf() returns the currently associated streambuf
-  std::streambuf* pbasebuf1 = active_buffer(sstrm1);
-  redirect_buffer(sstrm1, &sbuf);
-  std::stringbuf* const buf2 = sstrm1.rdbuf();
-  std::streambuf* pbasebuf2 = active_buffer(sstrm1);
-  VERIFY( buf1 == buf2 ); 
-  VERIFY( pbasebuf1 != pbasebuf2 );
-  VERIFY( pbasebuf2 == pbasebuf0 );
-
-  // derived rdbuf() returns the original buf, so str() doesn't change.
-  VERIFY( sstrm1.str() != str01 );
-  VERIFY( sstrm1.str() == str00 );
-  // however, casting the active streambuf to a stringbuf shows what's up:
-  std::stringbuf* psbuf = dynamic_cast<std::stringbuf*>(pbasebuf2);
-  str02 = psbuf->str();
-  VERIFY( str02 == str01 );
-
-  // How confusing and non-intuitive is this?
-  // These semantics are a joke, a serious defect, and incredibly lame.
-}
-
-void
-test03()
-{
-  bool test = true;
-
-  //
-  // 1: Automatic formatting of a compound string
-  //
-  int i = 1024;
-  int *pi = &i;
-  double d = 3.14159;
-  double *pd = &d;
-  std::string blank;
-  std::ostringstream ostrst01; 
-  std::ostringstream ostrst02(blank); 
-  
-  // No buffer, so should be created.
-  ostrst01 << "i: " << i << " i's address:  " << pi << "\n"
-            << "d: " << d << " d's address: " << pd << std::endl;
-  // Buffer, so existing buffer should be overwritten.
-  ostrst02 << "i: " << i << " i's address:  " << pi << "\n"
-            << "d: " << d << " d's address: " << pd << std::endl;
-
-  std::string msg01 = ostrst01.str();
-  std::string msg02 = ostrst02.str();
-  VERIFY( msg01 == msg02 );
-  VERIFY( msg02 != blank );
-
-  //
-  // 2: istringstream
-  //
-  // extracts the stored ascii values, placing them in turn in the four vars
-#if 0
-  int i2 = 0;
-  //int* pi2 = &i2;
-  void* pi2 = &i2;
-  double d2 = 0.0;
-  //  double* pd2 = &d2;
-  void* pd2 = &d2;
-  std::istringstream istrst01(ostrst02.str());
-
-  istrst01 >> i2 >> pi2 >> d2 >> pd2;
-  //istrst01 >> i2;
-  //istrst01 >> pi2;
-  VERIFY( i2 == i );
-  VERIFY( d2 == d );
-  VERIFY( pd2 == pd );
-  VERIFY( pi2 == pi );
-#endif
-
-  // stringstream
-  std::string str1("");
-  std::string str3("this is a somewhat  string");
-  std::stringstream ss1(str1, std::ios_base::in|std::ios_base::out);
-  std::stringstream ss2(str3, std::ios_base::in|std::ios_base::out);
-}
-
-// libstdc++/8466
-void test04()
-{
-  bool test = true;
-
-  const char* strlit00 = "orvieto";
-  const std::string str00 = strlit00;
-
-  std::ostringstream oss;
-
-  oss.str(str00);
-  oss << "cortona";
-  VERIFY( str00 == strlit00 );
-}
-
-int main()
-{
-  test01();
-  test02();
-  test03();
-  test04();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/27_io/types/1.cc b/libstdc++-v3/testsuite/27_io/types/1.cc
new file mode 100644 (file)
index 0000000..9ec9bb7
--- /dev/null
@@ -0,0 +1,38 @@
+// Copyright (C) 2002 Free Software Foundation
+//
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.4.2.1 - Types [lib.ios.types]
+
+#include <ios>
+#include <testsuite_hooks.h>
+
+// libstdc++/7219
+// Annex D, deprecated.
+void test01()
+{
+#if _GLIBCPP_DEPRECATED
+  std::ios_base::streampos spos;
+  std::ios_base::streamoff soff;
+#endif
+}
+
+int main(void)
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/types/2.cc b/libstdc++-v3/testsuite/27_io/types/2.cc
new file mode 100644 (file)
index 0000000..c64e20b
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (C) 2003 Free Software Foundation
+//
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.4.2.1 - Types [lib.ios.types]
+
+#include <ios>
+#include <testsuite_hooks.h>
+
+void test01()
+{
+  std::streamsize ssize; 
+  std::streamoff soff;
+
+  // No signed/unsigned warnings.
+  long l = ssize;
+
+  // Wrapped in pos_type is EOF.
+  soff = -1;
+}
+
+int main(void)
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/wide_stream_objects.cc b/libstdc++-v3/testsuite/27_io/wide_stream_objects.cc
deleted file mode 100644 (file)
index 022f6ef..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-// 2000-08-02 bkoz
-
-// Copyright (C) 2000 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// Include all the headers except for iostream.
-#include <algorithm>
-#include <bitset>
-#include <complex>
-#include <deque>
-#include <exception>
-#include <fstream>
-#include <functional>
-#include <iomanip>
-#include <ios>
-#include <iosfwd>
-#include <istream>
-#include <iterator>
-#include <limits>
-#include <list>
-#include <locale>
-#include <map>
-#include <memory>
-#include <new>
-#include <numeric>
-#include <ostream>
-#include <queue>
-#include <set>
-#include <sstream>
-#include <stack>
-#include <stdexcept>
-#include <streambuf>
-#include <string>
-#include <typeinfo>
-#include <utility>
-#include <valarray>
-#include <vector>
-#include <cassert>
-#include <cctype>
-#include <cerrno>
-#include <cfloat>
-#include <ciso646>
-#include <climits>
-#include <clocale>
-#include <cmath>
-#include <csetjmp>
-#include <csignal>
-#include <cstdarg>
-#include <cstddef>
-#include <cstdio>
-#include <cstdlib>
-#include <cstring>
-#include <ctime>
-#if _GLIBCPP_USE_WCHAR_T
-  #include <bits/c++config.h>
-  #include <cwchar>
-  #include <cwctype>
-#endif
-#include <testsuite_hooks.h>
-
-// Include iostream last, just to make is as difficult as possible to
-// properly initialize the standard iostream objects.
-#include <iostream>
-
-// Make sure all the standard streams are defined.
-int
-test01()
-{
-  bool test = true;
-
-#ifdef _GLIBCPP_USE_WCHAR_T
-  wchar_t array2[20];
-  typedef std::wios::traits_type wtraits_type;
-  wtraits_type::int_type wi = 15;
-  wtraits_type::copy(array2, L"testing istream", wi);
-  std::wcout << L"testing wcout" << std::endl;
-  std::wcerr << L"testing wcerr" << std::endl;
-  VERIFY( std::wcerr.flags() & std::ios_base::unitbuf );
-  std::wclog << L"testing wclog" << std::endl;
-  // std::wcin >> array2; // requires somebody to type something in.
-  VERIFY( std::wcin.tie() == &std::wcout );
-#endif
-
-  return 0;
-}
-
-
-int 
-main()
-{
-  test01();
-  
-  return 0;
-}
index fc8f61630111083207d766495ecfb5d514ae21f8..ce598d3b581653daff70a50e2b0bdc62ef86455a 100644 (file)
@@ -74,4 +74,4 @@ stamp_wchar:
 
 # By adding these files here, automake will remove them for 'make clean'
 CLEANFILES = *.txt *.tst *.exe core* filebuf_* tmp* ostream_* *.log *.sum \
-            testsuite_files testsuite_wchar_t site.exp abi_check 
+            testsuite_* site.exp abi_check 
index f9b0d99bf595d31d3d0b83cff4d8997ffd626d60..fde593ebf851733cd8147e84aeebc811a7358a0e 100644 (file)
@@ -181,7 +181,7 @@ abi_check_SOURCES = abi_check.cc
 
 # By adding these files here, automake will remove them for 'make clean'
 CLEANFILES = *.txt *.tst *.exe core* filebuf_* tmp* ostream_* *.log *.sum \
-            testsuite_files testsuite_wchar_t site.exp abi_check 
+            testsuite_* site.exp abi_check 
 
 mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
 CONFIG_HEADER = ../config.h
diff --git a/libstdc++-v3/testsuite/data/filebuf_members-1.tst b/libstdc++-v3/testsuite/data/filebuf_members-1.tst
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/libstdc++-v3/testsuite/data/filebuf_members-1.txt b/libstdc++-v3/testsuite/data/filebuf_members-1.txt
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/libstdc++-v3/testsuite/data/filebuf_virtuals-1.tst b/libstdc++-v3/testsuite/data/filebuf_virtuals-1.tst
new file mode 100644 (file)
index 0000000..cb3c57f
--- /dev/null
@@ -0,0 +1,158 @@
+// 990117 bkoz
+// test functionality of basic_filebuf for char_type == char
+// this is a data file for 27filebuf.cc
+
+// Copyright (C) 1997-1999 Cygnus Solutions
+//
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+/mnt/cdrom/sarah_vaughan/sarah_vaughan.allofme
+/mnt/cdrom/sarah_vaughan/sarah_vaughan.speaklow
+
+/mnt/cdrom/nikkigiovanni_thewayifeel/ng_01_the_way_i_feel
+/mnt/cdrom/nikkigiovanni_thewayifeel/ng_02_seduction_kidnap
+/mnt/cdrom/nikkigiovanni_thewayifeel/ng_03_just_a_ny_poem
+/mnt/cdrom/nikkigiovanni_thewayifeel/ng_04_butterflies_i_remem
+/mnt/cdrom/nikkigiovanni_thewayifeel/ng_05_luxury_poem
+/mnt/cdrom/nikkigiovanni_thewayifeel/ng_06_my_house
+/mnt/cdrom/nikkigiovanni_thewayifeel/ng_07_the_women_gather
+/mnt/cdrom/nikkigiovanni_thewayifeel/ng_08_the_life_i_led
+/mnt/cdrom/nikkigiovanni_thewayifeel/ng_09_when_i_die
+/mnt/cdrom/nikkigiovanni_thewayifeel/ng_10_revolutionary_dreams
+/mnt/cdrom/nikkigiovanni_thewayifeel/ng_11_winter_poem
+/mnt/cdrom/nikkigiovanni_thewayifeel/ng_12_a_certain_peace_i_nap
+/mnt/cdrom/nikkigiovanni_thewayifeel/ng_13_poem_for_a_lady_whose
+
+/mnt/cdrom/marley-songs_of_freedom/disk_1/
+/mnt/cdrom/marley-songs_of_freedom/disk_2/
+/mnt/cdrom/marley-songs_of_freedom/disk_4/
+
+/mnt/cdrom/marley-songs_of_freedom/disk_1/back out
+/mnt/cdrom/marley-songs_of_freedom/disk_1/bend down low
+/mnt/cdrom/marley-songs_of_freedom/disk_1/bus dem shut (pyaka)
+/mnt/cdrom/marley-songs_of_freedom/disk_1/caution
+/mnt/cdrom/marley-songs_of_freedom/disk_1/do it twice
+/mnt/cdrom/marley-songs_of_freedom/disk_1/don't rock the boat
+/mnt/cdrom/marley-songs_of_freedom/disk_1/duppy conqueror
+/mnt/cdrom/marley-songs_of_freedom/disk_1/hammer
+/mnt/cdrom/marley-songs_of_freedom/disk_1/hypocrites
+/mnt/cdrom/marley-songs_of_freedom/disk_1/i'm still waiting
+/mnt/cdrom/marley-songs_of_freedom/disk_1/judge not
+/mnt/cdrom/marley-songs_of_freedom/disk_1/mellow mood
+/mnt/cdrom/marley-songs_of_freedom/disk_1/mr brown
+/mnt/cdrom/marley-songs_of_freedom/disk_1/nice time
+/mnt/cdrom/marley-songs_of_freedom/disk_1/one cup of coffee
+/mnt/cdrom/marley-songs_of_freedom/disk_1/one love_people get ready
+/mnt/cdrom/marley-songs_of_freedom/disk_1/put it on
+/mnt/cdrom/marley-songs_of_freedom/disk_1/simmer down
+/mnt/cdrom/marley-songs_of_freedom/disk_1/small axe
+/mnt/cdrom/marley-songs_of_freedom/disk_1/soul rebel
+/mnt/cdrom/marley-songs_of_freedom/disk_1/soul shake down party
+/mnt/cdrom/marley-songs_of_freedom/disk_1/stir it up (original)
+/mnt/cdrom/marley-songs_of_freedom/disk_1/sun is shining
+/mnt/cdrom/marley-songs_of_freedom/disk_1/thank you lord (original)
+/mnt/cdrom/marley-songs_of_freedom/disk_2/acoustic medley
+/mnt/cdrom/marley-songs_of_freedom/disk_2/burnin' and lootin'
+/mnt/cdrom/marley-songs_of_freedom/disk_2/concrete jungle
+/mnt/cdrom/marley-songs_of_freedom/disk_2/craven choke puppy
+/mnt/cdrom/marley-songs_of_freedom/disk_2/get up stand up
+/mnt/cdrom/marley-songs_of_freedom/disk_2/guava jelly
+/mnt/cdrom/marley-songs_of_freedom/disk_2/high tide or low tide
+/mnt/cdrom/marley-songs_of_freedom/disk_2/i shot the sheriff
+/mnt/cdrom/marley-songs_of_freedom/disk_2/i'm hurting inside
+/mnt/cdrom/marley-songs_of_freedom/disk_2/iron lion zion
+/mnt/cdrom/marley-songs_of_freedom/disk_2/lick samba
+/mnt/cdrom/marley-songs_of_freedom/disk_2/lively up yourself
+/mnt/cdrom/marley-songs_of_freedom/disk_2/natty dread
+/mnt/cdrom/marley-songs_of_freedom/disk_2/no more trouble
+/mnt/cdrom/marley-songs_of_freedom/disk_2/rastaman chant
+/mnt/cdrom/marley-songs_of_freedom/disk_2/screw face
+/mnt/cdrom/marley-songs_of_freedom/disk_2/slave driver
+/mnt/cdrom/marley-songs_of_freedom/disk_2/trenchtown rock
+/mnt/cdrom/marley-songs_of_freedom/disk_4/africa unite
+/mnt/cdrom/marley-songs_of_freedom/disk_4/babylon system
+/mnt/cdrom/marley-songs_of_freedom/disk_4/bad card
+/mnt/cdrom/marley-songs_of_freedom/disk_4/coming in from the cold (12
+/mnt/cdrom/marley-songs_of_freedom/disk_4/could you be loved (12  mix
+/mnt/cdrom/marley-songs_of_freedom/disk_4/forever loving jah
+/mnt/cdrom/marley-songs_of_freedom/disk_4/give thanks and praise
+/mnt/cdrom/marley-songs_of_freedom/disk_4/one drop
+/mnt/cdrom/marley-songs_of_freedom/disk_4/one dub
+/mnt/cdrom/marley-songs_of_freedom/disk_4/rastaman live up
+/mnt/cdrom/marley-songs_of_freedom/disk_4/real situation
+/mnt/cdrom/marley-songs_of_freedom/disk_4/redemption song (live in pi
+/mnt/cdrom/marley-songs_of_freedom/disk_4/ride natty ride (12  mix)
+/mnt/cdrom/marley-songs_of_freedom/disk_4/so much trouble in the worl
+/mnt/cdrom/marley-songs_of_freedom/disk_4/survival
+/mnt/cdrom/marley-songs_of_freedom/disk_4/why should i (previously un
+/mnt/cdrom/marley-songs_of_freedom/disk_4/zimbabwe
+
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_01_pandemonium
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_02_sync_disjecta
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_03_object_unknown
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_04_it's_nice_not
+/mnt/cdrom/dj_spooky_rid-2dim_warefare/djspooky_05_dialectical_tra
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_06_post-human_soph
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_07_quilombo_ex
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_08_rekonstruction
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_09_scientifik
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_10_a_conversation
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_11_peace_in_zaire
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_13_degree_zero
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_14_roman_planeta
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_15_bass_digitalis
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_16_polyphony_of
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_17_riddim_warfare
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_18_the_nerd
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_20_theme_of_the
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_21_twilight_fugue
+
+/mnt/cdrom/stuff_smith_mosaic/disk3/01_desert_sands
+/mnt/cdrom/stuff_smith_mosaic/disk3/02_soft_winds
+/mnt/cdrom/stuff_smith_mosaic/disk3/03_time_and_again
+/mnt/cdrom/stuff_smith_mosaic/disk3/04_it_don't_mean_a_thing
+/mnt/cdrom/stuff_smith_mosaic/disk3/05_in_a_mellotone
+/mnt/cdrom/stuff_smith_mosaic/disk3/06_i_know_that_you_know
+/mnt/cdrom/stuff_smith_mosaic/disk3/07_heat_wave
+/mnt/cdrom/stuff_smith_mosaic/disk3/08_things_ain't_what_they_used_to_be
+/mnt/cdrom/stuff_smith_mosaic/disk3/09_body_and_soul
+
+So I take a break, wander down to the park to stand, then lean into
+the concrete railing demarking the beginnings of space, oceanic
+space. I watch the waves break, and form, and ease back out to sea and
+wrap my arms around myself and hug tightly because it's early in the
+morning and windy, and the sun is late getting out of bed today, which
+is good because if there was brilliant light illuminating all the
+beauty around me I would be shocked, stunned, forced to retreat back
+into my cabana in a daze, blinded by hummingbirds and callilillies and
+un-named red, yellow, and blue flowers. Green envelopes me, waves
+sooth me. I can see the wind flip the top of the waves seaward, right
+before they break. The sea seems so calm from my perch above the fray
+that I wonder if maybe there is just some part of the deepest, most
+abstract ocean where there is a large creature who happily chews
+plankton and wags its tail in gentle, adulating waves that spread and
+move and gracefully glide thousands of miles, to crash upon a beach,
+one after the other, politely waiting for a turn to dance with the
+seashore.
+
+I know: it is what the Mexican schoolchildren call "la vibora de la
+mer," the serpent of the sea.
+
+
+
+
+
diff --git a/libstdc++-v3/testsuite/data/filebuf_virtuals-1.txt b/libstdc++-v3/testsuite/data/filebuf_virtuals-1.txt
new file mode 100644 (file)
index 0000000..cb3c57f
--- /dev/null
@@ -0,0 +1,158 @@
+// 990117 bkoz
+// test functionality of basic_filebuf for char_type == char
+// this is a data file for 27filebuf.cc
+
+// Copyright (C) 1997-1999 Cygnus Solutions
+//
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+/mnt/cdrom/sarah_vaughan/sarah_vaughan.allofme
+/mnt/cdrom/sarah_vaughan/sarah_vaughan.speaklow
+
+/mnt/cdrom/nikkigiovanni_thewayifeel/ng_01_the_way_i_feel
+/mnt/cdrom/nikkigiovanni_thewayifeel/ng_02_seduction_kidnap
+/mnt/cdrom/nikkigiovanni_thewayifeel/ng_03_just_a_ny_poem
+/mnt/cdrom/nikkigiovanni_thewayifeel/ng_04_butterflies_i_remem
+/mnt/cdrom/nikkigiovanni_thewayifeel/ng_05_luxury_poem
+/mnt/cdrom/nikkigiovanni_thewayifeel/ng_06_my_house
+/mnt/cdrom/nikkigiovanni_thewayifeel/ng_07_the_women_gather
+/mnt/cdrom/nikkigiovanni_thewayifeel/ng_08_the_life_i_led
+/mnt/cdrom/nikkigiovanni_thewayifeel/ng_09_when_i_die
+/mnt/cdrom/nikkigiovanni_thewayifeel/ng_10_revolutionary_dreams
+/mnt/cdrom/nikkigiovanni_thewayifeel/ng_11_winter_poem
+/mnt/cdrom/nikkigiovanni_thewayifeel/ng_12_a_certain_peace_i_nap
+/mnt/cdrom/nikkigiovanni_thewayifeel/ng_13_poem_for_a_lady_whose
+
+/mnt/cdrom/marley-songs_of_freedom/disk_1/
+/mnt/cdrom/marley-songs_of_freedom/disk_2/
+/mnt/cdrom/marley-songs_of_freedom/disk_4/
+
+/mnt/cdrom/marley-songs_of_freedom/disk_1/back out
+/mnt/cdrom/marley-songs_of_freedom/disk_1/bend down low
+/mnt/cdrom/marley-songs_of_freedom/disk_1/bus dem shut (pyaka)
+/mnt/cdrom/marley-songs_of_freedom/disk_1/caution
+/mnt/cdrom/marley-songs_of_freedom/disk_1/do it twice
+/mnt/cdrom/marley-songs_of_freedom/disk_1/don't rock the boat
+/mnt/cdrom/marley-songs_of_freedom/disk_1/duppy conqueror
+/mnt/cdrom/marley-songs_of_freedom/disk_1/hammer
+/mnt/cdrom/marley-songs_of_freedom/disk_1/hypocrites
+/mnt/cdrom/marley-songs_of_freedom/disk_1/i'm still waiting
+/mnt/cdrom/marley-songs_of_freedom/disk_1/judge not
+/mnt/cdrom/marley-songs_of_freedom/disk_1/mellow mood
+/mnt/cdrom/marley-songs_of_freedom/disk_1/mr brown
+/mnt/cdrom/marley-songs_of_freedom/disk_1/nice time
+/mnt/cdrom/marley-songs_of_freedom/disk_1/one cup of coffee
+/mnt/cdrom/marley-songs_of_freedom/disk_1/one love_people get ready
+/mnt/cdrom/marley-songs_of_freedom/disk_1/put it on
+/mnt/cdrom/marley-songs_of_freedom/disk_1/simmer down
+/mnt/cdrom/marley-songs_of_freedom/disk_1/small axe
+/mnt/cdrom/marley-songs_of_freedom/disk_1/soul rebel
+/mnt/cdrom/marley-songs_of_freedom/disk_1/soul shake down party
+/mnt/cdrom/marley-songs_of_freedom/disk_1/stir it up (original)
+/mnt/cdrom/marley-songs_of_freedom/disk_1/sun is shining
+/mnt/cdrom/marley-songs_of_freedom/disk_1/thank you lord (original)
+/mnt/cdrom/marley-songs_of_freedom/disk_2/acoustic medley
+/mnt/cdrom/marley-songs_of_freedom/disk_2/burnin' and lootin'
+/mnt/cdrom/marley-songs_of_freedom/disk_2/concrete jungle
+/mnt/cdrom/marley-songs_of_freedom/disk_2/craven choke puppy
+/mnt/cdrom/marley-songs_of_freedom/disk_2/get up stand up
+/mnt/cdrom/marley-songs_of_freedom/disk_2/guava jelly
+/mnt/cdrom/marley-songs_of_freedom/disk_2/high tide or low tide
+/mnt/cdrom/marley-songs_of_freedom/disk_2/i shot the sheriff
+/mnt/cdrom/marley-songs_of_freedom/disk_2/i'm hurting inside
+/mnt/cdrom/marley-songs_of_freedom/disk_2/iron lion zion
+/mnt/cdrom/marley-songs_of_freedom/disk_2/lick samba
+/mnt/cdrom/marley-songs_of_freedom/disk_2/lively up yourself
+/mnt/cdrom/marley-songs_of_freedom/disk_2/natty dread
+/mnt/cdrom/marley-songs_of_freedom/disk_2/no more trouble
+/mnt/cdrom/marley-songs_of_freedom/disk_2/rastaman chant
+/mnt/cdrom/marley-songs_of_freedom/disk_2/screw face
+/mnt/cdrom/marley-songs_of_freedom/disk_2/slave driver
+/mnt/cdrom/marley-songs_of_freedom/disk_2/trenchtown rock
+/mnt/cdrom/marley-songs_of_freedom/disk_4/africa unite
+/mnt/cdrom/marley-songs_of_freedom/disk_4/babylon system
+/mnt/cdrom/marley-songs_of_freedom/disk_4/bad card
+/mnt/cdrom/marley-songs_of_freedom/disk_4/coming in from the cold (12
+/mnt/cdrom/marley-songs_of_freedom/disk_4/could you be loved (12  mix
+/mnt/cdrom/marley-songs_of_freedom/disk_4/forever loving jah
+/mnt/cdrom/marley-songs_of_freedom/disk_4/give thanks and praise
+/mnt/cdrom/marley-songs_of_freedom/disk_4/one drop
+/mnt/cdrom/marley-songs_of_freedom/disk_4/one dub
+/mnt/cdrom/marley-songs_of_freedom/disk_4/rastaman live up
+/mnt/cdrom/marley-songs_of_freedom/disk_4/real situation
+/mnt/cdrom/marley-songs_of_freedom/disk_4/redemption song (live in pi
+/mnt/cdrom/marley-songs_of_freedom/disk_4/ride natty ride (12  mix)
+/mnt/cdrom/marley-songs_of_freedom/disk_4/so much trouble in the worl
+/mnt/cdrom/marley-songs_of_freedom/disk_4/survival
+/mnt/cdrom/marley-songs_of_freedom/disk_4/why should i (previously un
+/mnt/cdrom/marley-songs_of_freedom/disk_4/zimbabwe
+
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_01_pandemonium
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_02_sync_disjecta
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_03_object_unknown
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_04_it's_nice_not
+/mnt/cdrom/dj_spooky_rid-2dim_warefare/djspooky_05_dialectical_tra
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_06_post-human_soph
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_07_quilombo_ex
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_08_rekonstruction
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_09_scientifik
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_10_a_conversation
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_11_peace_in_zaire
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_13_degree_zero
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_14_roman_planeta
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_15_bass_digitalis
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_16_polyphony_of
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_17_riddim_warfare
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_18_the_nerd
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_20_theme_of_the
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_21_twilight_fugue
+
+/mnt/cdrom/stuff_smith_mosaic/disk3/01_desert_sands
+/mnt/cdrom/stuff_smith_mosaic/disk3/02_soft_winds
+/mnt/cdrom/stuff_smith_mosaic/disk3/03_time_and_again
+/mnt/cdrom/stuff_smith_mosaic/disk3/04_it_don't_mean_a_thing
+/mnt/cdrom/stuff_smith_mosaic/disk3/05_in_a_mellotone
+/mnt/cdrom/stuff_smith_mosaic/disk3/06_i_know_that_you_know
+/mnt/cdrom/stuff_smith_mosaic/disk3/07_heat_wave
+/mnt/cdrom/stuff_smith_mosaic/disk3/08_things_ain't_what_they_used_to_be
+/mnt/cdrom/stuff_smith_mosaic/disk3/09_body_and_soul
+
+So I take a break, wander down to the park to stand, then lean into
+the concrete railing demarking the beginnings of space, oceanic
+space. I watch the waves break, and form, and ease back out to sea and
+wrap my arms around myself and hug tightly because it's early in the
+morning and windy, and the sun is late getting out of bed today, which
+is good because if there was brilliant light illuminating all the
+beauty around me I would be shocked, stunned, forced to retreat back
+into my cabana in a daze, blinded by hummingbirds and callilillies and
+un-named red, yellow, and blue flowers. Green envelopes me, waves
+sooth me. I can see the wind flip the top of the waves seaward, right
+before they break. The sea seems so calm from my perch above the fray
+that I wonder if maybe there is just some part of the deepest, most
+abstract ocean where there is a large creature who happily chews
+plankton and wags its tail in gentle, adulating waves that spread and
+move and gracefully glide thousands of miles, to crash upon a beach,
+one after the other, politely waiting for a turn to dance with the
+seashore.
+
+I know: it is what the Mexican schoolchildren call "la vibora de la
+mer," the serpent of the sea.
+
+
+
+
+
diff --git a/libstdc++-v3/testsuite/data/filebuf_virtuals-2.tst b/libstdc++-v3/testsuite/data/filebuf_virtuals-2.tst
new file mode 100644 (file)
index 0000000..f25bba4
--- /dev/null
@@ -0,0 +1 @@
+ac23456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZracadabras23456789:;<
\ No newline at end of file
diff --git a/libstdc++-v3/testsuite/data/filebuf_virtuals-3.tst b/libstdc++-v3/testsuite/data/filebuf_virtuals-3.tst
new file mode 100644 (file)
index 0000000..0a81f51
--- /dev/null
@@ -0,0 +1,7 @@
+bd2
+456x
+9m;uva?@ABCDEFGHIJKLMNOPQRSTUVWXYZracadabras, i wanna 
+because because
+because. . .
+of the wonderful things he does!!
+ok
\ No newline at end of file
diff --git a/libstdc++-v3/testsuite/data/ifstream_members-1.tst b/libstdc++-v3/testsuite/data/ifstream_members-1.tst
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/libstdc++-v3/testsuite/data/ifstream_members-1.txt b/libstdc++-v3/testsuite/data/ifstream_members-1.txt
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/libstdc++-v3/testsuite/data/ios_base_members_static-1.tst b/libstdc++-v3/testsuite/data/ios_base_members_static-1.tst
new file mode 100644 (file)
index 0000000..8d1e93a
--- /dev/null
@@ -0,0 +1,2 @@
+1234567890
+1234567890
diff --git a/libstdc++-v3/testsuite/data/istream_extractor_other-1.tst b/libstdc++-v3/testsuite/data/istream_extractor_other-1.tst
new file mode 100644 (file)
index 0000000..717a04c
--- /dev/null
@@ -0,0 +1,65 @@
+// 990811 bkoz
+
+// Copyright (C) 1999 Cygnus Solutions
+//
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+/mnt/cdrom/yabbyyou_jesusdread/disk_2/King Tubby's - Repatriation
+/mnt/cdrom/yabbyyou_jesusdread/disk_2/Vivian Jackson and the Prop
+/mnt/cdrom/yabbyyou_jesusdread/disk_2/Michael Rose - Born Free (d
+/mnt/cdrom/yabbyyou_jesusdread/disk_2/King Tubby's - Love Thy Nei
+/mnt/cdrom/yabbyyou_jesusdread/disk_1/Vivian Jackson and the Defe
+/mnt/cdrom/yabbyyou_jesusdread/disk_1/Vivian Jackson and the Ralp
+/mnt/cdrom/yabbyyou_jesusdread/disk_1/Tommy McCook and Don D. Jnr
+/mnt/cdrom/yabbyyou_jesusdread/disk_1/Big Youth and Vivian Jackso
+/mnt/cdrom/yabbyyou_jesusdread/disk_1/King Tubby's - Big Youth Fi
+/mnt/cdrom/yabbyyou_jesusdread/disk_1/Upsetter Mix - Rally Dub
+/mnt/cdrom/yabbyyou_jesusdread/disk_1/Dicky Burton - God Is Watch
+/mnt/cdrom/yabbyyou_jesusdread/disk_1/Pablo and Vivian Jackson - 
+/mnt/cdrom/yabbyyou_jesusdread/disk_1/King Tubby's - Rock King Tu
+/mnt/cdrom/TORTOISE_millions_now_living/tortoise_5
+/mnt/cdrom/TORTOISE_millions_now_living/tortoise_6
+/mnt/cdrom/bettycarter_i'myours,you'remine/This time
+/mnt/cdrom/bettycarter_i'myours,you'remine/I'm Yours, You're Mine
+/mnt/cdrom/bettycarter_i'myours,you'remine/Lonely House
+/mnt/cdrom/bettycarter_i'myours,you'remine/Close Your Eyes
+/mnt/cdrom/bettycarter_i'myours,you'remine/Useless Landscape
+/mnt/cdrom/bettycarter_i'myours,you'remine/East of the Sun
+/mnt/cdrom/bettycarter_i'myours,you'remine/September Song
+/mnt/cdrom/bettycarter_it'snotaboutthemelo/Naima's Love Song
+/mnt/cdrom/bettycarter_it'snotaboutthemelo/Stay As Sweet As You Are
+/mnt/cdrom/bettycarter_it'snotaboutthemelo/Make Him Believe
+/mnt/cdrom/bettycarter_it'snotaboutthemelo/I Should Care
+/mnt/cdrom/bettycarter_it'snotaboutthemelo/Once Upon a Summertime
+/mnt/cdrom/bettycarter_it'snotaboutthemelo/You Go To My Head
+/mnt/cdrom/bettycarter_it'snotaboutthemelo/In the Still Of the Night
+/mnt/cdrom/bettycarter_it'snotaboutthemelo/When It's Sleepy Time Down 
+/mnt/cdrom/bettycarter_it'snotaboutthemelo/The Love We Had Yesterday
+/mnt/cdrom/bettycarter_it'snotaboutthemelo/Dip Bag
+/mnt/cdrom/bettycarter_it'snotaboutthemelo/You're Mine, Too
+/mnt/cdrom/c_adderly_somethin'_else/Autumn Leaves
+/mnt/cdrom/c_adderly_somethin'_else/Love For Sale
+/mnt/cdrom/c_adderly_somethin'_else/Somethin' Else
+/mnt/cdrom/c_adderly_somethin'_else/One For Daddy-O
+
+
+
+
+
+
+
+
diff --git a/libstdc++-v3/testsuite/data/istream_extractor_other-1.txt b/libstdc++-v3/testsuite/data/istream_extractor_other-1.txt
new file mode 100644 (file)
index 0000000..717a04c
--- /dev/null
@@ -0,0 +1,65 @@
+// 990811 bkoz
+
+// Copyright (C) 1999 Cygnus Solutions
+//
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+/mnt/cdrom/yabbyyou_jesusdread/disk_2/King Tubby's - Repatriation
+/mnt/cdrom/yabbyyou_jesusdread/disk_2/Vivian Jackson and the Prop
+/mnt/cdrom/yabbyyou_jesusdread/disk_2/Michael Rose - Born Free (d
+/mnt/cdrom/yabbyyou_jesusdread/disk_2/King Tubby's - Love Thy Nei
+/mnt/cdrom/yabbyyou_jesusdread/disk_1/Vivian Jackson and the Defe
+/mnt/cdrom/yabbyyou_jesusdread/disk_1/Vivian Jackson and the Ralp
+/mnt/cdrom/yabbyyou_jesusdread/disk_1/Tommy McCook and Don D. Jnr
+/mnt/cdrom/yabbyyou_jesusdread/disk_1/Big Youth and Vivian Jackso
+/mnt/cdrom/yabbyyou_jesusdread/disk_1/King Tubby's - Big Youth Fi
+/mnt/cdrom/yabbyyou_jesusdread/disk_1/Upsetter Mix - Rally Dub
+/mnt/cdrom/yabbyyou_jesusdread/disk_1/Dicky Burton - God Is Watch
+/mnt/cdrom/yabbyyou_jesusdread/disk_1/Pablo and Vivian Jackson - 
+/mnt/cdrom/yabbyyou_jesusdread/disk_1/King Tubby's - Rock King Tu
+/mnt/cdrom/TORTOISE_millions_now_living/tortoise_5
+/mnt/cdrom/TORTOISE_millions_now_living/tortoise_6
+/mnt/cdrom/bettycarter_i'myours,you'remine/This time
+/mnt/cdrom/bettycarter_i'myours,you'remine/I'm Yours, You're Mine
+/mnt/cdrom/bettycarter_i'myours,you'remine/Lonely House
+/mnt/cdrom/bettycarter_i'myours,you'remine/Close Your Eyes
+/mnt/cdrom/bettycarter_i'myours,you'remine/Useless Landscape
+/mnt/cdrom/bettycarter_i'myours,you'remine/East of the Sun
+/mnt/cdrom/bettycarter_i'myours,you'remine/September Song
+/mnt/cdrom/bettycarter_it'snotaboutthemelo/Naima's Love Song
+/mnt/cdrom/bettycarter_it'snotaboutthemelo/Stay As Sweet As You Are
+/mnt/cdrom/bettycarter_it'snotaboutthemelo/Make Him Believe
+/mnt/cdrom/bettycarter_it'snotaboutthemelo/I Should Care
+/mnt/cdrom/bettycarter_it'snotaboutthemelo/Once Upon a Summertime
+/mnt/cdrom/bettycarter_it'snotaboutthemelo/You Go To My Head
+/mnt/cdrom/bettycarter_it'snotaboutthemelo/In the Still Of the Night
+/mnt/cdrom/bettycarter_it'snotaboutthemelo/When It's Sleepy Time Down 
+/mnt/cdrom/bettycarter_it'snotaboutthemelo/The Love We Had Yesterday
+/mnt/cdrom/bettycarter_it'snotaboutthemelo/Dip Bag
+/mnt/cdrom/bettycarter_it'snotaboutthemelo/You're Mine, Too
+/mnt/cdrom/c_adderly_somethin'_else/Autumn Leaves
+/mnt/cdrom/c_adderly_somethin'_else/Love For Sale
+/mnt/cdrom/c_adderly_somethin'_else/Somethin' Else
+/mnt/cdrom/c_adderly_somethin'_else/One For Daddy-O
+
+
+
+
+
+
+
+
diff --git a/libstdc++-v3/testsuite/data/istream_extractor_other-2.tst b/libstdc++-v3/testsuite/data/istream_extractor_other-2.tst
new file mode 100644 (file)
index 0000000..717a04c
--- /dev/null
@@ -0,0 +1,65 @@
+// 990811 bkoz
+
+// Copyright (C) 1999 Cygnus Solutions
+//
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+/mnt/cdrom/yabbyyou_jesusdread/disk_2/King Tubby's - Repatriation
+/mnt/cdrom/yabbyyou_jesusdread/disk_2/Vivian Jackson and the Prop
+/mnt/cdrom/yabbyyou_jesusdread/disk_2/Michael Rose - Born Free (d
+/mnt/cdrom/yabbyyou_jesusdread/disk_2/King Tubby's - Love Thy Nei
+/mnt/cdrom/yabbyyou_jesusdread/disk_1/Vivian Jackson and the Defe
+/mnt/cdrom/yabbyyou_jesusdread/disk_1/Vivian Jackson and the Ralp
+/mnt/cdrom/yabbyyou_jesusdread/disk_1/Tommy McCook and Don D. Jnr
+/mnt/cdrom/yabbyyou_jesusdread/disk_1/Big Youth and Vivian Jackso
+/mnt/cdrom/yabbyyou_jesusdread/disk_1/King Tubby's - Big Youth Fi
+/mnt/cdrom/yabbyyou_jesusdread/disk_1/Upsetter Mix - Rally Dub
+/mnt/cdrom/yabbyyou_jesusdread/disk_1/Dicky Burton - God Is Watch
+/mnt/cdrom/yabbyyou_jesusdread/disk_1/Pablo and Vivian Jackson - 
+/mnt/cdrom/yabbyyou_jesusdread/disk_1/King Tubby's - Rock King Tu
+/mnt/cdrom/TORTOISE_millions_now_living/tortoise_5
+/mnt/cdrom/TORTOISE_millions_now_living/tortoise_6
+/mnt/cdrom/bettycarter_i'myours,you'remine/This time
+/mnt/cdrom/bettycarter_i'myours,you'remine/I'm Yours, You're Mine
+/mnt/cdrom/bettycarter_i'myours,you'remine/Lonely House
+/mnt/cdrom/bettycarter_i'myours,you'remine/Close Your Eyes
+/mnt/cdrom/bettycarter_i'myours,you'remine/Useless Landscape
+/mnt/cdrom/bettycarter_i'myours,you'remine/East of the Sun
+/mnt/cdrom/bettycarter_i'myours,you'remine/September Song
+/mnt/cdrom/bettycarter_it'snotaboutthemelo/Naima's Love Song
+/mnt/cdrom/bettycarter_it'snotaboutthemelo/Stay As Sweet As You Are
+/mnt/cdrom/bettycarter_it'snotaboutthemelo/Make Him Believe
+/mnt/cdrom/bettycarter_it'snotaboutthemelo/I Should Care
+/mnt/cdrom/bettycarter_it'snotaboutthemelo/Once Upon a Summertime
+/mnt/cdrom/bettycarter_it'snotaboutthemelo/You Go To My Head
+/mnt/cdrom/bettycarter_it'snotaboutthemelo/In the Still Of the Night
+/mnt/cdrom/bettycarter_it'snotaboutthemelo/When It's Sleepy Time Down 
+/mnt/cdrom/bettycarter_it'snotaboutthemelo/The Love We Had Yesterday
+/mnt/cdrom/bettycarter_it'snotaboutthemelo/Dip Bag
+/mnt/cdrom/bettycarter_it'snotaboutthemelo/You're Mine, Too
+/mnt/cdrom/c_adderly_somethin'_else/Autumn Leaves
+/mnt/cdrom/c_adderly_somethin'_else/Love For Sale
+/mnt/cdrom/c_adderly_somethin'_else/Somethin' Else
+/mnt/cdrom/c_adderly_somethin'_else/One For Daddy-O
+
+
+
+
+
+
+
+
diff --git a/libstdc++-v3/testsuite/data/istream_seeks-1.tst b/libstdc++-v3/testsuite/data/istream_seeks-1.tst
new file mode 100644 (file)
index 0000000..5d9eafa
--- /dev/null
@@ -0,0 +1,7 @@
+bd2
+456x
+9mzuv>?@ABCDEFGHIJKLMNOPQRSTUVWXYZracadabras, i wannaz
+because because
+because. . 
+of the wonderful things he does!!
+ok
\ No newline at end of file
diff --git a/libstdc++-v3/testsuite/data/istream_seeks-1.txt b/libstdc++-v3/testsuite/data/istream_seeks-1.txt
new file mode 100644 (file)
index 0000000..5d9eafa
--- /dev/null
@@ -0,0 +1,7 @@
+bd2
+456x
+9mzuv>?@ABCDEFGHIJKLMNOPQRSTUVWXYZracadabras, i wannaz
+because because
+because. . 
+of the wonderful things he does!!
+ok
\ No newline at end of file
diff --git a/libstdc++-v3/testsuite/data/istream_seeks-2.tst b/libstdc++-v3/testsuite/data/istream_seeks-2.tst
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/libstdc++-v3/testsuite/data/istream_seeks-3.tst b/libstdc++-v3/testsuite/data/istream_seeks-3.tst
new file mode 100644 (file)
index 0000000..dc45fc9
--- /dev/null
@@ -0,0 +1,10 @@
+0-0 lootpack, peanut butter wolf, rob swift, madlib, quasimoto
+0-1 lootpack, peanut butter wolf, rob swift, madlib, quasimoto
+0-2 lootpack, peanut butter wolf, rob swift, madlib, quasimoto
+0-3 lootpack, peanut butter wolf, rob swift, madlib, quasimoto
+0-4 lootpack, peanut butter wolf, rob swift, madlib, quasimoto
+0-5 lootpack, peanut butter wolf, rob swift, madlib, quasimoto
+0-6 lootpack, peanut butter wolf, rob swift, madlib, quasimoto
+0-7 lootpack, peanut butter wolf, rob swift, madlib, quasimoto
+0-8 lootpack, peanut butter wolf, rob swift, madlib, quasimoto
+0-9 lootpack, peanut butter wolf, rob swift, madlib, quasimoto
diff --git a/libstdc++-v3/testsuite/data/istream_unformatted-1.tst b/libstdc++-v3/testsuite/data/istream_unformatted-1.tst
new file mode 100644 (file)
index 0000000..9b770a5
--- /dev/null
@@ -0,0 +1,1500 @@
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
diff --git a/libstdc++-v3/testsuite/data/istream_unformatted-1.txt b/libstdc++-v3/testsuite/data/istream_unformatted-1.txt
new file mode 100644 (file)
index 0000000..9b770a5
--- /dev/null
@@ -0,0 +1,1500 @@
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
diff --git a/libstdc++-v3/testsuite/data/ofstream_members-1.tst b/libstdc++-v3/testsuite/data/ofstream_members-1.tst
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/libstdc++-v3/testsuite/data/ostream_inserter_char-1.tst b/libstdc++-v3/testsuite/data/ostream_inserter_char-1.tst
new file mode 100644 (file)
index 0000000..0b0acc8
--- /dev/null
@@ -0,0 +1,1000 @@
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
diff --git a/libstdc++-v3/testsuite/data/ostream_inserter_char-1.txt b/libstdc++-v3/testsuite/data/ostream_inserter_char-1.txt
new file mode 100644 (file)
index 0000000..0b0acc8
--- /dev/null
@@ -0,0 +1,1000 @@
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
+123456789
diff --git a/libstdc++-v3/testsuite/data/ostream_inserter_other-1.tst b/libstdc++-v3/testsuite/data/ostream_inserter_other-1.tst
new file mode 100644 (file)
index 0000000..cb3c57f
--- /dev/null
@@ -0,0 +1,158 @@
+// 990117 bkoz
+// test functionality of basic_filebuf for char_type == char
+// this is a data file for 27filebuf.cc
+
+// Copyright (C) 1997-1999 Cygnus Solutions
+//
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+/mnt/cdrom/sarah_vaughan/sarah_vaughan.allofme
+/mnt/cdrom/sarah_vaughan/sarah_vaughan.speaklow
+
+/mnt/cdrom/nikkigiovanni_thewayifeel/ng_01_the_way_i_feel
+/mnt/cdrom/nikkigiovanni_thewayifeel/ng_02_seduction_kidnap
+/mnt/cdrom/nikkigiovanni_thewayifeel/ng_03_just_a_ny_poem
+/mnt/cdrom/nikkigiovanni_thewayifeel/ng_04_butterflies_i_remem
+/mnt/cdrom/nikkigiovanni_thewayifeel/ng_05_luxury_poem
+/mnt/cdrom/nikkigiovanni_thewayifeel/ng_06_my_house
+/mnt/cdrom/nikkigiovanni_thewayifeel/ng_07_the_women_gather
+/mnt/cdrom/nikkigiovanni_thewayifeel/ng_08_the_life_i_led
+/mnt/cdrom/nikkigiovanni_thewayifeel/ng_09_when_i_die
+/mnt/cdrom/nikkigiovanni_thewayifeel/ng_10_revolutionary_dreams
+/mnt/cdrom/nikkigiovanni_thewayifeel/ng_11_winter_poem
+/mnt/cdrom/nikkigiovanni_thewayifeel/ng_12_a_certain_peace_i_nap
+/mnt/cdrom/nikkigiovanni_thewayifeel/ng_13_poem_for_a_lady_whose
+
+/mnt/cdrom/marley-songs_of_freedom/disk_1/
+/mnt/cdrom/marley-songs_of_freedom/disk_2/
+/mnt/cdrom/marley-songs_of_freedom/disk_4/
+
+/mnt/cdrom/marley-songs_of_freedom/disk_1/back out
+/mnt/cdrom/marley-songs_of_freedom/disk_1/bend down low
+/mnt/cdrom/marley-songs_of_freedom/disk_1/bus dem shut (pyaka)
+/mnt/cdrom/marley-songs_of_freedom/disk_1/caution
+/mnt/cdrom/marley-songs_of_freedom/disk_1/do it twice
+/mnt/cdrom/marley-songs_of_freedom/disk_1/don't rock the boat
+/mnt/cdrom/marley-songs_of_freedom/disk_1/duppy conqueror
+/mnt/cdrom/marley-songs_of_freedom/disk_1/hammer
+/mnt/cdrom/marley-songs_of_freedom/disk_1/hypocrites
+/mnt/cdrom/marley-songs_of_freedom/disk_1/i'm still waiting
+/mnt/cdrom/marley-songs_of_freedom/disk_1/judge not
+/mnt/cdrom/marley-songs_of_freedom/disk_1/mellow mood
+/mnt/cdrom/marley-songs_of_freedom/disk_1/mr brown
+/mnt/cdrom/marley-songs_of_freedom/disk_1/nice time
+/mnt/cdrom/marley-songs_of_freedom/disk_1/one cup of coffee
+/mnt/cdrom/marley-songs_of_freedom/disk_1/one love_people get ready
+/mnt/cdrom/marley-songs_of_freedom/disk_1/put it on
+/mnt/cdrom/marley-songs_of_freedom/disk_1/simmer down
+/mnt/cdrom/marley-songs_of_freedom/disk_1/small axe
+/mnt/cdrom/marley-songs_of_freedom/disk_1/soul rebel
+/mnt/cdrom/marley-songs_of_freedom/disk_1/soul shake down party
+/mnt/cdrom/marley-songs_of_freedom/disk_1/stir it up (original)
+/mnt/cdrom/marley-songs_of_freedom/disk_1/sun is shining
+/mnt/cdrom/marley-songs_of_freedom/disk_1/thank you lord (original)
+/mnt/cdrom/marley-songs_of_freedom/disk_2/acoustic medley
+/mnt/cdrom/marley-songs_of_freedom/disk_2/burnin' and lootin'
+/mnt/cdrom/marley-songs_of_freedom/disk_2/concrete jungle
+/mnt/cdrom/marley-songs_of_freedom/disk_2/craven choke puppy
+/mnt/cdrom/marley-songs_of_freedom/disk_2/get up stand up
+/mnt/cdrom/marley-songs_of_freedom/disk_2/guava jelly
+/mnt/cdrom/marley-songs_of_freedom/disk_2/high tide or low tide
+/mnt/cdrom/marley-songs_of_freedom/disk_2/i shot the sheriff
+/mnt/cdrom/marley-songs_of_freedom/disk_2/i'm hurting inside
+/mnt/cdrom/marley-songs_of_freedom/disk_2/iron lion zion
+/mnt/cdrom/marley-songs_of_freedom/disk_2/lick samba
+/mnt/cdrom/marley-songs_of_freedom/disk_2/lively up yourself
+/mnt/cdrom/marley-songs_of_freedom/disk_2/natty dread
+/mnt/cdrom/marley-songs_of_freedom/disk_2/no more trouble
+/mnt/cdrom/marley-songs_of_freedom/disk_2/rastaman chant
+/mnt/cdrom/marley-songs_of_freedom/disk_2/screw face
+/mnt/cdrom/marley-songs_of_freedom/disk_2/slave driver
+/mnt/cdrom/marley-songs_of_freedom/disk_2/trenchtown rock
+/mnt/cdrom/marley-songs_of_freedom/disk_4/africa unite
+/mnt/cdrom/marley-songs_of_freedom/disk_4/babylon system
+/mnt/cdrom/marley-songs_of_freedom/disk_4/bad card
+/mnt/cdrom/marley-songs_of_freedom/disk_4/coming in from the cold (12
+/mnt/cdrom/marley-songs_of_freedom/disk_4/could you be loved (12  mix
+/mnt/cdrom/marley-songs_of_freedom/disk_4/forever loving jah
+/mnt/cdrom/marley-songs_of_freedom/disk_4/give thanks and praise
+/mnt/cdrom/marley-songs_of_freedom/disk_4/one drop
+/mnt/cdrom/marley-songs_of_freedom/disk_4/one dub
+/mnt/cdrom/marley-songs_of_freedom/disk_4/rastaman live up
+/mnt/cdrom/marley-songs_of_freedom/disk_4/real situation
+/mnt/cdrom/marley-songs_of_freedom/disk_4/redemption song (live in pi
+/mnt/cdrom/marley-songs_of_freedom/disk_4/ride natty ride (12  mix)
+/mnt/cdrom/marley-songs_of_freedom/disk_4/so much trouble in the worl
+/mnt/cdrom/marley-songs_of_freedom/disk_4/survival
+/mnt/cdrom/marley-songs_of_freedom/disk_4/why should i (previously un
+/mnt/cdrom/marley-songs_of_freedom/disk_4/zimbabwe
+
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_01_pandemonium
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_02_sync_disjecta
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_03_object_unknown
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_04_it's_nice_not
+/mnt/cdrom/dj_spooky_rid-2dim_warefare/djspooky_05_dialectical_tra
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_06_post-human_soph
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_07_quilombo_ex
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_08_rekonstruction
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_09_scientifik
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_10_a_conversation
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_11_peace_in_zaire
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_13_degree_zero
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_14_roman_planeta
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_15_bass_digitalis
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_16_polyphony_of
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_17_riddim_warfare
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_18_the_nerd
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_20_theme_of_the
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_21_twilight_fugue
+
+/mnt/cdrom/stuff_smith_mosaic/disk3/01_desert_sands
+/mnt/cdrom/stuff_smith_mosaic/disk3/02_soft_winds
+/mnt/cdrom/stuff_smith_mosaic/disk3/03_time_and_again
+/mnt/cdrom/stuff_smith_mosaic/disk3/04_it_don't_mean_a_thing
+/mnt/cdrom/stuff_smith_mosaic/disk3/05_in_a_mellotone
+/mnt/cdrom/stuff_smith_mosaic/disk3/06_i_know_that_you_know
+/mnt/cdrom/stuff_smith_mosaic/disk3/07_heat_wave
+/mnt/cdrom/stuff_smith_mosaic/disk3/08_things_ain't_what_they_used_to_be
+/mnt/cdrom/stuff_smith_mosaic/disk3/09_body_and_soul
+
+So I take a break, wander down to the park to stand, then lean into
+the concrete railing demarking the beginnings of space, oceanic
+space. I watch the waves break, and form, and ease back out to sea and
+wrap my arms around myself and hug tightly because it's early in the
+morning and windy, and the sun is late getting out of bed today, which
+is good because if there was brilliant light illuminating all the
+beauty around me I would be shocked, stunned, forced to retreat back
+into my cabana in a daze, blinded by hummingbirds and callilillies and
+un-named red, yellow, and blue flowers. Green envelopes me, waves
+sooth me. I can see the wind flip the top of the waves seaward, right
+before they break. The sea seems so calm from my perch above the fray
+that I wonder if maybe there is just some part of the deepest, most
+abstract ocean where there is a large creature who happily chews
+plankton and wags its tail in gentle, adulating waves that spread and
+move and gracefully glide thousands of miles, to crash upon a beach,
+one after the other, politely waiting for a turn to dance with the
+seashore.
+
+I know: it is what the Mexican schoolchildren call "la vibora de la
+mer," the serpent of the sea.
+
+
+
+
+
diff --git a/libstdc++-v3/testsuite/data/ostream_inserter_other-2.tst b/libstdc++-v3/testsuite/data/ostream_inserter_other-2.tst
new file mode 100644 (file)
index 0000000..cb3c57f
--- /dev/null
@@ -0,0 +1,158 @@
+// 990117 bkoz
+// test functionality of basic_filebuf for char_type == char
+// this is a data file for 27filebuf.cc
+
+// Copyright (C) 1997-1999 Cygnus Solutions
+//
+// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+/mnt/cdrom/sarah_vaughan/sarah_vaughan.allofme
+/mnt/cdrom/sarah_vaughan/sarah_vaughan.speaklow
+
+/mnt/cdrom/nikkigiovanni_thewayifeel/ng_01_the_way_i_feel
+/mnt/cdrom/nikkigiovanni_thewayifeel/ng_02_seduction_kidnap
+/mnt/cdrom/nikkigiovanni_thewayifeel/ng_03_just_a_ny_poem
+/mnt/cdrom/nikkigiovanni_thewayifeel/ng_04_butterflies_i_remem
+/mnt/cdrom/nikkigiovanni_thewayifeel/ng_05_luxury_poem
+/mnt/cdrom/nikkigiovanni_thewayifeel/ng_06_my_house
+/mnt/cdrom/nikkigiovanni_thewayifeel/ng_07_the_women_gather
+/mnt/cdrom/nikkigiovanni_thewayifeel/ng_08_the_life_i_led
+/mnt/cdrom/nikkigiovanni_thewayifeel/ng_09_when_i_die
+/mnt/cdrom/nikkigiovanni_thewayifeel/ng_10_revolutionary_dreams
+/mnt/cdrom/nikkigiovanni_thewayifeel/ng_11_winter_poem
+/mnt/cdrom/nikkigiovanni_thewayifeel/ng_12_a_certain_peace_i_nap
+/mnt/cdrom/nikkigiovanni_thewayifeel/ng_13_poem_for_a_lady_whose
+
+/mnt/cdrom/marley-songs_of_freedom/disk_1/
+/mnt/cdrom/marley-songs_of_freedom/disk_2/
+/mnt/cdrom/marley-songs_of_freedom/disk_4/
+
+/mnt/cdrom/marley-songs_of_freedom/disk_1/back out
+/mnt/cdrom/marley-songs_of_freedom/disk_1/bend down low
+/mnt/cdrom/marley-songs_of_freedom/disk_1/bus dem shut (pyaka)
+/mnt/cdrom/marley-songs_of_freedom/disk_1/caution
+/mnt/cdrom/marley-songs_of_freedom/disk_1/do it twice
+/mnt/cdrom/marley-songs_of_freedom/disk_1/don't rock the boat
+/mnt/cdrom/marley-songs_of_freedom/disk_1/duppy conqueror
+/mnt/cdrom/marley-songs_of_freedom/disk_1/hammer
+/mnt/cdrom/marley-songs_of_freedom/disk_1/hypocrites
+/mnt/cdrom/marley-songs_of_freedom/disk_1/i'm still waiting
+/mnt/cdrom/marley-songs_of_freedom/disk_1/judge not
+/mnt/cdrom/marley-songs_of_freedom/disk_1/mellow mood
+/mnt/cdrom/marley-songs_of_freedom/disk_1/mr brown
+/mnt/cdrom/marley-songs_of_freedom/disk_1/nice time
+/mnt/cdrom/marley-songs_of_freedom/disk_1/one cup of coffee
+/mnt/cdrom/marley-songs_of_freedom/disk_1/one love_people get ready
+/mnt/cdrom/marley-songs_of_freedom/disk_1/put it on
+/mnt/cdrom/marley-songs_of_freedom/disk_1/simmer down
+/mnt/cdrom/marley-songs_of_freedom/disk_1/small axe
+/mnt/cdrom/marley-songs_of_freedom/disk_1/soul rebel
+/mnt/cdrom/marley-songs_of_freedom/disk_1/soul shake down party
+/mnt/cdrom/marley-songs_of_freedom/disk_1/stir it up (original)
+/mnt/cdrom/marley-songs_of_freedom/disk_1/sun is shining
+/mnt/cdrom/marley-songs_of_freedom/disk_1/thank you lord (original)
+/mnt/cdrom/marley-songs_of_freedom/disk_2/acoustic medley
+/mnt/cdrom/marley-songs_of_freedom/disk_2/burnin' and lootin'
+/mnt/cdrom/marley-songs_of_freedom/disk_2/concrete jungle
+/mnt/cdrom/marley-songs_of_freedom/disk_2/craven choke puppy
+/mnt/cdrom/marley-songs_of_freedom/disk_2/get up stand up
+/mnt/cdrom/marley-songs_of_freedom/disk_2/guava jelly
+/mnt/cdrom/marley-songs_of_freedom/disk_2/high tide or low tide
+/mnt/cdrom/marley-songs_of_freedom/disk_2/i shot the sheriff
+/mnt/cdrom/marley-songs_of_freedom/disk_2/i'm hurting inside
+/mnt/cdrom/marley-songs_of_freedom/disk_2/iron lion zion
+/mnt/cdrom/marley-songs_of_freedom/disk_2/lick samba
+/mnt/cdrom/marley-songs_of_freedom/disk_2/lively up yourself
+/mnt/cdrom/marley-songs_of_freedom/disk_2/natty dread
+/mnt/cdrom/marley-songs_of_freedom/disk_2/no more trouble
+/mnt/cdrom/marley-songs_of_freedom/disk_2/rastaman chant
+/mnt/cdrom/marley-songs_of_freedom/disk_2/screw face
+/mnt/cdrom/marley-songs_of_freedom/disk_2/slave driver
+/mnt/cdrom/marley-songs_of_freedom/disk_2/trenchtown rock
+/mnt/cdrom/marley-songs_of_freedom/disk_4/africa unite
+/mnt/cdrom/marley-songs_of_freedom/disk_4/babylon system
+/mnt/cdrom/marley-songs_of_freedom/disk_4/bad card
+/mnt/cdrom/marley-songs_of_freedom/disk_4/coming in from the cold (12
+/mnt/cdrom/marley-songs_of_freedom/disk_4/could you be loved (12  mix
+/mnt/cdrom/marley-songs_of_freedom/disk_4/forever loving jah
+/mnt/cdrom/marley-songs_of_freedom/disk_4/give thanks and praise
+/mnt/cdrom/marley-songs_of_freedom/disk_4/one drop
+/mnt/cdrom/marley-songs_of_freedom/disk_4/one dub
+/mnt/cdrom/marley-songs_of_freedom/disk_4/rastaman live up
+/mnt/cdrom/marley-songs_of_freedom/disk_4/real situation
+/mnt/cdrom/marley-songs_of_freedom/disk_4/redemption song (live in pi
+/mnt/cdrom/marley-songs_of_freedom/disk_4/ride natty ride (12  mix)
+/mnt/cdrom/marley-songs_of_freedom/disk_4/so much trouble in the worl
+/mnt/cdrom/marley-songs_of_freedom/disk_4/survival
+/mnt/cdrom/marley-songs_of_freedom/disk_4/why should i (previously un
+/mnt/cdrom/marley-songs_of_freedom/disk_4/zimbabwe
+
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_01_pandemonium
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_02_sync_disjecta
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_03_object_unknown
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_04_it's_nice_not
+/mnt/cdrom/dj_spooky_rid-2dim_warefare/djspooky_05_dialectical_tra
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_06_post-human_soph
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_07_quilombo_ex
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_08_rekonstruction
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_09_scientifik
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_10_a_conversation
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_11_peace_in_zaire
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_13_degree_zero
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_14_roman_planeta
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_15_bass_digitalis
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_16_polyphony_of
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_17_riddim_warfare
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_18_the_nerd
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_20_theme_of_the
+/mnt/cdrom/dj_spooky_riddim_warefare/djspooky_21_twilight_fugue
+
+/mnt/cdrom/stuff_smith_mosaic/disk3/01_desert_sands
+/mnt/cdrom/stuff_smith_mosaic/disk3/02_soft_winds
+/mnt/cdrom/stuff_smith_mosaic/disk3/03_time_and_again
+/mnt/cdrom/stuff_smith_mosaic/disk3/04_it_don't_mean_a_thing
+/mnt/cdrom/stuff_smith_mosaic/disk3/05_in_a_mellotone
+/mnt/cdrom/stuff_smith_mosaic/disk3/06_i_know_that_you_know
+/mnt/cdrom/stuff_smith_mosaic/disk3/07_heat_wave
+/mnt/cdrom/stuff_smith_mosaic/disk3/08_things_ain't_what_they_used_to_be
+/mnt/cdrom/stuff_smith_mosaic/disk3/09_body_and_soul
+
+So I take a break, wander down to the park to stand, then lean into
+the concrete railing demarking the beginnings of space, oceanic
+space. I watch the waves break, and form, and ease back out to sea and
+wrap my arms around myself and hug tightly because it's early in the
+morning and windy, and the sun is late getting out of bed today, which
+is good because if there was brilliant light illuminating all the
+beauty around me I would be shocked, stunned, forced to retreat back
+into my cabana in a daze, blinded by hummingbirds and callilillies and
+un-named red, yellow, and blue flowers. Green envelopes me, waves
+sooth me. I can see the wind flip the top of the waves seaward, right
+before they break. The sea seems so calm from my perch above the fray
+that I wonder if maybe there is just some part of the deepest, most
+abstract ocean where there is a large creature who happily chews
+plankton and wags its tail in gentle, adulating waves that spread and
+move and gracefully glide thousands of miles, to crash upon a beach,
+one after the other, politely waiting for a turn to dance with the
+seashore.
+
+I know: it is what the Mexican schoolchildren call "la vibora de la
+mer," the serpent of the sea.
+
+
+
+
+
diff --git a/libstdc++-v3/testsuite/data/ostream_seeks-1.tst b/libstdc++-v3/testsuite/data/ostream_seeks-1.tst
new file mode 100644 (file)
index 0000000..e69de29
index b64274bea93c3408513d88f47e34c1c0235b921c..1d828626192623a79c96ca019c3c4eaeb52c82b9 100644 (file)
@@ -54,8 +54,11 @@ proc libstdc++-v3-init { args } {
     set dg-do-what-default run
 
     # Copy any required data files.
-    libstdc++-v3-copy-files [glob -nocomplain "$srcdir/{,*/}*/*.tst"] $outdir
-    libstdc++-v3-copy-files [glob -nocomplain "$srcdir/{,*/}*/*.txt"] $outdir
+    libstdc++-v3-copy-files [glob -nocomplain "$srcdir/data/*.tst"] $outdir
+    libstdc++-v3-copy-files [glob -nocomplain "$srcdir/data/*.txt"] $outdir
+
+    # Compute lists of files to test.
+    v3-compute-tests
 
     # set LD_LIBRARY_PATH so that libgcc_s, libstdc++ binaries can be found.
     # locate libgcc.a so we don't need to account for different values of
@@ -209,54 +212,109 @@ proc libstdc++-v3_target_compile { source dest type options } {
 }
 
 
-# A bit sloppy...  Returns a list of source files (full pathnames) to
-# compile.  We mimic the mkcheck script in that the first time this is run,
-# all existing files are listed in "testsuite_files" in the output
-# directory.  Subsequent runs pull the list from that file, allowing users
-# to trim the list down to problematic tests.
-### This is supposed to be done via RUNTESTFLAGS, but that doesn't work.
-proc libstdc++-v3-list-sourcefiles { } {
+# Constructs lists of source files (full pathnames) to test.  Two
+# files are constructed: testsuite_files, which is used to test with
+# the default dg-runtest command, and testsuite_files_interactive,
+# which is used to test cases that require input to be entered. In
+# addition, both lists are pruned of wchar_t tests if the toolchain
+# under test does not support wchar_t functionality.
+#
+# We mimic the mkcheck script in that the first time this is run, all
+# existing files are listed in "testsuite_files" in the output
+# directory.  Subsequent runs pull the list from that file, allowing
+# users to trim the list down to problematic tests, or just run
+# paticular directories or sub-directories of tests.
+#
+# Selecting individual tests can also be done with RUNTESTFLAGS, but
+# that doesn't really do all that we are trying to accomplish here.
+proc v3-compute-tests { } {
     global srcdir
     global outdir
 
-    set files_file "${outdir}/testsuite_files"
+    set tests_file "${outdir}/testsuite_files"
+    set tests_file_inter "${outdir}/testsuite_files_interactive"
     set sfiles ""
-    if { [file exists $files_file] } {
-       set f [open $files_file]
-       while { ! [eof $f] } {
-           set t [gets $f]
-           if { [string length "$t"] != 0 } {
-               lappend sfiles ${srcdir}/${t}
-           }
-       }
-    } else {
-       set f [open $files_file "w"]
-       set where_we_were [pwd]
-       cd $srcdir
-       foreach s [lsort [glob -nocomplain "*/*.cc" "*/*/*.cc" "{,*/}*/*/*/*.cc" ]] {
-           lappend sfiles ${srcdir}/${s}
-           puts $f $s
-       }
-       cd $where_we_were
+
+    # If there is a testsuite_file, use it. 
+    if { [file exists $tests_file] } {
+       return 
+    } 
+
+    # If not, generate it. 
+    set where_we_were [pwd]
+    cd $srcdir
+    foreach s [lsort [glob -nocomplain "*/*.cc" "*/*/*.cc" "{,*/}*/*/*/*.cc" ]] {
+       lappend sfiles ${s}
     }
-    close $f
+    cd $where_we_were
 
+    # Filter wchar_t tests.
     # Disable wchar_t tests if library not configured to support
     # wchar_t testing. 
     set wchar_file "${outdir}/testsuite_wchar_t"    
-    if { [file exists $wchar_file] } {
-       return $sfiles
-    } else {
+    if { ! [file exists $wchar_file] } {
        # Remove wchar_t tests files from list.
        set res {}
        foreach w $sfiles {
            if [regexp "wchar_t" $w] {
-               verbose "element out list is $w"
+               verbose "element wchar list is $w"
            } else {
-               verbose "element in list is $w"
+               verbose "element non-wchar list is $w"
                lappend res $w
            }
        }
-       return $res
+       set sfiles ${res}
+    }
+
+    # Filter interactive tests.
+    # Use special rules to run these tests.
+    set restwo {}
+    set sfiles_inter {}
+    foreach i $sfiles {
+       if [regexp "_xin" $i] {
+           verbose "element interactive list is $i"
+           lappend sfiles_inter $i
+       } else {
+           verbose "element non-interactive list is $i"
+           lappend restwo $i
+       }
+    }
+    set sfiles ${restwo}
+
+    # Write out testsuite_files.
+    set f [open $tests_file "w"]
+    foreach t $sfiles {
+       puts $f $t
+    }
+    close $f
+
+    # Write out testsuite_files_interactive.
+    set f [open $tests_file_inter "w"]
+    foreach t $sfiles_inter {
+       puts $f $t
+    }
+    close $f
+}
+
+proc v3-list-tests { filename } {
+    global srcdir
+    global outdir
+    
+    set tests_file "${outdir}/${filename}"
+    set sfiles ""
+
+    # If there is a testsuite_file, use it. 
+    if { [file exists $tests_file] } {
+       set f [open $tests_file]
+       while { ! [eof $f] } {
+           set t [gets $f]
+           if { [string length "$t"] != 0 } {
+               lappend sfiles  ${srcdir}/${t}
+           }
+       } 
+       close $f
+    } else {
+       verbose "cannot open $tests_file"
     }
+    return $sfiles
 }
index 8b70564d87a09f5e1d2be91bf488d8412353afea..00420992093c533c43cb197ac4ce403096d7813a 100644 (file)
@@ -26,11 +26,12 @@ if ![info exists DEFAULT_CXXFLAGS] then {
 }
 
 # Initialize 'dg' last or dejagnu exits with an error...
-libstdc++-v3-init
 dg-init
+libstdc++-v3-init
 
 # Main loop.
-dg-runtest [libstdc++-v3-list-sourcefiles] "" $DEFAULT_CXXFLAGS
+dg-runtest [v3-list-tests testsuite_files] "" $DEFAULT_CXXFLAGS
+#dg-runtest [v3-list-tests testsuite_files_interactive] "" $DEFAULT_CXXFLAGS
 
 # All done.
 dg-finish