diff options
-rw-r--r-- | tests/notnull_tests.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/notnull_tests.cpp b/tests/notnull_tests.cpp index 50b15f6..4baf7b3 100644 --- a/tests/notnull_tests.cpp +++ b/tests/notnull_tests.cpp @@ -134,6 +134,11 @@ TEST_CASE("TestNotNullConstructors") not_null<std::shared_ptr<int>> x( std::make_shared<int>(10)); // shared_ptr<int> is nullptr assignable + +#ifdef GSL_THROW_ON_CONTRACT_VIOLATION + int* pi = nullptr; + CHECK_THROWS_AS(not_null<decltype(pi)>(pi), fail_fast); +#endif } template<typename T> |