From d833d3c813edf1b81b359822d14dd3a1b7e06ced Mon Sep 17 00:00:00 2001 From: Jason Dillaman Date: Thu, 14 Dec 2017 14:09:10 -0500 Subject: [PATCH] test/librados_test_stub: add mock version of `create` Signed-off-by: Jason Dillaman (cherry picked from commit ed147192fdc1cc589cdfb107f5d1264568492e88) --- src/test/librados_test_stub/MockTestMemIoCtxImpl.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/test/librados_test_stub/MockTestMemIoCtxImpl.h b/src/test/librados_test_stub/MockTestMemIoCtxImpl.h index d6fb264743399..39c0e1ecb9dad 100644 --- a/src/test/librados_test_stub/MockTestMemIoCtxImpl.h +++ b/src/test/librados_test_stub/MockTestMemIoCtxImpl.h @@ -60,6 +60,11 @@ public: return TestMemIoCtxImpl::assert_exists(oid); } + MOCK_METHOD2(create, int(const std::string&, bool)); + int do_create(const std::string& oid, bool exclusive) { + return TestMemIoCtxImpl::create(oid, exclusive); + } + MOCK_METHOD3(cmpext, int(const std::string&, uint64_t, bufferlist&)); int do_cmpext(const std::string& oid, uint64_t off, bufferlist& cmp_bl) { return TestMemIoCtxImpl::cmpext(oid, off, cmp_bl); @@ -193,6 +198,7 @@ public: 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, assert_exists(_)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_assert_exists)); + ON_CALL(*this, create(_,_)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_create)); ON_CALL(*this, cmpext(_,_,_)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_cmpext)); ON_CALL(*this, exec(_, _, _, _, _, _, _)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_exec)); ON_CALL(*this, get_instance_id()).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_get_instance_id)); -- 2.39.5