From e7e6752b8b075d75e6f56a122f21ac3b5696bc71 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Wed, 30 Mar 2022 14:43:17 +0200 Subject: [PATCH] Update generated content --- .../chip-tool/zap-generated/test/Commands.h | 7720 +++++++++++++---- .../app1/zap-generated/test/Commands.h | 64 +- .../app2/zap-generated/test/Commands.h | 64 +- 3 files changed, 6039 insertions(+), 1809 deletions(-) diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index 44fac80f1ce2ed..0e6839c2a29361 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -510,12 +510,24 @@ class TestAccessControlClusterSuite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -1896,12 +1908,24 @@ class Test_TC_BI_1_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -2192,12 +2216,24 @@ class Test_TC_BI_2_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -2708,12 +2744,24 @@ class Test_TC_BI_2_2Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -3085,12 +3133,24 @@ class Test_TC_BOOL_1_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -3346,12 +3406,24 @@ class Test_TC_BOOL_2_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -3518,12 +3590,24 @@ class Test_TC_BRAC_1_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -3784,12 +3868,24 @@ class Test_TC_CC_1_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -4526,12 +4622,24 @@ class Test_TC_CC_2_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -9220,12 +9328,24 @@ class Test_TC_CC_3_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_2(void * context, CHIP_ERROR error) @@ -9622,12 +9742,24 @@ class Test_TC_CC_3_2Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_2(void * context, CHIP_ERROR error) @@ -9977,12 +10109,24 @@ class Test_TC_CC_3_3Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_2(void * context, CHIP_ERROR error) @@ -10268,12 +10412,24 @@ class Test_TC_CC_4_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_2(void * context, CHIP_ERROR error) @@ -10546,12 +10702,24 @@ class Test_TC_CC_4_2Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_2(void * context, CHIP_ERROR error) @@ -10963,12 +11131,24 @@ class Test_TC_CC_4_3Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_2(void * context, CHIP_ERROR error) @@ -11254,12 +11434,24 @@ class Test_TC_CC_4_4Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_2(void * context, CHIP_ERROR error) @@ -11513,12 +11705,24 @@ class Test_TC_CC_5_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_2(void * context, CHIP_ERROR error) @@ -11776,12 +11980,24 @@ class Test_TC_CC_5_2Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_2(void * context, CHIP_ERROR error) @@ -12063,12 +12279,24 @@ class Test_TC_CC_5_3Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_2(void * context, CHIP_ERROR error) @@ -12322,12 +12550,24 @@ class Test_TC_CC_6_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_2(void * context, CHIP_ERROR error) @@ -12604,12 +12844,24 @@ class Test_TC_CC_6_2Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_2(void * context, CHIP_ERROR error) @@ -13068,12 +13320,24 @@ class Test_TC_CC_6_3Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_2(void * context, CHIP_ERROR error) @@ -13379,12 +13643,24 @@ class Test_TC_CC_7_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_2(void * context, CHIP_ERROR error) @@ -13782,12 +14058,24 @@ class Test_TC_CC_7_2Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_2(void * context, CHIP_ERROR error) @@ -14172,12 +14460,24 @@ class Test_TC_CC_7_3Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_2(void * context, CHIP_ERROR error) @@ -14463,12 +14763,24 @@ class Test_TC_CC_7_4Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_2(void * context, CHIP_ERROR error) @@ -14766,12 +15078,24 @@ class Test_TC_CC_8_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_2(void * context, CHIP_ERROR error) @@ -15843,12 +16167,28 @@ class Test_TC_CC_9_1Suite : public TestCommand uint16_t EnhancedCurrentHueValue4; uint16_t ColorLoopStoredEnhancedHue4; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_2(void * context, CHIP_ERROR error) @@ -17849,12 +18189,24 @@ class Test_TC_CC_9_2Suite : public TestCommand uint16_t EnhancedCurrentHueValue; uint16_t ColorLoopStoredEnhancedHueValue; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_2(void * context, CHIP_ERROR error) @@ -18723,12 +19075,24 @@ class Test_TC_CC_9_3Suite : public TestCommand uint16_t EnhancedCurrentHueValue; uint16_t ColorLoopStoredEnhancedHueValue; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_2(void * context, CHIP_ERROR error) @@ -19529,12 +19893,24 @@ class Test_TC_DM_1_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -20268,12 +20644,24 @@ class Test_TC_DM_3_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -20440,12 +20828,24 @@ class Test_TC_DM_2_2Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -20694,12 +21094,24 @@ class Test_TC_EMR_1_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -20947,12 +21359,24 @@ class Test_TC_ETHDIAG_1_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -21032,12 +21456,24 @@ class Test_TC_ETHDIAG_2_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -21130,12 +21566,24 @@ class Test_TC_FLW_1_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -21363,12 +21811,24 @@ class Test_TC_FLW_2_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -21887,12 +22347,24 @@ class Test_TC_FLW_2_2Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -22058,12 +22530,24 @@ class Test_TC_GC_1_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -22328,12 +22812,24 @@ class Test_TC_I_1_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -22555,12 +23051,24 @@ class Test_TC_I_2_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -22820,12 +23328,64 @@ class Test_TC_I_2_3Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -23281,12 +23841,24 @@ class Test_TC_ILL_1_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -23520,12 +24092,24 @@ class Test_TC_ILL_2_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -23791,12 +24375,24 @@ class Test_TC_LVL_1_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -24298,12 +24894,28 @@ class Test_TC_LVL_2_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_3(void * context, CHIP_ERROR error) @@ -24917,12 +25529,24 @@ class Test_TC_LVL_2_2Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -25548,12 +26172,40 @@ class Test_TC_LVL_3_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -26087,12 +26739,52 @@ class Test_TC_LVL_4_1Suite : public TestCommand uint8_t MinlevelValue; chip::app::DataModel::Nullable DefaultMoveRateValue; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -26600,12 +27292,40 @@ class Test_TC_LVL_5_1Suite : public TestCommand uint8_t CurrentlevelValue; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_4(void * context, CHIP_ERROR error) @@ -27038,12 +27758,36 @@ class Test_TC_LVL_6_1Suite : public TestCommand uint8_t CurrentLevelValue; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_4(void * context, CHIP_ERROR error) @@ -27398,12 +28142,24 @@ class Test_TC_MC_1_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -27595,12 +28351,24 @@ class Test_TC_MC_1_2Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -27792,12 +28560,24 @@ class Test_TC_MC_1_3Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -27989,12 +28769,24 @@ class Test_TC_MC_1_4Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -28186,12 +28978,24 @@ class Test_TC_MC_1_5Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -28383,12 +29187,24 @@ class Test_TC_MC_1_6Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -28580,12 +29396,24 @@ class Test_TC_MC_1_7Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -28777,12 +29605,24 @@ class Test_TC_MC_1_8Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -28974,12 +29814,24 @@ class Test_TC_MC_1_9Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -29171,12 +30023,24 @@ class Test_TC_MC_1_10Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -29368,12 +30232,24 @@ class Test_TC_MC_1_11Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -29565,12 +30441,24 @@ class Test_TC_MC_1_12Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -29754,12 +30642,24 @@ class Test_TC_MC_2_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -29866,12 +30766,24 @@ class Test_TC_MC_3_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -29951,12 +30863,24 @@ class Test_TC_MC_3_2Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -30036,12 +30960,24 @@ class Test_TC_MC_3_3Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -30121,12 +31057,24 @@ class Test_TC_MC_3_4Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -30206,12 +31154,24 @@ class Test_TC_MC_3_5Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -30291,12 +31251,24 @@ class Test_TC_MC_3_6Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -30376,12 +31348,24 @@ class Test_TC_MC_3_7Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -30461,12 +31445,24 @@ class Test_TC_MC_3_8Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -30546,12 +31542,24 @@ class Test_TC_MC_3_9Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -30631,12 +31639,24 @@ class Test_TC_MC_3_10Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -30716,12 +31736,24 @@ class Test_TC_MC_3_11Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -30805,12 +31837,24 @@ class Test_TC_MC_5_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -30930,109 +31974,30 @@ class Test_TC_MC_5_2Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; - - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); - } - - CHIP_ERROR TestLogACommand_1() - { - SetIdentity(kIdentityAlpha); - return UserPrompt("verify that the channel has changed on the device."); - } -}; - -class Test_TC_MC_5_3Suite : public TestCommand -{ -public: - Test_TC_MC_5_3Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_MC_5_3", credsIssuerConfig), mTestIndex(0) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - - ~Test_TC_MC_5_3Suite() {} + bool shouldContinue = false; - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_5_3\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_5_3\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++) + switch (mTestIndex - 1) { case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : log a command\n"); - err = TestLogACommand_1(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } - if (CHIP_NO_ERROR != err) + if (shouldContinue) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); + ContinueOnChipMainThread(CHIP_NO_ERROR); } } - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 2; - - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override - { - bool isExpectedDnssdResult = false; - - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); - } - // // Tests methods // @@ -31046,15 +32011,15 @@ class Test_TC_MC_5_3Suite : public TestCommand CHIP_ERROR TestLogACommand_1() { SetIdentity(kIdentityAlpha); - return UserPrompt("verify that the channel has changed on the device"); + return UserPrompt("verify that the channel has changed on the device."); } }; -class Test_TC_MC_6_1Suite : public TestCommand +class Test_TC_MC_5_3Suite : public TestCommand { public: - Test_TC_MC_6_1Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_MC_6_1", credsIssuerConfig), mTestIndex(0) + Test_TC_MC_5_3Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_MC_5_3", credsIssuerConfig), mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -31062,7 +32027,7 @@ class Test_TC_MC_6_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MC_6_1Suite() {} + ~Test_TC_MC_5_3Suite() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -31071,12 +32036,123 @@ class Test_TC_MC_6_1Suite : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_6_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_5_3\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_6_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_5_3\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++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : log a command\n"); + err = TestLogACommand_1(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 2; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + // + // Tests methods + // + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + } + + CHIP_ERROR TestLogACommand_1() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("verify that the channel has changed on the device"); + } +}; + +class Test_TC_MC_6_1Suite : public TestCommand +{ +public: + Test_TC_MC_6_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_MC_6_1", credsIssuerConfig), mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_MC_6_1Suite() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_6_1\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_6_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -31136,12 +32212,40 @@ class Test_TC_MC_6_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_3(void * context, CHIP_ERROR error) @@ -31311,12 +32415,52 @@ class Test_TC_MC_6_2Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_3(void * context, CHIP_ERROR error) @@ -31484,12 +32628,36 @@ class Test_TC_MC_6_3Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -31623,12 +32791,48 @@ class Test_TC_MC_6_4Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_2(void * context, CHIP_ERROR error) @@ -31846,12 +33050,24 @@ class Test_TC_MC_7_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -31931,12 +33147,24 @@ class Test_TC_MC_7_2Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -32024,12 +33252,24 @@ class Test_TC_MC_8_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -32208,12 +33448,28 @@ class Test_TC_MC_9_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_2(void * context, CHIP_ERROR error) @@ -32509,12 +33765,24 @@ class Test_TC_MC_10_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -32677,12 +33945,24 @@ class Test_TC_MOD_1_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -32961,12 +34241,36 @@ class Test_TC_MF_1_4Suite : public TestCommand chip::Optional mPayload; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_3(void * context, CHIP_ERROR error) @@ -33382,12 +34686,24 @@ class Test_TC_OCC_1_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -33603,12 +34919,24 @@ class Test_TC_OCC_2_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -34011,12 +35339,24 @@ class Test_TC_OCC_2_2Suite : public TestCommand uint8_t OccupancyValue; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -34197,12 +35537,24 @@ class Test_TC_OO_1_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -34597,12 +35949,24 @@ class Test_TC_OO_2_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -34929,12 +36293,40 @@ class Test_TC_OO_2_2Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_2(void * context, CHIP_ERROR error) @@ -35925,12 +37317,36 @@ class Test_TC_OO_2_3Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_3(void * context, CHIP_ERROR error) @@ -37436,12 +38852,24 @@ class Test_TC_PS_1_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -37692,12 +39120,24 @@ class Test_TC_PS_2_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -38095,12 +39535,24 @@ class Test_TC_PRS_1_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -38313,12 +39765,24 @@ class Test_TC_PRS_2_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -38738,12 +40202,24 @@ class Test_TC_PCC_1_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -39323,12 +40799,24 @@ class Test_TC_PCC_2_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -41108,12 +42596,24 @@ class Test_TC_PCC_2_2Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -41364,12 +42864,24 @@ class Test_TC_PCC_2_3Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -41773,12 +43285,24 @@ class Test_TC_PCC_2_4Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -42240,12 +43764,24 @@ class Test_TC_RH_1_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -42475,12 +44011,24 @@ class Test_TC_RH_2_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -42690,12 +44238,24 @@ class Test_TC_RH_2_2Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -43027,106 +44587,199 @@ class Test_TC_SC_4_2Suite : public TestCommand char * deviceInstanceNameBeforeReboot1Buffer = nullptr; chip::CharSpan deviceInstanceNameBeforeReboot1; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; - if ((mTestIndex - 1) == 3) + bool shouldContinue = false; + + switch (mTestIndex - 1) { - isExpectedDnssdResult = true; + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + + VerifyOrReturn(CheckConstraintIsUpperCase("value.instanceName", value.instanceName, true)); + VerifyOrReturn(CheckConstraintIsHexString("value.instanceName", value.instanceName, true)); + VerifyOrReturn(CheckConstraintMinLength("value.instanceName", value.instanceName.size(), 16)); + VerifyOrReturn(CheckConstraintMaxLength("value.instanceName", value.instanceName.size(), 16)); + if (deviceInstanceNameBeforeReboot1Buffer != nullptr) + { + chip::Platform::MemoryFree(deviceInstanceNameBeforeReboot1Buffer); + } + deviceInstanceNameBeforeReboot1Buffer = static_cast(chip::Platform::MemoryAlloc(value.instanceName.size())); + memcpy(deviceInstanceNameBeforeReboot1Buffer, value.instanceName.data(), value.instanceName.size()); + deviceInstanceNameBeforeReboot1 = chip::CharSpan(deviceInstanceNameBeforeReboot1Buffer, value.instanceName.size()); + } + shouldContinue = true; + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + shouldContinue = true; + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintIsUpperCase("value.instanceName", value.instanceName, true)); - VerifyOrReturn(CheckConstraintIsHexString("value.instanceName", value.instanceName, true)); - VerifyOrReturn(CheckConstraintMinLength("value.instanceName", value.instanceName.size(), 16)); - VerifyOrReturn(CheckConstraintMaxLength("value.instanceName", value.instanceName.size(), 16)); - if (deviceInstanceNameBeforeReboot1Buffer != nullptr) + VerifyOrReturn(CheckValue("vendorId", value.vendorId, mVendorId.HasValue() ? mVendorId.Value() : 65521U)); + } + shouldContinue = true; + break; + case 9: + if (IsUnsupported(status.mStatus)) { - chip::Platform::MemoryFree(deviceInstanceNameBeforeReboot1Buffer); + shouldContinue = true; + return; } - deviceInstanceNameBeforeReboot1Buffer = static_cast(chip::Platform::MemoryAlloc(value.instanceName.size())); - memcpy(deviceInstanceNameBeforeReboot1Buffer, value.instanceName.data(), value.instanceName.size()); - deviceInstanceNameBeforeReboot1 = chip::CharSpan(deviceInstanceNameBeforeReboot1Buffer, value.instanceName.size()); - } - if ((mTestIndex - 1) == 4) - { - isExpectedDnssdResult = true; - } - if ((mTestIndex - 1) == 5) - { - isExpectedDnssdResult = true; - } - if ((mTestIndex - 1) == 6) - { - isExpectedDnssdResult = true; - } - if ((mTestIndex - 1) == 7) - { - isExpectedDnssdResult = true; - } - if ((mTestIndex - 1) == 8) - { - isExpectedDnssdResult = true; + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("vendorId", value.vendorId, mVendorId.HasValue() ? mVendorId.Value() : 65521U)); - } - if ((mTestIndex - 1) == 9) - { - isExpectedDnssdResult = true; + VerifyOrReturn(CheckValue("productId", value.productId, mProductId.HasValue() ? mProductId.Value() : 32769U)); + } + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("productId", value.productId, mProductId.HasValue() ? mProductId.Value() : 32769U)); - } - if ((mTestIndex - 1) == 10) - { - isExpectedDnssdResult = true; + VerifyOrReturn(CheckValuePresent("value.mrpRetryIntervalIdle", value.mrpRetryIntervalIdle)); + VerifyOrReturn( + CheckConstraintMaxValue("value.mrpRetryIntervalIdle.Value()", value.mrpRetryIntervalIdle.Value(), 3600000UL)); + } + shouldContinue = true; + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValuePresent("value.mrpRetryIntervalIdle", value.mrpRetryIntervalIdle)); - VerifyOrReturn( - CheckConstraintMaxValue("value.mrpRetryIntervalIdle.Value()", value.mrpRetryIntervalIdle.Value(), 3600000UL)); - } - if ((mTestIndex - 1) == 11) - { - isExpectedDnssdResult = true; + VerifyOrReturn(CheckValuePresent("value.mrpRetryIntervalActive", value.mrpRetryIntervalActive)); + VerifyOrReturn(CheckConstraintMaxValue("value.mrpRetryIntervalActive.Value()", value.mrpRetryIntervalActive.Value(), + 3600000UL)); + } + shouldContinue = true; + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValuePresent("value.mrpRetryIntervalActive", value.mrpRetryIntervalActive)); - VerifyOrReturn( - CheckConstraintMaxValue("value.mrpRetryIntervalActive.Value()", value.mrpRetryIntervalActive.Value(), 3600000UL)); - } - if ((mTestIndex - 1) == 12) - { - isExpectedDnssdResult = true; + VerifyOrReturn(CheckValue("commissioningMode", value.commissioningMode, 1)); + } + shouldContinue = true; + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("commissioningMode", value.commissioningMode, 1)); - } - if ((mTestIndex - 1) == 13) - { - isExpectedDnssdResult = true; + VerifyOrReturn(CheckConstraintMaxLength("value.deviceName", value.deviceName.size(), 32)); + } + shouldContinue = true; + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintMaxLength("value.deviceName", value.deviceName.size(), 32)); - } - if ((mTestIndex - 1) == 14) - { - isExpectedDnssdResult = true; + VerifyOrReturn(CheckConstraintMaxValue("value.rotatingIdLen", value.rotatingIdLen, 100ULL)); + } + shouldContinue = true; + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + shouldContinue = true; + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintMaxValue("value.rotatingIdLen", value.rotatingIdLen, 100ULL)); - } - if ((mTestIndex - 1) == 15) - { - isExpectedDnssdResult = true; - } - if ((mTestIndex - 1) == 16) - { - isExpectedDnssdResult = true; + VerifyOrReturn(CheckConstraintMaxLength("value.pairingInstruction", value.pairingInstruction.size(), 128)); + } + shouldContinue = true; + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintMaxLength("value.pairingInstruction", value.pairingInstruction.size(), 128)); + VerifyOrReturn(CheckConstraintMinValue("value.numIPs", value.numIPs, 1)); + } + shouldContinue = true; + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } - if ((mTestIndex - 1) == 17) - { - isExpectedDnssdResult = true; - VerifyOrReturn(CheckConstraintMinValue("value.numIPs", value.numIPs, 1)); + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); } - - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); } // @@ -43374,12 +45027,24 @@ class Test_TC_SWTCH_2_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -43811,12 +45476,164 @@ class Test_TC_SWTCH_2_2Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 34: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 35: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 36: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 37: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_3(void * context, CHIP_ERROR error) @@ -44182,12 +45999,24 @@ class Test_TC_TM_1_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -44351,12 +46180,24 @@ class Test_TC_TM_2_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -44603,12 +46444,24 @@ class Test_TC_TM_2_2Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -44840,12 +46693,24 @@ class Test_TC_TSTAT_1_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -45107,12 +46972,24 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -46292,12 +48169,24 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -47903,12 +49792,24 @@ class Test_TC_TSUIC_1_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -48150,12 +50051,24 @@ class Test_TC_TSUIC_2_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -48574,12 +50487,24 @@ class Test_TC_TSUIC_2_2Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -49066,12 +50991,24 @@ class Test_TC_DIAG_TH_NW_1_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_2(void * context, CHIP_ERROR error) @@ -49618,12 +51555,24 @@ class Test_TC_DIAG_TH_NW_1_2Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -53204,12 +55153,24 @@ class Test_TC_WIFIDIAG_1_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -53469,12 +55430,24 @@ class Test_TC_WIFIDIAG_3_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -53584,12 +55557,24 @@ class Test_TC_WNCV_1_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -54151,12 +56136,24 @@ class Test_TC_WNCV_2_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -56084,12 +58081,24 @@ class Test_TC_WNCV_2_2Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -56187,12 +58196,24 @@ class Test_TC_WNCV_2_4Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -56359,12 +58380,24 @@ class Test_TC_WNCV_2_5Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -56684,12 +58717,48 @@ class Test_TC_WNCV_3_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } typedef void (*Test_Test_TC_WNCV_3_1_OperationalStatus_ReportCallback)(void * context, uint8_t value); @@ -57626,12 +59695,48 @@ class Test_TC_WNCV_3_2Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } typedef void (*Test_Test_TC_WNCV_3_2_OperationalStatus_ReportCallback)(void * context, uint8_t value); @@ -58494,12 +60599,40 @@ class Test_TC_WNCV_3_3Suite : public TestCommand chip::app::DataModel::Nullable attrCurrentPositionLift; chip::app::DataModel::Nullable attrCurrentPositionTilt; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } typedef void (*Test_Test_TC_WNCV_3_3_OperationalStatus_ReportCallback)(void * context, uint8_t value); @@ -59078,12 +61211,32 @@ class Test_TC_WNCV_3_4Suite : public TestCommand chip::Optional mFullMotionDuration; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_5(void * context, CHIP_ERROR error) @@ -59442,12 +61595,32 @@ class Test_TC_WNCV_3_5Suite : public TestCommand chip::Optional mFullMotionDuration; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_5(void * context, CHIP_ERROR error) @@ -59815,12 +61988,44 @@ class Test_TC_WNCV_4_1Suite : public TestCommand chip::Optional mFullMotionDuration; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_3(void * context, CHIP_ERROR error) @@ -60230,12 +62435,44 @@ class Test_TC_WNCV_4_2Suite : public TestCommand chip::Optional mFullMotionDuration; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_3(void * context, CHIP_ERROR error) @@ -60620,12 +62857,24 @@ class Test_TC_WNCV_4_3Suite : public TestCommand chip::app::DataModel::Nullable attrCurrentPositionLiftPercent100ths; chip::app::DataModel::Nullable attrCurrentPositionLiftPercentage; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -60918,12 +63167,24 @@ class Test_TC_WNCV_4_4Suite : public TestCommand chip::app::DataModel::Nullable attrCurrentPositionTiltPercent100ths; chip::app::DataModel::Nullable attrCurrentPositionTiltPercentage; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -61179,12 +63440,24 @@ class TV_TargetNavigatorClusterSuite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -61404,12 +63677,24 @@ class TV_AudioOutputClusterSuite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -61708,12 +63993,24 @@ class TV_ApplicationLauncherClusterSuite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -61991,12 +64288,24 @@ class TV_KeypadInputClusterSuite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -62121,12 +64430,24 @@ class TV_AccountLoginClusterSuite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -62302,12 +64623,24 @@ class TV_WakeOnLanClusterSuite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -62453,12 +64786,24 @@ class TV_ApplicationBasicClusterSuite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -62906,12 +65251,24 @@ class TV_MediaPlaybackClusterSuite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -63779,12 +66136,24 @@ class TV_ChannelClusterSuite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -64143,12 +66512,24 @@ class TV_LowPowerClusterSuite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -64271,12 +66652,24 @@ class TV_ContentLauncherClusterSuite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -64640,12 +67033,24 @@ class TV_MediaInputClusterSuite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -67013,12 +69418,24 @@ class TestClusterSuite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } typedef void (*Test_TestCluster_list_int8u_ReportCallback)(void * context, @@ -83721,12 +86138,24 @@ class TestClusterComplexTypesSuite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_7(void * context, CHIP_ERROR error) @@ -84551,12 +86980,24 @@ class TestConstraintsSuite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -85301,12 +87742,28 @@ class TestDelayCommandsSuite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -85549,125 +88006,222 @@ class TestDiscoverySuite : public TestCommand char * deviceInstanceNameBeforeRebootBuffer = nullptr; chip::CharSpan deviceInstanceNameBeforeReboot; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; - if ((mTestIndex - 1) == 5) - { - isExpectedDnssdResult = true; + bool shouldContinue = false; - VerifyOrReturn(CheckConstraintIsUpperCase("value.instanceName", value.instanceName, true)); - VerifyOrReturn(CheckConstraintIsHexString("value.instanceName", value.instanceName, true)); - VerifyOrReturn(CheckConstraintMinLength("value.instanceName", value.instanceName.size(), 16)); - VerifyOrReturn(CheckConstraintMaxLength("value.instanceName", value.instanceName.size(), 16)); - if (deviceInstanceNameBeforeRebootBuffer != nullptr) + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::Platform::MemoryFree(deviceInstanceNameBeforeRebootBuffer); + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + + VerifyOrReturn(CheckConstraintIsUpperCase("value.instanceName", value.instanceName, true)); + VerifyOrReturn(CheckConstraintIsHexString("value.instanceName", value.instanceName, true)); + VerifyOrReturn(CheckConstraintMinLength("value.instanceName", value.instanceName.size(), 16)); + VerifyOrReturn(CheckConstraintMaxLength("value.instanceName", value.instanceName.size(), 16)); + if (deviceInstanceNameBeforeRebootBuffer != nullptr) + { + chip::Platform::MemoryFree(deviceInstanceNameBeforeRebootBuffer); + } + deviceInstanceNameBeforeRebootBuffer = static_cast(chip::Platform::MemoryAlloc(value.instanceName.size())); + memcpy(deviceInstanceNameBeforeRebootBuffer, value.instanceName.data(), value.instanceName.size()); + deviceInstanceNameBeforeReboot = chip::CharSpan(deviceInstanceNameBeforeRebootBuffer, value.instanceName.size()); } - deviceInstanceNameBeforeRebootBuffer = static_cast(chip::Platform::MemoryAlloc(value.instanceName.size())); - memcpy(deviceInstanceNameBeforeRebootBuffer, value.instanceName.data(), value.instanceName.size()); - deviceInstanceNameBeforeReboot = chip::CharSpan(deviceInstanceNameBeforeRebootBuffer, value.instanceName.size()); - } - if ((mTestIndex - 1) == 6) - { - isExpectedDnssdResult = true; - } - if ((mTestIndex - 1) == 7) - { - isExpectedDnssdResult = true; - } - if ((mTestIndex - 1) == 8) - { - isExpectedDnssdResult = true; - } - if ((mTestIndex - 1) == 9) - { - isExpectedDnssdResult = true; - } - if ((mTestIndex - 1) == 10) - { - isExpectedDnssdResult = true; + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + shouldContinue = true; + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + shouldContinue = true; + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("longDiscriminator", value.longDiscriminator, - mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U)); - VerifyOrReturn(CheckConstraintMinValue("value.longDiscriminator", value.longDiscriminator, 0U)); - VerifyOrReturn(CheckConstraintMaxValue("value.longDiscriminator", value.longDiscriminator, 4096U)); - } - if ((mTestIndex - 1) == 11) - { - isExpectedDnssdResult = true; + VerifyOrReturn(CheckValue("longDiscriminator", value.longDiscriminator, + mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U)); + VerifyOrReturn(CheckConstraintMinValue("value.longDiscriminator", value.longDiscriminator, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value.longDiscriminator", value.longDiscriminator, 4096U)); + } + shouldContinue = true; + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("vendorId", value.vendorId, mVendorId.HasValue() ? mVendorId.Value() : 65521U)); - } - if ((mTestIndex - 1) == 12) - { - isExpectedDnssdResult = true; + VerifyOrReturn(CheckValue("vendorId", value.vendorId, mVendorId.HasValue() ? mVendorId.Value() : 65521U)); + } + shouldContinue = true; + break; + case 12: + if (IsUnsupported(status.mStatus)) + { + shouldContinue = true; + return; + } + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("productId", value.productId, mProductId.HasValue() ? mProductId.Value() : 32769U)); - } - if ((mTestIndex - 1) == 13) - { - isExpectedDnssdResult = true; + VerifyOrReturn(CheckValue("productId", value.productId, mProductId.HasValue() ? mProductId.Value() : 32769U)); + } + shouldContinue = true; + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValuePresent("value.mrpRetryIntervalIdle", value.mrpRetryIntervalIdle)); - VerifyOrReturn( - CheckConstraintMaxValue("value.mrpRetryIntervalIdle.Value()", value.mrpRetryIntervalIdle.Value(), 3600000UL)); - } - if ((mTestIndex - 1) == 14) - { - isExpectedDnssdResult = true; + VerifyOrReturn(CheckValuePresent("value.mrpRetryIntervalIdle", value.mrpRetryIntervalIdle)); + VerifyOrReturn( + CheckConstraintMaxValue("value.mrpRetryIntervalIdle.Value()", value.mrpRetryIntervalIdle.Value(), 3600000UL)); + } + shouldContinue = true; + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValuePresent("value.mrpRetryIntervalActive", value.mrpRetryIntervalActive)); - VerifyOrReturn( - CheckConstraintMaxValue("value.mrpRetryIntervalActive.Value()", value.mrpRetryIntervalActive.Value(), 3600000UL)); - } - if ((mTestIndex - 1) == 15) - { - isExpectedDnssdResult = true; + VerifyOrReturn(CheckValuePresent("value.mrpRetryIntervalActive", value.mrpRetryIntervalActive)); + VerifyOrReturn(CheckConstraintMaxValue("value.mrpRetryIntervalActive.Value()", value.mrpRetryIntervalActive.Value(), + 3600000UL)); + } + shouldContinue = true; + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("commissioningMode", value.commissioningMode, 1)); - } - if ((mTestIndex - 1) == 16) - { - isExpectedDnssdResult = true; + VerifyOrReturn(CheckValue("commissioningMode", value.commissioningMode, 1)); + } + shouldContinue = true; + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintMaxLength("value.deviceName", value.deviceName.size(), 32)); - } - if ((mTestIndex - 1) == 17) - { - isExpectedDnssdResult = true; + VerifyOrReturn(CheckConstraintMaxLength("value.deviceName", value.deviceName.size(), 32)); + } + shouldContinue = true; + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintMaxValue("value.rotatingIdLen", value.rotatingIdLen, 100ULL)); - } - if ((mTestIndex - 1) == 18) - { - isExpectedDnssdResult = true; - } - if ((mTestIndex - 1) == 19) - { - isExpectedDnssdResult = true; + VerifyOrReturn(CheckConstraintMaxValue("value.rotatingIdLen", value.rotatingIdLen, 100ULL)); + } + shouldContinue = true; + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + shouldContinue = true; + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintMaxLength("value.pairingInstruction", value.pairingInstruction.size(), 128)); - } - if ((mTestIndex - 1) == 20) - { - isExpectedDnssdResult = true; + VerifyOrReturn(CheckConstraintMaxLength("value.pairingInstruction", value.pairingInstruction.size(), 128)); + } + shouldContinue = true; + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintMinValue("value.numIPs", value.numIPs, 1)); + VerifyOrReturn(CheckConstraintMinValue("value.numIPs", value.numIPs, 1)); + } + shouldContinue = true; + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + + VerifyOrReturn(CheckConstraintIsUpperCase("value.instanceName", value.instanceName, true)); + VerifyOrReturn(CheckConstraintIsHexString("value.instanceName", value.instanceName, true)); + VerifyOrReturn(CheckConstraintMinLength("value.instanceName", value.instanceName.size(), 16)); + VerifyOrReturn(CheckConstraintMaxLength("value.instanceName", value.instanceName.size(), 16)); + VerifyOrReturn(CheckConstraintNotValue("value.instanceName", value.instanceName, deviceInstanceNameBeforeReboot)); + } + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } - if ((mTestIndex - 1) == 24) - { - isExpectedDnssdResult = true; - VerifyOrReturn(CheckConstraintIsUpperCase("value.instanceName", value.instanceName, true)); - VerifyOrReturn(CheckConstraintIsHexString("value.instanceName", value.instanceName, true)); - VerifyOrReturn(CheckConstraintMinLength("value.instanceName", value.instanceName.size(), 16)); - VerifyOrReturn(CheckConstraintMaxLength("value.instanceName", value.instanceName.size(), 16)); - VerifyOrReturn(CheckConstraintNotValue("value.instanceName", value.instanceName, deviceInstanceNameBeforeReboot)); + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); } - - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); } // @@ -85993,12 +88547,32 @@ class TestLogCommandsSuite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -86581,12 +89155,24 @@ class TestSaveAsSuite : public TestCommand uint8_t * readAttributeOctetStringNotDefaultValueBuffer = nullptr; chip::ByteSpan readAttributeOctetStringNotDefaultValue; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_4(void * context, CHIP_ERROR error) @@ -90229,12 +92815,24 @@ class TestConfigVariablesSuite : public TestCommand uint8_t TestAddArgumentDefaultValue; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -90399,12 +92997,24 @@ class TestDescriptorClusterSuite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -90714,12 +93324,24 @@ class TestBasicInformationSuite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -91012,12 +93634,24 @@ class TestIdentifyClusterSuite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -91155,12 +93789,24 @@ class TestOperationalCredentialsClusterSuite : public TestCommand chip::FabricIndex ourFabricIndex; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -91610,12 +94256,32 @@ class TestModeSelectClusterSuite : public TestCommand uint8_t currentModeBeforeToggle; chip::app::DataModel::Nullable OnModeValue; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -92451,12 +95117,40 @@ class TestSystemCommandsSuite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -92591,12 +95285,24 @@ class TestBindingSuite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -93050,60 +95756,64 @@ class TestMultiAdminSuite : public TestCommand err = TestWaitForTheCommissionedDeviceToBeRetrievedForAlpha_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Open Commissioning Window from alpha\n"); - err = TestOpenCommissioningWindowFromAlpha_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Commission from alpha when the commissioning window is not opened\n"); + err = TestCommissionFromAlphaWhenTheCommissioningWindowIsNotOpened_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Commission from alpha again\n"); - err = TestCommissionFromAlphaAgain_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Open Commissioning Window from alpha\n"); + err = TestOpenCommissioningWindowFromAlpha_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Check that we just have the one fabric and did not add a new one\n"); - err = TestCheckThatWeJustHaveTheOneFabricAndDidNotAddANewOne_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Commission from alpha again\n"); + err = TestCommissionFromAlphaAgain_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Close Commissioning Window after failed commissioning\n"); - err = TestCloseCommissioningWindowAfterFailedCommissioning_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Check that we just have the one fabric and did not add a new one\n"); + err = TestCheckThatWeJustHaveTheOneFabricAndDidNotAddANewOne_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Open Commissioning Window from alpha again\n"); - err = TestOpenCommissioningWindowFromAlphaAgain_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : Close Commissioning Window after failed commissioning\n"); + err = TestCloseCommissioningWindowAfterFailedCommissioning_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Commission from beta\n"); - err = TestCommissionFromBeta_7(); + ChipLogProgress(chipTool, " ***** Test Step 7 : Open Commissioning Window from alpha again\n"); + err = TestOpenCommissioningWindowFromAlphaAgain_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Wait for the commissioned device to be retrieved for beta\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrievedForBeta_8(); + ChipLogProgress(chipTool, " ***** Test Step 8 : Commission from beta\n"); + err = TestCommissionFromBeta_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Open Commissioning Window from beta\n"); - err = TestOpenCommissioningWindowFromBeta_9(); + ChipLogProgress(chipTool, " ***** Test Step 9 : Wait for the commissioned device to be retrieved for beta\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrievedForBeta_9(); break; case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Commission from gamma\n"); - err = TestCommissionFromGamma_10(); + ChipLogProgress(chipTool, " ***** Test Step 10 : Open Commissioning Window from beta\n"); + err = TestOpenCommissioningWindowFromBeta_10(); break; case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Wait for the commissioned device to be retrieved for gamma\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrievedForGamma_11(); + ChipLogProgress(chipTool, " ***** Test Step 11 : Commission from gamma\n"); + err = TestCommissionFromGamma_11(); break; case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : read the mandatory attribute: NodeLabel from alpha\n"); - err = TestReadTheMandatoryAttributeNodeLabelFromAlpha_12(); + ChipLogProgress(chipTool, " ***** Test Step 12 : Wait for the commissioned device to be retrieved for gamma\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrievedForGamma_12(); break; case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : write the mandatory attribute NodeLabel from beta\n"); - err = TestWriteTheMandatoryAttributeNodeLabelFromBeta_13(); + ChipLogProgress(chipTool, " ***** Test Step 13 : read the mandatory attribute: NodeLabel from alpha\n"); + err = TestReadTheMandatoryAttributeNodeLabelFromAlpha_13(); break; case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : read the mandatory attribute: NodeLabel from gamma\n"); - err = TestReadTheMandatoryAttributeNodeLabelFromGamma_14(); + ChipLogProgress(chipTool, " ***** Test Step 14 : write the mandatory attribute NodeLabel from beta\n"); + err = TestWriteTheMandatoryAttributeNodeLabelFromBeta_14(); break; case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : write the mandatory attribute NodeLabel back to default\n"); - err = TestWriteTheMandatoryAttributeNodeLabelBackToDefault_15(); + ChipLogProgress(chipTool, " ***** Test Step 15 : read the mandatory attribute: NodeLabel from gamma\n"); + err = TestReadTheMandatoryAttributeNodeLabelFromGamma_15(); + break; + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : write the mandatory attribute NodeLabel back to default\n"); + err = TestWriteTheMandatoryAttributeNodeLabelBackToDefault_16(); break; } @@ -93121,7 +95831,7 @@ class TestMultiAdminSuite : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 16; + const uint16_t mTestCount = 17; chip::Optional mNodeId; chip::Optional mNodeIdForDuplicateCommissioning; @@ -93135,60 +95845,102 @@ class TestMultiAdminSuite : public TestCommand char * readFromAlphaBuffer = nullptr; chip::CharSpan readFromAlpha; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + VerifyOrReturn(CheckValue("clusterStatus", status.mClusterStatus.HasValue(), true)); + VerifyOrReturn(CheckValue("clusterStatus", status.mClusterStatus.Value(), 9)); + shouldContinue = true; + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } - static void OnFailureCallback_4(void * context, CHIP_ERROR error) + static void OnFailureCallback_5(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_4(error); + (static_cast(context))->OnFailureResponse_5(error); } static void - OnSuccessCallback_4(void * context, + OnSuccessCallback_5(void * context, const chip::app::DataModel::DecodableList< chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptor::DecodableType> & fabrics) { - (static_cast(context))->OnSuccessResponse_4(fabrics); + (static_cast(context))->OnSuccessResponse_5(fabrics); } - static void OnFailureCallback_12(void * context, CHIP_ERROR error) + static void OnFailureCallback_13(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_12(error); + (static_cast(context))->OnFailureResponse_13(error); } - static void OnSuccessCallback_12(void * context, chip::CharSpan nodeLabel) + static void OnSuccessCallback_13(void * context, chip::CharSpan nodeLabel) { - (static_cast(context))->OnSuccessResponse_12(nodeLabel); + (static_cast(context))->OnSuccessResponse_13(nodeLabel); } - static void OnFailureCallback_13(void * context, CHIP_ERROR error) + static void OnFailureCallback_14(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_13(error); + (static_cast(context))->OnFailureResponse_14(error); } - static void OnSuccessCallback_13(void * context) { (static_cast(context))->OnSuccessResponse_13(); } + static void OnSuccessCallback_14(void * context) { (static_cast(context))->OnSuccessResponse_14(); } - static void OnFailureCallback_14(void * context, CHIP_ERROR error) + static void OnFailureCallback_15(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_14(error); + (static_cast(context))->OnFailureResponse_15(error); } - static void OnSuccessCallback_14(void * context, chip::CharSpan nodeLabel) + static void OnSuccessCallback_15(void * context, chip::CharSpan nodeLabel) { - (static_cast(context))->OnSuccessResponse_14(nodeLabel); + (static_cast(context))->OnSuccessResponse_15(nodeLabel); } - static void OnFailureCallback_15(void * context, CHIP_ERROR error) + static void OnFailureCallback_16(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_15(error); + (static_cast(context))->OnFailureResponse_16(error); } - static void OnSuccessCallback_15(void * context) { (static_cast(context))->OnSuccessResponse_15(); } + static void OnSuccessCallback_16(void * context) { (static_cast(context))->OnSuccessResponse_16(); } // // Tests methods @@ -93206,7 +95958,14 @@ class TestMultiAdminSuite : public TestCommand return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); } - CHIP_ERROR TestOpenCommissioningWindowFromAlpha_2() + CHIP_ERROR TestCommissionFromAlphaWhenTheCommissioningWindowIsNotOpened_2() + { + SetIdentity(kIdentityAlpha); + return PairWithQRCode(mNodeIdForDuplicateCommissioning.HasValue() ? mNodeIdForDuplicateCommissioning.Value() : 17ULL, + mPayload.HasValue() ? mPayload.Value() : chip::CharSpan::fromCharString("MT:-24J0AFN00KA0648G00")); + } + + CHIP_ERROR TestOpenCommissioningWindowFromAlpha_3() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; using RequestType = chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type; @@ -93215,11 +95974,11 @@ class TestMultiAdminSuite : public TestCommand request.commissioningTimeout = 180U; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_2(); + (static_cast(context))->OnSuccessResponse_3(); }; auto failure = [](void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_2(error); + (static_cast(context))->OnFailureResponse_3(error); }; ReturnErrorOnFailure( @@ -93227,40 +95986,39 @@ class TestMultiAdminSuite : public TestCommand return CHIP_NO_ERROR; } - void OnFailureResponse_2(CHIP_ERROR error) + void OnFailureResponse_3(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_2() { NextTest(); } + void OnSuccessResponse_3() { NextTest(); } - CHIP_ERROR TestCommissionFromAlphaAgain_3() + CHIP_ERROR TestCommissionFromAlphaAgain_4() { SetIdentity(kIdentityAlpha); return PairWithQRCode(mNodeIdForDuplicateCommissioning.HasValue() ? mNodeIdForDuplicateCommissioning.Value() : 17ULL, - mPayload.HasValue() ? mPayload.Value() : chip::CharSpan::fromCharString("MT:-24J0AFN00KA0648G00"), - CHIP_ERROR_FABRIC_EXISTS); + mPayload.HasValue() ? mPayload.Value() : chip::CharSpan::fromCharString("MT:-24J0AFN00KA0648G00")); } - CHIP_ERROR TestCheckThatWeJustHaveTheOneFabricAndDidNotAddANewOne_4() + CHIP_ERROR TestCheckThatWeJustHaveTheOneFabricAndDidNotAddANewOne_5() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; chip::Controller::OperationalCredentialsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_4, OnFailureCallback_4, false)); + this, OnSuccessCallback_5, OnFailureCallback_5, false)); return CHIP_NO_ERROR; } - void OnFailureResponse_4(CHIP_ERROR error) + void OnFailureResponse_5(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_4(const chip::app::DataModel::DecodableList< + void OnSuccessResponse_5(const chip::app::DataModel::DecodableList< chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptor::DecodableType> & fabrics) { { @@ -93272,7 +96030,7 @@ class TestMultiAdminSuite : public TestCommand NextTest(); } - CHIP_ERROR TestCloseCommissioningWindowAfterFailedCommissioning_5() + CHIP_ERROR TestCloseCommissioningWindowAfterFailedCommissioning_6() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; using RequestType = chip::app::Clusters::AdministratorCommissioning::Commands::RevokeCommissioning::Type; @@ -93280,11 +96038,11 @@ class TestMultiAdminSuite : public TestCommand RequestType request; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_5(); + (static_cast(context))->OnSuccessResponse_6(); }; auto failure = [](void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_5(error); + (static_cast(context))->OnFailureResponse_6(error); }; ReturnErrorOnFailure( @@ -93292,15 +96050,15 @@ class TestMultiAdminSuite : public TestCommand return CHIP_NO_ERROR; } - void OnFailureResponse_5(CHIP_ERROR error) + void OnFailureResponse_6(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_5() { NextTest(); } + void OnSuccessResponse_6() { NextTest(); } - CHIP_ERROR TestOpenCommissioningWindowFromAlphaAgain_6() + CHIP_ERROR TestOpenCommissioningWindowFromAlphaAgain_7() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; using RequestType = chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type; @@ -93309,11 +96067,11 @@ class TestMultiAdminSuite : public TestCommand request.commissioningTimeout = 180U; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_6(); + (static_cast(context))->OnSuccessResponse_7(); }; auto failure = [](void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_6(error); + (static_cast(context))->OnFailureResponse_7(error); }; ReturnErrorOnFailure( @@ -93321,28 +96079,28 @@ class TestMultiAdminSuite : public TestCommand return CHIP_NO_ERROR; } - void OnFailureResponse_6(CHIP_ERROR error) + void OnFailureResponse_7(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_6() { NextTest(); } + void OnSuccessResponse_7() { NextTest(); } - CHIP_ERROR TestCommissionFromBeta_7() + CHIP_ERROR TestCommissionFromBeta_8() { SetIdentity(kIdentityBeta); return PairWithQRCode(mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL, mPayload.HasValue() ? mPayload.Value() : chip::CharSpan::fromCharString("MT:-24J0AFN00KA0648G00")); } - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrievedForBeta_8() + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrievedForBeta_9() { SetIdentity(kIdentityBeta); return WaitForCommissionee(mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL); } - CHIP_ERROR TestOpenCommissioningWindowFromBeta_9() + CHIP_ERROR TestOpenCommissioningWindowFromBeta_10() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; using RequestType = chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type; @@ -93351,11 +96109,11 @@ class TestMultiAdminSuite : public TestCommand request.commissioningTimeout = 180U; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_9(); + (static_cast(context))->OnSuccessResponse_10(); }; auto failure = [](void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_9(error); + (static_cast(context))->OnFailureResponse_10(error); }; ReturnErrorOnFailure( @@ -93363,45 +96121,45 @@ class TestMultiAdminSuite : public TestCommand return CHIP_NO_ERROR; } - void OnFailureResponse_9(CHIP_ERROR error) + void OnFailureResponse_10(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_9() { NextTest(); } + void OnSuccessResponse_10() { NextTest(); } - CHIP_ERROR TestCommissionFromGamma_10() + CHIP_ERROR TestCommissionFromGamma_11() { SetIdentity(kIdentityGamma); return PairWithQRCode(mNodeId3.HasValue() ? mNodeId3.Value() : 12586990ULL, mPayload.HasValue() ? mPayload.Value() : chip::CharSpan::fromCharString("MT:-24J0AFN00KA0648G00")); } - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrievedForGamma_11() + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrievedForGamma_12() { SetIdentity(kIdentityGamma); return WaitForCommissionee(mNodeId3.HasValue() ? mNodeId3.Value() : 12586990ULL); } - CHIP_ERROR TestReadTheMandatoryAttributeNodeLabelFromAlpha_12() + CHIP_ERROR TestReadTheMandatoryAttributeNodeLabelFromAlpha_13() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; chip::Controller::BasicClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_12, OnFailureCallback_12, true)); + this, OnSuccessCallback_13, OnFailureCallback_13, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_12(CHIP_ERROR error) + void OnFailureResponse_13(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_12(chip::CharSpan nodeLabel) + void OnSuccessResponse_13(chip::CharSpan nodeLabel) { VerifyOrReturn(CheckValueAsString("nodeLabel", nodeLabel, chip::CharSpan("", 0))); @@ -93415,7 +96173,7 @@ class TestMultiAdminSuite : public TestCommand NextTest(); } - CHIP_ERROR TestWriteTheMandatoryAttributeNodeLabelFromBeta_13() + CHIP_ERROR TestWriteTheMandatoryAttributeNodeLabelFromBeta_14() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; chip::Controller::BasicClusterTest cluster; @@ -93425,43 +96183,43 @@ class TestMultiAdminSuite : public TestCommand nodeLabelArgument = chip::Span("written from betagarbage: not in length on purpose", 17); ReturnErrorOnFailure(cluster.WriteAttribute( - nodeLabelArgument, this, OnSuccessCallback_13, OnFailureCallback_13)); + nodeLabelArgument, this, OnSuccessCallback_14, OnFailureCallback_14)); return CHIP_NO_ERROR; } - void OnFailureResponse_13(CHIP_ERROR error) + void OnFailureResponse_14(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_13() { NextTest(); } + void OnSuccessResponse_14() { NextTest(); } - CHIP_ERROR TestReadTheMandatoryAttributeNodeLabelFromGamma_14() + CHIP_ERROR TestReadTheMandatoryAttributeNodeLabelFromGamma_15() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; chip::Controller::BasicClusterTest cluster; cluster.Associate(mDevices[kIdentityGamma], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_14, OnFailureCallback_14, true)); + this, OnSuccessCallback_15, OnFailureCallback_15, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_14(CHIP_ERROR error) + void OnFailureResponse_15(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_14(chip::CharSpan nodeLabel) + void OnSuccessResponse_15(chip::CharSpan nodeLabel) { VerifyOrReturn(CheckConstraintNotValue("nodeLabel", nodeLabel, readFromAlpha)); NextTest(); } - CHIP_ERROR TestWriteTheMandatoryAttributeNodeLabelBackToDefault_15() + CHIP_ERROR TestWriteTheMandatoryAttributeNodeLabelBackToDefault_16() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; chip::Controller::BasicClusterTest cluster; @@ -93471,17 +96229,17 @@ class TestMultiAdminSuite : public TestCommand nodeLabelArgument = readFromAlpha; ReturnErrorOnFailure(cluster.WriteAttribute( - nodeLabelArgument, this, OnSuccessCallback_15, OnFailureCallback_15)); + nodeLabelArgument, this, OnSuccessCallback_16, OnFailureCallback_16)); return CHIP_NO_ERROR; } - void OnFailureResponse_15(CHIP_ERROR error) + void OnFailureResponse_16(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_15() { NextTest(); } + void OnSuccessResponse_16() { NextTest(); } }; class Test_TC_SWDIAG_1_1Suite : public TestCommand @@ -93581,12 +96339,24 @@ class Test_TC_SWDIAG_1_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -93800,12 +96570,20 @@ class Test_TC_SWDIAG_2_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -93906,12 +96684,24 @@ class Test_TC_SWDIAG_3_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_2(void * context, CHIP_ERROR error) @@ -94113,12 +96903,24 @@ class TestSubscribe_OnOffSuite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } typedef void (*Test_TestSubscribe_OnOff_OnOff_ReportCallback)(void * context, bool value); @@ -94858,12 +97660,24 @@ class DL_UsersAndCredentialsSuite : public TestCommand uint16_t NumberOfPINUsersSupported; uint16_t NumberOfRFIDUsersSupported; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_2(void * context, CHIP_ERROR error) @@ -99879,12 +102693,24 @@ class DL_LockUnlockSuite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_3(void * context, CHIP_ERROR error) @@ -100653,12 +103479,24 @@ class DL_SchedulesSuite : public TestCommand uint8_t NumberOfWeekDaySchedulesSupportedPerUser; uint8_t NumberOfYearDaySchedulesSupportedPerUser; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_2(void * context, CHIP_ERROR error) @@ -103936,12 +106774,24 @@ class TestGroupMessagingSuite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_5(void * context, CHIP_ERROR error) @@ -104608,12 +107458,24 @@ class TestGroupsClusterSuite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -105429,12 +108291,24 @@ class TestGroupKeyManagementClusterSuite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -106194,12 +109068,24 @@ class Test_TC_DD_1_5Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -106288,12 +109174,32 @@ class Test_TC_DD_1_6Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -106391,12 +109297,28 @@ class Test_TC_DD_1_7Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -106487,12 +109409,28 @@ class Test_TC_DD_1_8Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -106586,12 +109524,32 @@ class Test_TC_DD_1_9Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -106680,12 +109638,20 @@ class Test_TC_DD_1_10Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -106755,12 +109721,20 @@ class Test_TC_DD_2_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -106830,12 +109804,20 @@ class Test_TC_DD_2_2Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -106905,12 +109887,20 @@ class Test_TC_DD_3_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -106980,12 +109970,20 @@ class Test_TC_DD_3_2Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -107055,89 +110053,105 @@ class Test_TC_DD_3_5Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + // + // Tests methods + // +}; + +class Test_TC_DD_3_6Suite : public TestCommand +{ +public: + Test_TC_DD_3_6Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_DD_3_6", credsIssuerConfig), mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DD_3_6Suite() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_DD_3_6\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DD_3_6\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); + } + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 0; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); - } - - // - // Tests methods - // -}; - -class Test_TC_DD_3_6Suite : public TestCommand -{ -public: - Test_TC_DD_3_6Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_DD_3_6", credsIssuerConfig), mTestIndex(0) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - - ~Test_TC_DD_3_6Suite() {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) + switch (mTestIndex - 1) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_DD_3_6\n"); + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } - if (mTestCount == mTestIndex) + if (shouldContinue) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DD_3_6\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); + ContinueOnChipMainThread(CHIP_NO_ERROR); } } - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 0; - - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override - { - bool isExpectedDnssdResult = false; - - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); - } - // // Tests methods // @@ -107205,12 +110219,20 @@ class Test_TC_DD_3_9Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -107280,12 +110302,20 @@ class Test_TC_DD_3_10Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -107355,12 +110385,20 @@ class Test_TC_DD_3_11Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -107430,12 +110468,20 @@ class Test_TC_DD_3_12Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -107505,12 +110551,20 @@ class Test_TC_DD_3_13Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -107580,12 +110634,20 @@ class Test_TC_DD_3_14Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -107655,12 +110717,20 @@ class Test_TC_DD_4_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -107814,12 +110884,64 @@ class TestGroupDemoCommandSuite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -108295,12 +111417,24 @@ class TestGroupDemoConfigSuite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_3(void * context, CHIP_ERROR error) @@ -108563,12 +111697,20 @@ class Test_TC_BDX_1_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -108638,12 +111780,20 @@ class Test_TC_BDX_1_2Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -108713,12 +111863,20 @@ class Test_TC_BDX_1_3Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -108788,12 +111946,20 @@ class Test_TC_BDX_1_5Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -108863,12 +112029,20 @@ class Test_TC_BDX_1_6Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -108938,12 +112112,20 @@ class Test_TC_BDX_2_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -109013,87 +112195,103 @@ class Test_TC_BDX_2_2Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + // + // Tests methods + // +}; + +class Test_TC_BDX_2_3Suite : public TestCommand +{ +public: + Test_TC_BDX_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_BDX_2_3", credsIssuerConfig), mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_BDX_2_3Suite() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_BDX_2_3\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_BDX_2_3\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); + } + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 0; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); - } - - // - // Tests methods - // -}; - -class Test_TC_BDX_2_3Suite : public TestCommand -{ -public: - Test_TC_BDX_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_BDX_2_3", credsIssuerConfig), mTestIndex(0) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - - ~Test_TC_BDX_2_3Suite() {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) + switch (mTestIndex - 1) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_BDX_2_3\n"); + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } - if (mTestCount == mTestIndex) + if (shouldContinue) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_BDX_2_3\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; + ContinueOnChipMainThread(CHIP_NO_ERROR); } - - 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); - } - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 0; - - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override - { - bool isExpectedDnssdResult = false; - - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); } // @@ -109163,12 +112361,20 @@ class Test_TC_BDX_2_4Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -109238,12 +112444,20 @@ class Test_TC_BDX_2_5Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -109312,12 +112526,20 @@ class Test_TC_BR_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -109386,12 +112608,20 @@ class Test_TC_BR_2Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -109460,12 +112690,20 @@ class Test_TC_BR_3Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -109535,12 +112773,20 @@ class Test_TC_BRAC_2_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -109610,12 +112856,20 @@ class Test_TC_BRAC_2_2Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -109685,12 +112939,20 @@ class Test_TC_DM_1_2Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -109760,12 +113022,20 @@ class Test_TC_DM_1_4Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -109835,12 +113105,20 @@ class Test_TC_DM_2_3Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -109910,12 +113188,20 @@ class Test_TC_DM_2_4Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -109985,12 +113271,20 @@ class Test_TC_DM_3_2Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -110060,12 +113354,20 @@ class Test_TC_DM_3_4Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -110135,12 +113437,20 @@ class Test_TC_DIAG_LOG_1_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -110210,12 +113520,20 @@ class Test_TC_DIAG_LOG_1_2Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -110285,12 +113603,20 @@ class Test_TC_DIAG_LOG_1_3Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -110360,12 +113686,20 @@ class Test_TC_DESC_1_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -110435,12 +113769,20 @@ class Test_TC_ETHDIAG_1_2Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -110510,12 +113852,20 @@ class Test_TC_GC_1_2Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -110585,12 +113935,20 @@ class Test_TC_GC_1_3Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -110660,12 +114018,20 @@ class Test_TC_GENDIAG_1_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -110735,12 +114101,20 @@ class Test_TC_GENDIAG_1_2Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -110810,12 +114184,20 @@ class Test_TC_GENDIAG_2_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -110885,12 +114267,20 @@ class Test_TC_I_2_2Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -110960,12 +114350,20 @@ class Test_TC_ILL_2_2Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -111035,12 +114433,20 @@ class Test_TC_IDM_1_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -111110,12 +114516,20 @@ class Test_TC_IDM_1_2Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -111185,12 +114599,20 @@ class Test_TC_IDM_2_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -111260,12 +114682,20 @@ class Test_TC_IDM_2_2Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -111335,12 +114765,20 @@ class Test_TC_IDM_3_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -111410,12 +114848,20 @@ class Test_TC_IDM_3_2Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -111485,12 +114931,20 @@ class Test_TC_IDM_4_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -111560,12 +115014,20 @@ class Test_TC_IDM_4_2Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -111635,12 +115097,20 @@ class Test_TC_IDM_5_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -111710,12 +115180,20 @@ class Test_TC_IDM_5_2Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -111785,12 +115263,20 @@ class Test_TC_IDM_6_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -111860,12 +115346,20 @@ class Test_TC_IDM_6_2Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -111935,12 +115429,20 @@ class Test_TC_IDM_6_3Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -112010,12 +115512,20 @@ class Test_TC_IDM_6_4Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -112085,12 +115595,20 @@ class Test_TC_MC_3_12Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -112160,12 +115678,20 @@ class Test_TC_MC_3_13Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -112235,12 +115761,20 @@ class Test_TC_MC_4_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -112310,12 +115844,20 @@ class Test_TC_MC_8_2Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -112385,12 +115927,20 @@ class Test_TC_MC_9_2Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -112460,12 +116010,20 @@ class Test_TC_MC_10_2Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -112535,12 +116093,20 @@ class Test_TC_MC_10_3Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -112610,12 +116176,20 @@ class Test_TC_MC_10_4Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -112685,12 +116259,20 @@ class Test_TC_MC_10_5Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -112760,12 +116342,20 @@ class Test_TC_MC_10_6Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -112835,12 +116425,20 @@ class Test_TC_MF_1_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -112910,12 +116508,20 @@ class Test_TC_MF_1_2Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -113061,12 +116667,36 @@ class Test_TC_MF_1_3Suite : public TestCommand chip::Optional mPayload; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_5(void * context, CHIP_ERROR error) @@ -113556,12 +117186,20 @@ class Test_TC_MF_1_5Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -113631,12 +117269,20 @@ class Test_TC_MF_1_6Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -113706,12 +117352,20 @@ class Test_TC_MF_1_7Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -113781,12 +117435,20 @@ class Test_TC_MF_1_8Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -113856,12 +117518,20 @@ class Test_TC_MF_1_9Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -113931,12 +117601,20 @@ class Test_TC_MF_1_10Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -114006,12 +117684,20 @@ class Test_TC_MF_1_11Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -114081,12 +117767,20 @@ class Test_TC_MF_1_12Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -114156,12 +117850,20 @@ class Test_TC_MF_1_13Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -114231,12 +117933,20 @@ class Test_TC_MF_1_14Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -114306,12 +118016,20 @@ class Test_TC_MF_1_15Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -114381,12 +118099,20 @@ class Test_TC_MF_1_16Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -114456,12 +118182,20 @@ class Test_TC_MF_1_17Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -114531,12 +118265,20 @@ class Test_TC_MF_1_18Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -114606,12 +118348,20 @@ class Test_TC_MF_1_19Suite : public TestCommand chip::Optional mNodeId; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -114681,12 +118431,20 @@ class Test_TC_MF_1_20Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -114756,12 +118514,20 @@ class Test_TC_MF_1_21Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -114831,12 +118597,20 @@ class Test_TC_MF_1_22Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -114906,12 +118680,20 @@ class Test_TC_MF_1_23Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -114981,12 +118763,20 @@ class Test_TC_MF_1_24Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -115056,12 +118846,20 @@ class Test_TC_MF_1_25Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -115131,12 +118929,20 @@ class Test_TC_MF_1_26Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -115206,12 +119012,20 @@ class Test_TC_MF_1_27Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -115281,12 +119095,20 @@ class Test_TC_MF_1_28Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -115356,12 +119178,20 @@ class Test_TC_MOD_1_2Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -115431,12 +119261,20 @@ class Test_TC_MOD_2_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -115506,12 +119344,20 @@ class Test_TC_MOD_2_2Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -115581,12 +119427,20 @@ class Test_TC_MOD_3_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -115656,12 +119510,20 @@ class Test_TC_MOD_3_2Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -115731,12 +119593,20 @@ class Test_TC_MOD_3_3Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -115806,12 +119676,20 @@ class Test_TC_SU_1_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -115881,12 +119759,20 @@ class Test_TC_SU_2_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -115956,12 +119842,20 @@ class Test_TC_SU_2_2Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -116031,12 +119925,20 @@ class Test_TC_SU_2_3Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -116106,12 +120008,20 @@ class Test_TC_SU_2_4Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -116181,12 +120091,20 @@ class Test_TC_SU_2_5Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -116256,12 +120174,20 @@ class Test_TC_SU_2_6Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -116331,12 +120257,20 @@ class Test_TC_SU_2_7Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -116406,12 +120340,20 @@ class Test_TC_SU_3_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -116481,12 +120423,20 @@ class Test_TC_SU_3_2Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -116556,12 +120506,20 @@ class Test_TC_SU_3_3Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -116631,12 +120589,20 @@ class Test_TC_SU_3_4Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -116706,12 +120672,20 @@ class Test_TC_SU_4_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -116781,12 +120755,20 @@ class Test_TC_SU_4_2Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -116856,12 +120838,20 @@ class Test_TC_PSCFG_1_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -116931,12 +120921,20 @@ class Test_TC_PSCFG_2_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -117006,12 +121004,20 @@ class Test_TC_PSCFG_3_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -117081,12 +121087,20 @@ class Test_TC_SC_4_5Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -117156,12 +121170,20 @@ class Test_TC_SC_4_6Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -117231,12 +121253,20 @@ class Test_TC_SC_4_7Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -117306,12 +121336,20 @@ class Test_TC_SC_4_8Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -117381,12 +121419,20 @@ class Test_TC_SC_4_9Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -117456,12 +121502,20 @@ class Test_TC_SWDIAG_1_2Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -117531,12 +121585,20 @@ class Test_TC_WIFIDIAG_1_2Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -117606,12 +121668,20 @@ class Test_TC_WIFIDIAG_2_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -117681,12 +121751,20 @@ class Test_TC_WNCV_2_3Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -117756,12 +121834,20 @@ class Test_TC_WNCV_6_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -117831,12 +121917,20 @@ class Test_TC_FLW_3_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -117906,12 +122000,20 @@ class Test_TC_OCC_2_3Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -117981,12 +122083,20 @@ class Test_TC_OCC_2_4Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -118056,12 +122166,20 @@ class Test_TC_OCC_3_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -118131,12 +122249,20 @@ class Test_TC_OO_2_4Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -118206,12 +122332,20 @@ class Test_TC_PRS_2_2Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -118281,12 +122415,20 @@ class Test_TC_PRS_2_3Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -118356,12 +122498,20 @@ class Test_TC_PS_2_2Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // diff --git a/zzz_generated/placeholder/app1/zap-generated/test/Commands.h b/zzz_generated/placeholder/app1/zap-generated/test/Commands.h index e4572efc066c06..88f428d15118de 100644 --- a/zzz_generated/placeholder/app1/zap-generated/test/Commands.h +++ b/zzz_generated/placeholder/app1/zap-generated/test/Commands.h @@ -161,12 +161,28 @@ class Test_TC_DM_1_3_SimulatedSuite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -494,12 +510,24 @@ class Test_TC_DM_3_3_SimulatedSuite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -678,12 +706,24 @@ class Test_TC_DM_2_3_SimulatedSuite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // diff --git a/zzz_generated/placeholder/app2/zap-generated/test/Commands.h b/zzz_generated/placeholder/app2/zap-generated/test/Commands.h index e4572efc066c06..88f428d15118de 100644 --- a/zzz_generated/placeholder/app2/zap-generated/test/Commands.h +++ b/zzz_generated/placeholder/app2/zap-generated/test/Commands.h @@ -161,12 +161,28 @@ class Test_TC_DM_1_3_SimulatedSuite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -494,12 +510,24 @@ class Test_TC_DM_3_3_SimulatedSuite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -678,12 +706,24 @@ class Test_TC_DM_2_3_SimulatedSuite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } //