From 1d1fc9714bf6267f08280f4e8aaea2ed0aa84230 Mon Sep 17 00:00:00 2001 From: Dmitrii Petukhov Date: Mon, 2 Dec 2024 18:40:35 +0200 Subject: [PATCH] Remove redundant Parameters default ctor Signed-off-by: Dmitrii Petukhov --- ..._bmqstoragetool_journalfileprocessor.t.cpp | 28 +++++++++---------- .../m_bmqstoragetool_parameters.cpp | 17 ----------- .../m_bmqstoragetool_parameters.h | 2 -- 3 files changed, 14 insertions(+), 33 deletions(-) diff --git a/src/applications/bmqstoragetool/m_bmqstoragetool_journalfileprocessor.t.cpp b/src/applications/bmqstoragetool/m_bmqstoragetool_journalfileprocessor.t.cpp index d05da9b5a..18341df03 100644 --- a/src/applications/bmqstoragetool/m_bmqstoragetool_journalfileprocessor.t.cpp +++ b/src/applications/bmqstoragetool/m_bmqstoragetool_journalfileprocessor.t.cpp @@ -185,7 +185,7 @@ static void test1_breathingTest() journalFile.addAllTypesRecords(&records); // Prepare parameters - Parameters params(s_allocator_p); + Parameters params(CommandLineArguments(allocator_p), allocator_p); // Prepare file manager bslma::ManagedPtr fileManager( new (*s_allocator_p) FileManagerMock(journalFile), @@ -240,7 +240,7 @@ static void test2_searchGuidTest() journalFile.addAllTypesRecords(&records); // Prepare parameters - Parameters params(s_allocator_p); + Parameters params(CommandLineArguments(allocator_p), allocator_p); // Get list of message GUIDs for searching bsl::vector& searchGuids = params.d_guid; bsl::list::const_iterator recordIter = @@ -304,7 +304,7 @@ static void test3_searchNonExistingGuidTest() journalFile.addAllTypesRecords(&records); // Prepare parameters - Parameters params(s_allocator_p); + Parameters params(CommandLineArguments(allocator_p), allocator_p); // Get list of message GUIDs for searching bsl::vector& searchGuids = params.d_guid; bmqt::MessageGUID guid; @@ -362,7 +362,7 @@ static void test4_searchExistingAndNonExistingGuidTest() journalFile.addAllTypesRecords(&records); // Prepare parameters - Parameters params(s_allocator_p); + Parameters params(CommandLineArguments(allocator_p), allocator_p); // Get list of message GUIDs for searching bsl::vector& searchGuids = params.d_guid; @@ -444,7 +444,7 @@ static void test5_searchOutstandingMessagesTest() true); // Configure parameters to search outstanding messages - Parameters params(s_allocator_p); + Parameters params(CommandLineArguments(allocator_p), allocator_p); params.d_outstanding = true; // Prepare file manager bslma::ManagedPtr fileManager( @@ -505,7 +505,7 @@ static void test6_searchConfirmedMessagesTest() false); // Configure parameters to search confirmed messages - Parameters params(s_allocator_p); + Parameters params(CommandLineArguments(allocator_p), allocator_p); params.d_confirmed = true; // Prepare file manager bslma::ManagedPtr fileManager( @@ -568,7 +568,7 @@ static void test7_searchPartiallyConfirmedMessagesTest() &partiallyConfirmedGUIDS); // Configure parameters to search partially confirmed messages - Parameters params(s_allocator_p); + Parameters params(CommandLineArguments(allocator_p), allocator_p); params.d_partiallyConfirmed = true; // Prepare file manager bslma::ManagedPtr fileManager( @@ -631,7 +631,7 @@ static void test8_searchMessagesByQueueKeyTest() queueKey2); // Configure parameters to search messages by queueKey1 - Parameters params(s_allocator_p); + Parameters params(CommandLineArguments(allocator_p), allocator_p); params.d_queueKey.push_back(queueKey1); // Prepare file manager bslma::ManagedPtr fileManager( @@ -696,7 +696,7 @@ static void test9_searchMessagesByQueueNameTest() } QueueMap qMap(s_allocator_p); - Parameters params(s_allocator_p); + Parameters params(CommandLineArguments(allocator_p), allocator_p); params.d_queueName.push_back("queue1"); params.d_queueMap.insert(queueInfo); @@ -766,7 +766,7 @@ static void test10_searchMessagesByQueueNameAndQueueKeyTest() } QueueMap qMap(s_allocator_p); - Parameters params(s_allocator_p); + Parameters params(CommandLineArguments(allocator_p), allocator_p); params.d_queueName.push_back("queue1"); params.d_queueMap.insert(queueInfo); params.d_queueKey.push_back(queueKey2); @@ -821,7 +821,7 @@ static void test11_searchMessagesByTimestamp() const bsls::Types::Uint64 ts2 = 40 * journalFile.timestampIncrement(); // Configure parameters to search messages by timestamps - Parameters params(s_allocator_p); + Parameters params(CommandLineArguments(allocator_p), allocator_p); params.d_timestampGt = ts1; params.d_timestampLt = ts2; // Prepare file manager @@ -892,7 +892,7 @@ static void test12_printMessagesDetailsTest() false); // Configure parameters to print message details - Parameters params(s_allocator_p); + Parameters params(CommandLineArguments(allocator_p), allocator_p); params.d_details = true; // Prepare file manager bslma::ManagedPtr fileManager( @@ -1018,7 +1018,7 @@ static void test13_searchMessagesWithPayloadDumpTest() // Configure parameters to search confirmed messages GUIDs with dumping // messages payload. - Parameters params(s_allocator_p); + Parameters params(CommandLineArguments(allocator_p), allocator_p); params.d_confirmed = true; params.d_dumpPayload = true; // Prepare file manager @@ -1100,7 +1100,7 @@ static void test14_summaryTest() &partiallyConfirmedGUIDS); // Configure parameters to output summary - Parameters params(s_allocator_p); + Parameters params(CommandLineArguments(allocator_p), allocator_p); params.d_summary = true; // Prepare file manager bslma::ManagedPtr fileManager( diff --git a/src/applications/bmqstoragetool/m_bmqstoragetool_parameters.cpp b/src/applications/bmqstoragetool/m_bmqstoragetool_parameters.cpp index f4fadc170..fac1ee63d 100644 --- a/src/applications/bmqstoragetool/m_bmqstoragetool_parameters.cpp +++ b/src/applications/bmqstoragetool/m_bmqstoragetool_parameters.cpp @@ -209,23 +209,6 @@ bool CommandLineArguments::validate(bsl::string* error) return error->empty(); } -Parameters::Parameters(bslma::Allocator* allocator) -: d_queueMap(allocator) -, d_timestampGt(0) -, d_timestampLt(0) -, d_guid(allocator) -, d_queueKey(allocator) -, d_queueName(allocator) -, d_dumpLimit(0) -, d_details(false) -, d_dumpPayload(false) -, d_summary(false) -, d_outstanding(false) -, d_confirmed(false) -, d_partiallyConfirmed(false) -{ -} - Parameters::Parameters(const CommandLineArguments& arguments, bslma::Allocator* allocator) : d_queueMap(allocator) diff --git a/src/applications/bmqstoragetool/m_bmqstoragetool_parameters.h b/src/applications/bmqstoragetool/m_bmqstoragetool_parameters.h index f5e936388..30a3bb672 100644 --- a/src/applications/bmqstoragetool/m_bmqstoragetool_parameters.h +++ b/src/applications/bmqstoragetool/m_bmqstoragetool_parameters.h @@ -128,8 +128,6 @@ struct Parameters { // Min number of records per queue for detailed info to be displayed // CREATORS - /// Default constructor - explicit Parameters(bslma::Allocator* allocator = 0); /// Constructor from the specified 'aruments' explicit Parameters(const CommandLineArguments& aruments, bslma::Allocator* allocator = 0);