Skip to content

Commit

Permalink
Updated Unit Test cluster code
Browse files Browse the repository at this point in the history
  • Loading branch information
tennessee-google committed Jan 23, 2024
1 parent ffa32db commit 4bac8f5
Showing 1 changed file with 8 additions and 20 deletions.
28 changes: 8 additions & 20 deletions src/app/clusters/test-cluster-server/test-cluster-server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ bool emberAfUnitTestingClusterTestDifferentVendorMeiRequestCallback(
{
Events::TestDifferentVendorMeiEvent::Type event{ commandData.arg1 };

if (CHIP_NO_ERROR != LogEvent(event, commandPath.mEndpointId, response.evenNumber))
if (CHIP_NO_ERROR != LogEvent(event, commandPath.mEndpointId, response.eventNumber))
{
commandObj->AddStatus(commandPath, Status::Failure);
return true;
Expand Down Expand Up @@ -846,28 +846,16 @@ bool emberAfUnitTestingClusterTestEmitTestEventRequestCallback(
DataModel::List<const Structs::SimpleStruct::Type> arg5;
DataModel::List<const SimpleEnum> arg6;

{
Events::TestDifferentVendorMeiEvent::Type event{ commandData.arg1 };

if (CHIP_NO_ERROR != LogEvent(event, commandPath.mEndpointId, responseData.value))
{
commandObj->AddStatus(commandPath, Status::Failure);
return true;
}
}
// TODO: Add code to pull arg4, arg5 and arg6 from the arguments of the command
Events::TestEvent::Type event{ commandData.arg1, commandData.arg2, commandData.arg3, arg4, arg5, arg6 };

if (CHIP_NO_ERROR != LogEvent(event, commandPath.mEndpointId, responseData.value))
{
// TODO: Add code to pull arg4, arg5 and arg6 from the arguments of the command
Events::TestEvent::Type event{ commandData.arg1, commandData.arg2, commandData.arg3, arg4, arg5, arg6 };

EventNumber eventIdPlaceholder = 0;
if (CHIP_NO_ERROR != LogEvent(event, commandPath.mEndpointId, eventIdPlaceholder))
{
commandObj->AddStatus(commandPath, Status::Failure);
return true;
}
commandObj->AddResponse(commandPath, responseData);
commandObj->AddStatus(commandPath, Status::Failure);
return true;
}

commandObj->AddResponse(commandPath, responseData);
return true;
}

Expand Down

0 comments on commit 4bac8f5

Please sign in to comment.