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 3, 2023
1 parent 2d7892c commit 4bc78bd
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 4bc78bd

Please sign in to comment.