From bdb73f1f8ba9dcc8fe2d2fdf2279f39c9e365007 Mon Sep 17 00:00:00 2001 From: Marshall Clow Date: Thu, 12 Feb 2015 15:21:20 +0000 Subject: [PATCH] Remove undefined behavior from test; specifically, compare(NULL, XXX, 0). Thanks to Eric for the catch git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@228927 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../string.view/string.view.ops/to_string.pass.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/std/experimental/string.view/string.view.ops/to_string.pass.cpp b/test/std/experimental/string.view/string.view.ops/to_string.pass.cpp index 6387ac22..a180ab25 100644 --- a/test/std/experimental/string.view/string.view.ops/to_string.pass.cpp +++ b/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 sv1; String str1 = (String) sv1; + assert ( sv1.size() == 0); assert ( sv1.size() == str1.size ()); - assert ( std::char_traits::compare ( sv1.data(), str1.data(), sv1.size()) == 0 ); #if __cplusplus >= 201103L auto str2 = sv1.to_string(min_allocator()); assert ( sv1.size() == str2.size ()); - assert ( std::char_traits::compare ( sv1.data(), str2.data(), sv1.size()) == 0 ); #endif } }