From 9d7e85dd53f453dd3098265c5b0e8728a5c84748 Mon Sep 17 00:00:00 2001 From: manjunath-grl Date: Sat, 9 Jul 2022 20:57:09 +0530 Subject: [PATCH] auto generated files --- .../zap-generated/test/Commands.h | 2167 ----------------- 1 file changed, 2167 deletions(-) diff --git a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h index b7520fe9a1f905..388f16a141f920 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -57,7 +57,6 @@ class TestList : public Command { printf("Test_TC_CC_7_3\n"); printf("Test_TC_CC_7_4\n"); printf("Test_TC_CC_8_1\n"); - printf("Test_TC_BINFO_2_1\n"); printf("Test_TC_DESC_1_1\n"); printf("Test_TC_DGETH_2_1\n"); printf("Test_TC_DGETH_2_2\n"); @@ -16481,2171 +16480,6 @@ class Test_TC_CC_8_1 : public TestCommandBridge { } }; -class Test_TC_BINFO_2_1 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_BINFO_2_1() - : TestCommandBridge("Test_TC_BINFO_2_1") - , mTestIndex(0) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - - ~Test_TC_BINFO_2_1() {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_BINFO_2_1\n"); - } - - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_BINFO_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++) { - 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 : TH reads Location from the DUT.\n"); - err = TestThReadsLocationFromTheDut_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads DataModelRevision from the DUT.\n"); - if (ShouldSkip("BINFO.S.A0000")) { - NextTest(); - return; - } - err = TestThReadsDataModelRevisionFromTheDut_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : TH writes DataModelRevision from the DUT.\n"); - if (ShouldSkip("BINFO.S.A0000")) { - NextTest(); - return; - } - err = TestThWritesDataModelRevisionFromTheDut_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads DataModelRevision from the DUT.\n"); - if (ShouldSkip("BINFO.S.A0000")) { - NextTest(); - return; - } - err = TestThReadsDataModelRevisionFromTheDut_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : TH reads VendorName from the DUT.\n"); - if (ShouldSkip("BINFO.S.A0001")) { - NextTest(); - return; - } - err = TestThReadsVendorNameFromTheDut_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : TH writes VendorName from the DUT.\n"); - if (ShouldSkip("BINFO.S.A0001")) { - NextTest(); - return; - } - err = TestThWritesVendorNameFromTheDut_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : TH reads VendorName from the DUT.\n"); - if (ShouldSkip("BINFO.S.A0001")) { - NextTest(); - return; - } - err = TestThReadsVendorNameFromTheDut_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : TH reads VendorID from the DUT.\n"); - if (ShouldSkip("BINFO.S.A0002")) { - NextTest(); - return; - } - err = TestThReadsVendorIDFromTheDut_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : TH writes VendorID from the DUT.\n"); - if (ShouldSkip("BINFO.S.A0002")) { - NextTest(); - return; - } - err = TestThWritesVendorIDFromTheDut_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : TH reads VendorID from the DUT.\n"); - if (ShouldSkip("BINFO.S.A0002")) { - NextTest(); - return; - } - err = TestThReadsVendorIDFromTheDut_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : TH reads ProductName from the DUT\n"); - if (ShouldSkip("BINFO.S.A0003")) { - NextTest(); - return; - } - err = TestThReadsProductNameFromTheDut_11(); - break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : TH writes ProductName from the DUT.\n"); - if (ShouldSkip("BINFO.S.A0003")) { - NextTest(); - return; - } - err = TestThWritesProductNameFromTheDut_12(); - break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : TH reads ProductName from the DUT\n"); - if (ShouldSkip("BINFO.S.A0003")) { - NextTest(); - return; - } - err = TestThReadsProductNameFromTheDut_13(); - break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : TH reads ProductID from the DUT.\n"); - if (ShouldSkip("BINFO.S.A0004")) { - NextTest(); - return; - } - err = TestThReadsProductIDFromTheDut_14(); - break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : TH writes ProductID from the DUT.\n"); - if (ShouldSkip("BINFO.S.A0004")) { - NextTest(); - return; - } - err = TestThWritesProductIDFromTheDut_15(); - break; - case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : TH reads ProductID from the DUT.\n"); - if (ShouldSkip("BINFO.S.A0004")) { - NextTest(); - return; - } - err = TestThReadsProductIDFromTheDut_16(); - break; - case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : TH reads NodeLabel from the DUT\n"); - if (ShouldSkip("BINFO.S.A0005")) { - NextTest(); - return; - } - err = TestThReadsNodeLabelFromTheDut_17(); - break; - case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : TH writes NodeLabel from the DUT.\n"); - if (ShouldSkip("BINFO.S.A0005")) { - NextTest(); - return; - } - err = TestThWritesNodeLabelFromTheDut_18(); - break; - case 19: - ChipLogProgress(chipTool, " ***** Test Step 19 : TH reads NodeLabel from the DUT\n"); - if (ShouldSkip("BINFO.S.A0005")) { - NextTest(); - return; - } - err = TestThReadsNodeLabelFromTheDut_19(); - break; - case 20: - ChipLogProgress(chipTool, " ***** Test Step 20 : TH reads Location from the DUT.\n"); - if (ShouldSkip("BINFO.S.A0006")) { - NextTest(); - return; - } - err = TestThReadsLocationFromTheDut_20(); - break; - case 21: - ChipLogProgress(chipTool, " ***** Test Step 21 : TH write Location from the DUT\n"); - if (ShouldSkip("BINFO.S.A0006")) { - NextTest(); - return; - } - err = TestThWriteLocationFromTheDut_21(); - break; - case 22: - ChipLogProgress(chipTool, " ***** Test Step 22 : TH reads Location from the DUT.\n"); - if (ShouldSkip("BINFO.S.A0006")) { - NextTest(); - return; - } - err = TestThReadsLocationFromTheDut_22(); - break; - case 23: - ChipLogProgress(chipTool, " ***** Test Step 23 : TH reads HardwareVersion from the DUT\n"); - if (ShouldSkip("BINFO.S.A0007")) { - NextTest(); - return; - } - err = TestThReadsHardwareVersionFromTheDut_23(); - break; - case 24: - ChipLogProgress(chipTool, " ***** Test Step 24 : TH writes HardwareVersion from the DUT.\n"); - if (ShouldSkip("BINFO.S.A0007")) { - NextTest(); - return; - } - err = TestThWritesHardwareVersionFromTheDut_24(); - break; - case 25: - ChipLogProgress(chipTool, " ***** Test Step 25 : TH reads HardwareVersion from the DUT\n"); - if (ShouldSkip("BINFO.S.A0007")) { - NextTest(); - return; - } - err = TestThReadsHardwareVersionFromTheDut_25(); - break; - case 26: - ChipLogProgress(chipTool, " ***** Test Step 26 : TH reads HardwareVersionString from the DUT.\n"); - if (ShouldSkip("BINFO.S.A0008")) { - NextTest(); - return; - } - err = TestThReadsHardwareVersionStringFromTheDut_26(); - break; - case 27: - ChipLogProgress(chipTool, " ***** Test Step 27 : TH writes HardwareVersionString from the DUT.\n"); - if (ShouldSkip("BINFO.S.A0008")) { - NextTest(); - return; - } - err = TestThWritesHardwareVersionStringFromTheDut_27(); - break; - case 28: - ChipLogProgress(chipTool, " ***** Test Step 28 : TH reads HardwareVersionString from the DUT.\n"); - if (ShouldSkip("BINFO.S.A0008")) { - NextTest(); - return; - } - err = TestThReadsHardwareVersionStringFromTheDut_28(); - break; - case 29: - ChipLogProgress(chipTool, " ***** Test Step 29 : TH reads SoftwareVersion from the DUT\n"); - if (ShouldSkip("BINFO.S.A0009")) { - NextTest(); - return; - } - err = TestThReadsSoftwareVersionFromTheDut_29(); - break; - case 30: - ChipLogProgress(chipTool, - " ***** Test Step 30 : Verify that the SoftwareVersion is not displayed to the end-user through any device " - "specific means (ex: screen, audio)\n"); - if (ShouldSkip("PICS_USER_PROMPT && BINFO.S.A0009")) { - NextTest(); - return; - } - err = TestVerifyThatTheSoftwareVersionIsNotDisplayedToTheEndUserThroughAnyDeviceSpecificMeansExScreenAudio_30(); - break; - case 31: - ChipLogProgress(chipTool, " ***** Test Step 31 : TH writes SoftwareVersion from the DUT.\n"); - if (ShouldSkip("BINFO.S.A0009")) { - NextTest(); - return; - } - err = TestThWritesSoftwareVersionFromTheDut_31(); - break; - case 32: - ChipLogProgress(chipTool, " ***** Test Step 32 : TH reads SoftwareVersion from the DUT\n"); - if (ShouldSkip("BINFO.S.A0009")) { - NextTest(); - return; - } - err = TestThReadsSoftwareVersionFromTheDut_32(); - break; - case 33: - ChipLogProgress(chipTool, " ***** Test Step 33 : TH reads SoftwareVersionString from the DUT\n"); - if (ShouldSkip("BINFO.S.A000a")) { - NextTest(); - return; - } - err = TestThReadsSoftwareVersionStringFromTheDut_33(); - break; - case 34: - ChipLogProgress(chipTool, " ***** Test Step 34 : TH writes SoftwareVersionString from the DUT.\n"); - if (ShouldSkip("BINFO.S.A000a")) { - NextTest(); - return; - } - err = TestThWritesSoftwareVersionStringFromTheDut_34(); - break; - case 35: - ChipLogProgress(chipTool, " ***** Test Step 35 : TH reads SoftwareVersionString from the DUT\n"); - if (ShouldSkip("BINFO.S.A000a")) { - NextTest(); - return; - } - err = TestThReadsSoftwareVersionStringFromTheDut_35(); - break; - case 36: - ChipLogProgress(chipTool, " ***** Test Step 36 : TH reads ManufacturingDate from the DUT.\n"); - if (ShouldSkip("BINFO.S.A000b")) { - NextTest(); - return; - } - err = TestThReadsManufacturingDateFromTheDut_36(); - break; - case 37: - ChipLogProgress(chipTool, - " ***** Test Step 37 : Verify if the first 8 characters specify date according to ISO 8601, i.e, YYYYMMDD\n"); - if (ShouldSkip("PICS_USER_PROMPT && BINFO.S.A000b")) { - NextTest(); - return; - } - err = TestVerifyIfTheFirst8CharactersSpecifyDateAccordingToIso8601IeYyyymmdd_37(); - break; - case 38: - ChipLogProgress(chipTool, " ***** Test Step 38 : TH writes ManufacturingDate from the DUT.\n"); - if (ShouldSkip("BINFO.S.A000b")) { - NextTest(); - return; - } - err = TestThWritesManufacturingDateFromTheDut_38(); - break; - case 39: - ChipLogProgress(chipTool, " ***** Test Step 39 : TH reads ManufacturingDate from the DUT.\n"); - if (ShouldSkip("BINFO.S.A000b")) { - NextTest(); - return; - } - err = TestThReadsManufacturingDateFromTheDut_39(); - break; - case 40: - ChipLogProgress(chipTool, " ***** Test Step 40 : TH reads PartNumber from the DUT\n"); - if (ShouldSkip("BINFO.S.A000c && PART_NUM")) { - NextTest(); - return; - } - err = TestThReadsPartNumberFromTheDut_40(); - break; - case 41: - ChipLogProgress(chipTool, " ***** Test Step 41 : TH writes PartNumber from the DUT.\n"); - if (ShouldSkip("BINFO.S.A000c")) { - NextTest(); - return; - } - err = TestThWritesPartNumberFromTheDut_41(); - break; - case 42: - ChipLogProgress(chipTool, " ***** Test Step 42 : TH reads PartNumber from the DUT\n"); - if (ShouldSkip("BINFO.S.A000c && PART_NUM")) { - NextTest(); - return; - } - err = TestThReadsPartNumberFromTheDut_42(); - break; - case 43: - ChipLogProgress(chipTool, " ***** Test Step 43 : TH reads ProductURL from the DUT\n"); - if (ShouldSkip("BINFO.S.A000d")) { - NextTest(); - return; - } - err = TestThReadsProductURLFromTheDut_43(); - break; - case 44: - ChipLogProgress(chipTool, - " ***** Test Step 44 : Verify that it specifies a link to a specific web page, Verify that it follows the syntax " - "rules specified in RFC 3986.\n"); - if (ShouldSkip("PICS_USER_PROMPT && BINFO.S.A000d")) { - NextTest(); - return; - } - err = TestVerifyThatItSpecifiesALinkToASpecificWebPageVerifyThatItFollowsTheSyntaxRulesSpecifiedInRfc3986_44(); - break; - case 45: - ChipLogProgress(chipTool, " ***** Test Step 45 : TH writes ProductURL from the DUT.\n"); - if (ShouldSkip("BINFO.S.A000d")) { - NextTest(); - return; - } - err = TestThWritesProductURLFromTheDut_45(); - break; - case 46: - ChipLogProgress(chipTool, " ***** Test Step 46 : TH reads ProductURL from the DUT\n"); - if (ShouldSkip("BINFO.S.A000d")) { - NextTest(); - return; - } - err = TestThReadsProductURLFromTheDut_46(); - break; - case 47: - ChipLogProgress(chipTool, " ***** Test Step 47 : TH reads ProductLabel from the DUT.\n"); - if (ShouldSkip("BINFO.S.A000e")) { - NextTest(); - return; - } - err = TestThReadsProductLabelFromTheDut_47(); - break; - case 48: - ChipLogProgress(chipTool, - " ***** Test Step 48 : Verify that it does not include the name of the vendor as defined within the VendorName " - "attribute\n"); - if (ShouldSkip("PICS_USER_PROMPT && BINFO.S.A000e")) { - NextTest(); - return; - } - err = TestVerifyThatItDoesNotIncludeTheNameOfTheVendorAsDefinedWithinTheVendorNameAttribute_48(); - break; - case 49: - ChipLogProgress(chipTool, " ***** Test Step 49 : TH writes ProductLabel from the DUT.\n"); - if (ShouldSkip("BINFO.S.A000e")) { - NextTest(); - return; - } - err = TestThWritesProductLabelFromTheDut_49(); - break; - case 50: - ChipLogProgress(chipTool, " ***** Test Step 50 : TH reads ProductLabel from the DUT.\n"); - if (ShouldSkip("BINFO.S.A000e")) { - NextTest(); - return; - } - err = TestThReadsProductLabelFromTheDut_50(); - break; - case 51: - ChipLogProgress(chipTool, " ***** Test Step 51 : TH reads SerialNumber from the DUT.\n"); - err = TestThReadsSerialNumberFromTheDut_51(); - break; - case 52: - ChipLogProgress(chipTool, " ***** Test Step 52 : TH writes SerialNumber from the DUT.\n"); - if (ShouldSkip("BINFO.S.A000f")) { - NextTest(); - return; - } - err = TestThWritesSerialNumberFromTheDut_52(); - break; - case 53: - ChipLogProgress(chipTool, " ***** Test Step 53 : TH reads SerialNumber from the DUT.\n"); - if (ShouldSkip("BINFO.S.A000f")) { - NextTest(); - return; - } - err = TestThReadsSerialNumberFromTheDut_53(); - break; - case 54: - ChipLogProgress(chipTool, " ***** Test Step 54 : TH reads LocalConfigDisabled from the DUT.\n"); - if (ShouldSkip("BINFO.S.A0010")) { - NextTest(); - return; - } - err = TestThReadsLocalConfigDisabledFromTheDut_54(); - break; - case 55: - ChipLogProgress(chipTool, " ***** Test Step 55 : TH sets LocalConfigDisabled to True\n"); - if (ShouldSkip("BINFO.S.A0010")) { - NextTest(); - return; - } - err = TestThSetsLocalConfigDisabledToTrue_55(); - break; - case 56: - ChipLogProgress(chipTool, " ***** Test Step 56 : TH reads LocalConfigDisabled from the DUT.\n"); - if (ShouldSkip("BINFO.S.A0010")) { - NextTest(); - return; - } - err = TestThReadsLocalConfigDisabledFromTheDut_56(); - break; - case 57: - ChipLogProgress(chipTool, " ***** Test Step 57 : TH reads Reachable from the DUT.\n"); - if (ShouldSkip("BINFO.S.A0011")) { - NextTest(); - return; - } - err = TestThReadsReachableFromTheDut_57(); - break; - case 58: - ChipLogProgress( - chipTool, " ***** Test Step 58 : TH sends Write request message to DUT to change value of Reachable to false\n"); - if (ShouldSkip("BINFO.S.A0011")) { - NextTest(); - return; - } - err = TestThSendsWriteRequestMessageToDutToChangeValueOfReachableToFalse_58(); - break; - case 59: - ChipLogProgress(chipTool, " ***** Test Step 59 : TH reads UniqueID from the DUT.\n"); - if (ShouldSkip("BINFO.S.A0012")) { - NextTest(); - return; - } - err = TestThReadsUniqueIDFromTheDut_59(); - break; - case 60: - ChipLogProgress(chipTool, " ***** Test Step 60 : TH writes UniqueID from the DUT.\n"); - if (ShouldSkip("BINFO.S.A0012")) { - NextTest(); - return; - } - err = TestThWritesUniqueIDFromTheDut_60(); - break; - case 61: - ChipLogProgress(chipTool, " ***** Test Step 61 : TH reads UniqueID from the DUT.\n"); - if (ShouldSkip("BINFO.S.A0012")) { - NextTest(); - return; - } - err = TestThReadsUniqueIDFromTheDut_61(); - break; - case 62: - ChipLogProgress(chipTool, " ***** Test Step 62 : TH reads CapabilityMinima attribute from the DUT.\n"); - if (ShouldSkip("BINFO.S.A0013")) { - NextTest(); - return; - } - err = TestThReadsCapabilityMinimaAttributeFromTheDut_62(); - break; - case 63: - ChipLogProgress(chipTool, - " ***** Test Step 63 : Step 56 is implicitly validating the attribute(CapabilityMinima) constraints, as long as " - "the payload is being parsed successfully\n"); - if (ShouldSkip("PICS_USER_PROMPT && BINFO.S.A0013")) { - NextTest(); - return; - } - err = TestStep56IsImplicitlyValidatingTheAttributeCapabilityMinimaConstraintsAsLongAsThePayloadIsBeingParsedSuccessfully_63(); - break; - case 64: - ChipLogProgress(chipTool, " ***** Test Step 64 : TH writes CapabilityMinima from the DUT.\n"); - if (ShouldSkip("BINFO.S.A0013")) { - NextTest(); - return; - } - err = TestThWritesCapabilityMinimaFromTheDut_64(); - break; - case 65: - ChipLogProgress(chipTool, " ***** Test Step 65 : TH reads CapabilityMinima attribute from the DUT.\n"); - if (ShouldSkip("BINFO.S.A0013")) { - NextTest(); - return; - } - err = TestThReadsCapabilityMinimaAttributeFromTheDut_65(); - break; - } - - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - - void OnStatusUpdate(const chip::app::StatusIB & status) override - { - switch (mTestIndex - 1) { - case 0: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 1: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 2: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 3: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - break; - case 4: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 5: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 6: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - break; - case 7: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 8: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 9: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - break; - case 10: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 11: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 12: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - break; - case 13: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 14: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 15: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - break; - case 16: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 17: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 18: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 19: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 20: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 21: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 22: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 23: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 24: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - break; - case 25: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 26: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 27: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - break; - case 28: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 29: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 30: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 31: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - break; - case 32: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 33: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 34: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - break; - case 35: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 36: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 37: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 38: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - break; - case 39: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 40: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 41: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - break; - case 42: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 43: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 44: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 45: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - break; - case 46: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 47: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 48: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 49: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - break; - case 50: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 51: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 52: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - break; - case 53: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 54: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 55: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 56: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 57: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 58: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - break; - case 59: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 60: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - break; - case 61: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 62: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 63: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 64: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - break; - case 65: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - } - - // Go on to the next test. - 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 = 66; - - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; - value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; - return WaitForCommissionee("alpha", value); - } - NSString * _Nonnull CountryCode; - - CHIP_ERROR TestThReadsLocationFromTheDut_1() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeLocationWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads Location from the DUT. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - CountryCode = value; - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - NSNumber * _Nonnull DataModelRevisionValue; - - CHIP_ERROR TestThReadsDataModelRevisionFromTheDut_2() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeDataModelRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads DataModelRevision from the DUT. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("dataModelRevision", "", "uint16")); - VerifyOrReturn(CheckConstraintMinValue("dataModelRevision", [value unsignedShortValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("dataModelRevision", [value unsignedShortValue], 65534U)); - { - DataModelRevisionValue = value; - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThWritesDataModelRevisionFromTheDut_3() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id dataModelRevisionArgument; - dataModelRevisionArgument = [NSNumber numberWithUnsignedShort:4388U]; - [cluster - writeAttributeDataModelRevisionWithValue:dataModelRevisionArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH writes DataModelRevision from the DUT. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThReadsDataModelRevisionFromTheDut_4() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeDataModelRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads DataModelRevision from the DUT. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("DataModelRevision", actualValue, DataModelRevisionValue)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - NSString * _Nonnull VendorNameValue; - - CHIP_ERROR TestThReadsVendorNameFromTheDut_5() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeVendorNameWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads VendorName from the DUT. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("vendorName", "", "string")); - VerifyOrReturn(CheckConstraintMaxLength("vendorName", [value length], 32)); - { - VendorNameValue = value; - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThWritesVendorNameFromTheDut_6() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id vendorNameArgument; - vendorNameArgument = @"sample"; - [cluster writeAttributeVendorNameWithValue:vendorNameArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH writes VendorName from the DUT. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThReadsVendorNameFromTheDut_7() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeVendorNameWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads VendorName from the DUT. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValueAsString("VendorName", actualValue, VendorNameValue)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - NSNumber * _Nonnull VendorIDValue; - - CHIP_ERROR TestThReadsVendorIDFromTheDut_8() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeVendorIDWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads VendorID from the DUT. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("vendorID", "", "uint16")); - VerifyOrReturn(CheckConstraintMinValue("vendorID", [value unsignedShortValue], 1U)); - VerifyOrReturn(CheckConstraintMaxValue("vendorID", [value unsignedShortValue], 65521U)); - { - VendorIDValue = value; - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThWritesVendorIDFromTheDut_9() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id vendorIDArgument; - vendorIDArgument = [NSNumber numberWithUnsignedShort:17U]; - [cluster writeAttributeVendorIDWithValue:vendorIDArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH writes VendorID from the DUT. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThReadsVendorIDFromTheDut_10() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeVendorIDWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads VendorID from the DUT. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("VendorID", actualValue, VendorIDValue)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - NSString * _Nonnull ProductNameValue; - - CHIP_ERROR TestThReadsProductNameFromTheDut_11() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeProductNameWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads ProductName from the DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("productName", "", "string")); - VerifyOrReturn(CheckConstraintMaxLength("productName", [value length], 32)); - { - ProductNameValue = value; - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThWritesProductNameFromTheDut_12() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id productNameArgument; - productNameArgument = @"newproduct"; - [cluster writeAttributeProductNameWithValue:productNameArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH writes ProductName from the DUT. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThReadsProductNameFromTheDut_13() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeProductNameWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads ProductName from the DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValueAsString("ProductName", actualValue, ProductNameValue)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - NSNumber * _Nonnull ProductIDValue; - - CHIP_ERROR TestThReadsProductIDFromTheDut_14() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeProductIDWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads ProductID from the DUT. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("productID", "", "uint16")); - VerifyOrReturn(CheckConstraintMinValue("productID", [value unsignedShortValue], 1U)); - VerifyOrReturn(CheckConstraintMaxValue("productID", [value unsignedShortValue], 65534U)); - { - ProductIDValue = value; - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThWritesProductIDFromTheDut_15() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id productIDArgument; - productIDArgument = [NSNumber numberWithUnsignedShort:17697U]; - [cluster writeAttributeProductIDWithValue:productIDArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH writes ProductID from the DUT. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThReadsProductIDFromTheDut_16() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeProductIDWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads ProductID from the DUT. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("ProductID", actualValue, ProductIDValue)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - NSString * _Nonnull NodeLabelValue; - - CHIP_ERROR TestThReadsNodeLabelFromTheDut_17() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeNodeLabelWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads NodeLabel from the DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("nodeLabel", "", "string")); - VerifyOrReturn(CheckConstraintMaxLength("nodeLabel", [value length], 32)); - { - NodeLabelValue = value; - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThWritesNodeLabelFromTheDut_18() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id nodeLabelArgument; - nodeLabelArgument = @"newnode"; - [cluster writeAttributeNodeLabelWithValue:nodeLabelArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH writes NodeLabel from the DUT. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThReadsNodeLabelFromTheDut_19() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeNodeLabelWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads NodeLabel from the DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValueAsString("NodeLabel", actualValue, @"newnode")); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThReadsLocationFromTheDut_20() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeLocationWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads Location from the DUT. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValueAsString("Location", actualValue, CountryCode)); - } - - VerifyOrReturn(CheckConstraintType("location", "", "string")); - VerifyOrReturn(CheckConstraintMaxLength("location", [value length], 16)); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThWriteLocationFromTheDut_21() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id locationArgument; - locationArgument = @"in"; - [cluster writeAttributeLocationWithValue:locationArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH write Location from the DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThReadsLocationFromTheDut_22() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeLocationWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads Location from the DUT. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValueAsString("Location", actualValue, @"in")); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - NSNumber * _Nonnull HardwareVersionValue; - - CHIP_ERROR TestThReadsHardwareVersionFromTheDut_23() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeHardwareVersionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads HardwareVersion from the DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("hardwareVersion", "", "uint16")); - VerifyOrReturn(CheckConstraintMinValue("hardwareVersion", [value unsignedShortValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("hardwareVersion", [value unsignedShortValue], 65534U)); - { - HardwareVersionValue = value; - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThWritesHardwareVersionFromTheDut_24() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id hardwareVersionArgument; - hardwareVersionArgument = [NSNumber numberWithUnsignedShort:17713U]; - [cluster - writeAttributeHardwareVersionWithValue:hardwareVersionArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH writes HardwareVersion from the DUT. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThReadsHardwareVersionFromTheDut_25() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeHardwareVersionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads HardwareVersion from the DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("HardwareVersion", actualValue, HardwareVersionValue)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - NSString * _Nonnull HardwareVersionStringValue; - - CHIP_ERROR TestThReadsHardwareVersionStringFromTheDut_26() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeHardwareVersionStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads HardwareVersionString from the DUT. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("hardwareVersionString", "", "string")); - VerifyOrReturn(CheckConstraintMinLength("hardwareVersionString", [value length], 1)); - VerifyOrReturn(CheckConstraintMaxLength("hardwareVersionString", [value length], 64)); - { - HardwareVersionStringValue = value; - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThWritesHardwareVersionStringFromTheDut_27() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id hardwareVersionStringArgument; - hardwareVersionStringArgument = @"newhardwareversion"; - [cluster writeAttributeHardwareVersionStringWithValue:hardwareVersionStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH writes HardwareVersionString from the DUT. Error: %@", err); - - VerifyOrReturn( - CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThReadsHardwareVersionStringFromTheDut_28() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeHardwareVersionStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads HardwareVersionString from the DUT. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValueAsString("HardwareVersionString", actualValue, HardwareVersionStringValue)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - NSNumber * _Nonnull SoftwareVersionValue; - - CHIP_ERROR TestThReadsSoftwareVersionFromTheDut_29() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeSoftwareVersionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads SoftwareVersion from the DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintMinValue("softwareVersion", [value unsignedIntValue], 0UL)); - VerifyOrReturn(CheckConstraintMaxValue("softwareVersion", [value unsignedIntValue], 4294967294UL)); - { - SoftwareVersionValue = value; - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestVerifyThatTheSoftwareVersionIsNotDisplayedToTheEndUserThroughAnyDeviceSpecificMeansExScreenAudio_30() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - - CHIP_ERROR TestThWritesSoftwareVersionFromTheDut_31() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id softwareVersionArgument; - softwareVersionArgument = [NSNumber numberWithUnsignedInt:33299UL]; - [cluster - writeAttributeSoftwareVersionWithValue:softwareVersionArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH writes SoftwareVersion from the DUT. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThReadsSoftwareVersionFromTheDut_32() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeSoftwareVersionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads SoftwareVersion from the DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("SoftwareVersion", actualValue, SoftwareVersionValue)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - NSString * _Nonnull SoftwareVersionStringValue; - - CHIP_ERROR TestThReadsSoftwareVersionStringFromTheDut_33() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeSoftwareVersionStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads SoftwareVersionString from the DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintMinLength("softwareVersionString", [value length], 1)); - { - SoftwareVersionStringValue = value; - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThWritesSoftwareVersionStringFromTheDut_34() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id softwareVersionStringArgument; - softwareVersionStringArgument = @"1.0"; - [cluster writeAttributeSoftwareVersionStringWithValue:softwareVersionStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH writes SoftwareVersionString from the DUT. Error: %@", err); - - VerifyOrReturn( - CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThReadsSoftwareVersionStringFromTheDut_35() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeSoftwareVersionStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads SoftwareVersionString from the DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValueAsString("SoftwareVersionString", actualValue, SoftwareVersionStringValue)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - NSString * _Nonnull ManufacturingDateValue; - - CHIP_ERROR TestThReadsManufacturingDateFromTheDut_36() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeManufacturingDateWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads ManufacturingDate from the DUT. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("manufacturingDate", "", "string")); - VerifyOrReturn(CheckConstraintMinLength("manufacturingDate", [value length], 8)); - VerifyOrReturn(CheckConstraintMaxLength("manufacturingDate", [value length], 16)); - { - ManufacturingDateValue = value; - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestVerifyIfTheFirst8CharactersSpecifyDateAccordingToIso8601IeYyyymmdd_37() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - - CHIP_ERROR TestThWritesManufacturingDateFromTheDut_38() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id manufacturingDateArgument; - manufacturingDateArgument = @"20210814789452IN"; - [cluster - writeAttributeManufacturingDateWithValue:manufacturingDateArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH writes ManufacturingDate from the DUT. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThReadsManufacturingDateFromTheDut_39() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeManufacturingDateWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads ManufacturingDate from the DUT. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValueAsString("ManufacturingDate", actualValue, ManufacturingDateValue)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - NSString * _Nonnull PartNumberValue; - - CHIP_ERROR TestThReadsPartNumberFromTheDut_40() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributePartNumberWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads PartNumber from the DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("partNumber", "", "string")); - VerifyOrReturn(CheckConstraintMaxLength("partNumber", [value length], 32)); - { - PartNumberValue = value; - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThWritesPartNumberFromTheDut_41() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id partNumberArgument; - partNumberArgument = @"newpart"; - [cluster writeAttributePartNumberWithValue:partNumberArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH writes PartNumber from the DUT. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThReadsPartNumberFromTheDut_42() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributePartNumberWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads PartNumber from the DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValueAsString("PartNumber", actualValue, PartNumberValue)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - NSString * _Nonnull ProductURLValue; - - CHIP_ERROR TestThReadsProductURLFromTheDut_43() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeProductURLWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads ProductURL from the DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("productURL", "", "string")); - VerifyOrReturn(CheckConstraintMaxLength("productURL", [value length], 256)); - { - ProductURLValue = value; - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestVerifyThatItSpecifiesALinkToASpecificWebPageVerifyThatItFollowsTheSyntaxRulesSpecifiedInRfc3986_44() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - - CHIP_ERROR TestThWritesProductURLFromTheDut_45() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id productURLArgument; - productURLArgument = @"https://www.example.com"; - [cluster writeAttributeProductURLWithValue:productURLArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH writes ProductURL from the DUT. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThReadsProductURLFromTheDut_46() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeProductURLWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads ProductURL from the DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValueAsString("ProductURL", actualValue, ProductURLValue)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - NSString * _Nonnull ProductLabelValue; - - CHIP_ERROR TestThReadsProductLabelFromTheDut_47() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeProductLabelWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads ProductLabel from the DUT. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("productLabel", "", "string")); - VerifyOrReturn(CheckConstraintMaxLength("productLabel", [value length], 64)); - { - ProductLabelValue = value; - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestVerifyThatItDoesNotIncludeTheNameOfTheVendorAsDefinedWithinTheVendorNameAttribute_48() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - - CHIP_ERROR TestThWritesProductLabelFromTheDut_49() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id productLabelArgument; - productLabelArgument = @"newproductlabel"; - [cluster writeAttributeProductLabelWithValue:productLabelArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH writes ProductLabel from the DUT. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThReadsProductLabelFromTheDut_50() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeProductLabelWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads ProductLabel from the DUT. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValueAsString("ProductLabel", actualValue, ProductLabelValue)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - NSString * _Nonnull SerialNumberValue; - - CHIP_ERROR TestThReadsSerialNumberFromTheDut_51() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeSerialNumberWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads SerialNumber from the DUT. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("serialNumber", "", "string")); - VerifyOrReturn(CheckConstraintMaxLength("serialNumber", [value length], 32)); - { - SerialNumberValue = value; - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThWritesSerialNumberFromTheDut_52() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id serialNumberArgument; - serialNumberArgument = @"newserialnumber"; - [cluster writeAttributeSerialNumberWithValue:serialNumberArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH writes SerialNumber from the DUT. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThReadsSerialNumberFromTheDut_53() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeSerialNumberWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads SerialNumber from the DUT. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValueAsString("SerialNumber", actualValue, SerialNumberValue)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThReadsLocalConfigDisabledFromTheDut_54() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeLocalConfigDisabledWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads LocalConfigDisabled from the DUT. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("LocalConfigDisabled", actualValue, false)); - } - - VerifyOrReturn(CheckConstraintType("localConfigDisabled", "", "boolean")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThSetsLocalConfigDisabledToTrue_55() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id localConfigDisabledArgument; - localConfigDisabledArgument = [NSNumber numberWithBool:true]; - [cluster writeAttributeLocalConfigDisabledWithValue:localConfigDisabledArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sets LocalConfigDisabled to True Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThReadsLocalConfigDisabledFromTheDut_56() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeLocalConfigDisabledWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads LocalConfigDisabled from the DUT. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("LocalConfigDisabled", actualValue, true)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThReadsReachableFromTheDut_57() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeReachableWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads Reachable from the DUT. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("Reachable", actualValue, true)); - } - - VerifyOrReturn(CheckConstraintType("reachable", "", "boolean")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThSendsWriteRequestMessageToDutToChangeValueOfReachableToFalse_58() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id reachableArgument; - reachableArgument = [NSNumber numberWithBool:false]; - [cluster - writeAttributeReachableWithValue:reachableArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends Write request message to DUT to change value of Reachable to false Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - NSString * _Nonnull UniqueIDValue; - - CHIP_ERROR TestThReadsUniqueIDFromTheDut_59() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeUniqueIDWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads UniqueID from the DUT. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("uniqueID", "", "string")); - VerifyOrReturn(CheckConstraintMaxLength("uniqueID", [value length], 32)); - { - UniqueIDValue = value; - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThWritesUniqueIDFromTheDut_60() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id uniqueIDArgument; - uniqueIDArgument = @"newid"; - [cluster writeAttributeUniqueIDWithValue:uniqueIDArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH writes UniqueID from the DUT. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThReadsUniqueIDFromTheDut_61() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeUniqueIDWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads UniqueID from the DUT. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValueAsString("UniqueID", actualValue, UniqueIDValue)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - MTRBasicClusterCapabilityMinimaStruct * _Nonnull CapabilityMinimaValue; - - CHIP_ERROR TestThReadsCapabilityMinimaAttributeFromTheDut_62() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeCapabilityMinimaWithCompletionHandler:^( - MTRBasicClusterCapabilityMinimaStruct * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads CapabilityMinima attribute from the DUT. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - CapabilityMinimaValue = value; - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR - TestStep56IsImplicitlyValidatingTheAttributeCapabilityMinimaConstraintsAsLongAsThePayloadIsBeingParsedSuccessfully_63() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - - CHIP_ERROR TestThWritesCapabilityMinimaFromTheDut_64() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id capabilityMinimaArgument; - capabilityMinimaArgument = [[MTRBasicClusterCapabilityMinimaStruct alloc] init]; - ((MTRBasicClusterCapabilityMinimaStruct *) capabilityMinimaArgument).caseSessionsPerFabric = - [NSNumber numberWithUnsignedShort:4U]; - ((MTRBasicClusterCapabilityMinimaStruct *) capabilityMinimaArgument).subscriptionsPerFabric = - [NSNumber numberWithUnsignedShort:4U]; - - [cluster - writeAttributeCapabilityMinimaWithValue:capabilityMinimaArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH writes CapabilityMinima from the DUT. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThReadsCapabilityMinimaAttributeFromTheDut_65() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeCapabilityMinimaWithCompletionHandler:^( - MTRBasicClusterCapabilityMinimaStruct * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads CapabilityMinima attribute from the DUT. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } -}; - class Test_TC_DESC_1_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced @@ -109950,7 +107784,6 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), - make_unique(), make_unique(), make_unique(), make_unique(),