From 63b66a1133e4dabb6d625cb9773ecf5a7ed97574 Mon Sep 17 00:00:00 2001 From: Mykola Golub Date: Fri, 8 Nov 2019 21:49:51 +0200 Subject: [PATCH] test/librbd: fix mock warnings in TestMockIoImageRequest (introduced in 081d28ae) Signed-off-by: Mykola Golub --- src/test/librbd/io/test_mock_ImageRequestWQ.cc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/test/librbd/io/test_mock_ImageRequestWQ.cc b/src/test/librbd/io/test_mock_ImageRequestWQ.cc index c5478b6be7f1..e7f0acdb3c4d 100644 --- a/src/test/librbd/io/test_mock_ImageRequestWQ.cc +++ b/src/test/librbd/io/test_mock_ImageRequestWQ.cc @@ -255,6 +255,16 @@ struct TestMockIoImageRequestWQ : public TestMockFixture { void expect_start_op(MockImageDispatchSpec &mock_image_request) { EXPECT_CALL(mock_image_request, start_op()).Times(1); } + + void expect_get_image_extents(MockImageDispatchSpec &mock_image_request, + const Extents &extents) { + EXPECT_CALL(mock_image_request, get_image_extents()) + .WillOnce(Return(extents)); + } + + void expect_get_tid(MockImageDispatchSpec &mock_image_request, uint64_t tid) { + EXPECT_CALL(mock_image_request, get_tid()).WillOnce(Return(tid)); + } }; TEST_F(TestMockIoImageRequestWQ, AcquireLockError) { @@ -270,6 +280,8 @@ TEST_F(TestMockIoImageRequestWQ, AcquireLockError) { auto mock_queued_image_request = new MockImageDispatchSpec(); expect_was_throttled(*mock_queued_image_request, false); expect_set_throttled(*mock_queued_image_request); + expect_get_image_extents(*mock_queued_image_request, {}); + expect_get_tid(*mock_queued_image_request, 0); InSequence seq; MockImageRequestWQ mock_image_request_wq(&mock_image_ctx, "io", 60, nullptr); @@ -317,6 +329,8 @@ TEST_F(TestMockIoImageRequestWQ, AcquireLockBlacklisted) { auto mock_queued_image_request = new MockImageDispatchSpec(); expect_was_throttled(*mock_queued_image_request, false); expect_set_throttled(*mock_queued_image_request); + expect_get_image_extents(*mock_queued_image_request, {}); + expect_get_tid(*mock_queued_image_request, 0); InSequence seq; MockImageRequestWQ mock_image_request_wq(&mock_image_ctx, "io", 60, nullptr); @@ -357,6 +371,8 @@ TEST_F(TestMockIoImageRequestWQ, RefreshError) { auto mock_queued_image_request = new MockImageDispatchSpec(); expect_was_throttled(*mock_queued_image_request, false); expect_set_throttled(*mock_queued_image_request); + expect_get_image_extents(*mock_queued_image_request, {}); + expect_get_tid(*mock_queued_image_request, 0); InSequence seq; MockImageRequestWQ mock_image_request_wq(&mock_image_ctx, "io", 60, nullptr); -- 2.47.3