Commit 8363b773 by Paolo Carlini Committed by Paolo Carlini

1-in.cc: Fix for systems with BUFSIZ != 8192.

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
parent b57b79f7
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> 2003-06-16 Andreas Jaeger <aj@suse.de>
* acinclude.m4 (GLIBCPP_CONFIGURE_TESTSUITE): Make * acinclude.m4 (GLIBCPP_CONFIGURE_TESTSUITE): Make
......
...@@ -40,9 +40,9 @@ void test05() ...@@ -40,9 +40,9 @@ void test05()
bool test = true; bool test = true;
streamsize strmsz_1, strmsz_2, strmsz_3; streamsize strmsz_1, strmsz_2, strmsz_3;
int i = 0, j = 0, k = 0;
char carray1[13] = ""; char carray1[13] = "";
char carray2[8192] = ""; char carray2[8192] = "";
char buffer[8192] = "";
int_type c1, c2, c3, c4; int_type c1, c2, c3, c4;
// streamsize sgetn(char_type *s, streamsize n) // streamsize sgetn(char_type *s, streamsize n)
...@@ -53,6 +53,9 @@ void test05() ...@@ -53,6 +53,9 @@ void test05()
// in // 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); fb_01.open(name_01, ios_base::in);
VERIFY( !fb_01.write_position() ); VERIFY( !fb_01.write_position() );
strmsz_1 = fb_01.in_avail(); // 8261 strmsz_1 = fb_01.in_avail(); // 8261
......
...@@ -41,9 +41,9 @@ void test05() ...@@ -41,9 +41,9 @@ void test05()
bool test = true; bool test = true;
streamsize strmsz_1, strmsz_2, strmsz_3; streamsize strmsz_1, strmsz_2, strmsz_3;
int i = 0, j = 0, k = 0;
char carray1[13] = ""; char carray1[13] = "";
char carray2[8192] = ""; char carray2[8192] = "";
char buffer[8192] = "";
int_type c1, c2, c3, c4; int_type c1, c2, c3, c4;
// streamsize sgetn(char_type *s, streamsize n) // streamsize sgetn(char_type *s, streamsize n)
...@@ -66,6 +66,9 @@ void test05() ...@@ -66,6 +66,9 @@ void test05()
// in | out 2 // 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); fb_01.open(name_01, ios_base::in | ios_base::out);
VERIFY( fb_01.write_position() ); VERIFY( fb_01.write_position() );
strmsz_1 = fb_01.in_avail(); strmsz_1 = fb_01.in_avail();
......
...@@ -40,7 +40,6 @@ void test05() ...@@ -40,7 +40,6 @@ void test05()
bool test = true; bool test = true;
streamsize strmsz_1, strmsz_2, strmsz_3; streamsize strmsz_1, strmsz_2, strmsz_3;
int i = 0, j = 0, k = 0;
char carray1[13] = ""; char carray1[13] = "";
char carray2[8192] = ""; char carray2[8192] = "";
int_type c1, c2, c3, c4; int_type c1, c2, c3, c4;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment