This is the mail archive of the libstdc++@gcc.gnu.org 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]
Other format: [Raw text]

[PATCH] Fix ios_manip_basefield.cc for 64 bit machines


Hi,

I cannot tell for sure since I do not have a 64 machine at hand :-(, but most
probably the current ios_manip_basefield.cc fails on those due to the sign rule
of octals. Indeed:

    http://gcc.gnu.org/ml/gcc-testresults/2002-02/msg00597.html

Thus the following simple fix, characterized by a barely noticeable reduced
coverage. Should suffice for now. Ok head and 3.1 branch (after one day of
testing on the mainline ;-)?

Ciao,
Paolo.

/////////////

2002-02-27  Paolo Carlini  <pcarlini@unitus.it>

        * testsuite/27_io/ios_manip_basefield.cc (test01):
        Fix for 64 bit machines.

diff -urN libstdc++-v3-orig/testsuite/27_io/ios_manip_basefield.cc
libstdc++-v3/testsuite/27_io/ios_manip_basefield.cc
--- libstdc++-v3-orig/testsuite/27_io/ios_manip_basefield.cc Tue Feb 26 21:14:20
2002
+++ libstdc++-v3/testsuite/27_io/ios_manip_basefield.cc Wed Feb 27 20:30:06 2002

@@ -46,27 +46,27 @@
 {
   bool test = true;

-  const char lit[] = "037 777 654 322\n:037 776 543 211:\n:037 777 654 322
:\n"
-                     ":   037 777 765 433:\n:   037 777 776 544:\n: 04 553
207:\n"
+  const char lit[] = "0123 456\n: 01 234 567:\n:0123 456   :\n"
+                     ":    012 345:\n:     01 234:\n: 04 553 207:\n"
                      ":0361 100   :\n:    030 071:\n:     02 322:\n"
                      "0x000012 345 678\n";

   std::ostringstream oss;
   oss.imbue(std::locale(std::locale(), new MyNP));
   oss << std::oct << std::showbase;
-  oss << -0123456l << std::endl;
+  oss << 0123456l << std::endl;

   oss << ":" << std::setw(11);
-  oss << -01234567l << ":" << std::endl;
+  oss << 01234567l << ":" << std::endl;

-  oss << ":" << std::setw(18) << std::left;
-  oss << -0123456l << ":" << std::endl;
+  oss << ":" << std::setw(11) << std::left;
+  oss << 0123456l << ":" << std::endl;

-  oss << ":" << std::setw(18) << std::right;
-  oss << -012345l << ":" << std::endl;
+  oss << ":" << std::setw(11) << std::right;
+  oss << 012345l << ":" << std::endl;

-  oss << ":" << std::setw(18) << std::internal;
-  oss << -01234l << ":" << std::endl;
+  oss << ":" << std::setw(11) << std::internal;
+  oss << 01234l << ":" << std::endl;

   oss << ":" << std::setw(11);
   oss << 1234567l << ":" << std::endl;
@@ -128,11 +128,11 @@

 // Projected output:
 /*
-037 777 654 322
-:037 776 543 211:
-:037 777 654 322   :
-:   037 777 765 433:
-:   037 777 776 544:
+0123 456
+: 01 234 567:
+:0123 456   :
+:    012 345:
+:     01 234:
 : 04 553 207:
 :0361 100   :
 :    030 071:



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