This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
[v3] testsuite tweak
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: "libstdc++" <libstdc++ at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 3 Oct 2011 20:12:03 +0100
- Subject: [v3] testsuite tweak
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.
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()