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> x( std::make_shared(10)); // shared_ptr is nullptr assignable + +#ifdef GSL_THROW_ON_CONTRACT_VIOLATION + int* pi = nullptr; + CHECK_THROWS_AS(not_null(pi), fail_fast); +#endif } template