Skip to content

Commit

Permalink
Add status check in timed related test (project-chip#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 and isiu-apple committed Sep 16, 2022
1 parent 77144c7 commit 8ee4098
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 8ee4098

Please sign in to comment.