Skip to content

Commit

Permalink
tests: correct googlemock warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Jason Dillaman <[email protected]>
  • Loading branch information
Jason Dillaman committed Jan 15, 2016
1 parent a2ad7ec commit d093d83
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/test/librbd/test_mock_ExclusiveLock.cc
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ class TestMockExclusiveLock : public TestMockFixture {
.WillOnce(FinishRequest(&acquire_request, r, &mock_image_ctx));
if (r == 0) {
expect_notify_acquired_lock(mock_image_ctx);
expect_unblock_writes(mock_image_ctx);
}
}

Expand All @@ -98,6 +99,9 @@ class TestMockExclusiveLock : public TestMockFixture {
EXPECT_CALL(release_request, send())
.WillOnce(FinishRequest(&release_request, r, &mock_image_ctx));
if (r == 0) {
if (shutting_down) {
expect_unblock_writes(mock_image_ctx);
}
expect_notify_released_lock(mock_image_ctx);
expect_writes_empty(mock_image_ctx);
}
Expand Down Expand Up @@ -209,7 +213,6 @@ TEST_F(TestMockExclusiveLock, StateTransitions) {
ASSERT_TRUE(is_lock_owner(mock_image_ctx, exclusive_lock));

MockReleaseRequest shutdown_release;
expect_op_work_queue(mock_image_ctx);
expect_release_lock(mock_image_ctx, shutdown_release, 0, true);
ASSERT_EQ(0, when_shut_down(mock_image_ctx, exclusive_lock));
ASSERT_FALSE(is_lock_owner(mock_image_ctx, exclusive_lock));
Expand All @@ -235,7 +238,6 @@ TEST_F(TestMockExclusiveLock, TryLockLockedState) {
ASSERT_EQ(0, when_try_lock(mock_image_ctx, exclusive_lock));

MockReleaseRequest shutdown_release;
expect_op_work_queue(mock_image_ctx);
expect_release_lock(mock_image_ctx, shutdown_release, 0, true);
ASSERT_EQ(0, when_shut_down(mock_image_ctx, exclusive_lock));
}
Expand Down Expand Up @@ -283,7 +285,6 @@ TEST_F(TestMockExclusiveLock, TryLockBusy) {
ASSERT_FALSE(is_lock_owner(mock_image_ctx, exclusive_lock));

expect_unblock_writes(mock_image_ctx);
expect_op_work_queue(mock_image_ctx);
ASSERT_EQ(0, when_shut_down(mock_image_ctx, exclusive_lock));
}

Expand All @@ -308,7 +309,6 @@ TEST_F(TestMockExclusiveLock, TryLockError) {
ASSERT_FALSE(is_lock_owner(mock_image_ctx, exclusive_lock));

expect_unblock_writes(mock_image_ctx);
expect_op_work_queue(mock_image_ctx);
ASSERT_EQ(0, when_shut_down(mock_image_ctx, exclusive_lock));
}

Expand All @@ -331,7 +331,6 @@ TEST_F(TestMockExclusiveLock, RequestLockLockedState) {
ASSERT_EQ(0, when_try_lock(mock_image_ctx, exclusive_lock));

MockReleaseRequest shutdown_release;
expect_op_work_queue(mock_image_ctx);
expect_release_lock(mock_image_ctx, shutdown_release, 0, true);
ASSERT_EQ(0, when_request_lock(mock_image_ctx, exclusive_lock));

Expand Down Expand Up @@ -360,7 +359,6 @@ TEST_F(TestMockExclusiveLock, RequestLockBlacklist) {
ASSERT_FALSE(is_lock_owner(mock_image_ctx, exclusive_lock));

expect_unblock_writes(mock_image_ctx);
expect_op_work_queue(mock_image_ctx);
ASSERT_EQ(0, when_shut_down(mock_image_ctx, exclusive_lock));
}

Expand Down Expand Up @@ -389,7 +387,6 @@ TEST_F(TestMockExclusiveLock, RequestLockBusy) {
ASSERT_TRUE(is_lock_owner(mock_image_ctx, exclusive_lock));

MockReleaseRequest shutdown_release;
expect_op_work_queue(mock_image_ctx);
expect_release_lock(mock_image_ctx, shutdown_release, 0, true);
ASSERT_EQ(0, when_shut_down(mock_image_ctx, exclusive_lock));
}
Expand Down Expand Up @@ -419,7 +416,6 @@ TEST_F(TestMockExclusiveLock, RequestLockError) {
ASSERT_TRUE(is_lock_owner(mock_image_ctx, exclusive_lock));

MockReleaseRequest shutdown_release;
expect_op_work_queue(mock_image_ctx);
expect_release_lock(mock_image_ctx, shutdown_release, 0, true);
ASSERT_EQ(0, when_shut_down(mock_image_ctx, exclusive_lock));
}
Expand All @@ -441,7 +437,6 @@ TEST_F(TestMockExclusiveLock, ReleaseLockUnlockedState) {
ASSERT_EQ(0, when_release_lock(mock_image_ctx, exclusive_lock));

expect_unblock_writes(mock_image_ctx);
expect_op_work_queue(mock_image_ctx);
ASSERT_EQ(0, when_shut_down(mock_image_ctx, exclusive_lock));
}

Expand Down Expand Up @@ -470,7 +465,6 @@ TEST_F(TestMockExclusiveLock, ReleaseLockError) {
ASSERT_TRUE(is_lock_owner(mock_image_ctx, exclusive_lock));

MockReleaseRequest shutdown_release;
expect_op_work_queue(mock_image_ctx);
expect_release_lock(mock_image_ctx, shutdown_release, 0, true);
ASSERT_EQ(0, when_shut_down(mock_image_ctx, exclusive_lock));
ASSERT_FALSE(is_lock_owner(mock_image_ctx, exclusive_lock));
Expand Down

0 comments on commit d093d83

Please sign in to comment.