}
void expect_ioctx_create(librados::IoCtx &io_ctx) {
+ librados::MockTestMemIoCtxImpl &io_ctx_impl = get_mock_io_ctx(io_ctx);
EXPECT_CALL(*get_mock_io_ctx(io_ctx).get_mock_rados_client(), create_ioctx(_, _))
- .WillOnce(Return(&get_mock_io_ctx(io_ctx)));
+ .WillOnce(DoAll(GetReference(&io_ctx_impl),
+ Return(&get_mock_io_ctx(io_ctx))));
}
void expect_get_parent_global_image_id(librados::IoCtx &io_ctx,
ASSERT_EQ(std::string("remote image id"), remote_image_id);
ASSERT_TRUE(remote_journaler != nullptr);
ASSERT_EQ(cls::journal::CLIENT_STATE_DISCONNECTED, client_state);
+ delete remote_journaler;
}
TEST_F(TestMockImageReplayerPrepareRemoteImageRequest, SuccessNotRegistered) {
ASSERT_EQ(std::string("remote image id"), remote_image_id);
ASSERT_TRUE(remote_journaler != nullptr);
ASSERT_EQ(cls::journal::CLIENT_STATE_CONNECTED, client_state);
+ delete remote_journaler;
}
TEST_F(TestMockImageReplayerPrepareRemoteImageRequest, MirrorUuidError) {
context_wq->queue(arg0, r);
}
+ACTION_P(GetReference, ref_object) {
+ ref_object->get();
+}
+
MATCHER_P(ContentsEqual, bl, "") {
// TODO fix const-correctness of bufferlist
return const_cast<bufferlist &>(arg).contents_equal(