OSDN Git Service

2009-02-09 Jack Howarth <howarth@bromo.med.uc.edu>
[pf3gnuchains/gcc-fork.git] / libstdc++-v3 / testsuite / 27_io / ios_base / storage / 2.cc
index 7df7eb9..be4cf8d 100644 (file)
@@ -1,6 +1,7 @@
 // 2000-12-19 bkoz
 
-// Copyright (C) 2000, 2002, 2003 Free Software Foundation
+// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// Free Software Foundation
 //
 // 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
@@ -15,7 +16,7 @@
 
 // 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,
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
 // USA.
 
 // 27.4.2.5 ios_base storage functions
 // See http://gcc.gnu.org/ml/gcc/2002-05/msg01012.html
 // { dg-options "-lmalloc" { target mips*-*-irix6* } }
 
+// This fails on some versions of Darwin 8 because malloc doesn't return
+// NULL even if an allocation fails (filed as Radar 3884894).
+// { dg-do run { xfail *-*-darwin8.[0-4].* } }
+
+// Skip test at -m64 on Darwin because RLIMITS are not being honored.
+// Radar 6467883: 10.4/10.5 setrlimits are not honored by memory allocators
+// Radar 6467884: 10.X systems are not robust when paging space is exceeded
+// { dg-skip-if "" { *-*-darwin* && lp64 } { "*" } { "" } } 
+
 #include <sstream>
 #include <iostream>
+#include <limits>
 #include <testsuite_hooks.h>
 
 // libstdc++/3129
 void test02()
 {
-  bool test = true;
+  bool test __attribute__((unused)) = true;
   int max = std::numeric_limits<int>::max() - 1;
   std::stringbuf        strbuf;
   std::ios              ios(&strbuf);
@@ -58,7 +69,8 @@ void test02()
     }
   catch(...)
     {
-      VERIFY( test = false );
+      test = false;
+      VERIFY( test );
     }
   VERIFY( v == 0 );
 
@@ -77,7 +89,8 @@ void test02()
     }
   catch(...)
     {
-      VERIFY( test = false );
+      test = false;
+      VERIFY( test );
     }
   VERIFY( v == &test );
 
@@ -96,7 +109,8 @@ void test02()
     }
   catch(...)
     {
-      VERIFY( test = false );
+      test = false;
+      VERIFY( test );
     }
   VERIFY( l == 0 );
 
@@ -115,7 +129,8 @@ void test02()
     }
   catch(...)
     {
-      VERIFY( test = false );
+      test = false;
+      VERIFY( test );
     }
   VERIFY( l == 1 );