From: Mykola Golub Date: Tue, 16 May 2017 12:34:22 +0000 (+0200) Subject: test/librbd: TestMockImageRemoveRequest gmock warnings X-Git-Tag: v12.1.0~10^2~108^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c065cbdb20aca9bff9f67d2d343b34eb867b38a3;p=ceph.git test/librbd: TestMockImageRemoveRequest gmock warnings Signed-off-by: Mykola Golub --- diff --git a/src/test/librbd/image/test_mock_RemoveRequest.cc b/src/test/librbd/image/test_mock_RemoveRequest.cc index 4b271a454c9..77c536d03a8 100644 --- a/src/test/librbd/image/test_mock_RemoveRequest.cc +++ b/src/test/librbd/image/test_mock_RemoveRequest.cc @@ -154,6 +154,9 @@ public: .WillOnce(Invoke([r](bool open_parent, Context *on_ready) { on_ready->complete(r); })); + if (r < 0) { + EXPECT_CALL(mock_image_ctx, destroy()); + } } void expect_state_close(MockImageCtx &mock_image_ctx) { @@ -161,6 +164,7 @@ public: .WillOnce(Invoke([](Context *on_ready) { on_ready->complete(0); })); + EXPECT_CALL(mock_image_ctx, destroy()); } void expect_wq_queue(ContextWQ &wq, int r) {