This is the mail archive of the libstdc++@sourceware.cygnus.com mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Patches to testsuite


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Here are some patches to the testsuite to make the test programs less
dependent on the implementation details of libstdc++-v3

testsuite/27_io/filebuf.cc: Changed calls to fpos<>._M_position() to
implicit calls to operator streamoff().

testsuite/27_io/iostream_objects.cc: Removed #include <ciso646>, as
not needed

testsuite/27_io/ostream_inserter_arith.cc: Replaced explicit call to
numpunct<>._M_init() with overrides of the appropriate virtual
functions.

Index: filebuf.cc
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/testsuite/27_io/filebuf.cc,v
retrieving revision 1.3
diff -u -p -r1.3 filebuf.cc
- --- filebuf.cc  2000/05/09 07:19:14     1.3
+++ filebuf.cc  2000/06/06 14:16:12
@@ -409,7 +409,7 @@ bool test03() {
   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._M_position();
+  off_1 = pt_1;
   test &= off_1 > 0;
   c1 = fb_03.snextc(); file://current in pointer +1
   test &= c1 == '3';
@@ -423,7 +423,7 @@ bool test03() {
   file://cur
   // 27filebuf-3.txt = bd2\n456789:;<=>?...
   pt_2 = fb_03.pubseekoff(2, std::ios_base::cur);
- -  off_2 = pt_2._M_position();
+  off_2 = pt_2;
   test &= (off_2 == (off_1 + 2 + 1 + 1));
   c1 = fb_03.snextc(); file://current in pointer +1
   test &= c1 == '7';
@@ -437,7 +437,7 @@ bool test03() {
   // 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._M_position();
+  off_1 = pt_2;
   test &= off_1 > off_2; file://weak, but don't know exactly where it
ends
   c3 = fb_03.sputc('\n');
   strmsz_1 = fb_03.sputn("because because because. . .", 28);  
@@ -456,7 +456,7 @@ bool test03() {
   file://IN|OUT
   file://beg
   pt_1 = fb_03.pubseekoff(78, std::ios_base::beg);
- -  off_1 = pt_1._M_position();
+  off_1 = pt_1;
   test &= off_1 > 0;
   c1 = fb_03.snextc();                 file://current in pointer +1
   test &= c1 == ' ';
@@ -464,12 +464,12 @@ bool test03() {
   c3 = fb_03.sgetc();
   fb_03.pubsync();             file://resets pointers
   pt_2 = fb_03.pubseekpos(pt_1);
- -  off_2 = pt_2._M_position();
+  off_2 = pt_2;
   test &= off_1 == off_2;
   c3 = fb_03.snextc();                 file://current in pointer +1
   test &= c2 == c3;
   pt_1 = fb_03.pubseekoff(0, std::ios_base::end);
- -  off_1 = pt_1._M_position();
+  off_1 = pt_1;
   test &= off_1 > off_2;
   fb_03.sputn("\nof the wonderful things he does!!\nok", 37);
   fb_03.pubsync();

Index: iostream_objects.cc
===================================================================
RCS file:
/cvs/gcc/egcs/libstdc++-v3/testsuite/27_io/iostream_objects.cc,v
retrieving revision 1.1
diff -u -p -r1.1 iostream_objects.cc
- --- iostream_objects.cc 2000/04/21 20:33:34     1.1
+++ iostream_objects.cc 2000/06/06 14:16:12
@@ -54,7 +54,7 @@
 #include <cctype>
 #include <cerrno>
 #include <cfloat>
- -#include <ciso646>
+//#include <ciso646>
 #include <climits>
 #include <clocale>
 #include <cmath>


Index: ostream_inserter_arith.cc
===================================================================
RCS file:
/cvs/gcc/egcs/libstdc++-v3/testsuite/27_io/ostream_inserter_arith.cc,v
retrieving revision 1.1
diff -u -p -r1.1 ostream_inserter_arith.cc
- --- ostream_inserter_arith.cc   2000/04/21 20:33:34     1.1
+++ ostream_inserter_arith.cc   2000/06/06 14:16:12
@@ -142,10 +142,26 @@ class testpunct : public numpunct<_CharT
 public:
   typedef _CharT  char_type;
 
+    const char_type dchar;
+
   explicit
- -  testpunct(char_type decimal_char) : numpunct<_CharT>() 
+  testpunct(char_type decimal_char) : numpunct<_CharT>() ,
+      dchar(decimal_char)
     { 
- -      _M_init(decimal_char, ',', "");
+    }
+
+protected:
+    char_type do_decimal_point() const
+    {
+       return dchar;
+    }
+    char_type do_thousands_sep() const
+    {
+       return ',';
+    }
+    string do_grouping() const
+    {
+       return string();
     }
 };

Anthony

PGP Fingerprint: 
0E2D D32A 8732 DC31 804C  D435 9BF0 F8FE 1C1B 9AD5
PGP Key at: http://i3.yimg.com/3/c7e5ee24/g/68fc2307.asc

-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 6.5.1 for non-commercial use <http://www.pgp.com>
Comment: PGP Key at: http://i3.yimg.com/3/c7e5ee24/g/68fc2307.asc

iQA/AwUBOT0JAZvw+P4cG5rVEQLXrwCgusROMD7I86p/i1e1ki/A5Z8/610AoIvh
ksvQ7piTHG0rWnAqHHY54clp
=o+1A
-----END PGP SIGNATURE-----



__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]