]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test: added missing IoCtx copy/assignment methods in librados_test_stub 16096/head
authorJason Dillaman <dillaman@redhat.com>
Mon, 28 Nov 2016 18:36:01 +0000 (13:36 -0500)
committerNathan Cutler <ncutler@suse.com>
Wed, 5 Jul 2017 20:47:34 +0000 (22:47 +0200)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit c35d307c62961072b4c00f94e37486e3371c1a21)

src/test/librados_test_stub/LibradosTestStub.cc

index 005c576bc8bd0121a14cb0a77bc997a071918dd8..3a7b01547376fe8719b02a9e5103dc8d6ef41c15 100644 (file)
@@ -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<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();