summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/diagnostics
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2016-06-15 01:42:35 +0000
committerEric Fiselier <eric@efcs.ca>2016-06-15 01:42:35 +0000
commit78f8ce484f8373a196ab729e00a045972d91d7f3 (patch)
tree027ceca79d365db6420939b321eb06119aedd3e3 /libcxx/test/std/diagnostics
parentc4989d27b581a67c3a92be8e7b5005beae90e5c6 (diff)
downloadbcm5719-llvm-78f8ce484f8373a196ab729e00a045972d91d7f3.tar.gz
bcm5719-llvm-78f8ce484f8373a196ab729e00a045972d91d7f3.zip
Improve portability of hash tests. Patch from STL@microsoft.com
llvm-svn: 272744
Diffstat (limited to 'libcxx/test/std/diagnostics')
-rw-r--r--libcxx/test/std/diagnostics/syserr/syserr.hash/error_code.pass.cpp8
1 files changed, 5 insertions, 3 deletions
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 <system_error>
#include <cassert>
#include <type_traits>
+#include "test_macros.h"
+
void
test(int i)
{
@@ -31,7 +31,9 @@ test(int i)
static_assert((std::is_same<H::result_type, std::size_t>::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()
OpenPOWER on IntegriCloud