Skip to content

Commit

Permalink
Merge branch 'main' into perf-inline-stats-onevent
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitry Petukhov <[email protected]>
  • Loading branch information
tepamid authored Dec 16, 2024
2 parents 52ee21e + 171d7cc commit de13c43
Show file tree
Hide file tree
Showing 289 changed files with 19,315 additions and 17,741 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ static void test1_breathingTest()
fileManager,
bsl::cout,
bmqtst::TestHelperUtil::allocator());
ASSERT(dynamic_cast<JournalFileProcessor*>(cmdProcessor.get()) != 0);
BMQTST_ASSERT(dynamic_cast<JournalFileProcessor*>(cmdProcessor.get()) !=
0);
}

// ============================================================================
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ inline FileManagerImpl::FileHandler<ITER>::FileHandler(
}

template <typename ITER>
inline FileManagerImpl::FileHandler<ITER>::~FileHandler()
inline FileManagerImpl::FileHandler<ITER>::~FileHandler<ITER>()
{
d_iter.clear();
if (d_mfd.isValid()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,28 @@ namespace BloombergLP {

namespace m_bmqstoragetool {

// NOTHING
FileManagerMock::FileManagerMock()
: d_journalFileIt()
, d_dataFileIt()
{
EXPECT_CALL(*this, dataFileIterator())
.WillRepeatedly(testing::Return(&d_dataFileIt));
}

FileManagerMock::FileManagerMock(const JournalFile& journalFile)
: d_journalFileIt(&journalFile.mappedFileDescriptor(),
journalFile.fileHeader(),
false)
, d_dataFileIt()
{
EXPECT_CALL(*this, dataFileIterator())
.WillRepeatedly(testing::Return(&d_dataFileIt));
}

mqbs::JournalFileIterator* FileManagerMock::journalFileIterator()
{
return &d_journalFileIt;
}

} // close package namespace

Expand Down
56 changes: 0 additions & 56 deletions src/applications/bmqstoragetool/m_bmqstoragetool_filemanagermock.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,37 +27,8 @@
#include <m_bmqstoragetool_filemanager.h>
#include <m_bmqstoragetool_journalfile.h>

// GMOCK
// If bmqst_testhelper.h was defined before gtest.h, preserve macroses values.
// If not, undefine values from gtest.h.
#pragma push_macro("ASSERT_EQ")
#pragma push_macro("ASSERT_NE")
#pragma push_macro("ASSERT_LT")
#pragma push_macro("ASSERT_LE")
#pragma push_macro("ASSERT_GT")
#pragma push_macro("ASSERT_GE")
#pragma push_macro("TEST_F")
#pragma push_macro("TEST")

#include <gmock/gmock.h>

#undef ASSERT_EQ
#undef ASSERT_NE
#undef ASSERT_LT
#undef ASSERT_LE
#undef ASSERT_GT
#undef ASSERT_GE
#undef TEST_F
#undef TEST
#pragma pop_macro("ASSERT_EQ")
#pragma pop_macro("ASSERT_NE")
#pragma pop_macro("ASSERT_LT")
#pragma pop_macro("ASSERT_LE")
#pragma pop_macro("ASSERT_GT")
#pragma pop_macro("ASSERT_GE")
#pragma pop_macro("TEST_F")
#pragma pop_macro("TEST")

namespace BloombergLP {

namespace m_bmqstoragetool {
Expand Down Expand Up @@ -98,33 +69,6 @@ class FileManagerMock : public FileManager {
// INLINE DEFINITIONS
// ============================================================================

// =====================
// class FileManagerMock
// =====================

inline FileManagerMock::FileManagerMock()
: d_journalFileIt()
, d_dataFileIt()
{
EXPECT_CALL(*this, dataFileIterator())
.WillRepeatedly(testing::Return(&d_dataFileIt));
}

inline FileManagerMock::FileManagerMock(const JournalFile& journalFile)
: d_journalFileIt(&journalFile.mappedFileDescriptor(),
journalFile.fileHeader(),
false)
, d_dataFileIt()
{
EXPECT_CALL(*this, dataFileIterator())
.WillRepeatedly(testing::Return(&d_dataFileIt));
}

inline mqbs::JournalFileIterator* FileManagerMock::journalFileIterator()
{
return &d_journalFileIt;
}

} // close package namespace

} // close enterprise namespace
Expand Down
Loading

0 comments on commit de13c43

Please sign in to comment.