From 6d2f95973561c9f0911fce04dff2036f73a77442 Mon Sep 17 00:00:00 2001 From: Jason Dillaman Date: Mon, 28 Nov 2016 13:36:01 -0500 Subject: [PATCH] test: added missing IoCtx copy/assignment methods in librados_test_stub Signed-off-by: Jason Dillaman (cherry picked from commit c35d307c62961072b4c00f94e37486e3371c1a21) --- .../librados_test_stub/LibradosTestStub.cc | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/test/librados_test_stub/LibradosTestStub.cc b/src/test/librados_test_stub/LibradosTestStub.cc index 005c576bc8bd0..3a7b01547376f 100644 --- a/src/test/librados_test_stub/LibradosTestStub.cc +++ b/src/test/librados_test_stub/LibradosTestStub.cc @@ -355,6 +355,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(); -- 2.39.5