changing text in notices & readme. adding terminate handler for tests

This commit is contained in:
Jordan Maples [MSFT]
2019-12-12 10:55:26 -08:00
parent ec05ecd6b1
commit 4f6f05d463
15 changed files with 450 additions and 215 deletions
+13 -4
View File
@@ -42,6 +42,10 @@ namespace gsl
struct fail_fast;
} // namespace gsl
namespace{
constexpr std::string_view deathstring("Expected Death");
}
using namespace gsl;
GSL_SUPPRESS(f.4) // NO-FORMAT: attribute
@@ -146,6 +150,11 @@ TEST(strict_notnull_tests, TestStrictNotNull)
TEST(strict_notnull_tests, TestStrictNotNullConstructorTypeDeduction)
{
std::set_terminate([] {
std::cerr << "Expected Death. TestStrictNotNullConstructorTypeDeduction";
std::abort();
});
{
int i = 42;
@@ -172,7 +181,7 @@ TEST(strict_notnull_tests, TestStrictNotNullConstructorTypeDeduction)
int* p1 = nullptr;
const strict_not_null x{p1};
};
EXPECT_DEATH(workaround_macro(), ".*");
EXPECT_DEATH(workaround_macro(), deathstring.data());
}
{
@@ -180,14 +189,14 @@ TEST(strict_notnull_tests, TestStrictNotNullConstructorTypeDeduction)
const int* p1 = nullptr;
const strict_not_null x{p1};
};
EXPECT_DEATH(workaround_macro(), ".*");
EXPECT_DEATH(workaround_macro(), deathstring.data());
}
{
int* p = nullptr;
EXPECT_DEATH(helper(strict_not_null{p}), ".*");
EXPECT_DEATH(helper_const(strict_not_null{p}), ".*");
EXPECT_DEATH(helper(strict_not_null{p}), deathstring.data());
EXPECT_DEATH(helper_const(strict_not_null{p}), deathstring.data());
}
#ifdef CONFIRM_COMPILATION_ERRORS