summaryrefslogtreecommitdiffstats
path: root/libcxx/test
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/test')
-rw-r--r--libcxx/test/std/diagnostics/syserr/syserr.hash/error_code.pass.cpp8
-rw-r--r--libcxx/test/std/utilities/template.bitset/bitset.hash/bitset.pass.cpp8
2 files changed, 10 insertions, 6 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()
diff --git a/libcxx/test/std/utilities/template.bitset/bitset.hash/bitset.pass.cpp b/libcxx/test/std/utilities/template.bitset/bitset.hash/bitset.pass.cpp
index 520f2e8757c..bc65078911b 100644
--- a/libcxx/test/std/utilities/template.bitset/bitset.hash/bitset.pass.cpp
+++ b/libcxx/test/std/utilities/template.bitset/bitset.hash/bitset.pass.cpp
@@ -16,12 +16,12 @@
// size_t operator()(T val) const;
// };
-// Not very portable
-
#include <bitset>
#include <cassert>
#include <type_traits>
+#include "test_macros.h"
+
template <std::size_t N>
void
test()
@@ -32,7 +32,9 @@ test()
static_assert((std::is_same<typename H::result_type, std::size_t>::value), "" );
H h;
T bs(static_cast<unsigned long long>(N));
- assert(h(bs) == N);
+ const std::size_t result = h(bs);
+ LIBCPP_ASSERT(result == N);
+ ((void)result); // Prevent unused warning
}
int main()
OpenPOWER on IntegriCloud