From: Jason Dillaman Date: Thu, 14 Dec 2017 19:09:10 +0000 (-0500) Subject: test/librados_test_stub: add mock version of `create` X-Git-Tag: wip-pdonnell-testing-20180317.202121~757^2~15 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=ed147192fdc1cc589cdfb107f5d1264568492e88;p=ceph-ci.git test/librados_test_stub: add mock version of `create` Signed-off-by: Jason Dillaman --- diff --git a/src/test/librados_test_stub/MockTestMemIoCtxImpl.h b/src/test/librados_test_stub/MockTestMemIoCtxImpl.h index d6fb2647433..39c0e1ecb9d 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));