diff options
Diffstat (limited to 'base/bind_unittest.cc')
-rw-r--r-- | base/bind_unittest.cc | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/base/bind_unittest.cc b/base/bind_unittest.cc index 8718d1d..dde2226 100644 --- a/base/bind_unittest.cc +++ b/base/bind_unittest.cc @@ -4,12 +4,6 @@ #include "base/bind.h" -#if defined(BASE_CALLBACK_H_) -// We explicitly do not want to include callback.h so people are not tempted -// to use bind.h in a headerfile for getting the Callback types. -#error "base/bind.h should avoid pulling in callback.h by default." -#endif - #include "base/callback.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" @@ -317,6 +311,15 @@ TEST_F(BindTest, ReturnValues) { EXPECT_EQ(51337, const_method_const_obj_cb.Run()); } +// IgnoreReturn adapter test. +// - Function with return value, and no params can be converted to Closure. +TEST_F(BindTest, IgnoreReturn) { + EXPECT_CALL(static_func_mock_, IntMethod0()).WillOnce(Return(1337)); + Callback<int(void)> normal_cb = Bind(&IntFunc0); + Closure c = IgnoreReturn(normal_cb); + c.Run(); +} + // Argument binding tests. // - Argument binding to primitive. // - Argument binding to primitive pointer. |