Skip to content

Commit

Permalink
Fix bmqstoragetool-related enterprise CI fails (bloomberg#253)
Browse files Browse the repository at this point in the history
Signed-off-by: Anton Pryakhin <[email protected]>
Co-authored-by: Evgeny Malygin <[email protected]>
  • Loading branch information
2 people authored and alexander-e1off committed Oct 24, 2024
1 parent b8d3c4b commit 95ae384
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ static void test1_breathingTest()
fileManager,
bsl::cout,
s_allocator_p);
ASSERT_NE(dynamic_cast<JournalFileProcessor*>(cmdProcessor.get()),
bsl::nullptr_t());
ASSERT(dynamic_cast<JournalFileProcessor*>(cmdProcessor.get()) != 0);
}

// ============================================================================
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -515,9 +515,8 @@ static void test8_searchMessagesByQueueKeyTest()
queueKey2);

// Configure parameters to search messages by queueKey1
Parameters params(s_allocator_p);
bsl::vector<bsl::string> queueKeys(1, queueKey1, s_allocator_p);
params.d_queueKey = bsl::move(queueKeys);
Parameters params(s_allocator_p);
params.d_queueKey.push_back(queueKey1);
// Prepare file manager
bslma::ManagedPtr<FileManager> fileManager(
new (*s_allocator_p) FileManagerMock(journalFile, s_allocator_p),
Expand Down Expand Up @@ -652,9 +651,7 @@ static void test10_searchMessagesByQueueNameAndQueueKeyTest()
Parameters params(s_allocator_p);
params.d_queueName.push_back("queue1");
params.d_queueMap.insert(queueInfo);

bsl::vector<bsl::string> queueKeys(1, queueKey2, s_allocator_p);
params.d_queueKey = bsl::move(queueKeys);
params.d_queueKey.push_back(queueKey2);

// Prepare file manager
bslma::ManagedPtr<FileManager> fileManager(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ static void test1_breathingTest()
fileManager,
bsl::cout,
s_allocator_p);
ASSERT_NE(dynamic_cast<SearchResult*>(searchResult.get()),
bsl::nullptr_t());
ASSERT(dynamic_cast<SearchResult*>(searchResult.get()) != 0);
}

// ============================================================================
Expand Down
6 changes: 4 additions & 2 deletions src/applications/bmqstoragetool/m_bmqstoragetool_testutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,8 @@ class FileManagerMock : public FileManager {

mqbs::JournalFileIterator d_journalFileIt;
// Journal file iterator.
mqbs::DataFileIterator d_dataFileIt;
// Data file iterator.

public:
// CREATORS
Expand All @@ -234,7 +236,7 @@ class FileManagerMock : public FileManager {
explicit FileManagerMock(bslma::Allocator* allocator = 0)
{
EXPECT_CALL(*this, dataFileIterator())
.WillRepeatedly(Return(bsl::nullptr_t()));
.WillRepeatedly(Return(&d_dataFileIt));
}

/// Constructor using the specified `journalFile` and `allocator`.
Expand All @@ -245,7 +247,7 @@ class FileManagerMock : public FileManager {
false)
{
EXPECT_CALL(*this, dataFileIterator())
.WillRepeatedly(Return(bsl::nullptr_t()));
.WillRepeatedly(Return(&d_dataFileIt));
}

// MANIPULATORS
Expand Down

0 comments on commit 95ae384

Please sign in to comment.