]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test: added missing IoCtx copy/assignment methods in librados_test_stub
authorJason Dillaman <dillaman@redhat.com>
Mon, 28 Nov 2016 18:36:01 +0000 (13:36 -0500)
committerJason Dillaman <dillaman@redhat.com>
Tue, 14 Feb 2017 22:41:23 +0000 (17:41 -0500)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/test/librados_test_stub/LibradosTestStub.cc

index 79a7cdfbe7ecba7eade51c89077280115b75a3f6..5b59ef17df2a7c5863138712b7b0f66c18c01a8c 100644 (file)
@@ -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();