This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

[v3] testsuite fixes



Turns out that testsuite/27_io/ios_manip_basefield.cc has been failing
for some time, probably due to num_put issues WRT grouping on oct and
hex integers. I'm not quite sure what to do about it, and what the
expect output should be, as this has recently surfaced as an issue on
the LWG lists. In any case, it shouldn't silently fail.

All the iosmanip required functionality wasn't being tested for
linkage, which is now necessary. These tests are more placeholders for
that than something that also checks functionality.

This also includes the last of the money_put_* fixes for AIX and other
non-weak systems.

-benjamin

tested x86/linux

Index: testsuite/22_locale/money_put_members_char.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/22_locale/money_put_members_char.cc,v
retrieving revision 1.11
diff -c -p -r1.11 money_put_members_char.cc
*** money_put_members_char.cc	2002/02/18 21:23:26	1.11
--- money_put_members_char.cc	2002/02/20 20:58:48
*************** struct My_money_io : public std::moneypu
*** 315,321 ****
  
    pattern do_neg_format() const
    {
!     static pattern pat = { { symbol, space, sign, value } };
      return pat;
    }
  };
--- 315,321 ----
  
    pattern do_neg_format() const
    {
!     pattern pat = { { symbol, space, sign, value } };
      return pat;
    }
  };
Index: testsuite/22_locale/money_put_members_wchar_t.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/22_locale/money_put_members_wchar_t.cc,v
retrieving revision 1.10
diff -c -p -r1.10 money_put_members_wchar_t.cc
*** money_put_members_wchar_t.cc	2002/02/18 21:23:26	1.10
--- money_put_members_wchar_t.cc	2002/02/20 20:58:51
*************** struct My_money_io : public std::moneypu
*** 315,321 ****
  
    pattern do_neg_format() const
    {
!     static pattern pat = { { symbol, space, sign, value } };
      return pat;
    }
  };
--- 315,321 ----
  
    pattern do_neg_format() const
    {
!     pattern pat = { { symbol, space, sign, value } };
      return pat;
    }
  };
Index: testsuite/27_io/ios_manip_basefield.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/27_io/ios_manip_basefield.cc,v
retrieving revision 1.5
diff -c -p -r1.5 ios_manip_basefield.cc
*** ios_manip_basefield.cc	2002/01/23 01:12:10	1.5
--- ios_manip_basefield.cc	2002/02/20 20:58:51
***************
*** 1,6 ****
  // 981027 ncm work with libstdc++v3
  
! // Copyright (C) 1997, 1998, 1999 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
--- 1,6 ----
  // 981027 ncm work with libstdc++v3
  
! // Copyright (C) 1997, 1998, 1999, 2002 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
***************
*** 27,33 ****
  // invalidate any other reasons why the executable file might be covered by
  // the GNU General Public License.
  
- #include <iostream>
  #include <sstream>
  #include <locale>
  #include <iomanip>
--- 27,32 ----
*************** char   MyNP::do_thousands_sep() const { 
*** 45,75 ****
  int
  test01()
  {
!   std::cout.imbue(std::locale(std::locale(), new MyNP));
!   std::cout << std::oct << std::showbase;
!   std::cout << -0123456l << std::endl;
! 
!   std::cout << ":" << std::setw(11);
!   std::cout << -01234567l << ":" << std::endl;
! 
!   std::cout << ":" << std::setw(11) << std::left;
!   std::cout << -0123456l << ":" << std::endl;
! 
!   std::cout << ":" << std::setw(11) << std::right;
!   std::cout << -012345l << ":" << std::endl;
! 
!   std::cout << ":" << std::setw(11) << std::internal;
!   std::cout << -01234l << ":" << std::endl;
! 
!   std::cout << std::hex;
!   std::cout << std::setfill('0');
!   std::cout << std::internal;
!   std::cout << std::showbase;
!   std::cout << std::setw(16);
!   std::cout << 0x12345678l << std::endl;
! #ifdef DEBUG_ASSERT
!   assert (std::cout.good());
! #endif
    return 0;
  }
  
--- 44,79 ----
  int
  test01()
  {
!   bool test = true;
!   const char lit[] = "-0 123 456\n:-01 234 567:\n:-0 123 456 :"
!                      "\n:   -012 345:\n:-    01 234:\n0x000012 345 678";
!   std::ostringstream oss;
!   oss.imbue(std::locale(std::locale(), new MyNP));
!   oss << std::oct << std::showbase;
!   oss << -0123456l << std::endl;
! 
!   oss << ":" << std::setw(11);
!   oss << -01234567l << ":" << std::endl;
! 
!   oss << ":" << std::setw(11) << std::left;
!   oss << -0123456l << ":" << std::endl;
! 
!   oss << ":" << std::setw(11) << std::right;
!   oss << -012345l << ":" << std::endl;
! 
!   oss << ":" << std::setw(11) << std::internal;
!   oss << -01234l << ":" << std::endl;
! 
!   oss << std::hex;
!   oss << std::setfill('0');
!   oss << std::internal;
!   oss << std::showbase;
!   oss << std::setw(16);
!   oss << 0x12345678l << std::endl;
! 
!   VERIFY( oss.good() );
!   VERIFY( oss.str() == lit );
! 
    return 0;
  }
  
*************** test02()
*** 94,107 ****
    VERIFY( strbuf.str() == "cisco " ); 
    strbuf.str(str_blank);
  
! #ifdef DEBUG_ASSERT
!   assert (test);
! #endif
    return 0;
  }
  
  int 
