Skip to content

Commit

Permalink
[Simulated Test] Simulated node does not have a chance to send the in…
Browse files Browse the repository at this point in the history
…teraction response for the last step on success (#23224)
  • Loading branch information
vivien-apple authored and pull[bot] committed Feb 22, 2024
1 parent 9bddecb commit 3353961
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion examples/placeholder/linux/include/TestCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,21 @@ class TestCommand : public TestRunner,
void Exit(std::string message, CHIP_ERROR err) override
{
LogEnd(message, err);
SetCommandExitStatus(err);

if (CHIP_NO_ERROR == err)
{
chip::DeviceLayer::PlatformMgr().ScheduleWork(AsyncExit, reinterpret_cast<intptr_t>(this));
}
else
{
SetCommandExitStatus(err);
}
}

static void AsyncExit(intptr_t context)
{
TestCommand * command = reinterpret_cast<TestCommand *>(context);
command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void ScheduleNextTest(intptr_t context)
Expand Down

0 comments on commit 3353961

Please sign in to comment.