diff --git a/examples/chip-tool/templates/tests.js b/examples/chip-tool/templates/tests.js index 984521e8b7ff0d..19061a95db0aa0 100644 --- a/examples/chip-tool/templates/tests.js +++ b/examples/chip-tool/templates/tests.js @@ -72,6 +72,7 @@ function getTests() 'Test_TC_MC_3_2', 'Test_TC_MC_3_3', 'Test_TC_MC_3_4', + 'Test_TC_MC_3_5', ]; const OnOff = [ diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index c7b80ca4598318..29b2786e74d7ed 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -12016,6 +12016,54 @@ class Test_TC_MC_3_4 : public TestCommand // }; +class Test_TC_MC_3_5 : public TestCommand +{ +public: + Test_TC_MC_3_5() : TestCommand("Test_TC_MC_3_5"), mTestIndex(0) {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_3_5\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_3_5\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 0; + + // + // Tests methods + // +}; + class Test_TC_OCC_1_1 : public TestCommand { public: @@ -22848,6 +22896,7 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), + make_unique(), make_unique(), make_unique(), make_unique(),