From: Jason Dillaman Date: Mon, 28 Nov 2016 18:36:01 +0000 (-0500) Subject: test: added missing IoCtx copy/assignment methods in librados_test_stub X-Git-Tag: v12.0.1~375^2~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c35d307c62961072b4c00f94e37486e3371c1a21;p=ceph.git test: added missing IoCtx copy/assignment methods in librados_test_stub Signed-off-by: Jason Dillaman --- diff --git a/src/test/librados_test_stub/LibradosTestStub.cc b/src/test/librados_test_stub/LibradosTestStub.cc index 79a7cdfbe7e..5b59ef17df2 100644 --- a/src/test/librados_test_stub/LibradosTestStub.cc +++ b/src/test/librados_test_stub/LibradosTestStub.cc @@ -356,6 +356,28 @@ IoCtx::~IoCtx() { close(); } +IoCtx::IoCtx(const IoCtx& rhs) { + io_ctx_impl = rhs.io_ctx_impl; + if (io_ctx_impl) { + TestIoCtxImpl *ctx = reinterpret_cast(io_ctx_impl); + ctx->get(); + } +} + +IoCtx& IoCtx::operator=(const IoCtx& rhs) { + if (io_ctx_impl) { + TestIoCtxImpl *ctx = reinterpret_cast(io_ctx_impl); + ctx->put(); + } + + io_ctx_impl = rhs.io_ctx_impl; + if (io_ctx_impl) { + TestIoCtxImpl *ctx = reinterpret_cast(io_ctx_impl); + ctx->get(); + } + return *this; +} + int IoCtx::aio_flush() { TestIoCtxImpl *ctx = reinterpret_cast(io_ctx_impl); ctx->aio_flush();