summaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite/27_io/basic_streambuf/in_avail/wchar_t
diff options
context:
space:
mode:
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2004-07-11 19:13:59 +0000
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2004-07-11 19:13:59 +0000
commitbd0b04411fc5b484dd3f33cda5f2480326459252 (patch)
treec22f42857af14d7d2783e7b05df4aecad23368a1 /libstdc++-v3/testsuite/27_io/basic_streambuf/in_avail/wchar_t
parentdb97ad4157917ee22e26683eac93acea1f2b8cea (diff)
downloadgcc-bd0b04411fc5b484dd3f33cda5f2480326459252.tar.gz
2004-07-11 Paolo Carlini <pcarlini@suse.de>
Add wchar_t counterparts of the basic_streambbuf<char> tests. * testsuite/27_io/basic_streambuf/cons/wchar_t/1.cc: New. * testsuite/27_io/basic_streambuf/imbue/wchar_t/1.cc, 9322.cc: Likewise. * testsuite/27_io/basic_streambuf/in_avail/wchar_t/9701-3.cc: Likewise. * testsuite/27_io/basic_streambuf/overflow/wchar_t/1.cc, 2.cc, 3599.cc: Likewise. * testsuite/27_io/basic_streambuf/sgetc/wchar_t/1.cc: Likewise. * testsuite/27_io/basic_streambuf/sgetn/wchar_t/1.cc: Likewise. * testsuite/27_io/basic_streambuf/sputbackc/wchar_t/9538.cc: Likewise. * testsuite/27_io/basic_streambuf/sputc/wchar_t/1057.cc: Likewise. * testsuite/27_io/basic_streambuf/sputn/wchar_t/1.cc, 1057.cc: Likewise. * testsuite/27_io/basic_streambuf/sync/wchar_t/1057.cc: Likewise. * testsuite/27_io/basic_streambuf/imbue/char/1.cc, 9322.cc: Minor tweaks. * testsuite/27_io/basic_streambuf/overflow/char/2.cc, 3599.cc: Likewise. * testsuite/27_io/basic_streambuf/sputn/char/1057.cc: Likewise. * testsuite/27_io/basic_streambuf/sync/char/1057.cc: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@84526 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/testsuite/27_io/basic_streambuf/in_avail/wchar_t')
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_streambuf/in_avail/wchar_t/9701-3.cc59
1 files changed, 59 insertions, 0 deletions
diff --git a/libstdc++-v3/testsuite/27_io/basic_streambuf/in_avail/wchar_t/9701-3.cc b/libstdc++-v3/testsuite/27_io/basic_streambuf/in_avail/wchar_t/9701-3.cc
new file mode 100644
index 00000000000..239f790fe47
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_streambuf/in_avail/wchar_t/9701-3.cc
@@ -0,0 +1,59 @@
+// Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with 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.5.2.2.3 Get area
+
+#include <fstream>
+#include <testsuite_hooks.h>
+
+class Derived_fbuf : public std::wfilebuf
+{
+public:
+ const char_type* pub_egptr() const
+ { return egptr(); }
+
+ const char_type* pub_gptr() const
+ { return gptr(); }
+};
+
+// libstdc++/9701 (in_avail)
+void test01()
+{
+ using namespace std;
+ bool test __attribute__((unused)) = true;
+ const char* name = "tmp_file1_w";
+
+ Derived_fbuf df2;
+ df2.open(name, ios_base::in | ios_base::out | ios_base::trunc);
+
+ df2.sputn(L"Comomoc", 7);
+
+ df2.pubseekoff(0, ios_base::beg);
+ df2.sbumpc();
+ df2.sputbackc(L't');
+
+ VERIFY( df2.pub_gptr() < df2.pub_egptr() );
+ VERIFY( df2.in_avail() == df2.pub_egptr() - df2.pub_gptr() );
+}
+
+int
+main()
+{
+ test01();
+ return 0;
+}