diff options
author | Venky Shankar <vshankar@redhat.com> | 2018-02-12 04:29:12 +0100 |
---|---|---|
committer | Mahati Chamarthy <mahati.chamarthy@intel.com> | 2019-11-11 09:54:06 +0100 |
commit | f6b4d3d0f318a21f3e0975b8d061502cfd2fda67 (patch) | |
tree | b92aa7d4ae832203cc41d194533c1fc5426b2f7a /src/test/librbd/operation/test_mock_DisableFeaturesRequest.cc | |
parent | test: wait for pending journal replay operations (diff) | |
download | ceph-f6b4d3d0f318a21f3e0975b8d061502cfd2fda67.tar.xz ceph-f6b4d3d0f318a21f3e0975b8d061502cfd2fda67.zip |
test: fixup rbd tests as a side effect of reference counting
Allocate heap objects for Journal, ExclusiveLock and ObjectMap
as these classes are not reference counted. However mock objects
for these classes can be allocated on the stack as ->get() and
->put() operations are no-op.
Signed-off-by: Mahati Chamarthy <mahati.chamarthy@intel.com>
Signed-off-by: Venky Shankar <vshankar@redhat.com>
Diffstat (limited to 'src/test/librbd/operation/test_mock_DisableFeaturesRequest.cc')
-rw-r--r-- | src/test/librbd/operation/test_mock_DisableFeaturesRequest.cc | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/test/librbd/operation/test_mock_DisableFeaturesRequest.cc b/src/test/librbd/operation/test_mock_DisableFeaturesRequest.cc index a880a54afdc..b437f55b736 100644 --- a/src/test/librbd/operation/test_mock_DisableFeaturesRequest.cc +++ b/src/test/librbd/operation/test_mock_DisableFeaturesRequest.cc @@ -292,13 +292,9 @@ TEST_F(TestMockOperationDisableFeaturesRequest, All) { MockOperationImageCtx mock_image_ctx(*ictx); MockExclusiveLock mock_exclusive_lock; - MockJournal mock_journal_stack; - MockJournal *mock_journal = &mock_journal_stack; - if (features_to_disable & RBD_FEATURE_JOURNALING) { - mock_journal = new MockJournal(); - } + MockJournal mock_journal; MockObjectMap mock_object_map; - initialize_features(ictx, mock_image_ctx, mock_exclusive_lock, *mock_journal, + initialize_features(ictx, mock_image_ctx, mock_exclusive_lock, mock_journal, mock_object_map); expect_verify_lock_ownership(mock_image_ctx); @@ -444,9 +440,9 @@ TEST_F(TestMockOperationDisableFeaturesRequest, Mirroring) { MockOperationImageCtx mock_image_ctx(*ictx); MockExclusiveLock mock_exclusive_lock; - MockJournal *mock_journal = new MockJournal(); + MockJournal mock_journal; MockObjectMap mock_object_map; - initialize_features(ictx, mock_image_ctx, mock_exclusive_lock, *mock_journal, + initialize_features(ictx, mock_image_ctx, mock_exclusive_lock, mock_journal, mock_object_map); expect_verify_lock_ownership(mock_image_ctx); @@ -487,9 +483,9 @@ TEST_F(TestMockOperationDisableFeaturesRequest, MirroringError) { MockOperationImageCtx mock_image_ctx(*ictx); MockExclusiveLock mock_exclusive_lock; - MockJournal *mock_journal = new MockJournal(); + MockJournal mock_journal; MockObjectMap mock_object_map; - initialize_features(ictx, mock_image_ctx, mock_exclusive_lock, *mock_journal, + initialize_features(ictx, mock_image_ctx, mock_exclusive_lock, mock_journal, mock_object_map); expect_verify_lock_ownership(mock_image_ctx); |