Skip to content

Commit

Permalink
Add status check in timed related test (#21871)
Browse files Browse the repository at this point in the history
TestCommandHandlerWithProcessReceivedEmptyDataMsg not quite checking the
status returned from ProcessInvokeRequest, add the status check for ProcessInvokeRequest
  • Loading branch information
yunhanw-google authored Aug 15, 2022
1 parent 8a89db4 commit d71bb71
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/app/tests/TestCommandInteraction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1064,8 +1064,16 @@ void TestCommandInteraction::TestCommandHandlerWithProcessReceivedEmptyDataMsg(n

chip::isCommandDispatched = false;
GenerateInvokeRequest(apSuite, apContext, commandDatabuf, messageIsTimed, kTestCommandIdNoData);
commandHandler.ProcessInvokeRequest(std::move(commandDatabuf), transactionIsTimed);

Protocols::InteractionModel::Status status =
commandHandler.ProcessInvokeRequest(std::move(commandDatabuf), transactionIsTimed);
if (messageIsTimed != transactionIsTimed)
{
NL_TEST_ASSERT(apSuite, status == Protocols::InteractionModel::Status::UnsupportedAccess);
}
else
{
NL_TEST_ASSERT(apSuite, status == Protocols::InteractionModel::Status::Success);
}
NL_TEST_ASSERT(apSuite, chip::isCommandDispatched == (messageIsTimed == transactionIsTimed));
}
}
Expand Down

0 comments on commit d71bb71

Please sign in to comment.