From 78f8ce484f8373a196ab729e00a045972d91d7f3 Mon Sep 17 00:00:00 2001 From: Eric Fiselier Date: Wed, 15 Jun 2016 01:42:35 +0000 Subject: Improve portability of hash tests. Patch from STL@microsoft.com llvm-svn: 272744 --- .../test/std/diagnostics/syserr/syserr.hash/error_code.pass.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'libcxx/test/std/diagnostics/syserr') diff --git a/libcxx/test/std/diagnostics/syserr/syserr.hash/error_code.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.hash/error_code.pass.cpp index b812e364bbc..c8b3d98103c 100644 --- a/libcxx/test/std/diagnostics/syserr/syserr.hash/error_code.pass.cpp +++ b/libcxx/test/std/diagnostics/syserr/syserr.hash/error_code.pass.cpp @@ -16,12 +16,12 @@ // size_t operator()(T val) const; // }; -// Not very portable - #include #include #include +#include "test_macros.h" + void test(int i) { @@ -31,7 +31,9 @@ test(int i) static_assert((std::is_same::value), "" ); H h; T ec(i, std::system_category()); - assert(h(ec) == i); + const std::size_t result = h(ec); + LIBCPP_ASSERT(result == i); + ((void)result); // Prevent unused warning } int main() -- cgit v1.2.3