summaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite
diff options
context:
space:
mode:
authorbkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4>2000-05-09 07:19:14 +0000
committerbkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4>2000-05-09 07:19:14 +0000
commita23c119bcebe144da499ed681c32629bd6d9c601 (patch)
tree680d5729f6fb38d313b6e014e2964216f72074de /libstdc++-v3/testsuite
parent341cffb90200d6385141b4e5c4eb697e76128fda (diff)
downloadgcc-a23c119bcebe144da499ed681c32629bd6d9c601.tar.gz
2000-05-09 Vadim Egorov <egorovv@mailandnews.com>
Benjamin Kosnik <bkoz@gnu.org> Nathan Myers <ncm@cantrip.org> Dietmar Kuehl <dietmar_kuehl@yahoo.com> * bits/streambuf.tcc (basic_streambuf::xsgetn): Fix uflow case. (basic_streambuf::xsputn): Make consistent. * testsuite/27_io/filebuf.cc: Add tests. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@33794 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/testsuite')
-rw-r--r--libstdc++-v3/testsuite/27_io/filebuf.cc21
1 files changed, 20 insertions, 1 deletions
diff --git a/libstdc++-v3/testsuite/27_io/filebuf.cc b/libstdc++-v3/testsuite/27_io/filebuf.cc
index 586388e8e10..40e6cc6a1ab 100644
--- a/libstdc++-v3/testsuite/27_io/filebuf.cc
+++ b/libstdc++-v3/testsuite/27_io/filebuf.cc
@@ -503,12 +503,31 @@ bool test03() {
return test;
}
+bool test04()
+{
+ 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));
+ test &= len1 == sizeof(buffer);
+ test &= buffer[0] == 'a';
-int main() {
+#ifdef DEBUG_ASSERT
+ assert(test);
+#endif
+ return test;
+}
+
+int main()
+{
test00();
test01();
test02();
test03();
+ test04();
return 0;
}