Skip to content

Commit

Permalink
Remove redundant Parameters default ctor
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitrii Petukhov <[email protected]>
  • Loading branch information
bbpetukhov committed Dec 2, 2024
1 parent 959f269 commit 1d1fc97
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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> fileManager(
new (*s_allocator_p) FileManagerMock(journalFile),
Expand Down Expand Up @@ -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<bsl::string>& searchGuids = params.d_guid;
bsl::list<JournalFile::NodeType>::const_iterator recordIter =
Expand Down Expand Up @@ -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<bsl::string>& searchGuids = params.d_guid;
bmqt::MessageGUID guid;
Expand Down Expand Up @@ -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<bsl::string>& searchGuids = params.d_guid;
Expand Down Expand Up @@ -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> fileManager(
Expand Down Expand Up @@ -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> fileManager(
Expand Down Expand Up @@ -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> fileManager(
Expand Down Expand Up @@ -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> fileManager(
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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> fileManager(
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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> fileManager(
Expand Down
17 changes: 0 additions & 17 deletions src/applications/bmqstoragetool/m_bmqstoragetool_parameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 0 additions & 2 deletions src/applications/bmqstoragetool/m_bmqstoragetool_parameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 1d1fc97

Please sign in to comment.