From 8ee40989beb8b48716cd0dcf536b9deee7735563 Mon Sep 17 00:00:00 2001 From: yunhanw-google Date: Mon, 15 Aug 2022 16:19:44 -0700 Subject: [PATCH] Add status check in timed related test (#21871) TestCommandHandlerWithProcessReceivedEmptyDataMsg not quite checking the status returned from ProcessInvokeRequest, add the status check for ProcessInvokeRequest --- src/app/tests/TestCommandInteraction.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/app/tests/TestCommandInteraction.cpp b/src/app/tests/TestCommandInteraction.cpp index c36221395375ad..265d982acbaae4 100644 --- a/src/app/tests/TestCommandInteraction.cpp +++ b/src/app/tests/TestCommandInteraction.cpp @@ -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)); } }