From f4b96375ebebb4786e38c81199938c0295b5ee36 Mon Sep 17 00:00:00 2001 From: Mykola Golub Date: Thu, 20 Apr 2017 11:51:55 +0200 Subject: [PATCH] test/librados_test_stub: mock wrapper for aio_notify Signed-off-by: Mykola Golub --- src/test/librados_test_stub/MockTestMemIoCtxImpl.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/test/librados_test_stub/MockTestMemIoCtxImpl.h b/src/test/librados_test_stub/MockTestMemIoCtxImpl.h index 3d06d4fd806..e1d703dceff 100644 --- a/src/test/librados_test_stub/MockTestMemIoCtxImpl.h +++ b/src/test/librados_test_stub/MockTestMemIoCtxImpl.h @@ -35,6 +35,14 @@ public: return io_ctx_impl; } + MOCK_METHOD5(aio_notify, void(const std::string& o, AioCompletionImpl *c, + bufferlist& bl, uint64_t timeout_ms, + bufferlist *pbl)); + void do_aio_notify(const std::string& o, AioCompletionImpl *c, bufferlist& bl, + uint64_t timeout_ms, bufferlist *pbl) { + return TestMemIoCtxImpl::aio_notify(o, c, bl, timeout_ms, pbl); + } + MOCK_METHOD4(aio_watch, int(const std::string& o, AioCompletionImpl *c, uint64_t *handle, librados::WatchCtx2 *ctx)); int do_aio_watch(const std::string& o, AioCompletionImpl *c, @@ -155,6 +163,7 @@ public: void default_to_parent() { using namespace ::testing; + ON_CALL(*this, aio_notify(_, _, _, _, _)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_aio_notify)); ON_CALL(*this, aio_watch(_, _, _, _)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_aio_watch)); ON_CALL(*this, aio_unwatch(_, _)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_aio_unwatch)); ON_CALL(*this, exec(_, _, _, _, _, _, _)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_exec)); -- 2.39.5