Skip to content

Commit

Permalink
Fix: preconditions in InputUtil
Browse files Browse the repository at this point in the history
Signed-off-by: Evgeny Malygin <[email protected]>
  • Loading branch information
678098 committed Oct 30, 2023
1 parent e3985e4 commit fa661fc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/applications/bmqtool/m_bmqtool_inpututil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ namespace m_bmqtool {

bool InputUtil::getLine(bsl::string* out)
{
BSLS_ASSERT_SAFE(out);

bsl::cout << "> " << bsl::flush;
bsl::cin.clear();
bsl::getline(bsl::cin, *out);
Expand All @@ -54,7 +56,7 @@ void InputUtil::preprocessInput(bsl::string* verb,
{
BSLS_ASSERT_SAFE(verb);
BSLS_ASSERT_SAFE(output);
BSLS_ASSERT_SAFE(keys);

mwcu::MemOutStream oss;

bool isKey = true, isFirstKey = true, isVerb = true;
Expand Down Expand Up @@ -134,6 +136,8 @@ void InputUtil::populateProperties(
bmqa::MessageProperties* out,
const bsl::vector<MessageProperty>& properties)
{
BSLS_ASSERT_SAFE(out);

for (size_t i = 0; i < properties.size(); ++i) {
const bsl::string& name = properties[i].name();
const bsl::string& value = properties[i].value();
Expand Down Expand Up @@ -263,6 +267,8 @@ void InputUtil::verifyProperties(
bool InputUtil::populateSubscriptions(bmqt::QueueOptions* out,
const bsl::vector<Subscription>& in)
{
BSLS_ASSERT_SAFE(out);

bool failed = false;
for (size_t i = 0; i < in.size(); ++i) {
bmqt::Subscription to;
Expand Down

0 comments on commit fa661fc

Please sign in to comment.