summaryrefslogtreecommitdiffstats
path: root/base/bind_unittest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'base/bind_unittest.cc')
-rw-r--r--base/bind_unittest.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/base/bind_unittest.cc b/base/bind_unittest.cc
index 0f91b2e..1d808a6 100644
--- a/base/bind_unittest.cc
+++ b/base/bind_unittest.cc
@@ -798,5 +798,17 @@ TEST_F(BindTest, WindowsCallingConventions) {
}
#endif
+#if (!defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)) && GTEST_HAS_DEATH_TEST
+
+// Test null callbacks cause a DCHECK.
+TEST(BindDeathTest, NullCallback) {
+ base::Callback<void(int)> null_cb;
+ ASSERT_TRUE(null_cb.is_null());
+ EXPECT_DEATH(base::Bind(null_cb, 42), "");
+}
+
+#endif // (!defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)) &&
+ // GTEST_HAS_DEATH_TEST
+
} // namespace
} // namespace base