diff options
author | Marshall Clow <mclow.lists@gmail.com> | 2015-02-12 15:21:20 +0000 |
---|---|---|
committer | Marshall Clow <mclow.lists@gmail.com> | 2015-02-12 15:21:20 +0000 |
commit | 351dde4e033820546a530450bef6bd7a59e27b27 (patch) | |
tree | c9b30d2e8930c8cd30551b2fbec76fffad212d61 /libcxx/test/std/experimental/string.view/string.view.ops/to_string.pass.cpp | |
parent | be0fda3c33428efdcad1556a4db7a57fafb3b9f4 (diff) | |
download | bcm5719-llvm-351dde4e033820546a530450bef6bd7a59e27b27.tar.gz bcm5719-llvm-351dde4e033820546a530450bef6bd7a59e27b27.zip |
Remove undefined behavior from test; specifically, compare(NULL, XXX, 0). Thanks to Eric for the catch
llvm-svn: 228927
Diffstat (limited to 'libcxx/test/std/experimental/string.view/string.view.ops/to_string.pass.cpp')
-rw-r--r-- | libcxx/test/std/experimental/string.view/string.view.ops/to_string.pass.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/libcxx/test/std/experimental/string.view/string.view.ops/to_string.pass.cpp b/libcxx/test/std/experimental/string.view/string.view.ops/to_string.pass.cpp index 6387ac22280..a180ab257bf 100644 --- a/libcxx/test/std/experimental/string.view/string.view.ops/to_string.pass.cpp +++ b/libcxx/test/std/experimental/string.view/string.view.ops/to_string.pass.cpp @@ -41,13 +41,12 @@ void test ( const CharT *s ) { const std::experimental::basic_string_view<CharT> sv1; String str1 = (String) sv1; + assert ( sv1.size() == 0); assert ( sv1.size() == str1.size ()); - assert ( std::char_traits<CharT>::compare ( sv1.data(), str1.data(), sv1.size()) == 0 ); #if __cplusplus >= 201103L auto str2 = sv1.to_string(min_allocator<CharT>()); assert ( sv1.size() == str2.size ()); - assert ( std::char_traits<CharT>::compare ( sv1.data(), str2.data(), sv1.size()) == 0 ); #endif } } |