From 89b7e3983c75c8091aad28cdfe44e249ba388138 Mon Sep 17 00:00:00 2001 From: yunhanw Date: Fri, 12 Aug 2022 16:10:03 -0700 Subject: [PATCH] Add status check in timed related test 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)); } }