! main() {
    test01();
    test02();
    return 0;
--- 98,110 ----
    VERIFY( strbuf.str() == "cisco " ); 
    strbuf.str(str_blank);
  
!   VERIFY( test );
    return 0;
  }
  
  int 
! main() 
! {
    test01();
    test02();
    return 0;
*************** main() {
*** 116,118 ****
--- 119,122 ----
  :-    01 234:
  0x000012 345 678
  */
+ 
Index: testsuite/27_io/ios_manip_fmtflags.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/27_io/ios_manip_fmtflags.cc,v
retrieving revision 1.5
diff -c -p -r1.5 ios_manip_fmtflags.cc
*** ios_manip_fmtflags.cc	2002/01/16 19:57:38	1.5
--- ios_manip_fmtflags.cc	2002/02/20 20:58:51
***************
*** 1,6 ****
  // 981027 ncm work with libstdc++v3
  
! // Copyright (C) 1997, 1998, 1999, 2000, 2001 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
--- 1,7 ----
  // 981027 ncm work with libstdc++v3
  
! // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002
! // 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
*************** test01()
*** 69,75 ****
    oss << ":" << std::setw(3) << std::left << true << ":" << std::endl;
    oss << ":" << std::setw(3) << std::right << false << ":" << std::endl;
  
!   std::locale loc = std::locale (std::locale(), new MyNP);
    oss.imbue(loc);
  
    oss << std::boolalpha;
--- 70,76 ----
    oss << ":" << std::setw(3) << std::left << true << ":" << std::endl;
    oss << ":" << std::setw(3) << std::right << false << ":" << std::endl;
  
!   std::locale loc = std::locale (std::locale::classic(), new MyNP);
    oss.imbue(loc);
  
    oss << std::boolalpha;
Index: testsuite/27_io/standard_manipulators.cc
===================================================================
RCS file: standard_manipulators.cc
diff -N standard_manipulators.cc
*** /dev/null	Tue May  5 13:32:27 1998
--- standard_manipulators.cc	Wed Feb 20 12:58:51 2002
***************
*** 0 ****
--- 1,84 ----
+ // Copyright (C) 2002 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.6.3 - Standard manipulators
+ 
+ #include <sstream>
+ #include <iomanip>
+ #include <testsuite_hooks.h>
+ 
+ void
+ test01()
+ {
+   using namespace std;
+   bool test = true;
+ 
+   string s("john coltrane, a love supreme");
+   istringstream  iss(s);
+   ostringstream  oss;
+ 
+   // resetiosflags
+   resetiosflags(ios_base::boolalpha);
+   iss >> resetiosflags(ios_base::boolalpha);
+   VERIFY(iss.good());
+   oss << resetiosflags(ios_base::boolalpha);
+   VERIFY(oss.good());
+ 
+   // setiosflags
+   setiosflags(ios_base::skipws);
+   iss >> setiosflags(ios_base::skipws);
+   VERIFY(iss.good());
+   oss << setiosflags(ios_base::skipws);
+   VERIFY(oss.good());
+ 
+   // setbase
+   setbase(8);
+   iss >> setbase(8);
+   VERIFY(iss.good());
+   oss << setbase(8);
+   VERIFY(oss.good());
+ 
+   // setfil
+   setfill('a');
+   iss >>  setfill('a');
+   VERIFY(iss.good());
+   oss << setfill('a');
+   VERIFY(oss.good());
+  
+   // setprecision
+   setprecision(4);
+   iss >> setprecision(4);
+   VERIFY(iss.good());
+   oss << setprecision(4);
+   VERIFY(oss.good());
+   
+   // setprecision
+   setw(7);
+   iss >> setw(7);
+   VERIFY(iss.good());
+   oss << setw(7);
+   VERIFY(oss.good());
+ }
+ 
+ 
+ int
+ main()
+ {
+   test01();
+   return 0;
+ }


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