mirror of
https://github.com/microsoft/GSL.git
synced 2025-05-13 09:25:19 -04:00
Fixed compilation issues for GCC on Linux.
This commit is contained in:
@ -40,14 +40,14 @@ SUITE(string_span_tests)
|
||||
{
|
||||
std::string s = "Hello there world";
|
||||
cstring_span<> v = s;
|
||||
CHECK(v.length() == static_cast<cstring_span<>::size_type>(s.length()));
|
||||
CHECK(v.length() == static_cast<cstring_span<>::index_type>(s.length()));
|
||||
}
|
||||
|
||||
TEST(TestConstructFromStdVector)
|
||||
{
|
||||
std::vector<char> vec(5, 'h');
|
||||
string_span<> v {vec};
|
||||
CHECK(v.length() == static_cast<string_span<>::size_type>(vec.size()));
|
||||
CHECK(v.length() == static_cast<string_span<>::index_type>(vec.size()));
|
||||
}
|
||||
|
||||
TEST(TestStackArrayConstruction)
|
||||
@ -109,7 +109,7 @@ SUITE(string_span_tests)
|
||||
char stack_string[] = "Hello";
|
||||
cstring_span<> v = ensure_z(stack_string);
|
||||
auto s2 = gsl::to_string(v);
|
||||
CHECK(static_cast<cstring_span<>::size_type>(s2.length()) == v.length());
|
||||
CHECK(static_cast<cstring_span<>::index_type>(s2.length()) == v.length());
|
||||
CHECK(s2.length() == 5);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user