Skip to content

Commit

Permalink
Add status check in timed related test
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 committed Aug 12, 2022
1 parent 37b9f20 commit 89b7e39
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 89b7e39

Please sign in to comment.