mirror of
https://github.com/microsoft/GSL.git
synced 2025-11-16 15:29:32 +01:00
removed string_view for string in tests
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user