Skip to content

Commit

Permalink
test: added missing IoCtx copy/assignment methods in librados_test_stub
Browse files Browse the repository at this point in the history
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit c35d307)
  • Loading branch information
Jason Dillaman authored and smithfarm committed Jul 5, 2017
1 parent fa88fc7 commit 6d2f959
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/test/librados_test_stub/LibradosTestStub.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 6d2f959

Please sign in to comment.