mirror of
https://github.com/microsoft/GSL.git
synced 2024-11-03 17:56:43 -05:00
64-bit clean fixes.
This commit is contained in:
parent
cd80ef6146
commit
ca4cdd80de
@ -131,23 +131,23 @@ SUITE(span_tests)
|
|||||||
TEST(from_nullptr_length_constructor)
|
TEST(from_nullptr_length_constructor)
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
span<int> s{nullptr, 0};
|
span<int> s{nullptr, static_cast<span<int>::index_type>(0)};
|
||||||
CHECK(s.length() == 0 && s.data() == nullptr);
|
CHECK(s.length() == 0 && s.data() == nullptr);
|
||||||
|
|
||||||
span<const int> cs{nullptr, 0};
|
span<const int> cs{nullptr, static_cast<span<int>::index_type>(0)};
|
||||||
CHECK(cs.length() == 0 && cs.data() == nullptr);
|
CHECK(cs.length() == 0 && cs.data() == nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
span<int, 0> s{nullptr, 0};
|
span<int, 0> s{nullptr, static_cast<span<int>::index_type>(0)};
|
||||||
CHECK(s.length() == 0 && s.data() == nullptr);
|
CHECK(s.length() == 0 && s.data() == nullptr);
|
||||||
|
|
||||||
span<const int, 0> cs{nullptr, 0};
|
span<const int, 0> cs{nullptr, static_cast<span<int>::index_type>(0)};
|
||||||
CHECK(cs.length() == 0 && cs.data() == nullptr);
|
CHECK(cs.length() == 0 && cs.data() == nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
auto workaround_macro = []() { span<int, 1> s{ nullptr, 0 }; };
|
auto workaround_macro = []() { span<int, 1> s{ nullptr, static_cast<span<int>::index_type>(0) }; };
|
||||||
CHECK_THROW(workaround_macro(), fail_fast);
|
CHECK_THROW(workaround_macro(), fail_fast);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -168,10 +168,10 @@ SUITE(span_tests)
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
span<int*> s{nullptr, 0};
|
span<int*> s{nullptr, static_cast<span<int>::index_type>(0)};
|
||||||
CHECK(s.length() == 0 && s.data() == nullptr);
|
CHECK(s.length() == 0 && s.data() == nullptr);
|
||||||
|
|
||||||
span<const int*> cs{nullptr, 0};
|
span<const int*> cs{nullptr, static_cast<span<int>::index_type>(0)};
|
||||||
CHECK(cs.length() == 0 && cs.data() == nullptr);
|
CHECK(cs.length() == 0 && cs.data() == nullptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -194,7 +194,7 @@ SUITE(span_tests)
|
|||||||
|
|
||||||
{
|
{
|
||||||
int* p = nullptr;
|
int* p = nullptr;
|
||||||
span<int> s{p, 0};
|
span<int> s{p, static_cast<span<int>::index_type>(0)};
|
||||||
CHECK(s.length() == 0 && s.data() == nullptr);
|
CHECK(s.length() == 0 && s.data() == nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user