removed string_view for string in tests

This commit is contained in:
Jordan Maples [MSFT]
2019-12-12 11:15:41 -08:00
parent 4f6f05d463
commit 5099e8fa3e
10 changed files with 183 additions and 185 deletions

View File

@@ -72,7 +72,7 @@ auto strnlen(const CharT* s, std::size_t n)
namespace
{
constexpr std::string_view deathstring("Expected Death");
static const std::string deathstring("Expected Death");
template <typename T>
T move_wrapper(T&& t)
@@ -988,7 +988,7 @@ TEST(string_span_tests, zstring)
buf[0] = 'a';
auto workaround_macro = [&]() { const zstring_span<> zspan({buf, 1}); };
EXPECT_DEATH(workaround_macro(), deathstring.data());
EXPECT_DEATH(workaround_macro(), deathstring);
}
// usage scenario: create zero-terminated temp file name and pass to a legacy API
@@ -1010,7 +1010,7 @@ TEST(string_span_tests, wzstring)
std::cerr << "Expected Death. wzstring";
std::abort();
});
// create zspan from zero terminated string
{
wchar_t buf[1];
@@ -1029,7 +1029,7 @@ TEST(string_span_tests, wzstring)
buf[0] = L'a';
const auto workaround_macro = [&]() { const wzstring_span<> zspan({buf, 1}); };
EXPECT_DEATH(workaround_macro(), deathstring.data());
EXPECT_DEATH(workaround_macro(), deathstring);
}
// usage scenario: create zero-terminated temp file name and pass to a legacy API
@@ -1070,7 +1070,7 @@ TEST(string_span_tests, u16zstring)
buf[0] = u'a';
const auto workaround_macro = [&]() { const u16zstring_span<> zspan({buf, 1}); };
EXPECT_DEATH(workaround_macro(), deathstring.data());
EXPECT_DEATH(workaround_macro(), deathstring);
}
// usage scenario: create zero-terminated temp file name and pass to a legacy API
@@ -1111,7 +1111,7 @@ TEST(string_span_tests, u32zstring)
buf[0] = u'a';
const auto workaround_macro = [&]() { const u32zstring_span<> zspan({buf, 1}); };
EXPECT_DEATH(workaround_macro(), deathstring.data());
EXPECT_DEATH(workaround_macro(), deathstring);
}
// usage scenario: create zero-terminated temp file name and pass to a legacy API