summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/strings
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/test/std/strings')
-rw-r--r--libcxx/test/std/strings/basic.string.hash/strings.pass.cpp4
-rw-r--r--libcxx/test/std/strings/string.view/string.view.hash/string_view.pass.cpp3
2 files changed, 7 insertions, 0 deletions
diff --git a/libcxx/test/std/strings/basic.string.hash/strings.pass.cpp b/libcxx/test/std/strings/basic.string.hash/strings.pass.cpp
index 5fc32c06a70..d74e485752f 100644
--- a/libcxx/test/std/strings/basic.string.hash/strings.pass.cpp
+++ b/libcxx/test/std/strings/basic.string.hash/strings.pass.cpp
@@ -22,6 +22,8 @@
#include <cassert>
#include <type_traits>
+#include "test_macros.h"
+
template <class T>
void
test()
@@ -29,6 +31,8 @@ test()
typedef std::hash<T> H;
static_assert((std::is_same<typename H::argument_type, T>::value), "" );
static_assert((std::is_same<typename H::result_type, std::size_t>::value), "" );
+ ASSERT_NOEXCEPT(H()(T()));
+
H h;
std::string g1 = "1234567890";
std::string g2 = "1234567891";
diff --git a/libcxx/test/std/strings/string.view/string.view.hash/string_view.pass.cpp b/libcxx/test/std/strings/string.view/string.view.hash/string_view.pass.cpp
index d0766482551..53c3d261d88 100644
--- a/libcxx/test/std/strings/string.view/string.view.hash/string_view.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.hash/string_view.pass.cpp
@@ -23,6 +23,8 @@
#include <cassert>
#include <type_traits>
+#include "test_macros.h"
+
using std::string_view;
template <class SV>
@@ -36,6 +38,7 @@ test()
typedef typename SV::value_type char_type;
typedef std::basic_string<char_type> String;
typedef std::hash<String> SH;
+ ASSERT_NOEXCEPT(H()(SV()));
char_type g1 [ 10 ];
char_type g2 [ 10 ];
OpenPOWER on IntegriCloud