mirror of
https://github.com/microsoft/GSL.git
synced 2025-04-02 09:18:33 -04:00
check test 2
This commit is contained in:
parent
d88c5c01a5
commit
904995fde3
@ -258,17 +258,17 @@ TEST(span_test, from_pointer_pointer_construction)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// this will fail the std::distance() precondition, which asserts on MSVC debug builds
|
// this will fail the std::distance() precondition, which asserts on MSVC debug builds
|
||||||
{
|
{ // this test succeeds on all platforms, but it relies on UB
|
||||||
auto workaround_macro = [&]() { span<int> s{&arr[1], &arr[0]}; };
|
auto workaround_macro = [&]() { span<int> s{&arr[1], &arr[0]}; };
|
||||||
EXPECT_DEATH(workaround_macro(), expected);
|
EXPECT_DEATH(workaround_macro(), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
// this will fail the std::distance() precondition, which asserts on MSVC debug builds
|
// this will fail the std::distance() precondition, which asserts on MSVC debug builds
|
||||||
//{
|
{
|
||||||
// int* p = nullptr;
|
int* p = nullptr;
|
||||||
// auto workaround_macro = [&]() { span<int> s{&arr[0], p}; };
|
auto workaround_macro = [&]() { span<int> s{&arr[0], p}; };
|
||||||
// EXPECT_DEATH(workaround_macro(), expected);
|
EXPECT_DEATH(workaround_macro(), expected);
|
||||||
//}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
int* p = nullptr;
|
int* p = nullptr;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user