Patchwork [v3] testsuite tweak

login
register
mail settings
Submitter Jonathan Wakely
Date Oct. 3, 2011, 7:12 p.m.
Message ID <CAH6eHdQ239O4+jUko6OUeJdV8PvHAzLxDi5ERNHqtOiF8DV+dw@mail.gmail.com>
Download mbox | patch
Permalink /patch/117493/
State New
Headers show

Comments

Jonathan Wakely - Oct. 3, 2011, 7:12 p.m.
2011-10-03  Jonathan Wakely  <jwakely.gcc@gmail.com>

        * testsuite/20_util/pointer_traits/pointer_to.cc: Define equality
        operator and use.

Tested x86_64-linux, committed to trunk.

Patch

Index: testsuite/20_util/pointer_traits/pointer_to.cc
===================================================================
--- testsuite/20_util/pointer_traits/pointer_to.cc	(revision 179472)
+++ testsuite/20_util/pointer_traits/pointer_to.cc	(working copy)
@@ -29,12 +29,14 @@  struct Ptr
   static Ptr pointer_to(bool& b) { return Ptr{&b}; }
 };
 
+bool operator==(const Ptr& l, const Ptr& r) { return l.value == r.value; }
+
 void test01()
 {
   bool test = true;
-  Ptr p __attribute__((unused)) {&test};
+  Ptr p{ &test };
 
-  VERIFY( std::pointer_traits<Ptr>::pointer_to(test).value == &test );
+  VERIFY( std::pointer_traits<Ptr>::pointer_to(test) == p );
 }
 
 void test02()