1-in.cc: Fix for systems with BUFSIZ != 8192.
authorPaolo Carlini <pcarlini@unitus.it>
Mon, 16 Jun 2003 21:24:40 +0000 (23:24 +0200)
committerPaolo Carlini <paolo@gcc.gnu.org>
Mon, 16 Jun 2003 21:24:40 +0000 (21:24 +0000)
2003-06-16  Paolo Carlini  <pcarlini@unitus.it>

* testsuite/27_io/basic_filebuf/sgetn/char/1-in.cc: Fix
for systems with BUFSIZ != 8192.
* testsuite/27_io/basic_filebuf/sgetn/char/1-io.cc: Ditto.
* testsuite/27_io/basic_filebuf/sgetn/char/1-out.cc:
Minor tweaks.

From-SVN: r68041

libstdc++-v3/ChangeLog
libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/1-in.cc
libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/1-io.cc
libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/1-out.cc

index 7b6f186e3855379801b2478df07bf3d4946b331b..b9df74030399b593e73b0332fb2db026abfa52c4 100644 (file)
@@ -1,3 +1,11 @@
+2003-06-16  Paolo Carlini  <pcarlini@unitus.it>
+
+       * testsuite/27_io/basic_filebuf/sgetn/char/1-in.cc: Fix
+       for systems with BUFSIZ != 8192.
+       * testsuite/27_io/basic_filebuf/sgetn/char/1-io.cc: Ditto.
+       * testsuite/27_io/basic_filebuf/sgetn/char/1-out.cc:
+       Minor tweaks.
+
 2003-06-16  Andreas Jaeger  <aj@suse.de>
 
        * acinclude.m4 (GLIBCPP_CONFIGURE_TESTSUITE): Make
index 021a1c89d68f23f6657a599f093563aaf20374f6..0f17624c58c6bce99541685472b37c795697f77b 100644 (file)
@@ -37,12 +37,12 @@ void test05()
   typedef filebuf::int_type    int_type;
   typedef filebuf::traits_type         traits_type;
 
-  bool                                         test = true;
+  bool                                 test = true;
 
   streamsize                   strmsz_1, strmsz_2, strmsz_3;
-  int                                  i = 0, j = 0, k = 0;
   char carray1[13] = "";
   char carray2[8192] = "";
+  char buffer[8192] = "";
   int_type                     c1, c2, c3, c4;
   
   // streamsize sgetn(char_type *s, streamsize n)
@@ -52,7 +52,10 @@ void test05()
 
   // in 
   {
-    constraint_filebuf fb_01; 
+    constraint_filebuf fb_01;
+    // Need this since BUFSIZ is only guaranteed >= 255 and we want
+    // to trigger the same underflow situation everywhere.
+    fb_01.pubsetbuf(buffer, 8192);
     fb_01.open(name_01, ios_base::in);
     VERIFY( !fb_01.write_position() );
     strmsz_1 = fb_01.in_avail(); // 8261
index 432ed6cdab5cbd08cf41f047358aa818411afb56..ff2663ef91158b41c1417e31958cf8af5459ccc8 100644 (file)
@@ -38,12 +38,12 @@ void test05()
   typedef filebuf::int_type    int_type;
   typedef filebuf::traits_type         traits_type;
 
-  bool                                         test = true;
+  bool                                 test = true;
 
   streamsize                   strmsz_1, strmsz_2, strmsz_3;
-  int                                  i = 0, j = 0, k = 0;
   char carray1[13] = "";
   char carray2[8192] = "";
+  char buffer[8192] = "";
   int_type                     c1, c2, c3, c4;
   
   // streamsize sgetn(char_type *s, streamsize n)
@@ -65,7 +65,10 @@ void test05()
 
   // in | out 2
   {
-    constraint_filebuf fb_01; 
+    constraint_filebuf fb_01;
+    // Need this since BUFSIZ is only guaranteed >= 255 and we want
+    // to trigger the same underflow situation everywhere.
+    fb_01.pubsetbuf(buffer, 8192);
     fb_01.open(name_01, ios_base::in | ios_base::out);
     VERIFY( fb_01.write_position() );
     strmsz_1 = fb_01.in_avail();
index dcefe01c6a13e67725b3232fab94e66e7fb114de..7bd5e37e440f4c79ebbbe235cfbdd86236a519f0 100644 (file)
@@ -37,10 +37,9 @@ void test05()
   typedef filebuf::int_type    int_type;
   typedef filebuf::traits_type         traits_type;
 
-  bool                                         test = true;
+  bool                                 test = true;
 
   streamsize                   strmsz_1, strmsz_2, strmsz_3;
-  int                                  i = 0, j = 0, k = 0;
   char carray1[13] = "";
   char carray2[8192] = "";
   int_type                     c1, c2, c3, c4;
@@ -52,7 +51,7 @@ void test05()
 
   // out
   {
-    constraint_filebuf fb_02; 
+    constraint_filebuf fb_02;
     fb_02.open(name_02, ios_base::out | ios_base::trunc);
     VERIFY( fb_02.write_position() );
     VERIFY( !fb_02.read_position() );