Patchwork [v3] adjust weak_ptr testcase

login
register
mail settings
Submitter Jonathan Wakely
Date Dec. 23, 2011, 5:33 p.m.
Message ID <CAH6eHdRf-9FRFou4qV7z5cX55CgLzFiquKE=xLBbYZJ3ZTJ7OQ@mail.gmail.com>
Download mbox | patch
Permalink /patch/133102/
State New
Headers show

Comments

Jonathan Wakely - Dec. 23, 2011, 5:33 p.m.
This modifies the test to PASS when the expected type of exception is
caught, instead of being XFAIL due to uncaught exception.

Tested x86_64-linux, committed to trunk.

        * testsuite/tr1/2_general_utilities/shared_ptr/cons/
        weak_ptr_expired.cc: Modify to PASS instead of XFAIL.

Patch

Index: testsuite/tr1/2_general_utilities/shared_ptr/cons/weak_ptr_expired.cc
===================================================================
--- testsuite/tr1/2_general_utilities/shared_ptr/cons/weak_ptr_expired.cc	(revision 182660)
+++ testsuite/tr1/2_general_utilities/shared_ptr/cons/weak_ptr_expired.cc	(revision 182661)
@@ -1,5 +1,5 @@ 
-// { dg-do run { xfail *-*-* } }
-// Copyright (C) 2005, 2009 Free Software Foundation
+// { dg-do run }
+// Copyright (C) 2005, 2009, 2010, 2011 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
@@ -29,7 +29,7 @@  struct A { };
 int
 test01()
 {
-  bool test __attribute__((unused)) = true;
+  bool test = false;
 
   std::tr1::shared_ptr<A> a1(new A);
   std::tr1::weak_ptr<A> wa(a1);
@@ -42,12 +42,9 @@  test01()
   catch (const std::tr1::bad_weak_ptr&)
   {
     // Expected.
-      __throw_exception_again;
-  }
-  catch (...)
-  {
-    // Failed.
+    test = true;
   }
+  VERIFY( test );
 
   return 0;
 }