Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/microsoft/GSL.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormenete <menete@users.noreply.github.com>2018-02-12 20:31:09 +0300
committerNeil MacIntosh <neilmac@fb.com>2018-02-12 20:31:09 +0300
commitac91ac140824e75ca726a3af8e9129f70de35a6b (patch)
tree92a34f72a7ef89346ac7a77dd16dcda2d6998ae6 /tests/notnull_tests.cpp
parent3a12c55cb63c0a7e46d4bf3f73dcab72eb192adb (diff)
add throw on nullptr CTOR test (#577)
Diffstat (limited to 'tests/notnull_tests.cpp')
-rw-r--r--tests/notnull_tests.cpp5
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>