From 700a0def53cd8eb82e7d5b69286bad26f6c62817 Mon Sep 17 00:00:00 2001 From: Jason Dillaman Date: Fri, 4 Dec 2015 21:44:55 -0500 Subject: [PATCH] librados_test_stub: additional mocked IoCtx methods Signed-off-by: Jason Dillaman --- 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 198db6ccb6861..596436b33e727 100644 --- a/src/test/librados_test_stub/MockTestMemIoCtxImpl.h +++ b/src/test/librados_test_stub/MockTestMemIoCtxImpl.h @@ -72,6 +72,14 @@ public: return TestMemIoCtxImpl::selfmanaged_snap_remove(snap_id); } + MOCK_METHOD3(truncate, int(const std::string& oid, + uint64_t size, + const SnapContext &snapc)); + int do_truncate(const std::string& oid, uint64_t size, + const SnapContext &snapc) { + return TestMemIoCtxImpl::truncate(oid, size, snapc); + } + MOCK_METHOD3(write_full, int(const std::string& oid, bufferlist& bl, const SnapContext &snapc)); @@ -88,6 +96,7 @@ public: ON_CALL(*this, remove(_)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_remove)); ON_CALL(*this, selfmanaged_snap_create(_)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_selfmanaged_snap_create)); ON_CALL(*this, selfmanaged_snap_remove(_)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_selfmanaged_snap_remove)); + ON_CALL(*this, truncate(_,_,_)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_truncate)); ON_CALL(*this, write_full(_, _, _)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_write_full)); } -- 2.39.5