From dac48571f12579b3b3d3c00b053fd18ec0f86ff5 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Tue, 5 Apr 2022 11:20:43 +0200 Subject: [PATCH] [YAML] Issue an error on pairing timeout (#16774) --- .../templates/partials/test_cluster.zapt | 3 +- .../chip-tool/commands/tests/TestCommand.h | 6 + examples/chip-tool/templates/tests/helper.js | 31 +- .../tests/partials/test_cluster.zapt | 43 +- .../tests/partials/test_step_response.zapt | 42 + .../chip-tool/templates/tests/templates.json | 4 + examples/placeholder/templates/templates.json | 4 + src/app/tests/suites/TestMultiAdmin.yaml | 17 +- .../commissioner/CommissionerCommands.cpp | 82 +- .../commissioner/CommissionerCommands.h | 10 +- .../tests/suites/commands/discovery/BUILD.gn | 1 + .../commands/discovery/DiscoveryCommands.cpp | 134 +- .../commands/discovery/DiscoveryCommands.h | 24 +- src/app/tests/suites/include/ValueChecker.h | 11 + .../common/ClusterTestGeneration.js | 18 +- .../clusters/DiscoveryCommands.js | 22 + src/controller/CHIPDeviceController.cpp | 2 + src/controller/SetUpCodePairer.cpp | 21 +- src/controller/SetUpCodePairer.h | 5 + .../tests/partials/test_cluster.zapt | 2 +- src/lib/core/CHIPConfig.h | 12 + .../chip-tool/zap-generated/test/Commands.h | 7848 +++++++++++++---- .../app1/zap-generated/test/Commands.h | 64 +- .../app2/zap-generated/test/Commands.h | 64 +- 24 files changed, 6569 insertions(+), 1901 deletions(-) create mode 100644 examples/chip-tool/templates/tests/partials/test_step_response.zapt diff --git a/examples/chip-tool-darwin/templates/partials/test_cluster.zapt b/examples/chip-tool-darwin/templates/partials/test_cluster.zapt index 9f2ac193e903da..3b49c707311442 100644 --- a/examples/chip-tool-darwin/templates/partials/test_cluster.zapt +++ b/examples/chip-tool-darwin/templates/partials/test_cluster.zapt @@ -107,8 +107,7 @@ class {{filename}}: public TestCommandBridge {{else}} {{#if (isString type)}}@"{{/if}}{{definedValue}}{{#if (isString type)}}"{{/if}} {{~/if~}} - {{/chip_tests_item_parameters}} - {{additionalArguments}}); + {{/chip_tests_item_parameters}}); {{else}} CHIPDevice * device = GetConnectedDevice(); CHIPTest{{asUpperCamelCase cluster}} * cluster = [[CHIPTest{{asUpperCamelCase cluster}} alloc] initWithDevice:device endpoint:{{endpoint}} queue:mCallbackQueue]; diff --git a/examples/chip-tool/commands/tests/TestCommand.h b/examples/chip-tool/commands/tests/TestCommand.h index c84eee4da44fb4..848f285ecab875 100644 --- a/examples/chip-tool/commands/tests/TestCommand.h +++ b/examples/chip-tool/commands/tests/TestCommand.h @@ -86,6 +86,12 @@ class TestCommand : public CHIPCommand, chip::Callback::Callback mOnDeviceConnectedCallback; chip::Callback::Callback mOnDeviceConnectionFailureCallback; + bool IsUnsupported(const chip::app::StatusIB & status) + { + return status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute || + status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedCommand; + } + void Wait() { if (mDelayInMs.HasValue()) diff --git a/examples/chip-tool/templates/tests/helper.js b/examples/chip-tool/templates/tests/helper.js index 93a3c3c09cf072..83021e5535bc30 100644 --- a/examples/chip-tool/templates/tests/helper.js +++ b/examples/chip-tool/templates/tests/helper.js @@ -15,7 +15,8 @@ * limitations under the License. */ -const { asLowerCamelCase } = require('../../../../src/app/zap-templates/templates/app/helper.js'); +const { zapTypeToDecodableClusterObjectType, asUpperCamelCase, asLowerCamelCase } += require('../../../../src/app/zap-templates/templates/app/helper.js'); const { isTestOnlyCluster } = require('../../../../src/app/zap-templates/common/simulated-clusters/SimulatedClusters.js'); function utf8StringLength(str) @@ -47,8 +48,36 @@ function asPropertyValue(options) return name; } +async function asDecodableType() +{ + // Copy some properties needed by zapTypeToDecodableClusterObjectType + let target = { global : this.global, entryType : this.entryType }; + + let type; + if ('commandObject' in this) { + type = this.commandObject.responseName; + } else if ('attributeObject' in this) { + type = this.attributeObject.type; + target.isArray = this.attributeObject.isArray; + target.isOptional = this.attributeObject.isOptional; + target.isNullable = this.attributeObject.isNullable; + } else if ('eventObject' in this) { + type = this.eventObject.type; + } else { + throw new Error("Unsupported decodable type"); + } + + if (isTestOnlyCluster(this.cluster) || 'commandObject' in this) { + return `chip::app::Clusters::${asUpperCamelCase(this.cluster)}::Commands::${asUpperCamelCase(type)}::DecodableType`; + } + + const options = { 'hash' : { ns : this.cluster } }; + return await zapTypeToDecodableClusterObjectType.call(target, type, options); +} + // // Module exports // exports.utf8StringLength = utf8StringLength; exports.asPropertyValue = asPropertyValue; +exports.asDecodableType = asDecodableType; diff --git a/examples/chip-tool/templates/tests/partials/test_cluster.zapt b/examples/chip-tool/templates/tests/partials/test_cluster.zapt index e2a1fa4c96489d..35149bc8043574 100644 --- a/examples/chip-tool/templates/tests/partials/test_cluster.zapt +++ b/examples/chip-tool/templates/tests/partials/test_cluster.zapt @@ -83,25 +83,31 @@ class {{filename}}Suite: public TestCommand {{>setupSaveAs}} - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override { - bool isExpectedDnssdResult = false; - {{#chip_tests_items}} - {{#if (isStrEqual cluster "DiscoveryCommands")}} - if ((mTestIndex - 1) == {{index}}) - { - isExpectedDnssdResult = true; - {{#chip_tests_item_response_parameters}} - {{>maybeCheckExpectedValue}} - {{>maybeCheckExpectedConstraints}} - {{>maybeSaveAs}} - {{/chip_tests_item_response_parameters}} - } - {{/if}} - {{/chip_tests_items}} + bool shouldContinue = false; - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + switch (mTestIndex - 1) + { + {{#chip_tests_items}} + {{! + This check can be removed once the cluster APIs have been converted from Invoke to + ReadClient/WriteClient/CommandSender + }} + {{~#if (isTestOnlyCluster cluster)~}} + case {{index}}: + {{>test_step_response}} + break; + {{/if~}} + {{/chip_tests_items}} + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } {{! Helper around zapTypeToDecodableClusterObjectType that lets us set the @@ -203,8 +209,7 @@ class {{filename}}Suite: public TestCommand {{~else if (isString type)}}"{{definedValue}}" {{else}}{{definedValue}} {{~/if~}} - {{/chip_tests_item_parameters}} - {{additionalArguments}}); + {{/chip_tests_item_parameters}}); } {{else if isWait}} CHIP_ERROR {{>testCommand}}() diff --git a/examples/chip-tool/templates/tests/partials/test_step_response.zapt b/examples/chip-tool/templates/tests/partials/test_step_response.zapt new file mode 100644 index 00000000000000..3957c03d9c1cf2 --- /dev/null +++ b/examples/chip-tool/templates/tests/partials/test_step_response.zapt @@ -0,0 +1,42 @@ +{{~#*inline "maybeCheckClusterError"}} +{{#if response.clusterError}} + VerifyOrReturn(CheckValue("clusterStatus", status.mClusterStatus.HasValue(), true)); + VerifyOrReturn(CheckValue("clusterStatus", status.mClusterStatus.Value(), {{response.clusterError}})); +{{/if}} +{{/inline~}} + +{{~#*inline "maybeContinueWithoutWaitingOnDone"}} + {{~#if isWaitForReport}}shouldContinue = true;{{/if~}} + {{~#if (isTestOnlyCluster cluster)}}shouldContinue = true;{{/if~}} +{{/inline~}} + +{{~#*inline "maybeReturnOnUnsupported"}} +{{~#if optional}} + if (IsUnsupported(status.mStatus)) + { + {{>maybeContinueWithoutWaitingOnDone}} + return; + } +{{/if~}} +{{/inline~}} + +{{! --- Test Step Response Content --}} +{{#if response.error}} + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), {{response.error}})); + {{>maybeCheckClusterError}} +{{else}} + {{>maybeReturnOnUnsupported}} + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), {{response.error}})); + {{#if hasSpecificResponse}} + { + {{asDecodableType}} value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + {{#chip_tests_item_response_parameters}} + {{>maybeCheckExpectedValue}} + {{>maybeCheckExpectedConstraints}} + {{>maybeSaveAs}} + {{/chip_tests_item_response_parameters}} + } + {{/if}} +{{/if}} +{{>maybeContinueWithoutWaitingOnDone}} diff --git a/examples/chip-tool/templates/tests/templates.json b/examples/chip-tool/templates/tests/templates.json index dade4fa1273d74..7b95d4e1e2df79 100644 --- a/examples/chip-tool/templates/tests/templates.json +++ b/examples/chip-tool/templates/tests/templates.json @@ -21,6 +21,10 @@ "name": "test_cluster", "path": "partials/test_cluster.zapt" }, + { + "name": "test_step_response", + "path": "partials/test_step_response.zapt" + }, { "name": "maybeCheckExpectedValue", "path": "partials/checks/maybeCheckExpectedValue.zapt" diff --git a/examples/placeholder/templates/templates.json b/examples/placeholder/templates/templates.json index 9df7b8de4e2b60..fc2b2cc85a20bb 100644 --- a/examples/placeholder/templates/templates.json +++ b/examples/placeholder/templates/templates.json @@ -21,6 +21,10 @@ "name": "test_cluster", "path": "../../../examples/chip-tool/templates/tests/partials/test_cluster.zapt" }, + { + "name": "test_step_response", + "path": "../../../examples/chip-tool/templates/tests/partials/test_step_response.zapt" + }, { "name": "maybeCheckExpectedValue", "path": "../../../examples/chip-tool/templates/tests/partials/checks/maybeCheckExpectedValue.zapt" diff --git a/src/app/tests/suites/TestMultiAdmin.yaml b/src/app/tests/suites/TestMultiAdmin.yaml index 27067c9eb8fc03..f5397a42988187 100644 --- a/src/app/tests/suites/TestMultiAdmin.yaml +++ b/src/app/tests/suites/TestMultiAdmin.yaml @@ -50,6 +50,19 @@ tests: - name: "nodeId" value: nodeId + - label: "Commission from alpha when the commissioning window is not opened" + identity: "alpha" + cluster: "CommissionerCommands" + command: "PairWithQRCode" + arguments: + values: + - name: "nodeId" + value: nodeIdForDuplicateCommissioning + - name: "payload" + value: payload + response: + error: FAILURE + - label: "Open Commissioning Window from alpha" cluster: "AdministratorCommissioning" command: "OpenBasicCommissioningWindow" @@ -63,13 +76,15 @@ tests: identity: "alpha" cluster: "CommissionerCommands" command: "PairWithQRCode" - additionalArguments: ", CHIP_ERROR_FABRIC_EXISTS" arguments: values: - name: "nodeId" value: nodeIdForDuplicateCommissioning - name: "payload" value: payload + response: + error: FAILURE + clusterError: 0x09 #OperationalCertStatus::kFabricConflict - label: "Check that we just have the one fabric and did not add a new one" identity: "alpha" diff --git a/src/app/tests/suites/commands/commissioner/CommissionerCommands.cpp b/src/app/tests/suites/commands/commissioner/CommissionerCommands.cpp index 49e2b0a9ca46d1..c4e4b6448f44d9 100644 --- a/src/app/tests/suites/commands/commissioner/CommissionerCommands.cpp +++ b/src/app/tests/suites/commands/commissioner/CommissionerCommands.cpp @@ -20,12 +20,10 @@ constexpr uint16_t kPayloadMaxSize = 64; -CHIP_ERROR CommissionerCommands::PairWithQRCode(chip::NodeId nodeId, const chip::CharSpan payload, CHIP_ERROR expectedStatus) +CHIP_ERROR CommissionerCommands::PairWithQRCode(chip::NodeId nodeId, const chip::CharSpan payload) { VerifyOrReturnError(payload.size() > 0 && payload.size() < kPayloadMaxSize, CHIP_ERROR_INVALID_ARGUMENT); - mExpectedStatus = expectedStatus; - GetCurrentCommissioner().RegisterPairingDelegate(this); char qrCode[kPayloadMaxSize]; @@ -37,8 +35,6 @@ CHIP_ERROR CommissionerCommands::PairWithManualCode(chip::NodeId nodeId, const c { VerifyOrReturnError(payload.size() > 0 && payload.size() < kPayloadMaxSize, CHIP_ERROR_INVALID_ARGUMENT); - mExpectedStatus = CHIP_NO_ERROR; - GetCurrentCommissioner().RegisterPairingDelegate(this); char manualCode[kPayloadMaxSize]; @@ -48,11 +44,42 @@ CHIP_ERROR CommissionerCommands::PairWithManualCode(chip::NodeId nodeId, const c CHIP_ERROR CommissionerCommands::Unpair(chip::NodeId nodeId) { - mExpectedStatus = CHIP_NO_ERROR; - return GetCurrentCommissioner().UnpairDevice(nodeId); } +chip::app::StatusIB ConvertToStatusIB(CHIP_ERROR err) +{ + using chip::app::StatusIB; + using namespace chip; + using namespace chip::Protocols::InteractionModel; + using namespace chip::app::Clusters::OperationalCredentials; + + if (CHIP_ERROR_INVALID_PUBLIC_KEY == err) + { + return StatusIB(Status::Failure, to_underlying(OperationalCertStatus::kInvalidPublicKey)); + } + else if (CHIP_ERROR_WRONG_NODE_ID == err) + { + return StatusIB(Status::Failure, to_underlying(OperationalCertStatus::kInvalidNodeOpId)); + } + else if (CHIP_ERROR_UNSUPPORTED_CERT_FORMAT == err) + { + return StatusIB(Status::Failure, to_underlying(OperationalCertStatus::kInvalidNOC)); + } + else if (CHIP_ERROR_FABRIC_EXISTS == err) + { + return StatusIB(Status::Failure, to_underlying(OperationalCertStatus::kFabricConflict)); + } + else if (CHIP_ERROR_INVALID_FABRIC_ID == err) + { + return StatusIB(Status::Failure, to_underlying(OperationalCertStatus::kInvalidFabricIndex)); + } + else + { + return StatusIB(err); + } +} + void CommissionerCommands::OnStatusUpdate(DevicePairingDelegate::Status status) { switch (status) @@ -62,6 +89,7 @@ void CommissionerCommands::OnStatusUpdate(DevicePairingDelegate::Status status) break; case DevicePairingDelegate::Status::SecurePairingFailed: ChipLogError(chipTool, "Secure Pairing Failed"); + OnResponse(ConvertToStatusIB(CHIP_ERROR_INCORRECT_STATE), nullptr); break; } } @@ -71,52 +99,26 @@ void CommissionerCommands::OnPairingComplete(CHIP_ERROR err) if (CHIP_NO_ERROR != err) { ChipLogError(chipTool, "Pairing Complete Failure: %s", ErrorStr(err)); - LogErrorOnFailure(ContinueOnChipMainThread(err)); + OnResponse(ConvertToStatusIB(err), nullptr); } } void CommissionerCommands::OnPairingDeleted(CHIP_ERROR err) { - if (mExpectedStatus != err) + if (err != CHIP_NO_ERROR) { - if (err != CHIP_NO_ERROR) - { - ChipLogError(chipTool, "Pairing Delete Failure: %s", ErrorStr(err)); - } - else - { - ChipLogError(chipTool, "Got success but expected: %s", ErrorStr(mExpectedStatus)); - err = CHIP_ERROR_INCORRECT_STATE; - } - } - else - { - // Treat as success. - err = CHIP_NO_ERROR; + ChipLogError(chipTool, "Pairing Delete Failure: %s", ErrorStr(err)); } - LogErrorOnFailure(ContinueOnChipMainThread(err)); + OnResponse(ConvertToStatusIB(err), nullptr); } void CommissionerCommands::OnCommissioningComplete(chip::NodeId nodeId, CHIP_ERROR err) { - if (mExpectedStatus != err) - { - if (err != CHIP_NO_ERROR) - { - ChipLogError(chipTool, "Commissioning Complete Failure: %s", ErrorStr(err)); - } - else - { - ChipLogError(chipTool, "Got success but expected: %s", ErrorStr(mExpectedStatus)); - err = CHIP_ERROR_INCORRECT_STATE; - } - } - else + if (err != CHIP_NO_ERROR) { - // Treat as success. - err = CHIP_NO_ERROR; + ChipLogError(chipTool, "Commissioning Complete Failure: %s", ErrorStr(err)); } - LogErrorOnFailure(ContinueOnChipMainThread(err)); + OnResponse(ConvertToStatusIB(err), nullptr); } diff --git a/src/app/tests/suites/commands/commissioner/CommissionerCommands.h b/src/app/tests/suites/commands/commissioner/CommissionerCommands.h index 370723ec498382..b840665534b92d 100644 --- a/src/app/tests/suites/commands/commissioner/CommissionerCommands.h +++ b/src/app/tests/suites/commands/commissioner/CommissionerCommands.h @@ -27,10 +27,11 @@ class CommissionerCommands : public chip::Controller::DevicePairingDelegate CommissionerCommands(){}; ~CommissionerCommands() override{}; - virtual CHIP_ERROR ContinueOnChipMainThread(CHIP_ERROR err) = 0; - virtual chip::Controller::DeviceCommissioner & GetCurrentCommissioner() = 0; + virtual void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) = 0; + virtual CHIP_ERROR ContinueOnChipMainThread(CHIP_ERROR err) = 0; + virtual chip::Controller::DeviceCommissioner & GetCurrentCommissioner() = 0; - CHIP_ERROR PairWithQRCode(chip::NodeId nodeId, const chip::CharSpan payload, CHIP_ERROR expectedStatus = CHIP_NO_ERROR); + CHIP_ERROR PairWithQRCode(chip::NodeId nodeId, const chip::CharSpan payload); CHIP_ERROR PairWithManualCode(chip::NodeId nodeId, const chip::CharSpan payload); CHIP_ERROR Unpair(chip::NodeId nodeId); @@ -39,7 +40,4 @@ class CommissionerCommands : public chip::Controller::DevicePairingDelegate void OnPairingComplete(CHIP_ERROR error) override; void OnPairingDeleted(CHIP_ERROR error) override; void OnCommissioningComplete(chip::NodeId deviceId, CHIP_ERROR error) override; - -private: - CHIP_ERROR mExpectedStatus = CHIP_NO_ERROR; }; diff --git a/src/app/tests/suites/commands/discovery/BUILD.gn b/src/app/tests/suites/commands/discovery/BUILD.gn index 7adc0b79363e29..5525623b0c6006 100644 --- a/src/app/tests/suites/commands/discovery/BUILD.gn +++ b/src/app/tests/suites/commands/discovery/BUILD.gn @@ -26,6 +26,7 @@ static_library("discovery") { cflags = [ "-Wconversion" ] public_deps = [ + "${chip_root}/src/app", "${chip_root}/src/lib/address_resolve", "${chip_root}/src/lib/support", ] diff --git a/src/app/tests/suites/commands/discovery/DiscoveryCommands.cpp b/src/app/tests/suites/commands/discovery/DiscoveryCommands.cpp index 71be49564599f8..320f5b63a982df 100644 --- a/src/app/tests/suites/commands/discovery/DiscoveryCommands.cpp +++ b/src/app/tests/suites/commands/discovery/DiscoveryCommands.cpp @@ -159,5 +159,137 @@ void DiscoveryCommands::OnNodeDiscovered(const chip::Dnssd::DiscoveredNodeData & data.mrpRetryIntervalActive.SetValue(nodeData.mrpRetryIntervalActive.Value().count()); } - OnDiscoveryCommandsResults(data); + chip::app::StatusIB status; + status.mStatus = chip::Protocols::InteractionModel::Status::Success; + + constexpr uint32_t kMaxDataLen = 4096; + uint8_t * buffer = static_cast(chip::Platform::MemoryCalloc(sizeof(uint8_t), kMaxDataLen)); + if (buffer == nullptr) + { + ChipLogError(chipTool, "Can not dispatch mdns data: %s", chip::ErrorStr(CHIP_ERROR_NO_MEMORY)); + return; + } + + chip::TLV::TLVWriter writer; + writer.Init(buffer, kMaxDataLen); + CHIP_ERROR err = data.Encode(writer, chip::TLV::AnonymousTag()); + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, "Can not encode mdns data: %s", chip::ErrorStr(err)); + return; + } + + uint32_t dataLen = writer.GetLengthWritten(); + writer.Finalize(); + + chip::TLV::TLVReader reader; + reader.Init(buffer, dataLen); + reader.Next(); + + OnResponse(status, &reader); + + chip::Platform::MemoryFree(buffer); } + +CHIP_ERROR DiscoveryCommandResult::Encode(chip::TLV::TLVWriter & writer, chip::TLV::Tag tag) const +{ + chip::TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, chip::TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::ContextTag(0), hostName)); + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::ContextTag(1), instanceName)); + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::ContextTag(2), longDiscriminator)); + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::ContextTag(3), shortDiscriminator)); + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::ContextTag(4), vendorId)); + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::ContextTag(5), productId)); + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::ContextTag(6), commissioningMode)); + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::ContextTag(7), deviceType)); + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::ContextTag(8), deviceName)); + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::ContextTag(9), rotatingId)); + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::ContextTag(10), rotatingIdLen)); + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::ContextTag(11), pairingHint)); + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::ContextTag(12), pairingInstruction)); + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::ContextTag(13), supportsTcp)); + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::ContextTag(14), numIPs)); + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::ContextTag(15), port)); + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::ContextTag(16), mrpRetryIntervalIdle)); + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::ContextTag(17), mrpRetryIntervalActive)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DiscoveryCommandResult::Decode(chip::TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + chip::TLV::TLVType outer; + VerifyOrReturnError(chip::TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + ReturnErrorOnFailure(reader.EnterContainer(outer)); + + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + VerifyOrReturnError(chip::TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + switch (chip::TLV::TagNumFromTag(reader.GetTag())) + { + case 0: + ReturnErrorOnFailure(chip::app::DataModel::Decode(reader, hostName)); + break; + case 1: + ReturnErrorOnFailure(chip::app::DataModel::Decode(reader, instanceName)); + break; + case 2: + ReturnErrorOnFailure(chip::app::DataModel::Decode(reader, longDiscriminator)); + break; + case 3: + ReturnErrorOnFailure(chip::app::DataModel::Decode(reader, shortDiscriminator)); + break; + case 4: + ReturnErrorOnFailure(chip::app::DataModel::Decode(reader, vendorId)); + break; + case 5: + ReturnErrorOnFailure(chip::app::DataModel::Decode(reader, productId)); + break; + case 6: + ReturnErrorOnFailure(chip::app::DataModel::Decode(reader, commissioningMode)); + break; + case 7: + ReturnErrorOnFailure(chip::app::DataModel::Decode(reader, deviceType)); + break; + case 8: + ReturnErrorOnFailure(chip::app::DataModel::Decode(reader, deviceName)); + break; + case 9: + ReturnErrorOnFailure(chip::app::DataModel::Decode(reader, rotatingId)); + break; + case 10: + ReturnErrorOnFailure(chip::app::DataModel::Decode(reader, rotatingIdLen)); + break; + case 11: + ReturnErrorOnFailure(chip::app::DataModel::Decode(reader, pairingHint)); + break; + case 12: + ReturnErrorOnFailure(chip::app::DataModel::Decode(reader, pairingInstruction)); + break; + case 13: + ReturnErrorOnFailure(chip::app::DataModel::Decode(reader, supportsTcp)); + break; + case 14: + ReturnErrorOnFailure(chip::app::DataModel::Decode(reader, numIPs)); + break; + case 15: + ReturnErrorOnFailure(chip::app::DataModel::Decode(reader, port)); + break; + case 16: + ReturnErrorOnFailure(chip::app::DataModel::Decode(reader, mrpRetryIntervalIdle)); + break; + case 17: + ReturnErrorOnFailure(chip::app::DataModel::Decode(reader, mrpRetryIntervalActive)); + break; + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + + return CHIP_NO_ERROR; +}; diff --git a/src/app/tests/suites/commands/discovery/DiscoveryCommands.h b/src/app/tests/suites/commands/discovery/DiscoveryCommands.h index b0123e5476e04b..076e20a9e0ca7a 100644 --- a/src/app/tests/suites/commands/discovery/DiscoveryCommands.h +++ b/src/app/tests/suites/commands/discovery/DiscoveryCommands.h @@ -18,6 +18,9 @@ #pragma once +#include +#include +#include #include #include @@ -41,15 +44,33 @@ struct DiscoveryCommandResult uint16_t port; chip::Optional mrpRetryIntervalIdle; chip::Optional mrpRetryIntervalActive; + + CHIP_ERROR Encode(chip::TLV::TLVWriter & writer, chip::TLV::Tag tag) const; + CHIP_ERROR Decode(chip::TLV::TLVReader & reader); }; +namespace chip { +namespace app { +namespace Clusters { +namespace DiscoveryCommands { +namespace Commands { +namespace DiscoveryCommandResponse { +using DecodableType = DiscoveryCommandResult; +} +} // namespace Commands +} // namespace DiscoveryCommands +} // namespace Clusters +} // namespace app +} // namespace chip + class DiscoveryCommands : public chip::Dnssd::CommissioningResolveDelegate, public chip::Dnssd::OperationalResolveDelegate { public: DiscoveryCommands(){}; ~DiscoveryCommands() override{}; - virtual CHIP_ERROR ContinueOnChipMainThread(CHIP_ERROR err) = 0; + virtual void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) = 0; + virtual CHIP_ERROR ContinueOnChipMainThread(CHIP_ERROR err) = 0; CHIP_ERROR FindCommissionable(); CHIP_ERROR FindCommissionableByShortDiscriminator(uint64_t value); @@ -64,7 +85,6 @@ class DiscoveryCommands : public chip::Dnssd::CommissioningResolveDelegate, publ CHIP_ERROR SetupDiscoveryCommands(); CHIP_ERROR TearDownDiscoveryCommands(); - virtual void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData){}; /////////// CommissioningDelegate Interface ///////// void OnNodeDiscovered(const chip::Dnssd::DiscoveredNodeData & nodeData) override; diff --git a/src/app/tests/suites/include/ValueChecker.h b/src/app/tests/suites/include/ValueChecker.h index d952d0d7557de3..803879ea63516f 100644 --- a/src/app/tests/suites/include/ValueChecker.h +++ b/src/app/tests/suites/include/ValueChecker.h @@ -32,6 +32,17 @@ class ValueChecker protected: virtual void Exit(std::string message) = 0; + bool CheckDecodeValue(CHIP_ERROR error) + { + if (CHIP_NO_ERROR != error) + { + Exit(std::string("Can not decode data: ") + chip::ErrorStr(error)); + return false; + } + + return true; + } + bool CheckValueAsString(const char * itemName, chip::ByteSpan current, chip::ByteSpan expected) { if (!current.data_equal(expected)) diff --git a/src/app/zap-templates/common/ClusterTestGeneration.js b/src/app/zap-templates/common/ClusterTestGeneration.js index f7c2c9bd5dbbf2..4ada516a5cf9cb 100644 --- a/src/app/zap-templates/common/ClusterTestGeneration.js +++ b/src/app/zap-templates/common/ClusterTestGeneration.js @@ -485,14 +485,20 @@ async function chip_tests(list, options) test.tests = await Promise.all(test.tests.map(async function(item) { item.global = global; if (item.isCommand) { - let command = await assertCommandOrAttributeOrEvent(item); - item.commandObject = command; + let command = await assertCommandOrAttributeOrEvent(item); + item.commandObject = command; + item.hasSpecificArguments = true; + item.hasSpecificResponse = command.hasSpecificResponse; } else if (item.isAttribute) { - let attr = await assertCommandOrAttributeOrEvent(item); - item.attributeObject = attr; + let attr = await assertCommandOrAttributeOrEvent(item); + item.attributeObject = attr; + item.hasSpecificArguments = item.isWriteAttribute; + item.hasSpecificResponse = item.isReadAttribute || item.isSubscribeAttribute || item.isWaitForReport; } else if (item.isEvent) { - let evt = await assertCommandOrAttributeOrEvent(item); - item.eventObject = evt; + let evt = await assertCommandOrAttributeOrEvent(item); + item.eventObject = evt; + item.hasSpecificArguments = false; + item.hasSpecificResponse = true; } return item; })); diff --git a/src/app/zap-templates/common/simulated-clusters/clusters/DiscoveryCommands.js b/src/app/zap-templates/common/simulated-clusters/clusters/DiscoveryCommands.js index a154363b0c6ea1..627db19b77a75b 100644 --- a/src/app/zap-templates/common/simulated-clusters/clusters/DiscoveryCommands.js +++ b/src/app/zap-templates/common/simulated-clusters/clusters/DiscoveryCommands.js @@ -69,48 +69,64 @@ const kDefaultResponse = { const FindCommissionable = { name : 'FindCommissionable', arguments : [], + hasSpecificResponse : true, + responseName : 'DiscoveryCommandResponse', response : kDefaultResponse }; const FindCommissionableByShortDiscriminator = { name : 'FindCommissionableByShortDiscriminator', arguments : [ kNumberValueArgument ], + hasSpecificResponse : true, + responseName : 'DiscoveryCommandResponse', response : kDefaultResponse }; const FindCommissionableByLongDiscriminator = { name : 'FindCommissionableByLongDiscriminator', arguments : [ kNumberValueArgument ], + hasSpecificResponse : true, + responseName : 'DiscoveryCommandResponse', response : kDefaultResponse }; const FindCommissionableByCompressedFabricId = { name : 'FindOperationalByCompressedFabricId', arguments : [ kNumberValueArgument ], + hasSpecificResponse : true, + responseName : 'DiscoveryCommandResponse', response : kDefaultResponse }; const FindCommissionableByCommissioningMode = { name : 'FindCommissionableByCommissioningMode', arguments : [], + hasSpecificResponse : true, + responseName : 'DiscoveryCommandResponse', response : kDefaultResponse }; const FindCommissionableByVendorId = { name : 'FindCommissionableByVendorId', arguments : [ kNumberValueArgument ], + hasSpecificResponse : true, + responseName : 'DiscoveryCommandResponse', response : kDefaultResponse }; const FindCommissionableByDeviceType = { name : 'FindCommissionableByDeviceType', arguments : [ kNumberValueArgument ], + hasSpecificResponse : true, + responseName : 'DiscoveryCommandResponse', response : kDefaultResponse }; const FindCommissionableByName = { name : 'FindCommissionableByName', arguments : [ kStringValueArgument ], + hasSpecificResponse : true, + responseName : 'DiscoveryCommandResponse', response : kDefaultResponse }; @@ -121,18 +137,24 @@ const FindCommissionableByName = { const FindCommissioner = { name : 'FindCommissioner', arguments : [], + hasSpecificResponse : true, + responseName : 'DiscoveryCommandResponse', response : kDefaultResponse }; const FindCommissionerByVendorId = { name : 'FindCommissionableByVendorId', arguments : [ kNumberValueArgument ], + hasSpecificResponse : true, + responseName : 'DiscoveryCommandResponse', response : kDefaultResponse }; const FindCommissionerByDeviceType = { name : 'FindCommissionerByDeviceType', arguments : [ kNumberValueArgument ], + hasSpecificResponse : true, + responseName : 'DiscoveryCommandResponse', response : kDefaultResponse }; diff --git a/src/controller/CHIPDeviceController.cpp b/src/controller/CHIPDeviceController.cpp index c19959401afb3b..1d0191d0787adf 100644 --- a/src/controller/CHIPDeviceController.cpp +++ b/src/controller/CHIPDeviceController.cpp @@ -463,9 +463,11 @@ CHIP_ERROR DeviceCommissioner::Init(CommissionerInitParams params) mUdcServer->SetInstanceNameResolver(this); #endif // CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY + mSetUpCodePairer.SetSystemLayer(mSystemState->SystemLayer()); #if CONFIG_NETWORK_LAYER_BLE mSetUpCodePairer.SetBleLayer(mSystemState->BleLayer()); #endif // CONFIG_NETWORK_LAYER_BLE + return CHIP_NO_ERROR; } diff --git a/src/controller/SetUpCodePairer.cpp b/src/controller/SetUpCodePairer.cpp index c9c53996c320ab..c3b41a7aab1c0f 100644 --- a/src/controller/SetUpCodePairer.cpp +++ b/src/controller/SetUpCodePairer.cpp @@ -29,12 +29,17 @@ #include #include #include +#include + +constexpr uint32_t kDeviceDiscoveredTimeout = CHIP_CONFIG_SETUP_CODE_PAIRER_DISCOVERY_TIMEOUT_SECS * chip::kMillisecondsPerSecond; namespace chip { namespace Controller { CHIP_ERROR SetUpCodePairer::PairDevice(NodeId remoteId, const char * setUpCode, SetupCodePairerBehaviour commission) { + VerifyOrReturnError(mSystemLayer != nullptr, CHIP_ERROR_INCORRECT_STATE); + SetupPayload payload; mConnectionType = commission; @@ -47,7 +52,10 @@ CHIP_ERROR SetUpCodePairer::PairDevice(NodeId remoteId, const char * setUpCode, ResetDiscoveryState(); - return Connect(payload); + ReturnErrorOnFailure(Connect(payload)); + + return mSystemLayer->StartTimer(System::Clock::Milliseconds32(kDeviceDiscoveredTimeout), OnDeviceDiscoveredTimeoutCallback, + this); } CHIP_ERROR SetUpCodePairer::Connect(SetupPayload & payload) @@ -162,6 +170,8 @@ CHIP_ERROR SetUpCodePairer::StopConnectOverSoftAP() bool SetUpCodePairer::ConnectToDiscoveredDevice() { + mSystemLayer->CancelTimer(OnDeviceDiscoveredTimeoutCallback, this); + if (mWaitingForPASE) { // Nothing to do. Just wait until we either succeed or fail at that @@ -407,5 +417,14 @@ void SetUpCodePairer::OnCommissioningComplete(NodeId deviceId, CHIP_ERROR error) } } +void SetUpCodePairer::OnDeviceDiscoveredTimeoutCallback(System::Layer * layer, void * context) +{ + auto * pairer = static_cast(context); + LogErrorOnFailure(pairer->StopConnectOverBle()); + LogErrorOnFailure(pairer->StopConnectOverIP()); + LogErrorOnFailure(pairer->StopConnectOverSoftAP()); + pairer->mCommissioner->OnSessionEstablishmentError(CHIP_ERROR_TIMEOUT); +} + } // namespace Controller } // namespace chip diff --git a/src/controller/SetUpCodePairer.h b/src/controller/SetUpCodePairer.h index b60f94c284c139..d7697f2f0f1d46 100644 --- a/src/controller/SetUpCodePairer.h +++ b/src/controller/SetUpCodePairer.h @@ -64,6 +64,8 @@ class DLL_EXPORT SetUpCodePairer : public DevicePairingDelegate // Called by the DeviceCommissioner to notify that we have discovered a new device. void NotifyCommissionableDeviceDiscovered(const chip::Dnssd::DiscoveredNodeData & nodeData); + void SetSystemLayer(System::Layer * systemLayer) { mSystemLayer = systemLayer; }; + #if CONFIG_NETWORK_LAYER_BLE void SetBleLayer(Ble::BleLayer * bleLayer) { mBleLayer = bleLayer; }; #endif // CONFIG_NETWORK_LAYER_BLE @@ -120,6 +122,8 @@ class DLL_EXPORT SetUpCodePairer : public DevicePairingDelegate kTransportTypeCount, }; + static void OnDeviceDiscoveredTimeoutCallback(System::Layer * layer, void * context); + #if CONFIG_NETWORK_LAYER_BLE Ble::BleLayer * mBleLayer = nullptr; void OnDiscoveredDeviceOverBle(BLE_CONNECTION_OBJECT connObj); @@ -133,6 +137,7 @@ class DLL_EXPORT SetUpCodePairer : public DevicePairingDelegate Dnssd::DiscoveryFilter currentFilter; DeviceCommissioner * mCommissioner = nullptr; + System::Layer * mSystemLayer = nullptr; chip::NodeId mRemoteId; uint32_t mSetUpPINCode = 0; SetupCodePairerBehaviour mConnectionType = SetupCodePairerBehaviour::kCommission; diff --git a/src/darwin/Framework/CHIP/templates/tests/partials/test_cluster.zapt b/src/darwin/Framework/CHIP/templates/tests/partials/test_cluster.zapt index bae3552ed913ac..1ff01dfd9fae4b 100644 --- a/src/darwin/Framework/CHIP/templates/tests/partials/test_cluster.zapt +++ b/src/darwin/Framework/CHIP/templates/tests/partials/test_cluster.zapt @@ -24,7 +24,7 @@ ResponseHandler {{> subscribeDataCallback}} = nil; {{#if (isTestOnlyCluster cluster)}} dispatch_queue_t queue = dispatch_get_main_queue(); - {{command}}(expectation, queue{{#chip_tests_item_parameters}}, {{#if (isString type)}}@"{{/if}}{{> defined_value}}{{#if (isString type)}}"{{/if}}{{/chip_tests_item_parameters}}{{additionalArguments}}); + {{command}}(expectation, queue{{#chip_tests_item_parameters}}, {{#if (isString type)}}@"{{/if}}{{> defined_value}}{{#if (isString type)}}"{{/if}}{{/chip_tests_item_parameters}}); {{else}} CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); diff --git a/src/lib/core/CHIPConfig.h b/src/lib/core/CHIPConfig.h index 003411fa1d88f3..50c4f975cbf238 100644 --- a/src/lib/core/CHIPConfig.h +++ b/src/lib/core/CHIPConfig.h @@ -1813,6 +1813,18 @@ extern const char CHIP_NON_PRODUCTION_MARKER[]; #define CHIP_CONFIG_IM_STATUS_CODE_VERBOSE_FORMAT 0 #endif // CHIP_CONFIG_ERROR_FORMAT_AS_STRING +/** + * @def CHIP_CONFIG_SETUP_CODE_PAIRER_DISCOVERY_TIMEOUT_SECS + * + * @brief + * This is the default timeout for the discovery of devices by + * the setup code pairer. + * + */ +#ifndef CHIP_CONFIG_SETUP_CODE_PAIRER_DISCOVERY_TIMEOUT_SECS +#define CHIP_CONFIG_SETUP_CODE_PAIRER_DISCOVERY_TIMEOUT_SECS 30 +#endif // CHIP_CONFIG_SETUP_CODE_PAIRER_DISCOVERY_TIMEOUT_SECS + /** * @} */ diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index ee51c2fc0e169b..c8aee4745c9b97 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -513,12 +513,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) @@ -1899,12 +1911,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) @@ -2195,12 +2219,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) @@ -2711,12 +2747,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) @@ -3088,12 +3136,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) @@ -3349,12 +3409,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) @@ -3521,12 +3593,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) @@ -3787,12 +3871,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) @@ -4529,12 +4625,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) @@ -9223,12 +9331,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) @@ -9625,12 +9745,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) @@ -9980,12 +10112,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) @@ -10271,12 +10415,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) @@ -10549,12 +10705,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) @@ -10966,12 +11134,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) @@ -11257,12 +11437,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) @@ -11516,12 +11708,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) @@ -11779,12 +11983,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) @@ -12066,12 +12282,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) @@ -12325,12 +12553,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) @@ -12607,12 +12847,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) @@ -13071,12 +13323,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) @@ -13382,12 +13646,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) @@ -13785,12 +14061,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) @@ -14175,12 +14463,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) @@ -14466,12 +14766,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) @@ -14769,12 +15081,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) @@ -15846,12 +16170,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) @@ -17852,12 +18192,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) @@ -18726,12 +19078,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) @@ -19532,12 +19896,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) @@ -20271,12 +20647,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) @@ -20443,12 +20831,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) @@ -20697,12 +21097,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) @@ -20950,12 +21362,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); + } } // @@ -21035,12 +21459,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); + } } // @@ -21133,12 +21569,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) @@ -21366,12 +21814,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) @@ -21890,12 +22350,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) @@ -22061,12 +22533,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) @@ -22331,12 +22815,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) @@ -22558,12 +23054,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) @@ -22823,12 +23331,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); + } } // @@ -23284,12 +23844,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) @@ -23523,12 +24095,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) @@ -23794,12 +24378,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) @@ -24301,12 +24897,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) @@ -24920,12 +25532,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) @@ -25551,12 +26175,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) @@ -26090,12 +26742,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) @@ -26603,12 +27295,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) @@ -27041,12 +27761,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) @@ -27401,12 +28145,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) @@ -27598,12 +28354,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) @@ -27795,12 +28563,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) @@ -27992,12 +28772,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) @@ -28189,12 +28981,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) @@ -28386,12 +29190,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) @@ -28583,12 +29399,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) @@ -28780,12 +29608,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) @@ -28977,12 +29817,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) @@ -29174,12 +30026,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) @@ -29371,12 +30235,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) @@ -29568,12 +30444,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) @@ -29757,12 +30645,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); + } } // @@ -29869,12 +30769,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); + } } // @@ -29954,12 +30866,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); + } } // @@ -30039,12 +30963,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); + } } // @@ -30124,12 +31060,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); + } } // @@ -30209,12 +31157,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); + } } // @@ -30294,12 +31254,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); + } } // @@ -30379,12 +31351,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); + } } // @@ -30464,12 +31448,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); + } } // @@ -30549,12 +31545,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); + } } // @@ -30634,12 +31642,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); + } } // @@ -30719,12 +31739,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); + } } // @@ -30808,12 +31840,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) @@ -30933,109 +31977,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 // @@ -31049,15 +32014,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); @@ -31065,7 +32030,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 @@ -31074,12 +32039,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; } @@ -31139,12 +32215,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) @@ -31314,12 +32418,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) @@ -31487,12 +32631,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); + } } // @@ -31626,12 +32794,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) @@ -31849,12 +33053,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); + } } // @@ -31934,12 +33150,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); + } } // @@ -32027,12 +33255,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) @@ -32211,12 +33451,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) @@ -32512,12 +33768,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) @@ -32680,12 +33948,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) @@ -32964,12 +34244,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) @@ -33385,12 +34689,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) @@ -33606,12 +34922,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) @@ -34014,12 +35342,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) @@ -34200,12 +35540,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) @@ -34600,12 +35952,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) @@ -34932,12 +36296,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) @@ -35928,12 +37320,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) @@ -37525,12 +38941,72 @@ class Test_TC_OO_2_4Suite : public TestCommand chip::Optional mDiscriminator; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::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 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 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 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 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 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 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; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_2(void * context, CHIP_ERROR error) @@ -38112,12 +39588,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) @@ -38368,12 +39856,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) @@ -38771,12 +40271,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) @@ -38989,12 +40501,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) @@ -39414,12 +40938,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) @@ -39999,12 +41535,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) @@ -41784,12 +43332,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) @@ -42040,12 +43600,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) @@ -42449,12 +44021,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) @@ -42916,12 +44500,24 @@ 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) + { + 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) @@ -43156,12 +44752,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) @@ -43391,12 +44999,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) @@ -43606,12 +45226,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) @@ -43943,106 +45575,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(); } // @@ -44290,12 +46015,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) @@ -44727,12 +46464,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) @@ -45098,12 +46987,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) @@ -45267,12 +47168,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) @@ -45519,12 +47432,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) @@ -45756,12 +47681,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) @@ -46023,12 +47960,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) @@ -47208,12 +49157,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) @@ -48819,12 +50780,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) @@ -49066,12 +51039,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) @@ -49490,12 +51475,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) @@ -49982,12 +51979,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) @@ -50534,12 +52543,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) @@ -54104,12 +56125,24 @@ class Test_TC_LC_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) @@ -54244,12 +56277,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) @@ -54509,12 +56554,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); + } } // @@ -54624,12 +56681,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) @@ -55191,12 +57260,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) @@ -57124,12 +59205,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); + } } // @@ -57227,12 +59320,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) @@ -57399,12 +59504,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) @@ -57724,12 +59841,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); @@ -58666,12 +60819,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); @@ -59534,12 +61723,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); @@ -60118,12 +62335,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) @@ -60482,12 +62719,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) @@ -60855,12 +63112,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) @@ -61270,12 +63559,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) @@ -61660,12 +63981,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) @@ -61958,12 +64291,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) @@ -62219,12 +64564,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) @@ -62444,12 +64801,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) @@ -62748,12 +65117,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) @@ -63031,12 +65412,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); + } } // @@ -63161,12 +65554,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); + } } // @@ -63342,12 +65747,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) @@ -63493,12 +65910,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) @@ -63946,12 +66375,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) @@ -64819,12 +67260,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) @@ -65183,12 +67636,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); + } } // @@ -65311,12 +67776,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) @@ -65680,12 +68157,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) @@ -68053,12 +70542,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, @@ -84761,12 +87262,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) @@ -85591,12 +88104,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) @@ -86341,12 +88866,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); + } } // @@ -86589,125 +89130,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(); } // @@ -87033,12 +89671,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); + } } // @@ -87621,12 +90279,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) @@ -91269,12 +93939,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); + } } // @@ -91439,12 +94121,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) @@ -91754,12 +94448,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) @@ -92068,12 +94774,24 @@ class TestGeneralCommissioningSuite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnResponse(const chip::app::StatusIB & status, chip::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) @@ -92323,12 +95041,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); + } } // @@ -92466,12 +95196,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) @@ -92950,12 +95692,40 @@ 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 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 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; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } static void OnFailureCallback_1(void * context, CHIP_ERROR error) @@ -93969,12 +96739,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); + } } // @@ -94109,12 +96907,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) @@ -94568,60 +97378,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; } @@ -94639,7 +97453,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; @@ -94653,60 +97467,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 @@ -94724,7 +97580,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; @@ -94733,11 +97596,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( @@ -94745,40 +97608,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) { { @@ -94790,7 +97652,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; @@ -94798,11 +97660,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( @@ -94810,15 +97672,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; @@ -94827,11 +97689,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( @@ -94839,28 +97701,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; @@ -94869,11 +97731,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( @@ -94881,45 +97743,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))); @@ -94933,7 +97795,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; @@ -94943,43 +97805,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; @@ -94989,17 +97851,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 @@ -95099,12 +97961,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) @@ -95318,12 +98192,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); + } } // @@ -95424,12 +98306,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) @@ -95631,12 +98525,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); @@ -96376,12 +99282,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) @@ -101397,12 +104315,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) @@ -102171,12 +105101,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) @@ -105433,12 +108375,28 @@ class Test_TC_DL_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; + 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) @@ -105823,12 +108781,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) @@ -106529,12 +109499,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); + } } // @@ -107350,12 +110332,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) @@ -108115,12 +111109,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); + } } // @@ -108209,12 +111215,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); + } } // @@ -108312,12 +111338,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); + } } // @@ -108408,12 +111450,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); + } } // @@ -108507,12 +111565,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); + } } // @@ -108601,12 +111679,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); + } } // @@ -108676,12 +111762,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); + } } // @@ -108751,12 +111845,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); + } } // @@ -108826,89 +111928,105 @@ 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 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_2Suite : public TestCommand +{ +public: + Test_TC_DD_3_2Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_DD_3_2", 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_2Suite() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_DD_3_2\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DD_3_2\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_2Suite : public TestCommand -{ -public: - Test_TC_DD_3_2Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_DD_3_2", 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_2Suite() {} - - /////////// 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_2\n"); + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } - if (mTestCount == mTestIndex) + if (shouldContinue) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DD_3_2\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 // @@ -108976,12 +112094,20 @@ 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 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); + } } // @@ -109051,12 +112177,20 @@ class Test_TC_DD_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) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } } // @@ -109126,12 +112260,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); + } } // @@ -109201,12 +112343,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); + } } // @@ -109276,12 +112426,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); + } } // @@ -109351,12 +112509,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); + } } // @@ -109426,12 +112592,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); + } } // @@ -109501,12 +112675,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); + } } // @@ -109576,12 +112758,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); + } } // @@ -109735,12 +112925,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); + } } // @@ -110216,12 +113458,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) @@ -110484,12 +113738,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); + } } // @@ -110559,12 +113821,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); + } } // @@ -110634,12 +113904,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); + } } // @@ -110709,12 +113987,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); + } } // @@ -110784,87 +114070,103 @@ 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 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_1Suite : public TestCommand +{ +public: + Test_TC_BDX_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_BDX_2_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_BDX_2_1Suite() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_BDX_2_1\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_BDX_2_1\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_1Suite : public TestCommand -{ -public: - Test_TC_BDX_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_BDX_2_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_BDX_2_1Suite() {} - - /////////// 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_1\n"); + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } - if (mTestCount == mTestIndex) + if (shouldContinue) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_BDX_2_1\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(); } // @@ -110934,12 +114236,20 @@ 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 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); + } } // @@ -111009,12 +114319,20 @@ class Test_TC_BDX_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); + } } // @@ -111084,12 +114402,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); + } } // @@ -111159,12 +114485,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); + } } // @@ -111233,12 +114567,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); + } } // @@ -111307,12 +114649,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); + } } // @@ -111381,12 +114731,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); + } } // @@ -111456,12 +114814,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); + } } // @@ -111531,12 +114897,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); + } } // @@ -111606,12 +114980,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); + } } // @@ -111681,12 +115063,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); + } } // @@ -111756,12 +115146,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); + } } // @@ -111831,12 +115229,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); + } } // @@ -111906,12 +115312,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); + } } // @@ -111981,12 +115395,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); + } } // @@ -112056,12 +115478,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); + } } // @@ -112131,12 +115561,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); + } } // @@ -112206,12 +115644,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); + } } // @@ -112281,12 +115727,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); + } } // @@ -112356,12 +115810,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); + } } // @@ -112431,12 +115893,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); + } } // @@ -112506,12 +115976,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); + } } // @@ -112581,12 +116059,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); + } } // @@ -112656,12 +116142,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); + } } // @@ -112731,12 +116225,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); + } } // @@ -112806,12 +116308,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); + } } // @@ -112881,12 +116391,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); + } } // @@ -112956,12 +116474,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); + } } // @@ -113031,12 +116557,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); + } } // @@ -113106,12 +116640,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); + } } // @@ -113181,12 +116723,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); + } } // @@ -113256,12 +116806,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); + } } // @@ -113331,12 +116889,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); + } } // @@ -113406,12 +116972,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); + } } // @@ -113481,12 +117055,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); + } } // @@ -113556,12 +117138,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); + } } // @@ -113631,12 +117221,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); + } } // @@ -113706,12 +117304,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); + } } // @@ -113781,12 +117387,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); + } } // @@ -113856,12 +117470,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); + } } // @@ -113931,12 +117553,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); + } } // @@ -114006,12 +117636,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); + } } // @@ -114081,12 +117719,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); + } } // @@ -114156,12 +117802,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); + } } // @@ -114231,12 +117885,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); + } } // @@ -114306,12 +117968,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); + } } // @@ -114381,12 +118051,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); + } } // @@ -114456,12 +118134,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); + } } // @@ -114531,12 +118217,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); + } } // @@ -114606,12 +118300,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); + } } // @@ -114681,12 +118383,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); + } } // @@ -114756,12 +118466,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); + } } // @@ -114831,12 +118549,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); + } } // @@ -114982,12 +118708,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) @@ -115477,12 +119227,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); + } } // @@ -115552,12 +119310,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); + } } // @@ -115627,12 +119393,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); + } } // @@ -115702,12 +119476,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); + } } // @@ -115777,12 +119559,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); + } } // @@ -115852,12 +119642,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); + } } // @@ -115927,12 +119725,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); + } } // @@ -116002,12 +119808,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); + } } // @@ -116077,12 +119891,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); + } } // @@ -116152,12 +119974,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); + } } // @@ -116227,12 +120057,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); + } } // @@ -116302,12 +120140,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); + } } // @@ -116377,12 +120223,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); + } } // @@ -116452,12 +120306,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); + } } // @@ -116527,12 +120389,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); + } } // @@ -116602,12 +120472,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); + } } // @@ -116677,12 +120555,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); + } } // @@ -116752,12 +120638,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); + } } // @@ -116827,12 +120721,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); + } } // @@ -116902,12 +120804,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); + } } // @@ -116977,12 +120887,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); + } } // @@ -117052,12 +120970,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); + } } // @@ -117127,12 +121053,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); + } } // @@ -117202,12 +121136,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); + } } // @@ -117277,12 +121219,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); + } } // @@ -117352,12 +121302,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); + } } // @@ -117427,12 +121385,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); + } } // @@ -117502,12 +121468,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); + } } // @@ -117577,12 +121551,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); + } } // @@ -117652,12 +121634,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); + } } // @@ -117727,12 +121717,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); + } } // @@ -117802,12 +121800,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); + } } // @@ -117877,12 +121883,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); + } } // @@ -117952,12 +121966,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); + } } // @@ -118027,12 +122049,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); + } } // @@ -118102,12 +122132,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); + } } // @@ -118177,12 +122215,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); + } } // @@ -118252,12 +122298,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); + } } // @@ -118327,12 +122381,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); + } } // @@ -118402,12 +122464,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); + } } // @@ -118477,12 +122547,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); + } } // @@ -118552,12 +122630,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); + } } // @@ -118627,12 +122713,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); + } } // @@ -118702,12 +122796,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); + } } // @@ -118777,12 +122879,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); + } } // @@ -118852,12 +122962,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); + } } // @@ -118927,12 +123045,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); + } } // @@ -119002,12 +123128,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); + } } // @@ -119077,12 +123211,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); + } } // @@ -119152,12 +123294,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); + } } // @@ -119227,12 +123377,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); + } } // @@ -119302,12 +123460,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); + } } // @@ -119377,12 +123543,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); + } } // @@ -119452,12 +123626,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); + } } // @@ -119527,12 +123709,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); + } } // @@ -119602,12 +123792,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); + } } // @@ -119677,12 +123875,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); + } } // @@ -119752,12 +123958,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); + } } // @@ -119827,12 +124041,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); + } } // @@ -119902,12 +124124,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); + } } // @@ -119977,12 +124207,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); + } } // @@ -120052,12 +124290,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); + } } // @@ -120127,12 +124373,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); + } } //