diff options
author | Jason Dillaman <dillaman@redhat.com> | 2016-11-28 19:36:01 +0100 |
---|---|---|
committer | Jason Dillaman <dillaman@redhat.com> | 2017-02-14 23:41:23 +0100 |
commit | c35d307c62961072b4c00f94e37486e3371c1a21 (patch) | |
tree | cf0128c2af5e33a772b40d28e42c3ec70c5c9e64 /src/test/librados_test_stub | |
parent | Merge pull request #13419 from dmick/wip-17826 (diff) | |
download | ceph-c35d307c62961072b4c00f94e37486e3371c1a21.tar.xz ceph-c35d307c62961072b4c00f94e37486e3371c1a21.zip |
test: added missing IoCtx copy/assignment methods in librados_test_stub
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Diffstat (limited to 'src/test/librados_test_stub')
-rw-r--r-- | src/test/librados_test_stub/LibradosTestStub.cc | 22 |
1 files changed, 22 insertions, 0 deletions
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<TestIoCtxImpl*>(io_ctx_impl); + ctx->get(); + } +} + +IoCtx& IoCtx::operator=(const IoCtx& rhs) { + if (io_ctx_impl) { + TestIoCtxImpl *ctx = reinterpret_cast<TestIoCtxImpl*>(io_ctx_impl); + ctx->put(); + } + + io_ctx_impl = rhs.io_ctx_impl; + if (io_ctx_impl) { + TestIoCtxImpl *ctx = reinterpret_cast<TestIoCtxImpl*>(io_ctx_impl); + ctx->get(); + } + return *this; +} + int IoCtx::aio_flush() { TestIoCtxImpl *ctx = reinterpret_cast<TestIoCtxImpl*>(io_ctx_impl); ctx->aio_flush(); |