diff --git a/examples/chip-tool-darwin/commands/tests/TestCommandBridge.h b/examples/chip-tool-darwin/commands/tests/TestCommandBridge.h index e71085f05163ca..26b9bf7b816b8d 100644 --- a/examples/chip-tool-darwin/commands/tests/TestCommandBridge.h +++ b/examples/chip-tool-darwin/commands/tests/TestCommandBridge.h @@ -19,17 +19,23 @@ #pragma once #include "../common/CHIPCommandBridge.h" +#include #include #include #include #include #include +#import #import constexpr uint16_t kTimeoutInSeconds = 90; -class TestCommandBridge : public CHIPCommandBridge, public ValueChecker, public ConstraintsChecker, public PICSChecker { +class TestCommandBridge : public CHIPCommandBridge, + public ValueChecker, + public ConstraintsChecker, + public PICSChecker, + public SystemCommands { public: TestCommandBridge(const char * _Nonnull commandName) : CHIPCommandBridge(commandName) @@ -63,13 +69,13 @@ class TestCommandBridge : public CHIPCommandBridge, public ValueChecker, public SetCommandExitStatus(err); } - /////////// GlobalCommands Interface ///////// void Log(NSString * _Nonnull message) { NSLog(@"%@", message); NextTest(); } + /////////// DelayCommands-like Interface ///////// void WaitForMs(unsigned int ms) { dispatch_after(dispatch_time(DISPATCH_TIME_NOW, ms * NSEC_PER_MSEC), mCallbackQueue, ^{ @@ -84,6 +90,17 @@ class TestCommandBridge : public CHIPCommandBridge, public ValueChecker, public CHIPDeviceController * controller = CurrentCommissioner(); VerifyOrReturn(controller != nil, SetCommandExitStatus(CHIP_ERROR_INCORRECT_STATE)); + // Disconnect our existing device; otherwise getConnectedDevice will + // just hand it right back to us without establishing a new CASE + // session. + if (mConnectedDevice != nil) { + auto device = [mConnectedDevice internalDevice]; + if (device != nullptr) { + device->Disconnect(); + } + mConnectedDevice = nil; + } + [controller getConnectedDevice:nodeId queue:mCallbackQueue completionHandler:^(CHIPDevice * _Nullable device, NSError * _Nullable error) { @@ -95,6 +112,18 @@ class TestCommandBridge : public CHIPCommandBridge, public ValueChecker, public }]; } + /////////// SystemCommands Interface ///////// + CHIP_ERROR ContinueOnChipMainThread(CHIP_ERROR err) override + { + if (CHIP_NO_ERROR == err) { + WaitForMs(0); + + } else { + Exit(chip::ErrorStr(err), err); + } + return CHIP_NO_ERROR; + } + CHIPDevice * _Nullable GetConnectedDevice(void) { return mConnectedDevice; } protected: diff --git a/examples/chip-tool-darwin/templates/tests/partials/test_cluster.zapt b/examples/chip-tool-darwin/templates/tests/partials/test_cluster.zapt index 977d844374d04c..fe95b6f59304c2 100644 --- a/examples/chip-tool-darwin/templates/tests/partials/test_cluster.zapt +++ b/examples/chip-tool-darwin/templates/tests/partials/test_cluster.zapt @@ -108,7 +108,7 @@ class {{filename}}: public TestCommandBridge {{~#not_first}}, {{/not_first~}} {{#*inline "defaultValue"}}{{asTypedLiteral (chip_tests_config_get_default_value definedValue) (chip_tests_config_get_type definedValue)}}{{/inline}} {{~#if (chip_tests_config_has definedValue)~}} - m{{asUpperCamelCase definedValue}}.HasValue() ? m{{asUpperCamelCase definedValue}}.Value() : {{>defaultValue}} + m{{asUpperCamelCase definedValue}}.HasValue() ? m{{asUpperCamelCase definedValue}}.Value() : {{~#if (isString type)}}chip::CharSpan::fromCharString("{{>defaultValue}}"){{else}}{{>defaultValue}}{{/if~}} {{else}} {{#if (isString type)}}@"{{/if}}{{definedValue}}{{#if (isString type)}}"{{/if}} {{~/if~}} diff --git a/examples/chip-tool-darwin/templates/tests/tests.js b/examples/chip-tool-darwin/templates/tests/tests.js index ca7c68cf2779fb..631f591f8ff06c 100644 --- a/examples/chip-tool-darwin/templates/tests/tests.js +++ b/examples/chip-tool-darwin/templates/tests/tests.js @@ -79,10 +79,7 @@ function getTests() { const DeviceManagement = [ 'Test_TC_DM_1_1', 'Test_TC_DM_3_1', - ]; - - const DoorLock = [ - 'Test_TC_DL_1_3', + 'Test_TC_DM_2_2', ]; const ElectricalMeasurement = [ @@ -104,17 +101,17 @@ function getTests() { 'Test_TC_GC_1_1', ]; - const IlluminanceMeasurement = [ - 'Test_TC_ILL_1_1', - 'Test_TC_ILL_2_1', - ]; - const Identify = [ 'Test_TC_I_1_1', 'Test_TC_I_2_1', 'Test_TC_I_2_3', ]; + const IlluminanceMeasurement = [ + 'Test_TC_ILL_1_1', + 'Test_TC_ILL_2_1', + ]; + const OccupancySensing = [ 'Test_TC_OCC_1_1', 'Test_TC_OCC_2_1', @@ -131,6 +128,10 @@ function getTests() { 'Test_TC_LVL_6_1', ]; + const UserLabel = [ + 'Test_TC_LC_1_2', + ]; + const MediaControl = [ 'Test_TC_MC_1_1', 'Test_TC_MC_1_2', @@ -174,12 +175,21 @@ function getTests() { 'Test_TC_MOD_1_1', ]; + const MultipleFabrics = [ + // TODO: These tests all need PairWithQRCode + //'Test_TC_MF_1_3', + //'Test_TC_MF_1_4', + //'Test_TC_MF_1_5', + //'Test_TC_MF_1_6', + //'Test_TC_MF_1_15', + ]; + const OnOff = [ 'Test_TC_OO_1_1', 'Test_TC_OO_2_1', 'Test_TC_OO_2_2', 'Test_TC_OO_2_3', - // 'Test_TC_OO_2_4', Disable this Test for now as Darwin does not support reboot commands currently + 'Test_TC_OO_2_4', ]; const PowerSource = [ @@ -210,6 +220,11 @@ function getTests() { 'Test_TC_RH_2_2', ]; + const SecureChannel = [ + // TODO: This test needs FindCommissionable + //'Test_TC_SC_4_2', + ]; + const Switch = [ 'Test_TC_SWTCH_2_1', 'Test_TC_SWTCH_2_2', @@ -238,53 +253,79 @@ function getTests() { 'Test_TC_DIAG_TH_NW_1_2', ]; - const UserLabel = [ - 'Test_TC_LC_1_2', - ]; - const WiFiNetworkDiagnostics = [ 'Test_TC_WIFIDIAG_1_1', 'Test_TC_WIFIDIAG_3_1', ]; const WindowCovering = [ - // WindowCovering is make uses of multiples "subscribeAttribute", but it triggers - // some failures on darwin supposely because the ReadClient stays open for the - // whole duration of the tests and that goes past some internal limits. - // Because of this, some of the tests are disabled on darwin. 'Test_TC_WNCV_1_1', 'Test_TC_WNCV_2_1', 'Test_TC_WNCV_2_2', 'Test_TC_WNCV_2_3', 'Test_TC_WNCV_2_4', 'Test_TC_WNCV_2_5', - //'Test_TC_WNCV_3_1', - //'Test_TC_WNCV_3_2', - //'Test_TC_WNCV_3_3', + 'Test_TC_WNCV_3_1', + 'Test_TC_WNCV_3_2', + 'Test_TC_WNCV_3_3', 'Test_TC_WNCV_3_4', 'Test_TC_WNCV_3_5', + 'Test_TC_WNCV_4_1', + 'Test_TC_WNCV_4_2', 'Test_TC_WNCV_4_3', 'Test_TC_WNCV_4_4', - //'Test_TC_WNCV_4_5', Disable this Test for now as Darwin does not support reboot commands currently + 'Test_TC_WNCV_4_5', + ]; + + const TV = [ + 'TV_TargetNavigatorCluster', + 'TV_AudioOutputCluster', + 'TV_ApplicationLauncherCluster', + 'TV_KeypadInputCluster', + 'TV_AccountLoginCluster', + 'TV_WakeOnLanCluster', + 'TV_ApplicationBasicCluster', + 'TV_MediaPlaybackCluster', + 'TV_ChannelCluster', + 'TV_LowPowerCluster', + 'TV_ContentLauncherCluster', + 'TV_MediaInputCluster', ]; const Others = [ 'TestCluster', - 'TestSaveAs', + // TestClusterComplexTypes requires representing nullable optionals in ways + // that can differentiate missing and null, which Darwin can't right now. + //'TestClusterComplexTypes', 'TestConstraints', 'TestDelayCommands', + // TODO: TestEvents not supported in the codegen yet. + //'TestEvents', + // TODO: TestDiscovery needs FindCommissionable + //'TestDiscovery', + 'TestLogCommands', + 'TestSaveAs', + // TODO: TestConfigVariables not supported properly in codegen yet. + //'TestConfigVariables', 'TestDescriptorCluster', - // TestBasicInformation needs Reboot - //'TestBasicInformation', - // TestGeneralCommissioning needs Reboot + 'TestBasicInformation', + // TODO: TestGeneralCommissioning needs PairWithQRCode //'TestGeneralCommissioning', - 'TestGroupsCluster', - 'TestGroupKeyManagementCluster', 'TestIdentifyCluster', - 'TestLogCommands', 'TestOperationalCredentialsCluster', + 'TestModeSelectCluster', 'TestSelfFabricRemoval', + // TODO: TestSystemCommands needs codegen changes or changes to the system + // command implementation. + //'TestSystemCommands', 'TestBinding', + 'TestUserLabelCluster', + 'TestArmFailSafe', + ]; + + const MultiAdmin = [ + // TODO: TestMultiAdmin needs PairWithQRCode + //'TestMultiAdmin', ]; const SoftwareDiagnostics = [ @@ -297,6 +338,22 @@ function getTests() { 'TestSubscribe_OnOff', ]; + const DoorLock = [ + // TODO: DL_UsersAndCredentials needs some sort of codegen fixes to produce compiling code. + //'DL_UsersAndCredentials', + 'DL_LockUnlock', + // TODO: DL_Schedules needs some sort of codegen fixes to produce compiling code. + //'DL_Schedules', + 'Test_TC_DL_1_3', + ]; + + const Groups = [ + // TestGroupMessaging does not work on Darwin for now. + //'TestGroupMessaging', + 'TestGroupsCluster', + 'TestGroupKeyManagementCluster', + ]; + const tests = [ AccessControl, // BinaryInput, // @@ -305,16 +362,16 @@ function getTests() { ColorControl, // DeviceDiscovery, // DeviceManagement, // - DoorLock, // ElectricalMeasurement, // EthernetNetworkDiagnostics, // FlowMeasurement, // GeneralCommissioning, // - IlluminanceMeasurement, // Identify, // + IlluminanceMeasurement, // LevelControl, // MediaControl, // ModeSelect, // + MultipleFabrics, // OccupancySensing, // OnOff, // PowerSource, // @@ -322,6 +379,7 @@ function getTests() { PumpConfigurationControl, // PowerSourceConfiguration, // RelativeHumidityMeasurement, // + SecureChannel, // Switch, // TemperatureMeasurement, // Thermostat, // @@ -330,9 +388,13 @@ function getTests() { UserLabel, // WiFiNetworkDiagnostics, // WindowCovering, // + TV, // Others, // + MultiAdmin, // SoftwareDiagnostics, // Subscriptions, // + DoorLock, // + Groups, // ]; return tests.flat(1); } diff --git a/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h b/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h index a6a807e8f3f568..9606506ee4f4dd 100644 --- a/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h @@ -71,7 +71,7 @@ class TestList : public Command { printf("Test_TC_DD_1_9\n"); printf("Test_TC_DM_1_1\n"); printf("Test_TC_DM_3_1\n"); - printf("Test_TC_DL_1_3\n"); + printf("Test_TC_DM_2_2\n"); printf("Test_TC_EMR_1_1\n"); printf("Test_TC_ETHDIAG_1_1\n"); printf("Test_TC_ETHDIAG_2_1\n"); @@ -79,11 +79,11 @@ class TestList : public Command { printf("Test_TC_FLW_2_1\n"); printf("Test_TC_FLW_2_2\n"); printf("Test_TC_GC_1_1\n"); - printf("Test_TC_ILL_1_1\n"); - printf("Test_TC_ILL_2_1\n"); printf("Test_TC_I_1_1\n"); printf("Test_TC_I_2_1\n"); printf("Test_TC_I_2_3\n"); + printf("Test_TC_ILL_1_1\n"); + printf("Test_TC_ILL_2_1\n"); printf("Test_TC_LVL_1_1\n"); printf("Test_TC_LVL_2_1\n"); printf("Test_TC_LVL_2_2\n"); @@ -135,6 +135,7 @@ class TestList : public Command { printf("Test_TC_OO_2_1\n"); printf("Test_TC_OO_2_2\n"); printf("Test_TC_OO_2_3\n"); + printf("Test_TC_OO_2_4\n"); printf("Test_TC_PS_1_1\n"); printf("Test_TC_PS_2_1\n"); printf("Test_TC_PRS_1_1\n"); @@ -170,26 +171,50 @@ class TestList : public Command { printf("Test_TC_WNCV_2_3\n"); printf("Test_TC_WNCV_2_4\n"); printf("Test_TC_WNCV_2_5\n"); + printf("Test_TC_WNCV_3_1\n"); + printf("Test_TC_WNCV_3_2\n"); + printf("Test_TC_WNCV_3_3\n"); printf("Test_TC_WNCV_3_4\n"); printf("Test_TC_WNCV_3_5\n"); + printf("Test_TC_WNCV_4_1\n"); + printf("Test_TC_WNCV_4_2\n"); printf("Test_TC_WNCV_4_3\n"); printf("Test_TC_WNCV_4_4\n"); + printf("Test_TC_WNCV_4_5\n"); + printf("TV_TargetNavigatorCluster\n"); + printf("TV_AudioOutputCluster\n"); + printf("TV_ApplicationLauncherCluster\n"); + printf("TV_KeypadInputCluster\n"); + printf("TV_AccountLoginCluster\n"); + printf("TV_WakeOnLanCluster\n"); + printf("TV_ApplicationBasicCluster\n"); + printf("TV_MediaPlaybackCluster\n"); + printf("TV_ChannelCluster\n"); + printf("TV_LowPowerCluster\n"); + printf("TV_ContentLauncherCluster\n"); + printf("TV_MediaInputCluster\n"); printf("TestCluster\n"); - printf("TestSaveAs\n"); printf("TestConstraints\n"); printf("TestDelayCommands\n"); + printf("TestLogCommands\n"); + printf("TestSaveAs\n"); printf("TestDescriptorCluster\n"); - printf("TestGroupsCluster\n"); - printf("TestGroupKeyManagementCluster\n"); + printf("TestBasicInformation\n"); printf("TestIdentifyCluster\n"); - printf("TestLogCommands\n"); printf("TestOperationalCredentialsCluster\n"); + printf("TestModeSelectCluster\n"); printf("TestSelfFabricRemoval\n"); printf("TestBinding\n"); + printf("TestUserLabelCluster\n"); + printf("TestArmFailSafe\n"); printf("Test_TC_SWDIAG_1_1\n"); printf("Test_TC_SWDIAG_2_1\n"); printf("Test_TC_SWDIAG_3_1\n"); printf("TestSubscribe_OnOff\n"); + printf("DL_LockUnlock\n"); + printf("Test_TC_DL_1_3\n"); + printf("TestGroupsCluster\n"); + printf("TestGroupKeyManagementCluster\n"); return CHIP_NO_ERROR; } @@ -15837,11 +15862,11 @@ class Test_TC_DM_3_1 : public TestCommandBridge { } }; -class Test_TC_DL_1_3 : public TestCommandBridge { +class Test_TC_DM_2_2 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_DL_1_3() - : TestCommandBridge("Test_TC_DL_1_3") + Test_TC_DM_2_2() + : TestCommandBridge("Test_TC_DM_2_2") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -15851,7 +15876,7 @@ class Test_TC_DL_1_3 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_DL_1_3() {} + ~Test_TC_DM_2_2() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -15859,11 +15884,11 @@ class Test_TC_DL_1_3 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_DL_1_3\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_DM_2_2\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DL_1_3\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DM_2_2\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -15880,36 +15905,20 @@ class Test_TC_DL_1_3 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Create new PIN credential and lock/unlock user\n"); - err = TestCreateNewPinCredentialAndLockUnlockUser_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Query fabrics list\n"); + err = TestQueryFabricsList_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Precondition: Door is in locked state\n"); - err = TestPreconditionDoorIsInLockedState_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Query Supported Fabrics\n"); + err = TestQuerySupportedFabrics_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : TH writes AutoRelockTime attribute value as 10 seconds on the DUT\n"); - err = TestThWritesAutoRelockTimeAttributeValueAs10SecondsOnTheDut_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Query Commissioned Fabrics\n"); + err = TestQueryCommissionedFabrics_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : TH sends the unlock Door command to the DUT with valid PINCode\n"); - err = TestThSendsTheUnlockDoorCommandToTheDutWithValidPINCode_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : TH reads AutoRelockTime attribute from DUT\n"); - err = TestThReadsAutoRelockTimeAttributeFromDut_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Wait 10000ms\n"); - err = TestWait10000ms_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : TH reads LockState attriute\n"); - err = TestThReadsLockStateAttriute_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Clean the created credential\n"); - err = TestCleanTheCreatedCredential_8(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Query User Trusted Root Certificates\n"); + err = TestQueryUserTrustedRootCertificates_4(); break; } @@ -15926,7 +15935,7 @@ class Test_TC_DL_1_3 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 9; + const uint16_t mTestCount = 5; chip::Optional mNodeId; chip::Optional mCluster; @@ -15939,182 +15948,102 @@ class Test_TC_DL_1_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCreateNewPinCredentialAndLockUnlockUser_1() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[CHIPDoorLockClusterSetCredentialParams alloc] init]; - params.operationType = [NSNumber numberWithUnsignedChar:0]; - params.credential = [[CHIPDoorLockClusterDlCredential alloc] init]; - ((CHIPDoorLockClusterDlCredential *) params.credential).credentialType = [NSNumber numberWithUnsignedChar:1]; - ((CHIPDoorLockClusterDlCredential *) params.credential).credentialIndex = [NSNumber numberWithUnsignedShort:1U]; - - params.credentialData = [[NSData alloc] initWithBytes:"123456" length:6]; - params.userIndex = nil; - params.userStatus = nil; - params.userType = nil; - [cluster - setCredentialWithParams:params - completionHandler:^(CHIPDoorLockClusterSetCredentialResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Create new PIN credential and lock/unlock user Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0)); - } - - { - id actualValue = values.userIndex; - VerifyOrReturn(CheckValueNonNull("userIndex", actualValue)); - VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); - } - - { - id actualValue = values.nextCredentialIndex; - VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", actualValue)); - VerifyOrReturn(CheckValue("nextCredentialIndex", actualValue, 2U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestPreconditionDoorIsInLockedState_2() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[CHIPDoorLockClusterLockDoorParams alloc] init]; - params.pinCode = [[NSData alloc] initWithBytes:"123456" length:6]; - [cluster lockDoorWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Precondition: Door is in locked state Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThWritesAutoRelockTimeAttributeValueAs10SecondsOnTheDut_3() + CHIP_ERROR TestQueryFabricsList_1() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id autoRelockTimeArgument; - autoRelockTimeArgument = [NSNumber numberWithUnsignedInt:10UL]; - [cluster writeAttributeAutoRelockTimeWithValue:autoRelockTimeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH writes AutoRelockTime attribute value as 10 seconds on the DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThSendsTheUnlockDoorCommandToTheDutWithValidPINCode_4() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + CHIPReadParams * params = [[CHIPReadParams alloc] init]; + params.fabricFiltered = [NSNumber numberWithBool:true]; + [cluster readAttributeFabricsWithParams:params + completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Query fabrics list Error: %@", err); - __auto_type * params = [[CHIPDoorLockClusterUnlockDoorParams alloc] init]; - params.pinCode = [[NSData alloc] initWithBytes:"123456" length:6]; - [cluster unlockDoorWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends the unlock Door command to the DUT with valid PINCode Error: %@", err); + VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("Fabrics", [actualValue count], static_cast(1))); + VerifyOrReturn(CheckValueAsString("Label", + ((CHIPOperationalCredentialsClusterFabricDescriptor *) actualValue[0]).label, @"")); + } - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("fabrics", "", "list")); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsAutoRelockTimeAttributeFromDut_5() + CHIP_ERROR TestQuerySupportedFabrics_2() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAutoRelockTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads AutoRelockTime attribute from DUT Error: %@", err); + [cluster readAttributeSupportedFabricsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Query Supported Fabrics Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("AutoRelockTime", actualValue, 10UL)); + VerifyOrReturn(CheckValue("SupportedFabrics", actualValue, 16)); } + VerifyOrReturn(CheckConstraintType("supportedFabrics", "", "uint8")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWait10000ms_6() - { - WaitForMs(10000); - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThReadsLockStateAttriute_7() + CHIP_ERROR TestQueryCommissionedFabrics_3() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeLockStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads LockState attriute Error: %@", err); + [cluster readAttributeCommissionedFabricsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Query Commissioned Fabrics Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("LockState", actualValue)); - VerifyOrReturn(CheckValue("LockState", actualValue, 1)); + VerifyOrReturn(CheckValue("CommissionedFabrics", actualValue, 1)); } + VerifyOrReturn(CheckConstraintType("commissionedFabrics", "", "uint8")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestCleanTheCreatedCredential_8() + CHIP_ERROR TestQueryUserTrustedRootCertificates_4() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPDoorLockClusterClearCredentialParams alloc] init]; - params.credential = [[CHIPDoorLockClusterDlCredential alloc] init]; - ((CHIPDoorLockClusterDlCredential *) params.credential).credentialType = [NSNumber numberWithUnsignedChar:1]; - ((CHIPDoorLockClusterDlCredential *) params.credential).credentialIndex = [NSNumber numberWithUnsignedShort:1U]; - - [cluster clearCredentialWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Clean the created credential Error: %@", err); + [cluster readAttributeTrustedRootCertificatesWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Query User Trusted Root Certificates Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("trustedRootCertificates", "", "list")); + NextTest(); + }]; return CHIP_NO_ERROR; } @@ -17681,11 +17610,11 @@ class Test_TC_GC_1_1 : public TestCommandBridge { } }; -class Test_TC_ILL_1_1 : public TestCommandBridge { +class Test_TC_I_1_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_ILL_1_1() - : TestCommandBridge("Test_TC_ILL_1_1") + Test_TC_I_1_1() + : TestCommandBridge("Test_TC_I_1_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -17695,7 +17624,7 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_ILL_1_1() {} + ~Test_TC_I_1_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -17703,11 +17632,11 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_ILL_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_I_1_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_ILL_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_I_1_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -17724,8 +17653,8 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : read the global attribute: ClusterRevision\n"); - err = TestReadTheGlobalAttributeClusterRevision_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads the ClusterRevision attribute from the DUT\n"); + err = TestThReadsTheClusterRevisionAttributeFromTheDut_1(); break; case 2: ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute constraints : ClusterRevision\n"); @@ -17736,22 +17665,22 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { err = TestReadTheGlobalAttributeAttributeList_3(); break; case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_5(); + break; + case 6: ChipLogProgress(chipTool, - " ***** Test Step 4 : Read EventList attribute from the DUT and Verify that the DUT response provides a list of " + " ***** Test Step 6 : Read EventList attribute from the DUT and Verify that the DUT response provides a list of " "supported events.\n"); if (ShouldSkip("PICS_USER_PROMPT")) { NextTest(); return; } - err = TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: AcceptedCommandList\n"); - err = TestReadTheGlobalAttributeAcceptedCommandList_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Read the global attribute: GeneratedCommandList\n"); - err = TestReadTheGlobalAttributeGeneratedCommandList_6(); + err = TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_6(); break; case 7: ChipLogProgress(chipTool, @@ -17791,22 +17720,20 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + CHIP_ERROR TestThReadsTheClusterRevisionAttributeFromTheDut_1() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the global attribute: ClusterRevision Error: %@", err); + NSLog(@"TH reads the ClusterRevision attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 3U)); + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 4U)); } NextTest(); @@ -17818,9 +17745,7 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { @@ -17838,9 +17763,7 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { @@ -17850,16 +17773,13 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { { id actualValue = value; - VerifyOrReturn(CheckValue("AttributeList", [actualValue count], static_cast(9))); + VerifyOrReturn(CheckValue("AttributeList", [actualValue count], static_cast(6))); VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); - VerifyOrReturn(CheckValue("", actualValue[2], 2UL)); - VerifyOrReturn(CheckValue("", actualValue[3], 3UL)); - VerifyOrReturn(CheckValue("", actualValue[4], 4UL)); - VerifyOrReturn(CheckValue("", actualValue[5], 65528UL)); - VerifyOrReturn(CheckValue("", actualValue[6], 65529UL)); - VerifyOrReturn(CheckValue("", actualValue[7], 65531UL)); - VerifyOrReturn(CheckValue("", actualValue[8], 65533UL)); + VerifyOrReturn(CheckValue("", actualValue[2], 65528UL)); + VerifyOrReturn(CheckValue("", actualValue[3], 65529UL)); + VerifyOrReturn(CheckValue("", actualValue[4], 65531UL)); + VerifyOrReturn(CheckValue("", actualValue[5], 65533UL)); } VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); @@ -17869,18 +17789,10 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_4() - { - UserPrompt(@"Please enter 'y' for success", @"y"); - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_5() + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_4() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { @@ -17890,7 +17802,10 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { { id actualValue = value; - VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(3))); + VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); + VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); + VerifyOrReturn(CheckValue("", actualValue[2], 64UL)); } VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); @@ -17900,12 +17815,10 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_6() + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_5() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { @@ -17915,7 +17828,8 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { { id actualValue = value; - VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(1))); + VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); } VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); @@ -17925,6 +17839,12 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } + CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_6() + { + UserPrompt(@"Please enter 'y' for success", @"y"); + return CHIP_NO_ERROR; + } + CHIP_ERROR TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponseIndicatesFeatureMapAttributeHasTheValue0_7() { UserPrompt(@"Please enter '0' for success", @"0"); @@ -17932,11 +17852,11 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { } }; -class Test_TC_ILL_2_1 : public TestCommandBridge { +class Test_TC_I_2_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_ILL_2_1() - : TestCommandBridge("Test_TC_ILL_2_1") + Test_TC_I_2_1() + : TestCommandBridge("Test_TC_I_2_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -17946,7 +17866,7 @@ class Test_TC_ILL_2_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_ILL_2_1() {} + ~Test_TC_I_2_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -17954,11 +17874,11 @@ class Test_TC_ILL_2_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_ILL_2_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_I_2_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_ILL_2_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_I_2_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -17975,20 +17895,12 @@ class Test_TC_ILL_2_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads MinMeasuredValue attribute from DUT\n"); - err = TestThReadsMinMeasuredValueAttributeFromDut_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads the IdentifyTime attribute from the DUT\n"); + err = TestThReadsTheIdentifyTimeAttributeFromTheDut_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads MaxMeasuredValue attribute from DUT\n"); - err = TestThReadsMaxMeasuredValueAttributeFromDut_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads Tolerance attribute from DUT\n"); - err = TestThReadsToleranceAttributeFromDut_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads LightSensorType attribute from DUT\n"); - err = TestThReadsLightSensorTypeAttributeFromDut_4(); + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads the IdentifyType attribute from the DUT\n"); + err = TestThReadsTheIdentifyTypeAttributeFromTheDut_2(); break; } @@ -18005,7 +17917,7 @@ class Test_TC_ILL_2_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 5; + const uint16_t mTestCount = 3; chip::Optional mNodeId; chip::Optional mCluster; @@ -18018,79 +17930,41 @@ class Test_TC_ILL_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsMinMeasuredValueAttributeFromDut_1() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeMinMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads MinMeasuredValue attribute from DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("minMeasuredValue", "", "uint16")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("minMeasuredValue", [value unsignedShortValue], 1U)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("minMeasuredValue", [value unsignedShortValue], 65533U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThReadsMaxMeasuredValueAttributeFromDut_2() + CHIP_ERROR TestThReadsTheIdentifyTimeAttributeFromTheDut_1() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMaxMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads MaxMeasuredValue attribute from DUT Error: %@", err); + [cluster readAttributeIdentifyTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the IdentifyTime attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "", "uint16")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value unsignedShortValue], 2U)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("maxMeasuredValue", [value unsignedShortValue], 65534U)); - } - + VerifyOrReturn(CheckConstraintType("identifyTime", "", "uint16")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsToleranceAttributeFromDut_3() + CHIP_ERROR TestThReadsTheIdentifyTypeAttributeFromTheDut_2() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeToleranceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads Tolerance attribute from DUT Error: %@", err); + [cluster readAttributeIdentifyTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the IdentifyType attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("tolerance", "", "uint16")); + VerifyOrReturn(CheckConstraintType("identifyType", "", "enum8")); if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("tolerance", [value unsignedShortValue], 0U)); + VerifyOrReturn(CheckConstraintMinValue("identifyType", [value unsignedCharValue], 0)); } if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("tolerance", [value unsignedShortValue], 2048U)); + VerifyOrReturn(CheckConstraintMaxValue("identifyType", [value unsignedCharValue], 5)); } NextTest(); @@ -18098,33 +17972,13 @@ class Test_TC_ILL_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - - CHIP_ERROR TestThReadsLightSensorTypeAttributeFromDut_4() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeLightSensorTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads LightSensorType attribute from DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("lightSensorType", "", "enum8")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } }; -class Test_TC_I_1_1 : public TestCommandBridge { +class Test_TC_I_2_3 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_I_1_1() - : TestCommandBridge("Test_TC_I_1_1") + Test_TC_I_2_3() + : TestCommandBridge("Test_TC_I_2_3") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -18134,7 +17988,7 @@ class Test_TC_I_1_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_I_1_1() {} + ~Test_TC_I_2_3() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -18142,11 +17996,11 @@ class Test_TC_I_1_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_I_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_I_2_3\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_I_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_I_2_3\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -18159,408 +18013,44 @@ class Test_TC_I_1_1 : public TestCommandBridge { // 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(); + ChipLogProgress(chipTool, " ***** Test Step 0 : 1.Wait for the commissioned device to be retrieved\n"); + err = Test1WaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads the ClusterRevision attribute from the DUT\n"); - err = TestThReadsTheClusterRevisionAttributeFromTheDut_1(); + ChipLogProgress(chipTool, + " ***** Test Step 1 : TH sends TriggerEffect command to DUT with the effect identifier field set to 0x00 blink and " + "the effect variant field set to 0x00 default\n"); + err = TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0x00BlinkAndTheEffectVariantFieldSetTo0x00Default_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute constraints : ClusterRevision\n"); - err = TestReadTheGlobalAttributeConstraintsClusterRevision_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Manually check DUT executes a blink effect\n"); + err = TestManuallyCheckDutExecutesABlinkEffect_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); - err = TestReadTheGlobalAttributeAttributeList_3(); + ChipLogProgress(chipTool, + " ***** Test Step 3 : TH sends TriggerEffect command to DUT with the effect identifier field set to 0x01 breathe " + "and the effect variant field set to 0x00 default\n"); + err = TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0x01BreatheAndTheEffectVariantFieldSetTo0x00Default_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read the global attribute: AcceptedCommandList\n"); - err = TestReadTheGlobalAttributeAcceptedCommandList_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : check DUT executes a breathe effect\n"); + err = TestCheckDutExecutesABreatheEffect_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: GeneratedCommandList\n"); - err = TestReadTheGlobalAttributeGeneratedCommandList_5(); + ChipLogProgress(chipTool, + " ***** Test Step 5 : TH sends TriggerEffect command to DUT with the effect identifier field set to 0x02 okay and " + "the effect variant field set to 0x00 default\n"); + err = TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0x02OkayAndTheEffectVariantFieldSetTo0x00Default_5(); break; case 6: - ChipLogProgress(chipTool, - " ***** Test Step 6 : Read EventList attribute from the DUT and Verify that the DUT response provides a list of " - "supported events.\n"); - if (ShouldSkip("PICS_USER_PROMPT")) { - NextTest(); - return; - } - err = TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : check DUT executes an okay effect\n"); + err = TestCheckDutExecutesAnOkayEffect_6(); break; case 7: ChipLogProgress(chipTool, - " ***** Test Step 7 : Read FeatureMap attribute from the DUT and Verify that the DUT response indicates FeatureMap " - "attribute has the value 0\n"); - if (ShouldSkip("PICS_USER_PROMPT")) { - NextTest(); - return; - } - err = TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponseIndicatesFeatureMapAttributeHasTheValue0_7(); - 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 = 8; - - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThReadsTheClusterRevisionAttributeFromTheDut_1() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the ClusterRevision attribute from the DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 4U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute constraints : ClusterRevision Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AttributeList Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("AttributeList", [actualValue count], static_cast(6))); - VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); - VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); - VerifyOrReturn(CheckValue("", actualValue[2], 65528UL)); - VerifyOrReturn(CheckValue("", actualValue[3], 65529UL)); - VerifyOrReturn(CheckValue("", actualValue[4], 65531UL)); - VerifyOrReturn(CheckValue("", actualValue[5], 65533UL)); - } - - VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_4() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(3))); - VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); - VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); - VerifyOrReturn(CheckValue("", actualValue[2], 64UL)); - } - - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_5() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(1))); - VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); - } - - VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_6() - { - UserPrompt(@"Please enter 'y' for success", @"y"); - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponseIndicatesFeatureMapAttributeHasTheValue0_7() - { - UserPrompt(@"Please enter '0' for success", @"0"); - return CHIP_NO_ERROR; - } -}; - -class Test_TC_I_2_1 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_I_2_1() - : TestCommandBridge("Test_TC_I_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_I_2_1() {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_I_2_1\n"); - } - - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_I_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 the IdentifyTime attribute from the DUT\n"); - err = TestThReadsTheIdentifyTimeAttributeFromTheDut_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads the IdentifyType attribute from the DUT\n"); - err = TestThReadsTheIdentifyTypeAttributeFromTheDut_2(); - 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 = 3; - - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThReadsTheIdentifyTimeAttributeFromTheDut_1() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeIdentifyTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the IdentifyTime attribute from the DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("identifyTime", "", "uint16")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThReadsTheIdentifyTypeAttributeFromTheDut_2() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeIdentifyTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the IdentifyType attribute from the DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("identifyType", "", "enum8")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("identifyType", [value unsignedCharValue], 0)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("identifyType", [value unsignedCharValue], 5)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } -}; - -class Test_TC_I_2_3 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_I_2_3() - : TestCommandBridge("Test_TC_I_2_3") - , 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_I_2_3() {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_I_2_3\n"); - } - - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_I_2_3\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } - - Wait(); - - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : 1.Wait for the commissioned device to be retrieved\n"); - err = Test1WaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - case 1: - ChipLogProgress(chipTool, - " ***** Test Step 1 : TH sends TriggerEffect command to DUT with the effect identifier field set to 0x00 blink and " - "the effect variant field set to 0x00 default\n"); - err = TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0x00BlinkAndTheEffectVariantFieldSetTo0x00Default_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Manually check DUT executes a blink effect\n"); - err = TestManuallyCheckDutExecutesABlinkEffect_2(); - break; - case 3: - ChipLogProgress(chipTool, - " ***** Test Step 3 : TH sends TriggerEffect command to DUT with the effect identifier field set to 0x01 breathe " - "and the effect variant field set to 0x00 default\n"); - err = TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0x01BreatheAndTheEffectVariantFieldSetTo0x00Default_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : check DUT executes a breathe effect\n"); - err = TestCheckDutExecutesABreatheEffect_4(); - break; - case 5: - ChipLogProgress(chipTool, - " ***** Test Step 5 : TH sends TriggerEffect command to DUT with the effect identifier field set to 0x02 okay and " - "the effect variant field set to 0x00 default\n"); - err = TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0x02OkayAndTheEffectVariantFieldSetTo0x00Default_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : check DUT executes an okay effect\n"); - err = TestCheckDutExecutesAnOkayEffect_6(); - break; - case 7: - ChipLogProgress(chipTool, - " ***** Test Step 7 : TH sends TriggerEffect command to DUT with the effect identifier field set to 0x0b channel " - "change and the effect variant field set to 0x00 default\n"); - err = TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0x0bChannelChangeAndTheEffectVariantFieldSetTo0x00Default_7(); + " ***** Test Step 7 : TH sends TriggerEffect command to DUT with the effect identifier field set to 0x0b channel " + "change and the effect variant field set to 0x00 default\n"); + err = TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0x0bChannelChangeAndTheEffectVariantFieldSetTo0x00Default_7(); break; case 8: ChipLogProgress(chipTool, " ***** Test Step 8 : check DUT executes a channel change effect\n"); @@ -18957,11 +18447,11 @@ class Test_TC_I_2_3 : public TestCommandBridge { } }; -class Test_TC_LVL_1_1 : public TestCommandBridge { +class Test_TC_ILL_1_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_LVL_1_1() - : TestCommandBridge("Test_TC_LVL_1_1") + Test_TC_ILL_1_1() + : TestCommandBridge("Test_TC_ILL_1_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -18971,7 +18461,7 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_LVL_1_1() {} + ~Test_TC_ILL_1_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -18979,11 +18469,11 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_LVL_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_ILL_1_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_LVL_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_ILL_1_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -19009,10 +18499,6 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { break; case 3: ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { - NextTest(); - return; - } err = TestReadTheGlobalAttributeAttributeList_3(); break; case 4: @@ -19030,8 +18516,18 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { err = TestReadTheGlobalAttributeAcceptedCommandList_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : read the optional global attribute: FeatureMap\n"); - err = TestReadTheOptionalGlobalAttributeFeatureMap_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_6(); + break; + case 7: + ChipLogProgress(chipTool, + " ***** Test Step 7 : Read FeatureMap attribute from the DUT and Verify that the DUT response indicates FeatureMap " + "attribute has the value 0\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponseIndicatesFeatureMapAttributeHasTheValue0_7(); break; } @@ -19048,7 +18544,7 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 7; + const uint16_t mTestCount = 8; chip::Optional mNodeId; chip::Optional mCluster; @@ -19064,7 +18560,9 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { @@ -19074,7 +18572,7 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { { id actualValue = value; - VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 5U)); + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 3U)); } NextTest(); @@ -19086,7 +18584,9 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { @@ -19104,7 +18604,9 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { @@ -19114,21 +18616,16 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { { id actualValue = value; - VerifyOrReturn(CheckValue("AttributeList", [actualValue count], static_cast(14))); + VerifyOrReturn(CheckValue("AttributeList", [actualValue count], static_cast(9))); VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); VerifyOrReturn(CheckValue("", actualValue[2], 2UL)); VerifyOrReturn(CheckValue("", actualValue[3], 3UL)); VerifyOrReturn(CheckValue("", actualValue[4], 4UL)); - VerifyOrReturn(CheckValue("", actualValue[5], 5UL)); - VerifyOrReturn(CheckValue("", actualValue[6], 6UL)); - VerifyOrReturn(CheckValue("", actualValue[7], 10UL)); - VerifyOrReturn(CheckValue("", actualValue[8], 11UL)); - VerifyOrReturn(CheckValue("", actualValue[9], 12UL)); - VerifyOrReturn(CheckValue("", actualValue[10], 13UL)); - VerifyOrReturn(CheckValue("", actualValue[11], 14UL)); - VerifyOrReturn(CheckValue("", actualValue[12], 15UL)); - VerifyOrReturn(CheckValue("", actualValue[13], 16384UL)); + VerifyOrReturn(CheckValue("", actualValue[5], 65528UL)); + VerifyOrReturn(CheckValue("", actualValue[6], 65529UL)); + VerifyOrReturn(CheckValue("", actualValue[7], 65531UL)); + VerifyOrReturn(CheckValue("", actualValue[8], 65533UL)); } VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); @@ -19147,7 +18644,9 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_5() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { @@ -19157,15 +18656,7 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { { id actualValue = value; - VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(8))); - VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); - VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); - VerifyOrReturn(CheckValue("", actualValue[2], 2UL)); - VerifyOrReturn(CheckValue("", actualValue[3], 3UL)); - VerifyOrReturn(CheckValue("", actualValue[4], 4UL)); - VerifyOrReturn(CheckValue("", actualValue[5], 5UL)); - VerifyOrReturn(CheckValue("", actualValue[6], 6UL)); - VerifyOrReturn(CheckValue("", actualValue[7], 7UL)); + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); } VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); @@ -19175,34 +18666,43 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalGlobalAttributeFeatureMap_6() + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_6() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional global attribute: FeatureMap Error: %@", err); + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("FeatureMap", actualValue, 3UL)); + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); } + VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } + + CHIP_ERROR TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponseIndicatesFeatureMapAttributeHasTheValue0_7() + { + UserPrompt(@"Please enter '0' for success", @"0"); + return CHIP_NO_ERROR; + } }; -class Test_TC_LVL_2_1 : public TestCommandBridge { +class Test_TC_ILL_2_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_LVL_2_1() - : TestCommandBridge("Test_TC_LVL_2_1") + Test_TC_ILL_2_1() + : TestCommandBridge("Test_TC_ILL_2_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -19212,7 +18712,7 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_LVL_2_1() {} + ~Test_TC_ILL_2_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -19220,11 +18720,11 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_LVL_2_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_ILL_2_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_LVL_2_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_ILL_2_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -19241,64 +18741,20 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Reset level to 254\n"); - err = TestResetLevelTo254_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads MinMeasuredValue attribute from DUT\n"); + err = TestThReadsMinMeasuredValueAttributeFromDut_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Wait 100ms\n"); - err = TestWait100ms_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads MaxMeasuredValue attribute from DUT\n"); + err = TestThReadsMaxMeasuredValueAttributeFromDut_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Reads the CurrentLevel attribute\n"); - err = TestReadsTheCurrentLevelAttribute_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads Tolerance attribute from DUT\n"); + err = TestThReadsToleranceAttributeFromDut_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Reads the RemainingTime attribute\n"); - err = TestReadsTheRemainingTimeAttribute_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Reads the MinLevel attribute\n"); - err = TestReadsTheMinLevelAttribute_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Reads the MaxLevel attribute\n"); - err = TestReadsTheMaxLevelAttribute_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Reads the CurrentFrequency attribute\n"); - err = TestReadsTheCurrentFrequencyAttribute_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Reads the MinFrequency attribute\n"); - err = TestReadsTheMinFrequencyAttribute_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Reads the MaxFrequency attribute\n"); - err = TestReadsTheMaxFrequencyAttribute_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Reads the OnOffTransitionTime attribute\n"); - err = TestReadsTheOnOffTransitionTimeAttribute_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Reads the OnLevel attribute \n"); - err = TestReadsTheOnLevelAttribute_11(); - break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Reads the OnTransitionTime attribute \n"); - err = TestReadsTheOnTransitionTimeAttribute_12(); - break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Reads the OffTransitionTime attribute \n"); - err = TestReadsTheOffTransitionTimeAttribute_13(); - break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Reads the DefaultMoveRate attribute \n"); - err = TestReadsTheDefaultMoveRateAttribute_14(); - break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Reads the Options attribute \n"); - err = TestReadsTheOptionsAttribute_15(); + ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads LightSensorType attribute from DUT\n"); + err = TestThReadsLightSensorTypeAttributeFromDut_4(); break; } @@ -19315,7 +18771,7 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 16; + const uint16_t mTestCount = 5; chip::Optional mNodeId; chip::Optional mCluster; @@ -19328,24 +18784,497 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestResetLevelTo254_1() + CHIP_ERROR TestThReadsMinMeasuredValueAttributeFromDut_1() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPLevelControlClusterMoveToLevelParams alloc] init]; - params.level = [NSNumber numberWithUnsignedChar:254]; - params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; - params.optionMask = [NSNumber numberWithUnsignedChar:1]; - params.optionOverride = [NSNumber numberWithUnsignedChar:1]; - [cluster moveToLevelWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Reset level to 254 Error: %@", err); + [cluster readAttributeMinMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads MinMeasuredValue attribute from DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); + VerifyOrReturn(CheckConstraintType("minMeasuredValue", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("minMeasuredValue", [value unsignedShortValue], 1U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("minMeasuredValue", [value unsignedShortValue], 65533U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsMaxMeasuredValueAttributeFromDut_2() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMaxMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads MaxMeasuredValue attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value unsignedShortValue], 2U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("maxMeasuredValue", [value unsignedShortValue], 65534U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsToleranceAttributeFromDut_3() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeToleranceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads Tolerance attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("tolerance", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("tolerance", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("tolerance", [value unsignedShortValue], 2048U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsLightSensorTypeAttributeFromDut_4() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeLightSensorTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads LightSensorType attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("lightSensorType", "", "enum8")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_LVL_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_LVL_1_1() + : TestCommandBridge("Test_TC_LVL_1_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_LVL_1_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_LVL_1_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_LVL_1_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 : read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute constraints : ClusterRevision\n"); + err = TestReadTheGlobalAttributeConstraintsClusterRevision_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeAttributeList_3(); + break; + case 4: + ChipLogProgress(chipTool, + " ***** Test Step 4 : Read EventList attribute from the DUT and Verify that the DUT response provides a list of " + "supported events.\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : read the optional global attribute: FeatureMap\n"); + err = TestReadTheOptionalGlobalAttributeFeatureMap_6(); + 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 = 7; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the global attribute: ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 5U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute constraints : ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("AttributeList", [actualValue count], static_cast(14))); + VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); + VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); + VerifyOrReturn(CheckValue("", actualValue[2], 2UL)); + VerifyOrReturn(CheckValue("", actualValue[3], 3UL)); + VerifyOrReturn(CheckValue("", actualValue[4], 4UL)); + VerifyOrReturn(CheckValue("", actualValue[5], 5UL)); + VerifyOrReturn(CheckValue("", actualValue[6], 6UL)); + VerifyOrReturn(CheckValue("", actualValue[7], 10UL)); + VerifyOrReturn(CheckValue("", actualValue[8], 11UL)); + VerifyOrReturn(CheckValue("", actualValue[9], 12UL)); + VerifyOrReturn(CheckValue("", actualValue[10], 13UL)); + VerifyOrReturn(CheckValue("", actualValue[11], 14UL)); + VerifyOrReturn(CheckValue("", actualValue[12], 15UL)); + VerifyOrReturn(CheckValue("", actualValue[13], 16384UL)); + } + + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_4() + { + UserPrompt(@"Please enter 'y' for success", @"y"); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_5() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(8))); + VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); + VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); + VerifyOrReturn(CheckValue("", actualValue[2], 2UL)); + VerifyOrReturn(CheckValue("", actualValue[3], 3UL)); + VerifyOrReturn(CheckValue("", actualValue[4], 4UL)); + VerifyOrReturn(CheckValue("", actualValue[5], 5UL)); + VerifyOrReturn(CheckValue("", actualValue[6], 6UL)); + VerifyOrReturn(CheckValue("", actualValue[7], 7UL)); + } + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalGlobalAttributeFeatureMap_6() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the optional global attribute: FeatureMap Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 3UL)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_LVL_2_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_LVL_2_1() + : TestCommandBridge("Test_TC_LVL_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_LVL_2_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_LVL_2_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_LVL_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 : Reset level to 254\n"); + err = TestResetLevelTo254_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Wait 100ms\n"); + err = TestWait100ms_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Reads the CurrentLevel attribute\n"); + err = TestReadsTheCurrentLevelAttribute_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Reads the RemainingTime attribute\n"); + err = TestReadsTheRemainingTimeAttribute_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Reads the MinLevel attribute\n"); + err = TestReadsTheMinLevelAttribute_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Reads the MaxLevel attribute\n"); + err = TestReadsTheMaxLevelAttribute_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Reads the CurrentFrequency attribute\n"); + err = TestReadsTheCurrentFrequencyAttribute_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Reads the MinFrequency attribute\n"); + err = TestReadsTheMinFrequencyAttribute_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Reads the MaxFrequency attribute\n"); + err = TestReadsTheMaxFrequencyAttribute_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Reads the OnOffTransitionTime attribute\n"); + err = TestReadsTheOnOffTransitionTimeAttribute_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Reads the OnLevel attribute \n"); + err = TestReadsTheOnLevelAttribute_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Reads the OnTransitionTime attribute \n"); + err = TestReadsTheOnTransitionTimeAttribute_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : Reads the OffTransitionTime attribute \n"); + err = TestReadsTheOffTransitionTimeAttribute_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Reads the DefaultMoveRate attribute \n"); + err = TestReadsTheDefaultMoveRateAttribute_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Reads the Options attribute \n"); + err = TestReadsTheOptionsAttribute_15(); + 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 = 16; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestResetLevelTo254_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPLevelControlClusterMoveToLevelParams alloc] init]; + params.level = [NSNumber numberWithUnsignedChar:254]; + params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; + params.optionMask = [NSNumber numberWithUnsignedChar:1]; + params.optionOverride = [NSNumber numberWithUnsignedChar:1]; + [cluster moveToLevelWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Reset level to 254 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); }]; return CHIP_NO_ERROR; @@ -31097,6 +31026,520 @@ class Test_TC_OO_2_3 : public TestCommandBridge { } }; +class Test_TC_OO_2_4 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_OO_2_4() + : TestCommandBridge("Test_TC_OO_2_4") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("discriminator", 0, UINT16_MAX, &mDiscriminator); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_OO_2_4() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_OO_2_4\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OO_2_4\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 sends On command to DUT\n"); + err = TestThSendsOnCommandToDut_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : TH writes a value of 0 to StartUpOnOff attribute of DUT\n"); + err = TestThWritesAValueOf0ToStartUpOnOffAttributeOfDut_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads the StartUpOnOff attribute from the DUT\n"); + err = TestThReadsTheStartUpOnOffAttributeFromTheDut_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Power off DUT\n"); + err = TestPowerOffDut_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : TH reads the OnOff attribute from the DUT\n"); + err = TestThReadsTheOnOffAttributeFromTheDut_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : TH writes a value of 1 to StartUpOnOff attribute of DUT\n"); + err = TestThWritesAValueOf1ToStartUpOnOffAttributeOfDut_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Power off DUT\n"); + err = TestPowerOffDut_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : TH reads the OnOff attribute from the DUT\n"); + err = TestThReadsTheOnOffAttributeFromTheDut_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : TH writes a value of 2 to StartUpOnOff attribute of DUT\n"); + err = TestThWritesAValueOf2ToStartUpOnOffAttributeOfDut_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Power off DUT\n"); + err = TestPowerOffDut_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : TH reads the OnOff attribute from the DUT\n"); + err = TestThReadsTheOnOffAttributeFromTheDut_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Power off DUT\n"); + err = TestPowerOffDut_15(); + break; + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : TH reads the OnOff attribute from the DUT\n"); + err = TestThReadsTheOnOffAttributeFromTheDut_17(); + break; + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : TH writes NULL to StartUpOnOff attribute of DUT\n"); + err = TestThWritesNullToStartUpOnOffAttributeOfDut_18(); + break; + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : Power off DUT\n"); + err = TestPowerOffDut_19(); + break; + case 20: + ChipLogProgress(chipTool, " ***** Test Step 20 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_20(); + break; + case 21: + ChipLogProgress(chipTool, " ***** Test Step 21 : TH reads the OnOff attribute from the DUT\n"); + err = TestThReadsTheOnOffAttributeFromTheDut_21(); + break; + case 22: + ChipLogProgress(chipTool, " ***** Test Step 22 : TH sends Off command to DUT\n"); + err = TestThSendsOffCommandToDut_22(); + break; + case 23: + ChipLogProgress(chipTool, " ***** Test Step 23 : Power off DUT\n"); + err = TestPowerOffDut_23(); + break; + case 24: + ChipLogProgress(chipTool, " ***** Test Step 24 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_24(); + break; + case 25: + ChipLogProgress(chipTool, " ***** Test Step 25 : TH reads the OnOff attribute from the DUT\n"); + err = TestThReadsTheOnOffAttributeFromTheDut_25(); + 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 = 26; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mDiscriminator; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThSendsOnCommandToDut_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster onWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends On command to DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThWritesAValueOf0ToStartUpOnOffAttributeOfDut_2() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id startUpOnOffArgument; + startUpOnOffArgument = [NSNumber numberWithUnsignedChar:0]; + [cluster writeAttributeStartUpOnOffWithValue:startUpOnOffArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH writes a value of 0 to StartUpOnOff attribute of DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsTheStartUpOnOffAttributeFromTheDut_3() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeStartUpOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the StartUpOnOff attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("StartUpOnOff", actualValue)); + VerifyOrReturn(CheckValue("StartUpOnOff", actualValue, 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestPowerOffDut_4() + { + Reboot(mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_5() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsTheOnOffAttributeFromTheDut_6() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the OnOff attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThWritesAValueOf1ToStartUpOnOffAttributeOfDut_7() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id startUpOnOffArgument; + startUpOnOffArgument = [NSNumber numberWithUnsignedChar:1]; + [cluster writeAttributeStartUpOnOffWithValue:startUpOnOffArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH writes a value of 1 to StartUpOnOff attribute of DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestPowerOffDut_8() + { + Reboot(mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_9() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsTheOnOffAttributeFromTheDut_10() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the OnOff attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThWritesAValueOf2ToStartUpOnOffAttributeOfDut_11() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id startUpOnOffArgument; + startUpOnOffArgument = [NSNumber numberWithUnsignedChar:2]; + [cluster writeAttributeStartUpOnOffWithValue:startUpOnOffArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH writes a value of 2 to StartUpOnOff attribute of DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestPowerOffDut_12() + { + Reboot(mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_13() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsTheOnOffAttributeFromTheDut_14() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the OnOff attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestPowerOffDut_15() + { + Reboot(mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_16() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsTheOnOffAttributeFromTheDut_17() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the OnOff attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThWritesNullToStartUpOnOffAttributeOfDut_18() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id startUpOnOffArgument; + startUpOnOffArgument = nil; + [cluster writeAttributeStartUpOnOffWithValue:startUpOnOffArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH writes NULL to StartUpOnOff attribute of DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestPowerOffDut_19() + { + Reboot(mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_20() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsTheOnOffAttributeFromTheDut_21() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the OnOff attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThSendsOffCommandToDut_22() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster offWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends Off command to DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestPowerOffDut_23() + { + Reboot(mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_24() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsTheOnOffAttributeFromTheDut_25() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the OnOff attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + class Test_TC_PS_1_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced @@ -46553,23 +46996,21 @@ class Test_TC_WNCV_2_5 : public TestCommandBridge { } }; -class Test_TC_WNCV_3_4 : public TestCommandBridge { +class Test_TC_WNCV_3_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_WNCV_3_4() - : TestCommandBridge("Test_TC_WNCV_3_4") + Test_TC_WNCV_3_1() + : TestCommandBridge("Test_TC_WNCV_3_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("fastMotionDuration", 0, UINT16_MAX, &mFastMotionDuration); - AddArgument("fullMotionDuration", 0, UINT16_MAX, &mFullMotionDuration); AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_WNCV_3_4() {} + ~Test_TC_WNCV_3_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -46577,11 +47018,11 @@ class Test_TC_WNCV_3_4 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_3_4\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_3_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_3_4\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_3_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -46603,54 +47044,154 @@ class Test_TC_WNCV_3_4 : public TestCommandBridge { err = Test1aThSendsDownOrCloseCommandToPrepositionTheDutInTheOppositeDirection_1(); break; case 2: - ChipLogProgress( - chipTool, " ***** Test Step 2 : 1b: TH Waits for fastMotionDuration seconds movement(s) on the device\n"); - err = Test1bThWaitsForFastMotionDurationSecondsMovementsOnTheDevice_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : 1b: TH Waits for 10 seconds movement(s) on the device\n"); + err = Test1bThWaitsFor10SecondsMovementsOnTheDevice_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : 2a: TH sends UpOrOpen command to DUT\n"); - err = Test2aThSendsUpOrOpenCommandToDut_3(); + ChipLogProgress( + chipTool, " ***** Test Step 3 : 1c: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT\n"); + if (ShouldSkip("WNCV_LF && WNCV_PA_LF")) { + NextTest(); + return; + } + err = Test1cIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_3(); break; case 4: - ChipLogProgress( - chipTool, " ***** Test Step 4 : 2b: TH Waits for fullMotionDuration seconds movement(s) on the device\n"); - err = Test2bThWaitsForFullMotionDurationSecondsMovementsOnTheDevice_4(); + ChipLogProgress(chipTool, + " ***** Test Step 4 : 1d: If (PA & LF) TH reads CurrentPositionLiftPercentage optional attribute from DUT\n"); + if (ShouldSkip("WNCV_LF && WNCV_PA_LF && A_CURRENTPOSITIONLIFTPERCENTAGE")) { + NextTest(); + return; + } + err = Test1dIfPaLfThReadsCurrentPositionLiftPercentageOptionalAttributeFromDut_4(); break; case 5: ChipLogProgress( - chipTool, " ***** Test Step 5 : 3a: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT\n"); - if (ShouldSkip("WNCV_LF && WNCV_PA_LF")) { + chipTool, " ***** Test Step 5 : 1e: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT\n"); + if (ShouldSkip("WNCV_TL && WNCV_PA_TL")) { NextTest(); return; } - err = Test3aIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_5(); + err = Test1eIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_5(); break; case 6: ChipLogProgress(chipTool, - " ***** Test Step 6 : 3b: If (PA & LF) TH reads CurrentPositionLiftPercentage optional attribute from DUT\n"); - if (ShouldSkip("WNCV_LF && WNCV_PA_LF && A_CURRENTPOSITIONLIFTPERCENTAGE")) { + " ***** Test Step 6 : 1f: If (PA & TL) TH reads CurrentPositionTiltPercentage optional attribute from DUT\n"); + if (ShouldSkip("WNCV_TL && WNCV_PA_TL && A_CURRENTPOSITIONTILTPERCENTAGE")) { NextTest(); return; } - err = Test3bIfPaLfThReadsCurrentPositionLiftPercentageOptionalAttributeFromDut_6(); + err = Test1fIfPaTlThReadsCurrentPositionTiltPercentageOptionalAttributeFromDut_6(); break; case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Report: 2: Subscribe to DUT reports on OperationalStatus attribute\n"); + err = TestReport2SubscribeToDutReportsOnOperationalStatusAttribute_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : 2: Subscribe to DUT reports on OperationalStatus attribute\n"); + err = Test2SubscribeToDutReportsOnOperationalStatusAttribute_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : 2a: TH sends UpOrOpen command to DUT\n"); + err = Test2aThSendsUpOrOpenCommandToDut_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : 2b: DUT updates its attributes\n"); + err = Test2bDutUpdatesItsAttributes_10(); + break; + case 11: ChipLogProgress( - chipTool, " ***** Test Step 7 : 3c: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT\n"); + chipTool, " ***** Test Step 11 : 2c: If (PA & LF) TH reads TargetPositionLiftPercent100ths attribute from DUT\n"); + if (ShouldSkip("WNCV_LF && WNCV_PA_LF")) { + NextTest(); + return; + } + err = Test2cIfPaLfThReadsTargetPositionLiftPercent100thsAttributeFromDut_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : 2e: TH leave the device moving for 2 seconds\n"); + err = Test2eThLeaveTheDeviceMovingFor2Seconds_12(); + break; + case 13: + ChipLogProgress( + chipTool, " ***** Test Step 13 : 3a1: Verify DUT reports OperationalStatus attribute to TH after a UpOrOpen\n"); + err = Test3a1VerifyDutReportsOperationalStatusAttributeToThAfterAUpOrOpen_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : 3a2: DUT updates its attributes\n"); + err = Test3a2DutUpdatesItsAttributes_14(); + break; + case 15: + ChipLogProgress( + chipTool, " ***** Test Step 15 : 3b: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT\n"); + if (ShouldSkip("WNCV_LF && WNCV_PA_LF")) { + NextTest(); + return; + } + err = Test3bIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_15(); + break; + case 16: + ChipLogProgress(chipTool, + " ***** Test Step 16 : 3c: If (PA & LF) TH reads CurrentPositionLiftPercentage optional attribute from DUT\n"); + if (ShouldSkip("WNCV_LF && WNCV_PA_LF && A_CURRENTPOSITIONLIFTPERCENTAGE")) { + NextTest(); + return; + } + err = Test3cIfPaLfThReadsCurrentPositionLiftPercentageOptionalAttributeFromDut_16(); + break; + case 17: + ChipLogProgress( + chipTool, " ***** Test Step 17 : 3d: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT\n"); if (ShouldSkip("WNCV_TL && WNCV_PA_TL")) { NextTest(); return; } - err = Test3cIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_7(); + err = Test3dIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_17(); break; - case 8: + case 18: ChipLogProgress(chipTool, - " ***** Test Step 8 : 3d: If (PA & TL) TH reads CurrentPositionTiltPercentage optional attribute from DUT\n"); - if (ShouldSkip("WNCV_TL && WNCV_PA_TL && A_CURRENTPOSITIONLIFTPERCENTAGE")) { + " ***** Test Step 18 : 3e: If (PA & LF) TH reads CurrentPositionTiltPercentage optional attribute from DUT\n"); + if (ShouldSkip("WNCV_TL && WNCV_PA_TL && A_CURRENTPOSITIONTILTPERCENTAGE")) { NextTest(); return; } - err = Test3dIfPaTlThReadsCurrentPositionTiltPercentageOptionalAttributeFromDut_8(); + err = Test3eIfPaLfThReadsCurrentPositionTiltPercentageOptionalAttributeFromDut_18(); + break; + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : 4a: TH sends a StopMotion command to DUT\n"); + err = Test4aThSendsAStopMotionCommandToDut_19(); + break; + case 20: + ChipLogProgress( + chipTool, " ***** Test Step 20 : 4b: TH waits for 3 seconds the end of inertial movement(s) on the device\n"); + err = Test4bThWaitsFor3SecondsTheEndOfInertialMovementsOnTheDevice_20(); + break; + case 21: + ChipLogProgress( + chipTool, " ***** Test Step 21 : 4c: Verify DUT update OperationalStatus attribute to TH after a StopMotion\n"); + err = Test4cVerifyDutUpdateOperationalStatusAttributeToThAfterAStopMotion_21(); + break; + case 22: + ChipLogProgress(chipTool, " ***** Test Step 22 : 5a: TH waits for x seconds attributes update on the device\n"); + err = Test5aThWaitsForXSecondsAttributesUpdateOnTheDevice_22(); + break; + case 23: + ChipLogProgress( + chipTool, " ***** Test Step 23 : 5b: If (PA & LF) TH reads TargetPositionLiftPercent100ths attribute from DUT\n"); + if (ShouldSkip("WNCV_LF && WNCV_PA_LF")) { + NextTest(); + return; + } + err = Test5bIfPaLfThReadsTargetPositionLiftPercent100thsAttributeFromDut_23(); + break; + case 24: + ChipLogProgress( + chipTool, " ***** Test Step 24 : 5c: If (PA & TL) TH reads TargetPositionTiltPercent100ths attribute from DUT\n"); + if (ShouldSkip("WNCV_TL && WNCV_PA_TL")) { + NextTest(); + return; + } + err = Test5cIfPaTlThReadsTargetPositionTiltPercent100thsAttributeFromDut_24(); break; } @@ -46667,13 +47208,11 @@ class Test_TC_WNCV_3_4 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 9; + const uint16_t mTestCount = 25; chip::Optional mNodeId; chip::Optional mCluster; chip::Optional mEndpoint; - chip::Optional mFastMotionDuration; - chip::Optional mFullMotionDuration; chip::Optional mTimeout; CHIP_ERROR Test0WaitForTheCommissionedDeviceToBeRetrieved_0() @@ -46699,36 +47238,13 @@ class Test_TC_WNCV_3_4 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR Test1bThWaitsForFastMotionDurationSecondsMovementsOnTheDevice_2() - { - WaitForMs(mFastMotionDuration.HasValue() ? mFastMotionDuration.Value() : 3000U); - return CHIP_NO_ERROR; - } - - CHIP_ERROR Test2aThSendsUpOrOpenCommandToDut_3() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster upOrOpenWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"2a: TH sends UpOrOpen command to DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR Test2bThWaitsForFullMotionDurationSecondsMovementsOnTheDevice_4() + CHIP_ERROR Test1bThWaitsFor10SecondsMovementsOnTheDevice_2() { - WaitForMs(mFullMotionDuration.HasValue() ? mFullMotionDuration.Value() : 6000U); + WaitForMs(10000); return CHIP_NO_ERROR; } - CHIP_ERROR Test3aIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_5() + CHIP_ERROR Test1cIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_3() { CHIPDevice * device = GetConnectedDevice(); CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -46736,14 +47252,18 @@ class Test_TC_WNCV_3_4 : public TestCommandBridge { [cluster readAttributeCurrentPositionLiftPercent100thsWithCompletionHandler:^( NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3a: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT Error: %@", err); + NSLog(@"1c: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("CurrentPositionLiftPercent100ths", actualValue)); - VerifyOrReturn(CheckValue("CurrentPositionLiftPercent100ths", actualValue, 0U)); + VerifyOrReturn(CheckConstraintType("currentPositionLiftPercent100ths", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue( + "currentPositionLiftPercent100ths", [value unsignedShortValue], 1U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue( + "currentPositionLiftPercent100ths", [value unsignedShortValue], 10000U)); } NextTest(); @@ -46752,7 +47272,7 @@ class Test_TC_WNCV_3_4 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR Test3bIfPaLfThReadsCurrentPositionLiftPercentageOptionalAttributeFromDut_6() + CHIP_ERROR Test1dIfPaLfThReadsCurrentPositionLiftPercentageOptionalAttributeFromDut_4() { CHIPDevice * device = GetConnectedDevice(); CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -46760,14 +47280,18 @@ class Test_TC_WNCV_3_4 : public TestCommandBridge { [cluster readAttributeCurrentPositionLiftPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3b: If (PA & LF) TH reads CurrentPositionLiftPercentage optional attribute from DUT Error: %@", err); + NSLog(@"1d: If (PA & LF) TH reads CurrentPositionLiftPercentage optional attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("CurrentPositionLiftPercentage", actualValue)); - VerifyOrReturn(CheckValue("CurrentPositionLiftPercentage", actualValue, 0)); + VerifyOrReturn(CheckConstraintType("currentPositionLiftPercentage", "", "uint8")); + if (value != nil) { + VerifyOrReturn( + CheckConstraintMinValue("currentPositionLiftPercentage", [value unsignedCharValue], 1)); + } + if (value != nil) { + VerifyOrReturn( + CheckConstraintMaxValue("currentPositionLiftPercentage", [value unsignedCharValue], 100)); } NextTest(); @@ -46776,7 +47300,7 @@ class Test_TC_WNCV_3_4 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR Test3cIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_7() + CHIP_ERROR Test1eIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_5() { CHIPDevice * device = GetConnectedDevice(); CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -46784,14 +47308,18 @@ class Test_TC_WNCV_3_4 : public TestCommandBridge { [cluster readAttributeCurrentPositionTiltPercent100thsWithCompletionHandler:^( NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3c: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT Error: %@", err); + NSLog(@"1e: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("CurrentPositionTiltPercent100ths", actualValue)); - VerifyOrReturn(CheckValue("CurrentPositionTiltPercent100ths", actualValue, 0U)); + VerifyOrReturn(CheckConstraintType("currentPositionTiltPercent100ths", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue( + "currentPositionTiltPercent100ths", [value unsignedShortValue], 1U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue( + "currentPositionTiltPercent100ths", [value unsignedShortValue], 10000U)); } NextTest(); @@ -46800,7 +47328,7 @@ class Test_TC_WNCV_3_4 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR Test3dIfPaTlThReadsCurrentPositionTiltPercentageOptionalAttributeFromDut_8() + CHIP_ERROR Test1fIfPaTlThReadsCurrentPositionTiltPercentageOptionalAttributeFromDut_6() { CHIPDevice * device = GetConnectedDevice(); CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -46808,14 +47336,18 @@ class Test_TC_WNCV_3_4 : public TestCommandBridge { [cluster readAttributeCurrentPositionTiltPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3d: If (PA & TL) TH reads CurrentPositionTiltPercentage optional attribute from DUT Error: %@", err); + NSLog(@"1f: If (PA & TL) TH reads CurrentPositionTiltPercentage optional attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("CurrentPositionTiltPercentage", actualValue)); - VerifyOrReturn(CheckValue("CurrentPositionTiltPercentage", actualValue, 0)); + VerifyOrReturn(CheckConstraintType("currentPositionTiltPercentage", "", "uint8")); + if (value != nil) { + VerifyOrReturn( + CheckConstraintMinValue("currentPositionTiltPercentage", [value unsignedCharValue], 1)); + } + if (value != nil) { + VerifyOrReturn( + CheckConstraintMaxValue("currentPositionTiltPercentage", [value unsignedCharValue], 100)); } NextTest(); @@ -46823,184 +47355,144 @@ class Test_TC_WNCV_3_4 : public TestCommandBridge { return CHIP_NO_ERROR; } -}; + bool testSendClusterTest_TC_WNCV_3_1_000007_WaitForReport_Fulfilled = false; + ResponseHandler _Nullable test_Test_TC_WNCV_3_1_OperationalStatus_Reported = nil; -class Test_TC_WNCV_3_5 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_WNCV_3_5() - : TestCommandBridge("Test_TC_WNCV_3_5") - , mTestIndex(0) + CHIP_ERROR TestReport2SubscribeToDutReportsOnOperationalStatusAttribute_7() { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("fastMotionDuration", 0, UINT16_MAX, &mFastMotionDuration); - AddArgument("fullMotionDuration", 0, UINT16_MAX, &mFullMotionDuration); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - ~Test_TC_WNCV_3_5() {} + test_Test_TC_WNCV_3_1_OperationalStatus_Reported = ^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Report: 2: Subscribe to DUT reports on OperationalStatus attribute Error: %@", err); - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; + VerifyOrReturn(CheckValue("status", err, 0)); - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_3_5\n"); - } + VerifyOrReturn(CheckConstraintType("operationalStatus", "", "map8")); + testSendClusterTest_TC_WNCV_3_1_000007_WaitForReport_Fulfilled = true; + }; - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_3_5\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + NextTest(); + return CHIP_NO_ERROR; + } - Wait(); + CHIP_ERROR Test2SubscribeToDutReportsOnOperationalStatusAttribute_8() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - // 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 : 0: Wait for the commissioned device to be retrieved\n"); - err = Test0WaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - case 1: - ChipLogProgress( - chipTool, " ***** Test Step 1 : 1a: TH sends UpOrOpen command to preposition the DUT in the opposite direction\n"); - err = Test1aThSendsUpOrOpenCommandToPrepositionTheDutInTheOppositeDirection_1(); - break; - case 2: - ChipLogProgress( - chipTool, " ***** Test Step 2 : 1b: TH Waits for fastMotionDuration seconds movement(s) on the device\n"); - err = Test1bThWaitsForFastMotionDurationSecondsMovementsOnTheDevice_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : 2a: TH sends DownOrClose command to DUT\n"); - err = Test2aThSendsDownOrCloseCommandToDut_3(); - break; - case 4: - ChipLogProgress( - chipTool, " ***** Test Step 4 : 2b: TH Waits for fullMotionDuration seconds movement(s) on the device\n"); - err = Test2bThWaitsForFullMotionDurationSecondsMovementsOnTheDevice_4(); - break; - case 5: - ChipLogProgress( - chipTool, " ***** Test Step 5 : 3a: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT\n"); - if (ShouldSkip("WNCV_LF && WNCV_PA_LF")) { - NextTest(); - return; - } - err = Test3aIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_5(); - break; - case 6: - ChipLogProgress(chipTool, - " ***** Test Step 6 : 3b: If (PA & LF) TH reads CurrentPositionLiftPercentage optional attribute from DUT\n"); - if (ShouldSkip("WNCV_LF && WNCV_PA_LF && A_CURRENTPOSITIONLIFTPERCENTAGE")) { - NextTest(); - return; - } - err = Test3bIfPaLfThReadsCurrentPositionLiftPercentageOptionalAttributeFromDut_6(); - break; - case 7: - ChipLogProgress( - chipTool, " ***** Test Step 7 : 3c: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT\n"); - if (ShouldSkip("WNCV_TL && WNCV_PA_TL")) { - NextTest(); - return; - } - err = Test3cIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_7(); - break; - case 8: - ChipLogProgress(chipTool, - " ***** Test Step 8 : 3d: If (PA & TL) TH reads CurrentPositionTiltPercentage optional attribute from DUT\n"); - if (ShouldSkip("WNCV_TL && WNCV_PA_TL && A_CURRENTPOSITIONLIFTPERCENTAGE")) { + uint16_t minIntervalArgument = 4U; + uint16_t maxIntervalArgument = 5U; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + [cluster subscribeAttributeOperationalStatusWithMinInterval:[NSNumber numberWithUnsignedInt:minIntervalArgument] + maxInterval:[NSNumber numberWithUnsignedInt:maxIntervalArgument] + params:params + subscriptionEstablished:^{ + VerifyOrReturn(testSendClusterTest_TC_WNCV_3_1_000007_WaitForReport_Fulfilled, + SetCommandExitStatus(CHIP_ERROR_INCORRECT_STATE)); NextTest(); - return; } - err = Test3dIfPaTlThReadsCurrentPositionTiltPercentageOptionalAttributeFromDut_8(); - break; - } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"2: Subscribe to DUT reports on OperationalStatus attribute Error: %@", err); - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + VerifyOrReturn(CheckValue("status", err, 0)); + if (test_Test_TC_WNCV_3_1_OperationalStatus_Reported != nil) { + ResponseHandler callback = test_Test_TC_WNCV_3_1_OperationalStatus_Reported; + test_Test_TC_WNCV_3_1_OperationalStatus_Reported = nil; + callback(value, err); + } + }]; + + return CHIP_NO_ERROR; } - chip::System::Clock::Timeout GetWaitDuration() const override + CHIP_ERROR Test2aThSendsUpOrOpenCommandToDut_9() { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 9; + [cluster upOrOpenWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"2a: TH sends UpOrOpen command to DUT Error: %@", err); - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mFastMotionDuration; - chip::Optional mFullMotionDuration; - chip::Optional mTimeout; + VerifyOrReturn(CheckValue("status", err, 0)); - CHIP_ERROR Test0WaitForTheCommissionedDeviceToBeRetrieved_0() + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test2bDutUpdatesItsAttributes_10() { - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + WaitForMs(100); return CHIP_NO_ERROR; } - CHIP_ERROR Test1aThSendsUpOrOpenCommandToPrepositionTheDutInTheOppositeDirection_1() + CHIP_ERROR Test2cIfPaLfThReadsTargetPositionLiftPercent100thsAttributeFromDut_11() { CHIPDevice * device = GetConnectedDevice(); CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster upOrOpenWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"1a: TH sends UpOrOpen command to preposition the DUT in the opposite direction Error: %@", err); + [cluster readAttributeTargetPositionLiftPercent100thsWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"2c: If (PA & LF) TH reads TargetPositionLiftPercent100ths attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("TargetPositionLiftPercent100ths", actualValue)); + VerifyOrReturn(CheckValue("TargetPositionLiftPercent100ths", actualValue, 0U)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test1bThWaitsForFastMotionDurationSecondsMovementsOnTheDevice_2() + CHIP_ERROR Test2eThLeaveTheDeviceMovingFor2Seconds_12() { - WaitForMs(mFastMotionDuration.HasValue() ? mFastMotionDuration.Value() : 3000U); + WaitForMs(2000); return CHIP_NO_ERROR; } - CHIP_ERROR Test2aThSendsDownOrCloseCommandToDut_3() + CHIP_ERROR Test3a1VerifyDutReportsOperationalStatusAttributeToThAfterAUpOrOpen_13() { CHIPDevice * device = GetConnectedDevice(); CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster downOrCloseWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"2a: TH sends DownOrClose command to DUT Error: %@", err); + test_Test_TC_WNCV_3_1_OperationalStatus_Reported = ^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3a1: Verify DUT reports OperationalStatus attribute to TH after a UpOrOpen Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckConstraintType("operationalStatus", "", "map8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("operationalStatus", [value unsignedCharValue], 5)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("operationalStatus", [value unsignedCharValue], 21)); + } + NextTest(); - }]; + }; return CHIP_NO_ERROR; } - CHIP_ERROR Test2bThWaitsForFullMotionDurationSecondsMovementsOnTheDevice_4() + CHIP_ERROR Test3a2DutUpdatesItsAttributes_14() { - WaitForMs(mFullMotionDuration.HasValue() ? mFullMotionDuration.Value() : 6000U); + WaitForMs(2000); return CHIP_NO_ERROR; } - CHIP_ERROR Test3aIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_5() + CHIP_ERROR Test3bIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_15() { CHIPDevice * device = GetConnectedDevice(); CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -47008,14 +47500,18 @@ class Test_TC_WNCV_3_5 : public TestCommandBridge { [cluster readAttributeCurrentPositionLiftPercent100thsWithCompletionHandler:^( NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3a: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT Error: %@", err); + NSLog(@"3b: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("CurrentPositionLiftPercent100ths", actualValue)); - VerifyOrReturn(CheckValue("CurrentPositionLiftPercent100ths", actualValue, 10000U)); + VerifyOrReturn(CheckConstraintType("currentPositionLiftPercent100ths", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue( + "currentPositionLiftPercent100ths", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue( + "currentPositionLiftPercent100ths", [value unsignedShortValue], 9999U)); } NextTest(); @@ -47024,7 +47520,7 @@ class Test_TC_WNCV_3_5 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR Test3bIfPaLfThReadsCurrentPositionLiftPercentageOptionalAttributeFromDut_6() + CHIP_ERROR Test3cIfPaLfThReadsCurrentPositionLiftPercentageOptionalAttributeFromDut_16() { CHIPDevice * device = GetConnectedDevice(); CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -47032,14 +47528,18 @@ class Test_TC_WNCV_3_5 : public TestCommandBridge { [cluster readAttributeCurrentPositionLiftPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3b: If (PA & LF) TH reads CurrentPositionLiftPercentage optional attribute from DUT Error: %@", err); + NSLog(@"3c: If (PA & LF) TH reads CurrentPositionLiftPercentage optional attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("CurrentPositionLiftPercentage", actualValue)); - VerifyOrReturn(CheckValue("CurrentPositionLiftPercentage", actualValue, 100)); + VerifyOrReturn(CheckConstraintType("currentPositionLiftPercentage", "", "uint8")); + if (value != nil) { + VerifyOrReturn( + CheckConstraintMinValue("currentPositionLiftPercentage", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn( + CheckConstraintMaxValue("currentPositionLiftPercentage", [value unsignedCharValue], 99)); } NextTest(); @@ -47048,7 +47548,7 @@ class Test_TC_WNCV_3_5 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR Test3cIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_7() + CHIP_ERROR Test3dIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_17() { CHIPDevice * device = GetConnectedDevice(); CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -47056,14 +47556,18 @@ class Test_TC_WNCV_3_5 : public TestCommandBridge { [cluster readAttributeCurrentPositionTiltPercent100thsWithCompletionHandler:^( NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3c: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT Error: %@", err); + NSLog(@"3d: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("CurrentPositionTiltPercent100ths", actualValue)); - VerifyOrReturn(CheckValue("CurrentPositionTiltPercent100ths", actualValue, 10000U)); + VerifyOrReturn(CheckConstraintType("currentPositionTiltPercent100ths", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue( + "currentPositionTiltPercent100ths", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue( + "currentPositionTiltPercent100ths", [value unsignedShortValue], 9999U)); } NextTest(); @@ -47072,7 +47576,7 @@ class Test_TC_WNCV_3_5 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR Test3dIfPaTlThReadsCurrentPositionTiltPercentageOptionalAttributeFromDut_8() + CHIP_ERROR Test3eIfPaLfThReadsCurrentPositionTiltPercentageOptionalAttributeFromDut_18() { CHIPDevice * device = GetConnectedDevice(); CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -47080,14 +47584,18 @@ class Test_TC_WNCV_3_5 : public TestCommandBridge { [cluster readAttributeCurrentPositionTiltPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3d: If (PA & TL) TH reads CurrentPositionTiltPercentage optional attribute from DUT Error: %@", err); + NSLog(@"3e: If (PA & LF) TH reads CurrentPositionTiltPercentage optional attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("CurrentPositionTiltPercentage", actualValue)); - VerifyOrReturn(CheckValue("CurrentPositionTiltPercentage", actualValue, 100)); + VerifyOrReturn(CheckConstraintType("currentPositionTiltPercentage", "", "uint8")); + if (value != nil) { + VerifyOrReturn( + CheckConstraintMinValue("currentPositionTiltPercentage", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn( + CheckConstraintMaxValue("currentPositionTiltPercentage", [value unsignedCharValue], 99)); } NextTest(); @@ -47095,13 +47603,120 @@ class Test_TC_WNCV_3_5 : public TestCommandBridge { return CHIP_NO_ERROR; } + + CHIP_ERROR Test4aThSendsAStopMotionCommandToDut_19() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster stopMotionWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"4a: TH sends a StopMotion command to DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test4bThWaitsFor3SecondsTheEndOfInertialMovementsOnTheDevice_20() + { + WaitForMs(3000); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test4cVerifyDutUpdateOperationalStatusAttributeToThAfterAStopMotion_21() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOperationalStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"4c: Verify DUT update OperationalStatus attribute to TH after a StopMotion Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("OperationalStatus", actualValue, 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test5aThWaitsForXSecondsAttributesUpdateOnTheDevice_22() + { + WaitForMs(1000); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test5bIfPaLfThReadsTargetPositionLiftPercent100thsAttributeFromDut_23() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeTargetPositionLiftPercent100thsWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"5b: If (PA & LF) TH reads TargetPositionLiftPercent100ths attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("targetPositionLiftPercent100ths", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue( + "targetPositionLiftPercent100ths", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue( + "targetPositionLiftPercent100ths", [value unsignedShortValue], 9999U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test5cIfPaTlThReadsTargetPositionTiltPercent100thsAttributeFromDut_24() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeTargetPositionTiltPercent100thsWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"5c: If (PA & TL) TH reads TargetPositionTiltPercent100ths attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("targetPositionTiltPercent100ths", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue( + "targetPositionTiltPercent100ths", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue( + "targetPositionTiltPercent100ths", [value unsignedShortValue], 9999U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } }; -class Test_TC_WNCV_4_3 : public TestCommandBridge { +class Test_TC_WNCV_3_2 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_WNCV_4_3() - : TestCommandBridge("Test_TC_WNCV_4_3") + Test_TC_WNCV_3_2() + : TestCommandBridge("Test_TC_WNCV_3_2") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -47111,7 +47726,7 @@ class Test_TC_WNCV_4_3 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_WNCV_4_3() {} + ~Test_TC_WNCV_3_2() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -47119,11 +47734,11 @@ class Test_TC_WNCV_4_3 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_4_3\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_3_2\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_4_3\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_3_2\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -47141,44 +47756,158 @@ class Test_TC_WNCV_4_3 : public TestCommandBridge { break; case 1: ChipLogProgress( - chipTool, " ***** Test Step 1 : 1a: If (PA_LF & LF) TH reads CurrentPositionLiftPercent100ths from DUT\n"); + chipTool, " ***** Test Step 1 : 1a: TH sends UpOrOpen command to preposition the DUT in the opposite direction\n"); + err = Test1aThSendsUpOrOpenCommandToPrepositionTheDutInTheOppositeDirection_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : 1b: TH Waits for 10 seconds movement(s) on the device\n"); + err = Test1bThWaitsFor10SecondsMovementsOnTheDevice_2(); + break; + case 3: + ChipLogProgress( + chipTool, " ***** Test Step 3 : 1c: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT\n"); if (ShouldSkip("WNCV_LF && WNCV_PA_LF")) { NextTest(); return; } - err = Test1aIfPaLfLfThReadsCurrentPositionLiftPercent100thsFromDut_1(); + err = Test1cIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_3(); break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : 1b: If (PA_LF & LF) TH reads CurrentPositionLiftPercentage from DUT\n"); + case 4: + ChipLogProgress(chipTool, + " ***** Test Step 4 : 1d: If (PA & LF) TH reads CurrentPositionLiftPercentage optional attribute from DUT\n"); if (ShouldSkip("WNCV_LF && WNCV_PA_LF && A_CURRENTPOSITIONLIFTPERCENTAGE")) { NextTest(); return; } - err = Test1bIfPaLfLfThReadsCurrentPositionLiftPercentageFromDut_2(); + err = Test1dIfPaLfThReadsCurrentPositionLiftPercentageOptionalAttributeFromDut_4(); break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : 2b: TH sends GoToLiftPercentage command with BadParam to DUT\n"); - if (ShouldSkip("WNCV_LF && WNCV_PA_LF || WNCV_LF && CR_GOTOLIFTPERCENTAGE")) { + case 5: + ChipLogProgress( + chipTool, " ***** Test Step 5 : 1e: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT\n"); + if (ShouldSkip("WNCV_TL && WNCV_PA_TL")) { NextTest(); return; } - err = Test2bThSendsGoToLiftPercentageCommandWithBadParamToDut_3(); + err = Test1eIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_5(); break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : 3a: TH sends GoToLiftPercentage command with 10001 to DUT\n"); - if (ShouldSkip("WNCV_LF && WNCV_PA_LF || WNCV_LF && CR_GOTOLIFTPERCENTAGE")) { + case 6: + ChipLogProgress(chipTool, + " ***** Test Step 6 : 1f: If (PA & TL) TH reads CurrentPositionTiltPercentage optional attribute from DUT\n"); + if (ShouldSkip("WNCV_TL && WNCV_PA_TL && A_CURRENTPOSITIONTILTPERCENTAGE")) { NextTest(); return; } - err = Test3aThSendsGoToLiftPercentageCommandWith10001ToDut_4(); + err = Test1fIfPaTlThReadsCurrentPositionTiltPercentageOptionalAttributeFromDut_6(); break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : 4a: TH sends GoToLiftPercentage command with 0xFFFF to DUT\n"); - if (ShouldSkip("WNCV_LF && WNCV_PA_LF || WNCV_LF && CR_GOTOLIFTPERCENTAGE")) { + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Report: 2: Subscribe to DUT reports on OperationalStatus attribute\n"); + err = TestReport2SubscribeToDutReportsOnOperationalStatusAttribute_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : 2: Subscribe to DUT reports on OperationalStatus attribute\n"); + err = Test2SubscribeToDutReportsOnOperationalStatusAttribute_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : 2a: TH sends DownOrClose command to DUT\n"); + err = Test2aThSendsDownOrCloseCommandToDut_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : 2b: DUT updates its attributes\n"); + err = Test2bDutUpdatesItsAttributes_10(); + break; + case 11: + ChipLogProgress( + chipTool, " ***** Test Step 11 : 2c: If (PA & LF) TH reads TargetPositionLiftPercent100ths attribute from DUT\n"); + if (ShouldSkip("WNCV_LF && WNCV_PA_LF")) { NextTest(); return; } - err = Test4aThSendsGoToLiftPercentageCommandWith0xFFFFToDut_5(); + err = Test2cIfPaLfThReadsTargetPositionLiftPercent100thsAttributeFromDut_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : 2e: TH leave the device moving for 2 seconds\n"); + err = Test2eThLeaveTheDeviceMovingFor2Seconds_12(); + break; + case 13: + ChipLogProgress( + chipTool, " ***** Test Step 13 : 3a: Verify DUT reports OperationalStatus attribute to TH after a DownOrClose\n"); + err = Test3aVerifyDutReportsOperationalStatusAttributeToThAfterADownOrClose_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : 3a2: DUT updates its attributes\n"); + err = Test3a2DutUpdatesItsAttributes_14(); + break; + case 15: + ChipLogProgress( + chipTool, " ***** Test Step 15 : 3b: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT\n"); + if (ShouldSkip("WNCV_LF && WNCV_PA_LF")) { + NextTest(); + return; + } + err = Test3bIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_15(); + break; + case 16: + ChipLogProgress(chipTool, + " ***** Test Step 16 : 3c: If (PA & LF) TH reads CurrentPositionLiftPercentage optional attribute from DUT\n"); + if (ShouldSkip("WNCV_LF && WNCV_PA_LF && A_CURRENTPOSITIONLIFTPERCENTAGE")) { + NextTest(); + return; + } + err = Test3cIfPaLfThReadsCurrentPositionLiftPercentageOptionalAttributeFromDut_16(); + break; + case 17: + ChipLogProgress( + chipTool, " ***** Test Step 17 : 3d: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT\n"); + if (ShouldSkip("WNCV_TL && WNCV_PA_TL")) { + NextTest(); + return; + } + err = Test3dIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_17(); + break; + case 18: + ChipLogProgress(chipTool, + " ***** Test Step 18 : 3e: If (PA & LF) TH reads CurrentPositionTiltPercentage optional attribute from DUT\n"); + if (ShouldSkip("WNCV_TL && WNCV_PA_TL && A_CURRENTPOSITIONTILTPERCENTAGE")) { + NextTest(); + return; + } + err = Test3eIfPaLfThReadsCurrentPositionTiltPercentageOptionalAttributeFromDut_18(); + break; + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : 4a: TH sends a StopMotion command to DUT\n"); + err = Test4aThSendsAStopMotionCommandToDut_19(); + break; + case 20: + ChipLogProgress( + chipTool, " ***** Test Step 20 : 4b: TH waits for 3 seconds the end of inertial movement(s) on the device\n"); + err = Test4bThWaitsFor3SecondsTheEndOfInertialMovementsOnTheDevice_20(); + break; + case 21: + ChipLogProgress( + chipTool, " ***** Test Step 21 : 4c: Verify DUT update OperationalStatus attribute to TH after a StopMotion\n"); + err = Test4cVerifyDutUpdateOperationalStatusAttributeToThAfterAStopMotion_21(); + break; + case 22: + ChipLogProgress(chipTool, " ***** Test Step 22 : 5a: TH waits for x seconds attributes update on the device\n"); + err = Test5aThWaitsForXSecondsAttributesUpdateOnTheDevice_22(); + break; + case 23: + ChipLogProgress( + chipTool, " ***** Test Step 23 : 5b: If (PA & LF) TH reads TargetPositionLiftPercent100ths attribute from DUT\n"); + if (ShouldSkip("WNCV_LF && WNCV_PA_LF")) { + NextTest(); + return; + } + err = Test5bIfPaLfThReadsTargetPositionLiftPercent100thsAttributeFromDut_23(); + break; + case 24: + ChipLogProgress( + chipTool, " ***** Test Step 24 : 5c: If (PA & TL) TH reads TargetPositionTiltPercent100ths attribute from DUT\n"); + if (ShouldSkip("WNCV_TL && WNCV_PA_TL")) { + NextTest(); + return; + } + err = Test5cIfPaTlThReadsTargetPositionTiltPercent100thsAttributeFromDut_24(); break; } @@ -47195,7 +47924,7 @@ class Test_TC_WNCV_4_3 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 6; + const uint16_t mTestCount = 25; chip::Optional mNodeId; chip::Optional mCluster; @@ -47207,9 +47936,31 @@ class Test_TC_WNCV_4_3 : public TestCommandBridge { WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - NSNumber * _Nullable attrCurrentPositionLiftPercent100ths; - CHIP_ERROR Test1aIfPaLfLfThReadsCurrentPositionLiftPercent100thsFromDut_1() + CHIP_ERROR Test1aThSendsUpOrOpenCommandToPrepositionTheDutInTheOppositeDirection_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster upOrOpenWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"1a: TH sends UpOrOpen command to preposition the DUT in the opposite direction Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test1bThWaitsFor10SecondsMovementsOnTheDevice_2() + { + WaitForMs(10000); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test1cIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_3() { CHIPDevice * device = GetConnectedDevice(); CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -47217,20 +47968,18 @@ class Test_TC_WNCV_4_3 : public TestCommandBridge { [cluster readAttributeCurrentPositionLiftPercent100thsWithCompletionHandler:^( NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"1a: If (PA_LF & LF) TH reads CurrentPositionLiftPercent100ths from DUT Error: %@", err); + NSLog(@"1c: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckConstraintType("currentPositionLiftPercent100ths", "", "uint16")); if (value != nil) { VerifyOrReturn(CheckConstraintMinValue( "currentPositionLiftPercent100ths", [value unsignedShortValue], 0U)); } if (value != nil) { VerifyOrReturn(CheckConstraintMaxValue( - "currentPositionLiftPercent100ths", [value unsignedShortValue], 10000U)); - } - { - attrCurrentPositionLiftPercent100ths = value; + "currentPositionLiftPercent100ths", [value unsignedShortValue], 9999U)); } NextTest(); @@ -47238,9 +47987,8 @@ class Test_TC_WNCV_4_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nullable attrCurrentPositionLiftPercentage; - CHIP_ERROR Test1bIfPaLfLfThReadsCurrentPositionLiftPercentageFromDut_2() + CHIP_ERROR Test1dIfPaLfThReadsCurrentPositionLiftPercentageOptionalAttributeFromDut_4() { CHIPDevice * device = GetConnectedDevice(); CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -47248,20 +47996,18 @@ class Test_TC_WNCV_4_3 : public TestCommandBridge { [cluster readAttributeCurrentPositionLiftPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"1b: If (PA_LF & LF) TH reads CurrentPositionLiftPercentage from DUT Error: %@", err); + NSLog(@"1d: If (PA & LF) TH reads CurrentPositionLiftPercentage optional attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckConstraintType("currentPositionLiftPercentage", "", "uint8")); if (value != nil) { VerifyOrReturn( CheckConstraintMinValue("currentPositionLiftPercentage", [value unsignedCharValue], 0)); } if (value != nil) { VerifyOrReturn( - CheckConstraintMaxValue("currentPositionLiftPercentage", [value unsignedCharValue], 100)); - } - { - attrCurrentPositionLiftPercentage = value; + CheckConstraintMaxValue("currentPositionLiftPercentage", [value unsignedCharValue], 99)); } NextTest(); @@ -47270,180 +48016,255 @@ class Test_TC_WNCV_4_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR Test2bThSendsGoToLiftPercentageCommandWithBadParamToDut_3() + CHIP_ERROR Test1eIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_5() { CHIPDevice * device = GetConnectedDevice(); CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPWindowCoveringClusterGoToLiftPercentageParams alloc] init]; - params.liftPercentageValue = [NSNumber numberWithUnsignedChar:63]; - params.liftPercent100thsValue = [NSNumber numberWithUnsignedShort:12288U]; - [cluster goToLiftPercentageWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"2b: TH sends GoToLiftPercentage command with BadParam to DUT Error: %@", err); + [cluster readAttributeCurrentPositionTiltPercent100thsWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"1e: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentPositionTiltPercent100ths", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue( + "currentPositionTiltPercent100ths", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue( + "currentPositionTiltPercent100ths", [value unsignedShortValue], 9999U)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test3aThSendsGoToLiftPercentageCommandWith10001ToDut_4() + CHIP_ERROR Test1fIfPaTlThReadsCurrentPositionTiltPercentageOptionalAttributeFromDut_6() { CHIPDevice * device = GetConnectedDevice(); CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPWindowCoveringClusterGoToLiftPercentageParams alloc] init]; - params.liftPercentageValue = [NSNumber numberWithUnsignedChar:100]; - params.liftPercent100thsValue = [NSNumber numberWithUnsignedShort:10001U]; - [cluster goToLiftPercentageWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"3a: TH sends GoToLiftPercentage command with 10001 to DUT Error: %@", err); + [cluster + readAttributeCurrentPositionTiltPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"1f: If (PA & TL) TH reads CurrentPositionTiltPercentage optional attribute from DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentPositionTiltPercentage", "", "uint8")); + if (value != nil) { + VerifyOrReturn( + CheckConstraintMinValue("currentPositionTiltPercentage", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn( + CheckConstraintMaxValue("currentPositionTiltPercentage", [value unsignedCharValue], 99)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } + bool testSendClusterTest_TC_WNCV_3_2_000007_WaitForReport_Fulfilled = false; + ResponseHandler _Nullable test_Test_TC_WNCV_3_2_OperationalStatus_Reported = nil; - CHIP_ERROR Test4aThSendsGoToLiftPercentageCommandWith0xFFFFToDut_5() + CHIP_ERROR TestReport2SubscribeToDutReportsOnOperationalStatusAttribute_7() { CHIPDevice * device = GetConnectedDevice(); CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPWindowCoveringClusterGoToLiftPercentageParams alloc] init]; - params.liftPercentageValue = [NSNumber numberWithUnsignedChar:255]; - params.liftPercent100thsValue = [NSNumber numberWithUnsignedShort:65535U]; - [cluster goToLiftPercentageWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"4a: TH sends GoToLiftPercentage command with 0xFFFF to DUT Error: %@", err); + test_Test_TC_WNCV_3_2_OperationalStatus_Reported = ^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Report: 2: Subscribe to DUT reports on OperationalStatus attribute Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("operationalStatus", "", "map8")); + testSendClusterTest_TC_WNCV_3_2_000007_WaitForReport_Fulfilled = true; + }; + NextTest(); return CHIP_NO_ERROR; } -}; -class Test_TC_WNCV_4_4 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_WNCV_4_4() - : TestCommandBridge("Test_TC_WNCV_4_4") - , mTestIndex(0) + CHIP_ERROR Test2SubscribeToDutReportsOnOperationalStatusAttribute_8() { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + uint16_t minIntervalArgument = 4U; + uint16_t maxIntervalArgument = 5U; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + [cluster subscribeAttributeOperationalStatusWithMinInterval:[NSNumber numberWithUnsignedInt:minIntervalArgument] + maxInterval:[NSNumber numberWithUnsignedInt:maxIntervalArgument] + params:params + subscriptionEstablished:^{ + VerifyOrReturn(testSendClusterTest_TC_WNCV_3_2_000007_WaitForReport_Fulfilled, + SetCommandExitStatus(CHIP_ERROR_INCORRECT_STATE)); + NextTest(); + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"2: Subscribe to DUT reports on OperationalStatus attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + if (test_Test_TC_WNCV_3_2_OperationalStatus_Reported != nil) { + ResponseHandler callback = test_Test_TC_WNCV_3_2_OperationalStatus_Reported; + test_Test_TC_WNCV_3_2_OperationalStatus_Reported = nil; + callback(value, err); + } + }]; + + return CHIP_NO_ERROR; } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_WNCV_4_4() {} + CHIP_ERROR Test2aThSendsDownOrCloseCommandToDut_9() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - /////////// TestCommand Interface ///////// - void NextTest() override + [cluster downOrCloseWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"2a: TH sends DownOrClose command to DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test2bDutUpdatesItsAttributes_10() { - CHIP_ERROR err = CHIP_NO_ERROR; + WaitForMs(100); + return CHIP_NO_ERROR; + } - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_4_4\n"); - } + CHIP_ERROR Test2cIfPaLfThReadsTargetPositionLiftPercent100thsAttributeFromDut_11() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_4_4\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + [cluster readAttributeTargetPositionLiftPercent100thsWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"2c: If (PA & LF) TH reads TargetPositionLiftPercent100ths attribute from DUT Error: %@", err); - Wait(); + VerifyOrReturn(CheckValue("status", err, 0)); - // 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 : 0: Wait for the commissioned device to be retrieved\n"); - err = Test0WaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - case 1: - ChipLogProgress( - chipTool, " ***** Test Step 1 : 1a: If (PA_TL & TL) TH reads CurrentPositionTiltPercent100ths from DUT\n"); - if (ShouldSkip("WNCV_TL && WNCV_PA_TL")) { - NextTest(); - return; - } - err = Test1aIfPaTlTlThReadsCurrentPositionTiltPercent100thsFromDut_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : 1b: If (PA_TL & TL) TH reads CurrentPositionTiltPercentage from DUT\n"); - if (ShouldSkip("WNCV_TL && WNCV_PA_TL && A_CURRENTPOSITIONTILTPERCENTAGE")) { - NextTest(); - return; - } - err = Test1bIfPaTlTlThReadsCurrentPositionTiltPercentageFromDut_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : 2b: TH sends GoToTiltPercentage command with BadParam to DUT\n"); - if (ShouldSkip("WNCV_TL && WNCV_PA_TL || WNCV_TL && CR_GOTOTILTPERCENTAGE")) { - NextTest(); - return; + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("TargetPositionLiftPercent100ths", actualValue)); + VerifyOrReturn(CheckValue("TargetPositionLiftPercent100ths", actualValue, 10000U)); } - err = Test2bThSendsGoToTiltPercentageCommandWithBadParamToDut_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : 3a: TH sends GoToTiltPercentage command with 10001 to DUT\n"); - if (ShouldSkip("WNCV_TL && WNCV_PA_TL || WNCV_TL && CR_GOTOTILTPERCENTAGE")) { - NextTest(); - return; + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test2eThLeaveTheDeviceMovingFor2Seconds_12() + { + WaitForMs(2000); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test3aVerifyDutReportsOperationalStatusAttributeToThAfterADownOrClose_13() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + test_Test_TC_WNCV_3_2_OperationalStatus_Reported = ^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3a: Verify DUT reports OperationalStatus attribute to TH after a DownOrClose Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("operationalStatus", "", "map8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("operationalStatus", [value unsignedCharValue], 10)); } - err = Test3aThSendsGoToTiltPercentageCommandWith10001ToDut_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : 4a: TH sends GoToTiltPercentage command with 0xFFFF to DUT\n"); - if (ShouldSkip("WNCV_TL && WNCV_PA_TL || WNCV_TL && CR_GOTOTILTPERCENTAGE")) { - NextTest(); - return; + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("operationalStatus", [value unsignedCharValue], 42)); } - err = Test4aThSendsGoToTiltPercentageCommandWith0xFFFFToDut_5(); - break; - } - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + NextTest(); + }; + + return CHIP_NO_ERROR; } - chip::System::Clock::Timeout GetWaitDuration() const override + CHIP_ERROR Test3a2DutUpdatesItsAttributes_14() { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + WaitForMs(2000); + return CHIP_NO_ERROR; } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 6; + CHIP_ERROR Test3bIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_15() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; + [cluster readAttributeCurrentPositionLiftPercent100thsWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3b: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT Error: %@", err); - CHIP_ERROR Test0WaitForTheCommissionedDeviceToBeRetrieved_0() + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentPositionLiftPercent100ths", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue( + "currentPositionLiftPercent100ths", [value unsignedShortValue], 1U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue( + "currentPositionLiftPercent100ths", [value unsignedShortValue], 10000U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test3cIfPaLfThReadsCurrentPositionLiftPercentageOptionalAttributeFromDut_16() { - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster + readAttributeCurrentPositionLiftPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3c: If (PA & LF) TH reads CurrentPositionLiftPercentage optional attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentPositionLiftPercentage", "", "uint8")); + if (value != nil) { + VerifyOrReturn( + CheckConstraintMinValue("currentPositionLiftPercentage", [value unsignedCharValue], 1)); + } + if (value != nil) { + VerifyOrReturn( + CheckConstraintMaxValue("currentPositionLiftPercentage", [value unsignedCharValue], 100)); + } + + NextTest(); + }]; + return CHIP_NO_ERROR; } - NSNumber * _Nullable attrCurrentPositionTiltPercent100ths; - CHIP_ERROR Test1aIfPaTlTlThReadsCurrentPositionTiltPercent100thsFromDut_1() + CHIP_ERROR Test3dIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_17() { CHIPDevice * device = GetConnectedDevice(); CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -47451,30 +48272,27 @@ class Test_TC_WNCV_4_4 : public TestCommandBridge { [cluster readAttributeCurrentPositionTiltPercent100thsWithCompletionHandler:^( NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"1a: If (PA_TL & TL) TH reads CurrentPositionTiltPercent100ths from DUT Error: %@", err); + NSLog(@"3d: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckConstraintType("currentPositionTiltPercent100ths", "", "uint16")); if (value != nil) { VerifyOrReturn(CheckConstraintMinValue( - "currentPositionTiltPercent100ths", [value unsignedShortValue], 0U)); + "currentPositionTiltPercent100ths", [value unsignedShortValue], 1U)); } if (value != nil) { VerifyOrReturn(CheckConstraintMaxValue( "currentPositionTiltPercent100ths", [value unsignedShortValue], 10000U)); } - { - attrCurrentPositionTiltPercent100ths = value; - } NextTest(); }]; return CHIP_NO_ERROR; } - NSNumber * _Nullable attrCurrentPositionTiltPercentage; - CHIP_ERROR Test1bIfPaTlTlThReadsCurrentPositionTiltPercentageFromDut_2() + CHIP_ERROR Test3eIfPaLfThReadsCurrentPositionTiltPercentageOptionalAttributeFromDut_18() { CHIPDevice * device = GetConnectedDevice(); CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -47482,21 +48300,19 @@ class Test_TC_WNCV_4_4 : public TestCommandBridge { [cluster readAttributeCurrentPositionTiltPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"1b: If (PA_TL & TL) TH reads CurrentPositionTiltPercentage from DUT Error: %@", err); + NSLog(@"3e: If (PA & LF) TH reads CurrentPositionTiltPercentage optional attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckConstraintType("currentPositionTiltPercentage", "", "uint8")); if (value != nil) { VerifyOrReturn( - CheckConstraintMinValue("currentPositionTiltPercentage", [value unsignedCharValue], 0)); + CheckConstraintMinValue("currentPositionTiltPercentage", [value unsignedCharValue], 1)); } if (value != nil) { VerifyOrReturn( CheckConstraintMaxValue("currentPositionTiltPercentage", [value unsignedCharValue], 100)); } - { - attrCurrentPositionTiltPercentage = value; - } NextTest(); }]; @@ -47504,72 +48320,119 @@ class Test_TC_WNCV_4_4 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR Test2bThSendsGoToTiltPercentageCommandWithBadParamToDut_3() + CHIP_ERROR Test4aThSendsAStopMotionCommandToDut_19() { CHIPDevice * device = GetConnectedDevice(); CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPWindowCoveringClusterGoToTiltPercentageParams alloc] init]; - params.tiltPercentageValue = [NSNumber numberWithUnsignedChar:63]; - params.tiltPercent100thsValue = [NSNumber numberWithUnsignedShort:12288U]; - [cluster goToTiltPercentageWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"2b: TH sends GoToTiltPercentage command with BadParam to DUT Error: %@", err); + [cluster stopMotionWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"4a: TH sends a StopMotion command to DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test3aThSendsGoToTiltPercentageCommandWith10001ToDut_4() + CHIP_ERROR Test4bThWaitsFor3SecondsTheEndOfInertialMovementsOnTheDevice_20() + { + WaitForMs(3000); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test4cVerifyDutUpdateOperationalStatusAttributeToThAfterAStopMotion_21() { CHIPDevice * device = GetConnectedDevice(); CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPWindowCoveringClusterGoToTiltPercentageParams alloc] init]; - params.tiltPercentageValue = [NSNumber numberWithUnsignedChar:100]; - params.tiltPercent100thsValue = [NSNumber numberWithUnsignedShort:10001U]; - [cluster goToTiltPercentageWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"3a: TH sends GoToTiltPercentage command with 10001 to DUT Error: %@", err); + [cluster readAttributeOperationalStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"4c: Verify DUT update OperationalStatus attribute to TH after a StopMotion Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("OperationalStatus", actualValue, 0)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test4aThSendsGoToTiltPercentageCommandWith0xFFFFToDut_5() + CHIP_ERROR Test5aThWaitsForXSecondsAttributesUpdateOnTheDevice_22() + { + WaitForMs(1000); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test5bIfPaLfThReadsTargetPositionLiftPercent100thsAttributeFromDut_23() { CHIPDevice * device = GetConnectedDevice(); CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPWindowCoveringClusterGoToTiltPercentageParams alloc] init]; - params.tiltPercentageValue = [NSNumber numberWithUnsignedChar:255]; - params.tiltPercent100thsValue = [NSNumber numberWithUnsignedShort:65535U]; - [cluster goToTiltPercentageWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"4a: TH sends GoToTiltPercentage command with 0xFFFF to DUT Error: %@", err); + [cluster readAttributeTargetPositionLiftPercent100thsWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"5b: If (PA & LF) TH reads TargetPositionLiftPercent100ths attribute from DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("targetPositionLiftPercent100ths", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue( + "targetPositionLiftPercent100ths", [value unsignedShortValue], 1U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue( + "targetPositionLiftPercent100ths", [value unsignedShortValue], 10000U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test5cIfPaTlThReadsTargetPositionTiltPercent100thsAttributeFromDut_24() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeTargetPositionTiltPercent100thsWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"5c: If (PA & TL) TH reads TargetPositionTiltPercent100ths attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("targetPositionTiltPercent100ths", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue( + "targetPositionTiltPercent100ths", [value unsignedShortValue], 1U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue( + "targetPositionTiltPercent100ths", [value unsignedShortValue], 10000U)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } }; -class TestCluster : public TestCommandBridge { +class Test_TC_WNCV_3_3 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - TestCluster() - : TestCommandBridge("TestCluster") + Test_TC_WNCV_3_3() + : TestCommandBridge("Test_TC_WNCV_3_3") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -47579,7 +48442,7 @@ class TestCluster : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~TestCluster() {} + ~Test_TC_WNCV_3_3() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -47587,11 +48450,11 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: TestCluster\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_3_3\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: TestCluster\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_3_3\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -47604,2108 +48467,8930 @@ class TestCluster : public TestCommandBridge { // 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(); + ChipLogProgress(chipTool, " ***** Test Step 0 : 0: Wait for the commissioned device to be retrieved\n"); + err = Test0WaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Send Test Command\n"); - err = TestSendTestCommand_1(); + ChipLogProgress(chipTool, + " ***** Test Step 1 : 1a: TH sends DownOrClose command to preposition the DUT in the opposite direction\n"); + err = Test1aThSendsDownOrCloseCommandToPrepositionTheDutInTheOppositeDirection_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Send Test Not Handled Command\n"); - err = TestSendTestNotHandledCommand_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : 1b: TH Waits for 6-8 seconds movement(s) on the device\n"); + err = Test1bThWaitsFor68SecondsMovementsOnTheDevice_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Send Test Specific Command\n"); - err = TestSendTestSpecificCommand_3(); + ChipLogProgress( + chipTool, " ***** Test Step 3 : 1c: TH sends UpOrOpen command to preposition the DUT in the opposite direction\n"); + err = Test1cThSendsUpOrOpenCommandToPrepositionTheDutInTheOppositeDirection_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Send Test Add Arguments Command\n"); - err = TestSendTestAddArgumentsCommand_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : 1d: TH Waits for 2 seconds movement(s) on the device\n"); + err = Test1dThWaitsFor2SecondsMovementsOnTheDevice_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Send failing Test Add Arguments Command\n"); - err = TestSendFailingTestAddArgumentsCommand_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Report: 2: Subscribe to DUT reports on OperationalStatus attribute\n"); + err = TestReport2SubscribeToDutReportsOnOperationalStatusAttribute_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Read attribute BOOLEAN Default Value\n"); - err = TestReadAttributeBooleanDefaultValue_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : 2: Subscribe to DUT reports on OperationalStatus attribute\n"); + err = Test2SubscribeToDutReportsOnOperationalStatusAttribute_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Write attribute BOOLEAN True\n"); - err = TestWriteAttributeBooleanTrue_7(); + ChipLogProgress(chipTool, " ***** Test Step 7 : 2a: TH sends a StopMotion command to DUT\n"); + err = Test2aThSendsAStopMotionCommandToDut_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Read attribute BOOLEAN True\n"); - err = TestReadAttributeBooleanTrue_8(); + ChipLogProgress( + chipTool, " ***** Test Step 8 : 2b: TH waits for 3 seconds the end of inertial movement(s) on the device\n"); + err = Test2bThWaitsFor3SecondsTheEndOfInertialMovementsOnTheDevice_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Write attribute BOOLEAN False\n"); - err = TestWriteAttributeBooleanFalse_9(); + ChipLogProgress( + chipTool, " ***** Test Step 9 : 2c: Verify DUT reports OperationalStatus attribute to TH after a StopMotion\n"); + err = Test2cVerifyDutReportsOperationalStatusAttributeToThAfterAStopMotion_9(); break; case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Read attribute BOOLEAN False\n"); - err = TestReadAttributeBooleanFalse_10(); + ChipLogProgress(chipTool, " ***** Test Step 10 : 2d: TH waits for 100ms - 3s attributes update on the device\n"); + err = Test2dThWaitsFor100ms3sAttributesUpdateOnTheDevice_10(); break; case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Read attribute BITMAP8 Default Value\n"); - err = TestReadAttributeBitmap8DefaultValue_11(); + ChipLogProgress(chipTool, " ***** Test Step 11 : 2e: TH reads OperationalStatus attribute from DUT\n"); + err = Test2eThReadsOperationalStatusAttributeFromDut_11(); break; case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Write attribute BITMAP8 Max Value\n"); - err = TestWriteAttributeBitmap8MaxValue_12(); + ChipLogProgress( + chipTool, " ***** Test Step 12 : 3a: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT\n"); + if (ShouldSkip("WNCV_LF && WNCV_PA_LF")) { + NextTest(); + return; + } + err = Test3aIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_12(); break; case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Read attribute BITMAP8 Max Value\n"); - err = TestReadAttributeBitmap8MaxValue_13(); + ChipLogProgress(chipTool, + " ***** Test Step 13 : 3b: If (PA & LF) TH reads TargetPositionLiftPercent100ths attribute 3c: it Must be equal " + "with CurrentPositionLiftPercent100ths from DUT\n"); + if (ShouldSkip("WNCV_LF && WNCV_PA_LF")) { + NextTest(); + return; + } + err = Test3bIfPaLfThReadsTargetPositionLiftPercent100thsAttribute3cItMustBeEqualWithCurrentPositionLiftPercent100thsFromDut_13(); break; case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Write attribute BITMAP8 Min Value\n"); - err = TestWriteAttributeBitmap8MinValue_14(); + ChipLogProgress( + chipTool, " ***** Test Step 14 : 4a: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT\n"); + if (ShouldSkip("WNCV_TL && WNCV_PA_TL")) { + NextTest(); + return; + } + err = Test4aIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_14(); break; case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Read attribute BITMAP8 Min Value\n"); - err = TestReadAttributeBitmap8MinValue_15(); - break; - case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : Read attribute BITMAP16 Default Value\n"); - err = TestReadAttributeBitmap16DefaultValue_16(); - break; - case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : Write attribute BITMAP16 Max Value\n"); - err = TestWriteAttributeBitmap16MaxValue_17(); - break; - case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : Read attribute BITMAP16 Max Value\n"); - err = TestReadAttributeBitmap16MaxValue_18(); - break; - case 19: - ChipLogProgress(chipTool, " ***** Test Step 19 : Write attribute BITMAP16 Min Value\n"); - err = TestWriteAttributeBitmap16MinValue_19(); - break; - case 20: - ChipLogProgress(chipTool, " ***** Test Step 20 : Read attribute BITMAP16 Min Value\n"); - err = TestReadAttributeBitmap16MinValue_20(); - break; - case 21: - ChipLogProgress(chipTool, " ***** Test Step 21 : Read attribute BITMAP32 Default Value\n"); - err = TestReadAttributeBitmap32DefaultValue_21(); - break; - case 22: - ChipLogProgress(chipTool, " ***** Test Step 22 : Write attribute BITMAP32 Max Value\n"); - err = TestWriteAttributeBitmap32MaxValue_22(); - break; - case 23: - ChipLogProgress(chipTool, " ***** Test Step 23 : Read attribute BITMAP32 Max Value\n"); - err = TestReadAttributeBitmap32MaxValue_23(); - break; - case 24: - ChipLogProgress(chipTool, " ***** Test Step 24 : Write attribute BITMAP32 Min Value\n"); - err = TestWriteAttributeBitmap32MinValue_24(); - break; - case 25: - ChipLogProgress(chipTool, " ***** Test Step 25 : Read attribute BITMAP32 Min Value\n"); - err = TestReadAttributeBitmap32MinValue_25(); - break; - case 26: - ChipLogProgress(chipTool, " ***** Test Step 26 : Read attribute BITMAP64 Default Value\n"); - err = TestReadAttributeBitmap64DefaultValue_26(); - break; - case 27: - ChipLogProgress(chipTool, " ***** Test Step 27 : Write attribute BITMAP64 Max Value\n"); - err = TestWriteAttributeBitmap64MaxValue_27(); - break; - case 28: - ChipLogProgress(chipTool, " ***** Test Step 28 : Read attribute BITMAP64 Max Value\n"); - err = TestReadAttributeBitmap64MaxValue_28(); - break; - case 29: - ChipLogProgress(chipTool, " ***** Test Step 29 : Write attribute BITMAP64 Min Value\n"); - err = TestWriteAttributeBitmap64MinValue_29(); - break; - case 30: - ChipLogProgress(chipTool, " ***** Test Step 30 : Read attribute BITMAP64 Min Value\n"); - err = TestReadAttributeBitmap64MinValue_30(); - break; - case 31: - ChipLogProgress(chipTool, " ***** Test Step 31 : Read attribute INT8U Default Value\n"); - err = TestReadAttributeInt8uDefaultValue_31(); - break; - case 32: - ChipLogProgress(chipTool, " ***** Test Step 32 : Write attribute INT8U Max Value\n"); - err = TestWriteAttributeInt8uMaxValue_32(); + ChipLogProgress(chipTool, + " ***** Test Step 15 : 4b: If (PA & TL) TH reads TargetPositionTiltPercent100ths attribute 4c: it Must be equal " + "with CurrentPositionTiltPercent100ths from DUT\n"); + if (ShouldSkip("WNCV_TL && WNCV_PA_TL")) { + NextTest(); + return; + } + err = Test4bIfPaTlThReadsTargetPositionTiltPercent100thsAttribute4cItMustBeEqualWithCurrentPositionTiltPercent100thsFromDut_15(); break; - case 33: - ChipLogProgress(chipTool, " ***** Test Step 33 : Read attribute INT8U Max Value\n"); - err = TestReadAttributeInt8uMaxValue_33(); + } + + 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 = 16; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR Test0WaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test1aThSendsDownOrCloseCommandToPrepositionTheDutInTheOppositeDirection_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster downOrCloseWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"1a: TH sends DownOrClose command to preposition the DUT in the opposite direction Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test1bThWaitsFor68SecondsMovementsOnTheDevice_2() + { + WaitForMs(6000); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test1cThSendsUpOrOpenCommandToPrepositionTheDutInTheOppositeDirection_3() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster upOrOpenWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"1c: TH sends UpOrOpen command to preposition the DUT in the opposite direction Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test1dThWaitsFor2SecondsMovementsOnTheDevice_4() + { + WaitForMs(2000); + return CHIP_NO_ERROR; + } + bool testSendClusterTest_TC_WNCV_3_3_000005_WaitForReport_Fulfilled = false; + ResponseHandler _Nullable test_Test_TC_WNCV_3_3_OperationalStatus_Reported = nil; + + CHIP_ERROR TestReport2SubscribeToDutReportsOnOperationalStatusAttribute_5() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + test_Test_TC_WNCV_3_3_OperationalStatus_Reported = ^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Report: 2: Subscribe to DUT reports on OperationalStatus attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("operationalStatus", "", "map8")); + testSendClusterTest_TC_WNCV_3_3_000005_WaitForReport_Fulfilled = true; + }; + + NextTest(); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test2SubscribeToDutReportsOnOperationalStatusAttribute_6() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + uint16_t minIntervalArgument = 4U; + uint16_t maxIntervalArgument = 5U; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + [cluster subscribeAttributeOperationalStatusWithMinInterval:[NSNumber numberWithUnsignedInt:minIntervalArgument] + maxInterval:[NSNumber numberWithUnsignedInt:maxIntervalArgument] + params:params + subscriptionEstablished:^{ + VerifyOrReturn(testSendClusterTest_TC_WNCV_3_3_000005_WaitForReport_Fulfilled, + SetCommandExitStatus(CHIP_ERROR_INCORRECT_STATE)); + NextTest(); + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"2: Subscribe to DUT reports on OperationalStatus attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + if (test_Test_TC_WNCV_3_3_OperationalStatus_Reported != nil) { + ResponseHandler callback = test_Test_TC_WNCV_3_3_OperationalStatus_Reported; + test_Test_TC_WNCV_3_3_OperationalStatus_Reported = nil; + callback(value, err); + } + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test2aThSendsAStopMotionCommandToDut_7() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster stopMotionWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"2a: TH sends a StopMotion command to DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test2bThWaitsFor3SecondsTheEndOfInertialMovementsOnTheDevice_8() + { + WaitForMs(3000); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test2cVerifyDutReportsOperationalStatusAttributeToThAfterAStopMotion_9() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + test_Test_TC_WNCV_3_3_OperationalStatus_Reported = ^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"2c: Verify DUT reports OperationalStatus attribute to TH after a StopMotion Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("OperationalStatus", actualValue, 0)); + } + + NextTest(); + }; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test2dThWaitsFor100ms3sAttributesUpdateOnTheDevice_10() + { + WaitForMs(2000); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test2eThReadsOperationalStatusAttributeFromDut_11() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOperationalStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"2e: TH reads OperationalStatus attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("OperationalStatus", actualValue, 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nullable attrCurrentPositionLift; + + CHIP_ERROR Test3aIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_12() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentPositionLiftPercent100thsWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3a: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue( + "currentPositionLiftPercent100ths", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue( + "currentPositionLiftPercent100ths", [value unsignedShortValue], 10000U)); + } + { + attrCurrentPositionLift = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + Test3bIfPaLfThReadsTargetPositionLiftPercent100thsAttribute3cItMustBeEqualWithCurrentPositionLiftPercent100thsFromDut_13() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeTargetPositionLiftPercent100thsWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3b: If (PA & LF) TH reads TargetPositionLiftPercent100ths attribute 3c: it Must be equal with " + @"CurrentPositionLiftPercent100ths from DUT Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + if (attrCurrentPositionLift == nil) { + VerifyOrReturn(CheckValueNull("TargetPositionLiftPercent100ths", actualValue)); + } else { + VerifyOrReturn(CheckValueNonNull("TargetPositionLiftPercent100ths", actualValue)); + VerifyOrReturn(CheckValue("TargetPositionLiftPercent100ths", actualValue, attrCurrentPositionLift)); + } + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nullable attrCurrentPositionTilt; + + CHIP_ERROR Test4aIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_14() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentPositionTiltPercent100thsWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"4a: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue( + "currentPositionTiltPercent100ths", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue( + "currentPositionTiltPercent100ths", [value unsignedShortValue], 10000U)); + } + { + attrCurrentPositionTilt = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + Test4bIfPaTlThReadsTargetPositionTiltPercent100thsAttribute4cItMustBeEqualWithCurrentPositionTiltPercent100thsFromDut_15() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeTargetPositionTiltPercent100thsWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"4b: If (PA & TL) TH reads TargetPositionTiltPercent100ths attribute 4c: it Must be equal with " + @"CurrentPositionTiltPercent100ths from DUT Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + if (attrCurrentPositionTilt == nil) { + VerifyOrReturn(CheckValueNull("TargetPositionTiltPercent100ths", actualValue)); + } else { + VerifyOrReturn(CheckValueNonNull("TargetPositionTiltPercent100ths", actualValue)); + VerifyOrReturn(CheckValue("TargetPositionTiltPercent100ths", actualValue, attrCurrentPositionTilt)); + } + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_WNCV_3_4 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_WNCV_3_4() + : TestCommandBridge("Test_TC_WNCV_3_4") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("fastMotionDuration", 0, UINT16_MAX, &mFastMotionDuration); + AddArgument("fullMotionDuration", 0, UINT16_MAX, &mFullMotionDuration); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_WNCV_3_4() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_3_4\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_3_4\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 : 0: Wait for the commissioned device to be retrieved\n"); + err = Test0WaitForTheCommissionedDeviceToBeRetrieved_0(); break; - case 34: - ChipLogProgress(chipTool, " ***** Test Step 34 : Write attribute INT8U Min Value\n"); - err = TestWriteAttributeInt8uMinValue_34(); + case 1: + ChipLogProgress(chipTool, + " ***** Test Step 1 : 1a: TH sends DownOrClose command to preposition the DUT in the opposite direction\n"); + err = Test1aThSendsDownOrCloseCommandToPrepositionTheDutInTheOppositeDirection_1(); break; - case 35: - ChipLogProgress(chipTool, " ***** Test Step 35 : Read attribute INT8U Min Value\n"); - err = TestReadAttributeInt8uMinValue_35(); + case 2: + ChipLogProgress( + chipTool, " ***** Test Step 2 : 1b: TH Waits for fastMotionDuration seconds movement(s) on the device\n"); + err = Test1bThWaitsForFastMotionDurationSecondsMovementsOnTheDevice_2(); break; - case 36: - ChipLogProgress(chipTool, " ***** Test Step 36 : Read attribute INT16U Default Value\n"); - err = TestReadAttributeInt16uDefaultValue_36(); + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : 2a: TH sends UpOrOpen command to DUT\n"); + err = Test2aThSendsUpOrOpenCommandToDut_3(); break; - case 37: - ChipLogProgress(chipTool, " ***** Test Step 37 : Write attribute INT16U Max Value\n"); - err = TestWriteAttributeInt16uMaxValue_37(); + case 4: + ChipLogProgress( + chipTool, " ***** Test Step 4 : 2b: TH Waits for fullMotionDuration seconds movement(s) on the device\n"); + err = Test2bThWaitsForFullMotionDurationSecondsMovementsOnTheDevice_4(); break; - case 38: - ChipLogProgress(chipTool, " ***** Test Step 38 : Read attribute INT16U Max Value\n"); - err = TestReadAttributeInt16uMaxValue_38(); + case 5: + ChipLogProgress( + chipTool, " ***** Test Step 5 : 3a: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT\n"); + if (ShouldSkip("WNCV_LF && WNCV_PA_LF")) { + NextTest(); + return; + } + err = Test3aIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_5(); break; - case 39: - ChipLogProgress(chipTool, " ***** Test Step 39 : Write attribute INT16U Min Value\n"); - err = TestWriteAttributeInt16uMinValue_39(); + case 6: + ChipLogProgress(chipTool, + " ***** Test Step 6 : 3b: If (PA & LF) TH reads CurrentPositionLiftPercentage optional attribute from DUT\n"); + if (ShouldSkip("WNCV_LF && WNCV_PA_LF && A_CURRENTPOSITIONLIFTPERCENTAGE")) { + NextTest(); + return; + } + err = Test3bIfPaLfThReadsCurrentPositionLiftPercentageOptionalAttributeFromDut_6(); break; - case 40: - ChipLogProgress(chipTool, " ***** Test Step 40 : Read attribute INT16U Min Value\n"); - err = TestReadAttributeInt16uMinValue_40(); + case 7: + ChipLogProgress( + chipTool, " ***** Test Step 7 : 3c: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT\n"); + if (ShouldSkip("WNCV_TL && WNCV_PA_TL")) { + NextTest(); + return; + } + err = Test3cIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_7(); break; - case 41: - ChipLogProgress(chipTool, " ***** Test Step 41 : Read attribute INT32U Default Value\n"); - err = TestReadAttributeInt32uDefaultValue_41(); + case 8: + ChipLogProgress(chipTool, + " ***** Test Step 8 : 3d: If (PA & TL) TH reads CurrentPositionTiltPercentage optional attribute from DUT\n"); + if (ShouldSkip("WNCV_TL && WNCV_PA_TL && A_CURRENTPOSITIONLIFTPERCENTAGE")) { + NextTest(); + return; + } + err = Test3dIfPaTlThReadsCurrentPositionTiltPercentageOptionalAttributeFromDut_8(); break; - case 42: - ChipLogProgress(chipTool, " ***** Test Step 42 : Write attribute INT32U Max Value\n"); - err = TestWriteAttributeInt32uMaxValue_42(); + } + + 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 = 9; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mFastMotionDuration; + chip::Optional mFullMotionDuration; + chip::Optional mTimeout; + + CHIP_ERROR Test0WaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test1aThSendsDownOrCloseCommandToPrepositionTheDutInTheOppositeDirection_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster downOrCloseWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"1a: TH sends DownOrClose command to preposition the DUT in the opposite direction Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test1bThWaitsForFastMotionDurationSecondsMovementsOnTheDevice_2() + { + WaitForMs(mFastMotionDuration.HasValue() ? mFastMotionDuration.Value() : 3000U); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test2aThSendsUpOrOpenCommandToDut_3() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster upOrOpenWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"2a: TH sends UpOrOpen command to DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test2bThWaitsForFullMotionDurationSecondsMovementsOnTheDevice_4() + { + WaitForMs(mFullMotionDuration.HasValue() ? mFullMotionDuration.Value() : 6000U); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test3aIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_5() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentPositionLiftPercent100thsWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3a: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentPositionLiftPercent100ths", actualValue)); + VerifyOrReturn(CheckValue("CurrentPositionLiftPercent100ths", actualValue, 0U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test3bIfPaLfThReadsCurrentPositionLiftPercentageOptionalAttributeFromDut_6() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster + readAttributeCurrentPositionLiftPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3b: If (PA & LF) TH reads CurrentPositionLiftPercentage optional attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentPositionLiftPercentage", actualValue)); + VerifyOrReturn(CheckValue("CurrentPositionLiftPercentage", actualValue, 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test3cIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_7() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentPositionTiltPercent100thsWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3c: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentPositionTiltPercent100ths", actualValue)); + VerifyOrReturn(CheckValue("CurrentPositionTiltPercent100ths", actualValue, 0U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test3dIfPaTlThReadsCurrentPositionTiltPercentageOptionalAttributeFromDut_8() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster + readAttributeCurrentPositionTiltPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3d: If (PA & TL) TH reads CurrentPositionTiltPercentage optional attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentPositionTiltPercentage", actualValue)); + VerifyOrReturn(CheckValue("CurrentPositionTiltPercentage", actualValue, 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_WNCV_3_5 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_WNCV_3_5() + : TestCommandBridge("Test_TC_WNCV_3_5") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("fastMotionDuration", 0, UINT16_MAX, &mFastMotionDuration); + AddArgument("fullMotionDuration", 0, UINT16_MAX, &mFullMotionDuration); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_WNCV_3_5() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_3_5\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_3_5\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : 0: Wait for the commissioned device to be retrieved\n"); + err = Test0WaitForTheCommissionedDeviceToBeRetrieved_0(); break; - case 43: - ChipLogProgress(chipTool, " ***** Test Step 43 : Read attribute INT32U Max Value\n"); - err = TestReadAttributeInt32uMaxValue_43(); + case 1: + ChipLogProgress( + chipTool, " ***** Test Step 1 : 1a: TH sends UpOrOpen command to preposition the DUT in the opposite direction\n"); + err = Test1aThSendsUpOrOpenCommandToPrepositionTheDutInTheOppositeDirection_1(); break; - case 44: - ChipLogProgress(chipTool, " ***** Test Step 44 : Write attribute INT32U Min Value\n"); - err = TestWriteAttributeInt32uMinValue_44(); + case 2: + ChipLogProgress( + chipTool, " ***** Test Step 2 : 1b: TH Waits for fastMotionDuration seconds movement(s) on the device\n"); + err = Test1bThWaitsForFastMotionDurationSecondsMovementsOnTheDevice_2(); break; - case 45: - ChipLogProgress(chipTool, " ***** Test Step 45 : Read attribute INT32U Min Value\n"); - err = TestReadAttributeInt32uMinValue_45(); + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : 2a: TH sends DownOrClose command to DUT\n"); + err = Test2aThSendsDownOrCloseCommandToDut_3(); break; - case 46: - ChipLogProgress(chipTool, " ***** Test Step 46 : Read attribute INT64U Default Value\n"); - err = TestReadAttributeInt64uDefaultValue_46(); + case 4: + ChipLogProgress( + chipTool, " ***** Test Step 4 : 2b: TH Waits for fullMotionDuration seconds movement(s) on the device\n"); + err = Test2bThWaitsForFullMotionDurationSecondsMovementsOnTheDevice_4(); break; - case 47: - ChipLogProgress(chipTool, " ***** Test Step 47 : Write attribute INT64U Max Value\n"); - err = TestWriteAttributeInt64uMaxValue_47(); + case 5: + ChipLogProgress( + chipTool, " ***** Test Step 5 : 3a: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT\n"); + if (ShouldSkip("WNCV_LF && WNCV_PA_LF")) { + NextTest(); + return; + } + err = Test3aIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_5(); break; - case 48: - ChipLogProgress(chipTool, " ***** Test Step 48 : Read attribute INT64U Max Value\n"); - err = TestReadAttributeInt64uMaxValue_48(); + case 6: + ChipLogProgress(chipTool, + " ***** Test Step 6 : 3b: If (PA & LF) TH reads CurrentPositionLiftPercentage optional attribute from DUT\n"); + if (ShouldSkip("WNCV_LF && WNCV_PA_LF && A_CURRENTPOSITIONLIFTPERCENTAGE")) { + NextTest(); + return; + } + err = Test3bIfPaLfThReadsCurrentPositionLiftPercentageOptionalAttributeFromDut_6(); break; - case 49: - ChipLogProgress(chipTool, " ***** Test Step 49 : Write attribute INT64U Min Value\n"); - err = TestWriteAttributeInt64uMinValue_49(); + case 7: + ChipLogProgress( + chipTool, " ***** Test Step 7 : 3c: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT\n"); + if (ShouldSkip("WNCV_TL && WNCV_PA_TL")) { + NextTest(); + return; + } + err = Test3cIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_7(); break; - case 50: - ChipLogProgress(chipTool, " ***** Test Step 50 : Read attribute INT64U Min Value\n"); - err = TestReadAttributeInt64uMinValue_50(); + case 8: + ChipLogProgress(chipTool, + " ***** Test Step 8 : 3d: If (PA & TL) TH reads CurrentPositionTiltPercentage optional attribute from DUT\n"); + if (ShouldSkip("WNCV_TL && WNCV_PA_TL && A_CURRENTPOSITIONLIFTPERCENTAGE")) { + NextTest(); + return; + } + err = Test3dIfPaTlThReadsCurrentPositionTiltPercentageOptionalAttributeFromDut_8(); break; - case 51: - ChipLogProgress(chipTool, " ***** Test Step 51 : Read attribute INT8S Default Value\n"); - err = TestReadAttributeInt8sDefaultValue_51(); + } + + 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 = 9; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mFastMotionDuration; + chip::Optional mFullMotionDuration; + chip::Optional mTimeout; + + CHIP_ERROR Test0WaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test1aThSendsUpOrOpenCommandToPrepositionTheDutInTheOppositeDirection_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster upOrOpenWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"1a: TH sends UpOrOpen command to preposition the DUT in the opposite direction Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test1bThWaitsForFastMotionDurationSecondsMovementsOnTheDevice_2() + { + WaitForMs(mFastMotionDuration.HasValue() ? mFastMotionDuration.Value() : 3000U); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test2aThSendsDownOrCloseCommandToDut_3() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster downOrCloseWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"2a: TH sends DownOrClose command to DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test2bThWaitsForFullMotionDurationSecondsMovementsOnTheDevice_4() + { + WaitForMs(mFullMotionDuration.HasValue() ? mFullMotionDuration.Value() : 6000U); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test3aIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_5() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentPositionLiftPercent100thsWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3a: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentPositionLiftPercent100ths", actualValue)); + VerifyOrReturn(CheckValue("CurrentPositionLiftPercent100ths", actualValue, 10000U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test3bIfPaLfThReadsCurrentPositionLiftPercentageOptionalAttributeFromDut_6() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster + readAttributeCurrentPositionLiftPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3b: If (PA & LF) TH reads CurrentPositionLiftPercentage optional attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentPositionLiftPercentage", actualValue)); + VerifyOrReturn(CheckValue("CurrentPositionLiftPercentage", actualValue, 100)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test3cIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_7() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentPositionTiltPercent100thsWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3c: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentPositionTiltPercent100ths", actualValue)); + VerifyOrReturn(CheckValue("CurrentPositionTiltPercent100ths", actualValue, 10000U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test3dIfPaTlThReadsCurrentPositionTiltPercentageOptionalAttributeFromDut_8() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster + readAttributeCurrentPositionTiltPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3d: If (PA & TL) TH reads CurrentPositionTiltPercentage optional attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentPositionTiltPercentage", actualValue)); + VerifyOrReturn(CheckValue("CurrentPositionTiltPercentage", actualValue, 100)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_WNCV_4_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_WNCV_4_1() + : TestCommandBridge("Test_TC_WNCV_4_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("fullMotionDuration", 0, UINT16_MAX, &mFullMotionDuration); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_WNCV_4_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_4_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_4_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 : 0: Wait for the commissioned device to be retrieved\n"); + err = Test0WaitForTheCommissionedDeviceToBeRetrieved_0(); break; - case 52: - ChipLogProgress(chipTool, " ***** Test Step 52 : Write attribute INT8S Max Value\n"); - err = TestWriteAttributeInt8sMaxValue_52(); + case 1: + ChipLogProgress(chipTool, + " ***** Test Step 1 : 1a: TH sends DownOrClose command to preposition the DUT in the opposite direction\n"); + err = Test1aThSendsDownOrCloseCommandToPrepositionTheDutInTheOppositeDirection_1(); break; - case 53: - ChipLogProgress(chipTool, " ***** Test Step 53 : Read attribute INT8S Max Value\n"); - err = TestReadAttributeInt8sMaxValue_53(); + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : 1b: TH waits for x seconds movement(s) on the DUT\n"); + err = Test1bThWaitsForXSecondsMovementsOnTheDut_2(); break; - case 54: - ChipLogProgress(chipTool, " ***** Test Step 54 : Write attribute INT8S Min Value\n"); - err = TestWriteAttributeInt8sMinValue_54(); - break; - case 55: - ChipLogProgress(chipTool, " ***** Test Step 55 : Read attribute INT8S Min Value\n"); - err = TestReadAttributeInt8sMinValue_55(); - break; - case 56: - ChipLogProgress(chipTool, " ***** Test Step 56 : Write attribute INT8S Default Value\n"); - err = TestWriteAttributeInt8sDefaultValue_56(); - break; - case 57: - ChipLogProgress(chipTool, " ***** Test Step 57 : Read attribute INT8S Default Value\n"); - err = TestReadAttributeInt8sDefaultValue_57(); - break; - case 58: - ChipLogProgress(chipTool, " ***** Test Step 58 : Read attribute INT16S Default Value\n"); - err = TestReadAttributeInt16sDefaultValue_58(); - break; - case 59: - ChipLogProgress(chipTool, " ***** Test Step 59 : Write attribute INT16S Max Value\n"); - err = TestWriteAttributeInt16sMaxValue_59(); - break; - case 60: - ChipLogProgress(chipTool, " ***** Test Step 60 : Read attribute INT16S Max Value\n"); - err = TestReadAttributeInt16sMaxValue_60(); - break; - case 61: - ChipLogProgress(chipTool, " ***** Test Step 61 : Write attribute INT16S Min Value\n"); - err = TestWriteAttributeInt16sMinValue_61(); - break; - case 62: - ChipLogProgress(chipTool, " ***** Test Step 62 : Read attribute INT16S Min Value\n"); - err = TestReadAttributeInt16sMinValue_62(); - break; - case 63: - ChipLogProgress(chipTool, " ***** Test Step 63 : Write attribute INT16S Default Value\n"); - err = TestWriteAttributeInt16sDefaultValue_63(); - break; - case 64: - ChipLogProgress(chipTool, " ***** Test Step 64 : Read attribute INT16S Default Value\n"); - err = TestReadAttributeInt16sDefaultValue_64(); - break; - case 65: - ChipLogProgress(chipTool, " ***** Test Step 65 : Read attribute INT32S Default Value\n"); - err = TestReadAttributeInt32sDefaultValue_65(); - break; - case 66: - ChipLogProgress(chipTool, " ***** Test Step 66 : Write attribute INT32S Max Value\n"); - err = TestWriteAttributeInt32sMaxValue_66(); - break; - case 67: - ChipLogProgress(chipTool, " ***** Test Step 67 : Read attribute INT32S Max Value\n"); - err = TestReadAttributeInt32sMaxValue_67(); - break; - case 68: - ChipLogProgress(chipTool, " ***** Test Step 68 : Write attribute INT32S Min Value\n"); - err = TestWriteAttributeInt32sMinValue_68(); - break; - case 69: - ChipLogProgress(chipTool, " ***** Test Step 69 : Read attribute INT32S Min Value\n"); - err = TestReadAttributeInt32sMinValue_69(); - break; - case 70: - ChipLogProgress(chipTool, " ***** Test Step 70 : Write attribute INT32S Default Value\n"); - err = TestWriteAttributeInt32sDefaultValue_70(); - break; - case 71: - ChipLogProgress(chipTool, " ***** Test Step 71 : Read attribute INT32S Default Value\n"); - err = TestReadAttributeInt32sDefaultValue_71(); - break; - case 72: - ChipLogProgress(chipTool, " ***** Test Step 72 : Read attribute INT64S Default Value\n"); - err = TestReadAttributeInt64sDefaultValue_72(); - break; - case 73: - ChipLogProgress(chipTool, " ***** Test Step 73 : Write attribute INT64S Max Value\n"); - err = TestWriteAttributeInt64sMaxValue_73(); - break; - case 74: - ChipLogProgress(chipTool, " ***** Test Step 74 : Read attribute INT64S Max Value\n"); - err = TestReadAttributeInt64sMaxValue_74(); - break; - case 75: - ChipLogProgress(chipTool, " ***** Test Step 75 : Write attribute INT64S Min Value\n"); - err = TestWriteAttributeInt64sMinValue_75(); - break; - case 76: - ChipLogProgress(chipTool, " ***** Test Step 76 : Read attribute INT64S Min Value\n"); - err = TestReadAttributeInt64sMinValue_76(); - break; - case 77: - ChipLogProgress(chipTool, " ***** Test Step 77 : Write attribute INT64S Default Value\n"); - err = TestWriteAttributeInt64sDefaultValue_77(); - break; - case 78: - ChipLogProgress(chipTool, " ***** Test Step 78 : Read attribute INT64S Default Value\n"); - err = TestReadAttributeInt64sDefaultValue_78(); - break; - case 79: - ChipLogProgress(chipTool, " ***** Test Step 79 : Read attribute SINGLE Default Value\n"); - err = TestReadAttributeSingleDefaultValue_79(); - break; - case 80: - ChipLogProgress(chipTool, " ***** Test Step 80 : Write attribute SINGLE medium Value\n"); - err = TestWriteAttributeSingleMediumValue_80(); - break; - case 81: - ChipLogProgress(chipTool, " ***** Test Step 81 : Read attribute SINGLE medium Value\n"); - err = TestReadAttributeSingleMediumValue_81(); - break; - case 82: - ChipLogProgress(chipTool, " ***** Test Step 82 : Write attribute SINGLE large Value\n"); - err = TestWriteAttributeSingleLargeValue_82(); - break; - case 83: - ChipLogProgress(chipTool, " ***** Test Step 83 : Read attribute SINGLE large Value\n"); - err = TestReadAttributeSingleLargeValue_83(); - break; - case 84: - ChipLogProgress(chipTool, " ***** Test Step 84 : Write attribute SINGLE small Value\n"); - err = TestWriteAttributeSingleSmallValue_84(); - break; - case 85: - ChipLogProgress(chipTool, " ***** Test Step 85 : Read attribute SINGLE small Value\n"); - err = TestReadAttributeSingleSmallValue_85(); - break; - case 86: - ChipLogProgress(chipTool, " ***** Test Step 86 : Write attribute SINGLE Default Value\n"); - err = TestWriteAttributeSingleDefaultValue_86(); - break; - case 87: - ChipLogProgress(chipTool, " ***** Test Step 87 : Read attribute SINGLE Default Value\n"); - err = TestReadAttributeSingleDefaultValue_87(); - break; - case 88: - ChipLogProgress(chipTool, " ***** Test Step 88 : Read attribute DOUBLE Default Value\n"); - err = TestReadAttributeDoubleDefaultValue_88(); - break; - case 89: - ChipLogProgress(chipTool, " ***** Test Step 89 : Write attribute DOUBLE medium Value\n"); - err = TestWriteAttributeDoubleMediumValue_89(); - break; - case 90: - ChipLogProgress(chipTool, " ***** Test Step 90 : Read attribute DOUBLE medium Value\n"); - err = TestReadAttributeDoubleMediumValue_90(); - break; - case 91: - ChipLogProgress(chipTool, " ***** Test Step 91 : Write attribute DOUBLE large Value\n"); - err = TestWriteAttributeDoubleLargeValue_91(); - break; - case 92: - ChipLogProgress(chipTool, " ***** Test Step 92 : Read attribute DOUBLE large Value\n"); - err = TestReadAttributeDoubleLargeValue_92(); - break; - case 93: - ChipLogProgress(chipTool, " ***** Test Step 93 : Write attribute DOUBLE small Value\n"); - err = TestWriteAttributeDoubleSmallValue_93(); - break; - case 94: - ChipLogProgress(chipTool, " ***** Test Step 94 : Read attribute DOUBLE small Value\n"); - err = TestReadAttributeDoubleSmallValue_94(); - break; - case 95: - ChipLogProgress(chipTool, " ***** Test Step 95 : Write attribute DOUBLE Default Value\n"); - err = TestWriteAttributeDoubleDefaultValue_95(); - break; - case 96: - ChipLogProgress(chipTool, " ***** Test Step 96 : Read attribute DOUBLE Default Value\n"); - err = TestReadAttributeDoubleDefaultValue_96(); - break; - case 97: - ChipLogProgress(chipTool, " ***** Test Step 97 : Read attribute ENUM8 Default Value\n"); - err = TestReadAttributeEnum8DefaultValue_97(); + case 3: + ChipLogProgress( + chipTool, " ***** Test Step 3 : 1c: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT\n"); + if (ShouldSkip("WNCV_PA_LF && WNCV_LF")) { + NextTest(); + return; + } + err = Test1cIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_3(); break; - case 98: - ChipLogProgress(chipTool, " ***** Test Step 98 : Write attribute ENUM8 Max Value\n"); - err = TestWriteAttributeEnum8MaxValue_98(); + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : 2a: TH sends GoToLiftPercentage command with 25 percent to DUT\n"); + if (ShouldSkip("WNCV_LF && CR_GOTOLIFTPERCENTAGE")) { + NextTest(); + return; + } + err = Test2aThSendsGoToLiftPercentageCommandWith25PercentToDut_4(); break; - case 99: - ChipLogProgress(chipTool, " ***** Test Step 99 : Read attribute ENUM8 Max Value\n"); - err = TestReadAttributeEnum8MaxValue_99(); + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : 2b: DUT updates its attributes\n"); + err = Test2bDutUpdatesItsAttributes_5(); break; - case 100: - ChipLogProgress(chipTool, " ***** Test Step 100 : Write attribute ENUM8 Min Value\n"); - err = TestWriteAttributeEnum8MinValue_100(); + case 6: + ChipLogProgress( + chipTool, " ***** Test Step 6 : 2c: If (PA & LF) TH reads TargetPositionLiftPercent100ths attribute from DUT\n"); + if (ShouldSkip("WNCV_PA_LF && WNCV_LF")) { + NextTest(); + return; + } + err = Test2cIfPaLfThReadsTargetPositionLiftPercent100thsAttributeFromDut_6(); break; - case 101: - ChipLogProgress(chipTool, " ***** Test Step 101 : Read attribute ENUM8 Min Value\n"); - err = TestReadAttributeEnum8MinValue_101(); + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : 3a: TH set a timeout of X minutes for failure\n"); + err = Test3aThSetATimeoutOfXMinutesForFailure_7(); break; - case 102: - ChipLogProgress(chipTool, " ***** Test Step 102 : Read attribute ENUM16 Default Value\n"); - err = TestReadAttributeEnum16DefaultValue_102(); + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : 3b: TH reads OperationalStatus attribute from DUT\n"); + err = Test3bThReadsOperationalStatusAttributeFromDut_8(); break; - case 103: - ChipLogProgress(chipTool, " ***** Test Step 103 : Write attribute ENUM16 Max Value\n"); - err = TestWriteAttributeEnum16MaxValue_103(); + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : 4a: TH sends GoToLiftPercentage command with 75.20 percent to DUT\n"); + if (ShouldSkip("WNCV_LF && CR_GOTOLIFTPERCENTAGE")) { + NextTest(); + return; + } + err = Test4aThSendsGoToLiftPercentageCommandWith7520PercentToDut_9(); break; - case 104: - ChipLogProgress(chipTool, " ***** Test Step 104 : Read attribute ENUM16 Max Value\n"); - err = TestReadAttributeEnum16MaxValue_104(); + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : 4b: DUT updates its attributes\n"); + err = Test4bDutUpdatesItsAttributes_10(); break; - case 105: - ChipLogProgress(chipTool, " ***** Test Step 105 : Write attribute ENUM16 Min Value\n"); - err = TestWriteAttributeEnum16MinValue_105(); + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : 5a: TH waits for x seconds movement(s) on the DUT\n"); + err = Test5aThWaitsForXSecondsMovementsOnTheDut_11(); break; - case 106: - ChipLogProgress(chipTool, " ***** Test Step 106 : Read attribute ENUM16 Min Value\n"); - err = TestReadAttributeEnum16MinValue_106(); + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : 5b: TH reads OperationalStatus attribute from DUT\n"); + err = Test5bThReadsOperationalStatusAttributeFromDut_12(); break; - case 107: - ChipLogProgress(chipTool, " ***** Test Step 107 : Read attribute OCTET_STRING Default Value\n"); - err = TestReadAttributeOctetStringDefaultValue_107(); + } + + 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 = 13; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mFullMotionDuration; + chip::Optional mTimeout; + + CHIP_ERROR Test0WaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test1aThSendsDownOrCloseCommandToPrepositionTheDutInTheOppositeDirection_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster downOrCloseWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"1a: TH sends DownOrClose command to preposition the DUT in the opposite direction Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test1bThWaitsForXSecondsMovementsOnTheDut_2() + { + WaitForMs(mFullMotionDuration.HasValue() ? mFullMotionDuration.Value() : 6000U); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test1cIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_3() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentPositionLiftPercent100thsWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"1c: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("currentPositionLiftPercent100ths", value, 0U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test2aThSendsGoToLiftPercentageCommandWith25PercentToDut_4() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPWindowCoveringClusterGoToLiftPercentageParams alloc] init]; + params.liftPercentageValue = [NSNumber numberWithUnsignedChar:25]; + params.liftPercent100thsValue = [NSNumber numberWithUnsignedShort:2500U]; + [cluster goToLiftPercentageWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"2a: TH sends GoToLiftPercentage command with 25 percent to DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test2bDutUpdatesItsAttributes_5() + { + WaitForMs(100); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test2cIfPaLfThReadsTargetPositionLiftPercent100thsAttributeFromDut_6() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeTargetPositionLiftPercent100thsWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"2c: If (PA & LF) TH reads TargetPositionLiftPercent100ths attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("TargetPositionLiftPercent100ths", actualValue)); + VerifyOrReturn(CheckValue("TargetPositionLiftPercent100ths", actualValue, 2500U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test3aThSetATimeoutOfXMinutesForFailure_7() + { + WaitForMs(mFullMotionDuration.HasValue() ? mFullMotionDuration.Value() : 6000U); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test3bThReadsOperationalStatusAttributeFromDut_8() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOperationalStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3b: TH reads OperationalStatus attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("OperationalStatus", actualValue, 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test4aThSendsGoToLiftPercentageCommandWith7520PercentToDut_9() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPWindowCoveringClusterGoToLiftPercentageParams alloc] init]; + params.liftPercentageValue = [NSNumber numberWithUnsignedChar:75]; + params.liftPercent100thsValue = [NSNumber numberWithUnsignedShort:7520U]; + [cluster goToLiftPercentageWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"4a: TH sends GoToLiftPercentage command with 75.20 percent to DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test4bDutUpdatesItsAttributes_10() + { + WaitForMs(100); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test5aThWaitsForXSecondsMovementsOnTheDut_11() + { + WaitForMs(mFullMotionDuration.HasValue() ? mFullMotionDuration.Value() : 6000U); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test5bThReadsOperationalStatusAttributeFromDut_12() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOperationalStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"5b: TH reads OperationalStatus attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("OperationalStatus", actualValue, 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_WNCV_4_2 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_WNCV_4_2() + : TestCommandBridge("Test_TC_WNCV_4_2") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("fullMotionDuration", 0, UINT16_MAX, &mFullMotionDuration); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_WNCV_4_2() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_4_2\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_4_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++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : 0: Wait for the commissioned device to be retrieved\n"); + err = Test0WaitForTheCommissionedDeviceToBeRetrieved_0(); break; - case 108: - ChipLogProgress(chipTool, " ***** Test Step 108 : Write attribute OCTET_STRING with embedded null\n"); - err = TestWriteAttributeOctetStringWithEmbeddedNull_108(); + case 1: + ChipLogProgress(chipTool, + " ***** Test Step 1 : 1a: TH sends DownOrClose command to preposition the DUT in the opposite direction\n"); + err = Test1aThSendsDownOrCloseCommandToPrepositionTheDutInTheOppositeDirection_1(); break; - case 109: - ChipLogProgress(chipTool, " ***** Test Step 109 : Read attribute OCTET_STRING with embedded null\n"); - err = TestReadAttributeOctetStringWithEmbeddedNull_109(); + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : 1b: TH waits for x seconds movement(s) on the DUT\n"); + err = Test1bThWaitsForXSecondsMovementsOnTheDut_2(); break; - case 110: - ChipLogProgress(chipTool, " ***** Test Step 110 : Write attribute OCTET_STRING with weird chars\n"); - err = TestWriteAttributeOctetStringWithWeirdChars_110(); + case 3: + ChipLogProgress( + chipTool, " ***** Test Step 3 : 1c: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT\n"); + if (ShouldSkip("WNCV_PA_TL && WNCV_TL")) { + NextTest(); + return; + } + err = Test1cIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_3(); break; - case 111: - ChipLogProgress(chipTool, " ***** Test Step 111 : Read attribute OCTET_STRING with weird chars\n"); - err = TestReadAttributeOctetStringWithWeirdChars_111(); + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : 2a: TH sends GoToTiltPercentage command with 30 percent to DUT\n"); + if (ShouldSkip("WNCV_TL && CR_GOTOTILTPERCENTAGE")) { + NextTest(); + return; + } + err = Test2aThSendsGoToTiltPercentageCommandWith30PercentToDut_4(); break; - case 112: - ChipLogProgress(chipTool, " ***** Test Step 112 : Write attribute OCTET_STRING\n"); - err = TestWriteAttributeOctetString_112(); + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : 2b: DUT updates its attributes\n"); + err = Test2bDutUpdatesItsAttributes_5(); break; - case 113: - ChipLogProgress(chipTool, " ***** Test Step 113 : Read attribute OCTET_STRING\n"); - err = TestReadAttributeOctetString_113(); + case 6: + ChipLogProgress( + chipTool, " ***** Test Step 6 : 2c: If (PA & TL) TH reads TargetPositionTiltPercent100ths attribute from DUT\n"); + if (ShouldSkip("WNCV_PA_TL && WNCV_TL")) { + NextTest(); + return; + } + err = Test2cIfPaTlThReadsTargetPositionTiltPercent100thsAttributeFromDut_6(); break; - case 114: - ChipLogProgress(chipTool, " ***** Test Step 114 : Write attribute OCTET_STRING\n"); - err = TestWriteAttributeOctetString_114(); + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : 3a: TH set a timeout of X minutes for failure\n"); + err = Test3aThSetATimeoutOfXMinutesForFailure_7(); break; - case 115: - ChipLogProgress(chipTool, " ***** Test Step 115 : Read attribute OCTET_STRING\n"); - err = TestReadAttributeOctetString_115(); + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : 3b: TH reads OperationalStatus attribute from DUT\n"); + err = Test3bThReadsOperationalStatusAttributeFromDut_8(); break; - case 116: - ChipLogProgress(chipTool, " ***** Test Step 116 : Write attribute OCTET_STRING\n"); - err = TestWriteAttributeOctetString_116(); + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : 4a: TH sends GoToTiltPercentage command with 60.20 percent to DUT\n"); + if (ShouldSkip("WNCV_TL && CR_GOTOTILTPERCENTAGE")) { + NextTest(); + return; + } + err = Test4aThSendsGoToTiltPercentageCommandWith6020PercentToDut_9(); break; - case 117: - ChipLogProgress(chipTool, " ***** Test Step 117 : Read attribute LONG_OCTET_STRING Default Value\n"); - err = TestReadAttributeLongOctetStringDefaultValue_117(); + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : 4b: DUT updates its attributes\n"); + err = Test4bDutUpdatesItsAttributes_10(); break; - case 118: - ChipLogProgress(chipTool, " ***** Test Step 118 : Write attribute LONG_OCTET_STRING\n"); - err = TestWriteAttributeLongOctetString_118(); + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : 5a: TH waits for x seconds movement(s) on the DUT\n"); + err = Test5aThWaitsForXSecondsMovementsOnTheDut_11(); break; - case 119: - ChipLogProgress(chipTool, " ***** Test Step 119 : Read attribute LONG_OCTET_STRING\n"); - err = TestReadAttributeLongOctetString_119(); + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : 5b: TH reads OperationalStatus attribute from DUT\n"); + err = Test5bThReadsOperationalStatusAttributeFromDut_12(); break; - case 120: - ChipLogProgress(chipTool, " ***** Test Step 120 : Write attribute LONG_OCTET_STRING\n"); - err = TestWriteAttributeLongOctetString_120(); - break; - case 121: - ChipLogProgress(chipTool, " ***** Test Step 121 : Read attribute CHAR_STRING Default Value\n"); - err = TestReadAttributeCharStringDefaultValue_121(); - break; - case 122: - ChipLogProgress(chipTool, " ***** Test Step 122 : Write attribute CHAR_STRING\n"); - err = TestWriteAttributeCharString_122(); + } + + 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 = 13; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mFullMotionDuration; + chip::Optional mTimeout; + + CHIP_ERROR Test0WaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test1aThSendsDownOrCloseCommandToPrepositionTheDutInTheOppositeDirection_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster downOrCloseWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"1a: TH sends DownOrClose command to preposition the DUT in the opposite direction Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test1bThWaitsForXSecondsMovementsOnTheDut_2() + { + WaitForMs(mFullMotionDuration.HasValue() ? mFullMotionDuration.Value() : 6000U); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test1cIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_3() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentPositionTiltPercent100thsWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"1c: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("currentPositionTiltPercent100ths", value, 0U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test2aThSendsGoToTiltPercentageCommandWith30PercentToDut_4() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPWindowCoveringClusterGoToTiltPercentageParams alloc] init]; + params.tiltPercentageValue = [NSNumber numberWithUnsignedChar:30]; + params.tiltPercent100thsValue = [NSNumber numberWithUnsignedShort:3000U]; + [cluster goToTiltPercentageWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"2a: TH sends GoToTiltPercentage command with 30 percent to DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test2bDutUpdatesItsAttributes_5() + { + WaitForMs(100); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test2cIfPaTlThReadsTargetPositionTiltPercent100thsAttributeFromDut_6() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeTargetPositionTiltPercent100thsWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"2c: If (PA & TL) TH reads TargetPositionTiltPercent100ths attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("TargetPositionTiltPercent100ths", actualValue)); + VerifyOrReturn(CheckValue("TargetPositionTiltPercent100ths", actualValue, 3000U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test3aThSetATimeoutOfXMinutesForFailure_7() + { + WaitForMs(mFullMotionDuration.HasValue() ? mFullMotionDuration.Value() : 6000U); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test3bThReadsOperationalStatusAttributeFromDut_8() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOperationalStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3b: TH reads OperationalStatus attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("OperationalStatus", actualValue, 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test4aThSendsGoToTiltPercentageCommandWith6020PercentToDut_9() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPWindowCoveringClusterGoToTiltPercentageParams alloc] init]; + params.tiltPercentageValue = [NSNumber numberWithUnsignedChar:60]; + params.tiltPercent100thsValue = [NSNumber numberWithUnsignedShort:6005U]; + [cluster goToTiltPercentageWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"4a: TH sends GoToTiltPercentage command with 60.20 percent to DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test4bDutUpdatesItsAttributes_10() + { + WaitForMs(100); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test5aThWaitsForXSecondsMovementsOnTheDut_11() + { + WaitForMs(mFullMotionDuration.HasValue() ? mFullMotionDuration.Value() : 6000U); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test5bThReadsOperationalStatusAttributeFromDut_12() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOperationalStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"5b: TH reads OperationalStatus attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("OperationalStatus", actualValue, 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_WNCV_4_3 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_WNCV_4_3() + : TestCommandBridge("Test_TC_WNCV_4_3") + , 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_WNCV_4_3() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_4_3\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_4_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 : 0: Wait for the commissioned device to be retrieved\n"); + err = Test0WaitForTheCommissionedDeviceToBeRetrieved_0(); break; - case 123: - ChipLogProgress(chipTool, " ***** Test Step 123 : Read attribute CHAR_STRING\n"); - err = TestReadAttributeCharString_123(); + case 1: + ChipLogProgress( + chipTool, " ***** Test Step 1 : 1a: If (PA_LF & LF) TH reads CurrentPositionLiftPercent100ths from DUT\n"); + if (ShouldSkip("WNCV_LF && WNCV_PA_LF")) { + NextTest(); + return; + } + err = Test1aIfPaLfLfThReadsCurrentPositionLiftPercent100thsFromDut_1(); break; - case 124: - ChipLogProgress(chipTool, " ***** Test Step 124 : Write attribute CHAR_STRING - Value too long\n"); - err = TestWriteAttributeCharStringValueTooLong_124(); + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : 1b: If (PA_LF & LF) TH reads CurrentPositionLiftPercentage from DUT\n"); + if (ShouldSkip("WNCV_LF && WNCV_PA_LF && A_CURRENTPOSITIONLIFTPERCENTAGE")) { + NextTest(); + return; + } + err = Test1bIfPaLfLfThReadsCurrentPositionLiftPercentageFromDut_2(); break; - case 125: - ChipLogProgress(chipTool, " ***** Test Step 125 : Read attribute CHAR_STRING\n"); - err = TestReadAttributeCharString_125(); + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : 2b: TH sends GoToLiftPercentage command with BadParam to DUT\n"); + if (ShouldSkip("WNCV_LF && WNCV_PA_LF || WNCV_LF && CR_GOTOLIFTPERCENTAGE")) { + NextTest(); + return; + } + err = Test2bThSendsGoToLiftPercentageCommandWithBadParamToDut_3(); break; - case 126: - ChipLogProgress(chipTool, " ***** Test Step 126 : Write attribute CHAR_STRING - Empty\n"); - err = TestWriteAttributeCharStringEmpty_126(); + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : 3a: TH sends GoToLiftPercentage command with 10001 to DUT\n"); + if (ShouldSkip("WNCV_LF && WNCV_PA_LF || WNCV_LF && CR_GOTOLIFTPERCENTAGE")) { + NextTest(); + return; + } + err = Test3aThSendsGoToLiftPercentageCommandWith10001ToDut_4(); break; - case 127: - ChipLogProgress(chipTool, " ***** Test Step 127 : Read attribute LONG_CHAR_STRING Default Value\n"); - err = TestReadAttributeLongCharStringDefaultValue_127(); + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : 4a: TH sends GoToLiftPercentage command with 0xFFFF to DUT\n"); + if (ShouldSkip("WNCV_LF && WNCV_PA_LF || WNCV_LF && CR_GOTOLIFTPERCENTAGE")) { + NextTest(); + return; + } + err = Test4aThSendsGoToLiftPercentageCommandWith0xFFFFToDut_5(); break; - case 128: - ChipLogProgress(chipTool, " ***** Test Step 128 : Write attribute LONG_CHAR_STRING\n"); - err = TestWriteAttributeLongCharString_128(); + } + + 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 = 6; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR Test0WaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + NSNumber * _Nullable attrCurrentPositionLiftPercent100ths; + + CHIP_ERROR Test1aIfPaLfLfThReadsCurrentPositionLiftPercent100thsFromDut_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentPositionLiftPercent100thsWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"1a: If (PA_LF & LF) TH reads CurrentPositionLiftPercent100ths from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue( + "currentPositionLiftPercent100ths", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue( + "currentPositionLiftPercent100ths", [value unsignedShortValue], 10000U)); + } + { + attrCurrentPositionLiftPercent100ths = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nullable attrCurrentPositionLiftPercentage; + + CHIP_ERROR Test1bIfPaLfLfThReadsCurrentPositionLiftPercentageFromDut_2() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster + readAttributeCurrentPositionLiftPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"1b: If (PA_LF & LF) TH reads CurrentPositionLiftPercentage from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + if (value != nil) { + VerifyOrReturn( + CheckConstraintMinValue("currentPositionLiftPercentage", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn( + CheckConstraintMaxValue("currentPositionLiftPercentage", [value unsignedCharValue], 100)); + } + { + attrCurrentPositionLiftPercentage = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test2bThSendsGoToLiftPercentageCommandWithBadParamToDut_3() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPWindowCoveringClusterGoToLiftPercentageParams alloc] init]; + params.liftPercentageValue = [NSNumber numberWithUnsignedChar:63]; + params.liftPercent100thsValue = [NSNumber numberWithUnsignedShort:12288U]; + [cluster goToLiftPercentageWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"2b: TH sends GoToLiftPercentage command with BadParam to DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test3aThSendsGoToLiftPercentageCommandWith10001ToDut_4() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPWindowCoveringClusterGoToLiftPercentageParams alloc] init]; + params.liftPercentageValue = [NSNumber numberWithUnsignedChar:100]; + params.liftPercent100thsValue = [NSNumber numberWithUnsignedShort:10001U]; + [cluster goToLiftPercentageWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"3a: TH sends GoToLiftPercentage command with 10001 to DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test4aThSendsGoToLiftPercentageCommandWith0xFFFFToDut_5() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPWindowCoveringClusterGoToLiftPercentageParams alloc] init]; + params.liftPercentageValue = [NSNumber numberWithUnsignedChar:255]; + params.liftPercent100thsValue = [NSNumber numberWithUnsignedShort:65535U]; + [cluster goToLiftPercentageWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"4a: TH sends GoToLiftPercentage command with 0xFFFF to DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_WNCV_4_4 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_WNCV_4_4() + : TestCommandBridge("Test_TC_WNCV_4_4") + , 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_WNCV_4_4() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_4_4\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_4_4\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 : 0: Wait for the commissioned device to be retrieved\n"); + err = Test0WaitForTheCommissionedDeviceToBeRetrieved_0(); break; - case 129: - ChipLogProgress(chipTool, " ***** Test Step 129 : Read attribute LONG_CHAR_STRING\n"); - err = TestReadAttributeLongCharString_129(); + case 1: + ChipLogProgress( + chipTool, " ***** Test Step 1 : 1a: If (PA_TL & TL) TH reads CurrentPositionTiltPercent100ths from DUT\n"); + if (ShouldSkip("WNCV_TL && WNCV_PA_TL")) { + NextTest(); + return; + } + err = Test1aIfPaTlTlThReadsCurrentPositionTiltPercent100thsFromDut_1(); break; - case 130: - ChipLogProgress(chipTool, " ***** Test Step 130 : Write attribute LONG_CHAR_STRING\n"); - err = TestWriteAttributeLongCharString_130(); + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : 1b: If (PA_TL & TL) TH reads CurrentPositionTiltPercentage from DUT\n"); + if (ShouldSkip("WNCV_TL && WNCV_PA_TL && A_CURRENTPOSITIONTILTPERCENTAGE")) { + NextTest(); + return; + } + err = Test1bIfPaTlTlThReadsCurrentPositionTiltPercentageFromDut_2(); break; - case 131: - ChipLogProgress(chipTool, " ***** Test Step 131 : Read attribute LIST_LONG_OCTET_STRING (for chunked read)\n"); - err = TestReadAttributeListLongOctetStringForChunkedRead_131(); + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : 2b: TH sends GoToTiltPercentage command with BadParam to DUT\n"); + if (ShouldSkip("WNCV_TL && WNCV_PA_TL || WNCV_TL && CR_GOTOTILTPERCENTAGE")) { + NextTest(); + return; + } + err = Test2bThSendsGoToTiltPercentageCommandWithBadParamToDut_3(); break; - case 132: - ChipLogProgress(chipTool, " ***** Test Step 132 : Write attribute LIST_LONG_OCTET_STRING (for chunked write)\n"); - err = TestWriteAttributeListLongOctetStringForChunkedWrite_132(); - break; - case 133: - ChipLogProgress(chipTool, " ***** Test Step 133 : Read attribute LIST_LONG_OCTET_STRING (for chunked read)\n"); - err = TestReadAttributeListLongOctetStringForChunkedRead_133(); - break; - case 134: - ChipLogProgress(chipTool, " ***** Test Step 134 : Read attribute EPOCH_US Default Value\n"); - err = TestReadAttributeEpochUsDefaultValue_134(); - break; - case 135: - ChipLogProgress(chipTool, " ***** Test Step 135 : Write attribute EPOCH_US Max Value\n"); - err = TestWriteAttributeEpochUsMaxValue_135(); - break; - case 136: - ChipLogProgress(chipTool, " ***** Test Step 136 : Read attribute EPOCH_US Max Value\n"); - err = TestReadAttributeEpochUsMaxValue_136(); - break; - case 137: - ChipLogProgress(chipTool, " ***** Test Step 137 : Write attribute EPOCH_US Min Value\n"); - err = TestWriteAttributeEpochUsMinValue_137(); - break; - case 138: - ChipLogProgress(chipTool, " ***** Test Step 138 : Read attribute EPOCH_US Min Value\n"); - err = TestReadAttributeEpochUsMinValue_138(); - break; - case 139: - ChipLogProgress(chipTool, " ***** Test Step 139 : Read attribute EPOCH_S Default Value\n"); - err = TestReadAttributeEpochSDefaultValue_139(); - break; - case 140: - ChipLogProgress(chipTool, " ***** Test Step 140 : Write attribute EPOCH_S Max Value\n"); - err = TestWriteAttributeEpochSMaxValue_140(); - break; - case 141: - ChipLogProgress(chipTool, " ***** Test Step 141 : Read attribute EPOCH_S Max Value\n"); - err = TestReadAttributeEpochSMaxValue_141(); - break; - case 142: - ChipLogProgress(chipTool, " ***** Test Step 142 : Write attribute EPOCH_S Min Value\n"); - err = TestWriteAttributeEpochSMinValue_142(); - break; - case 143: - ChipLogProgress(chipTool, " ***** Test Step 143 : Read attribute EPOCH_S Min Value\n"); - err = TestReadAttributeEpochSMinValue_143(); - break; - case 144: - ChipLogProgress(chipTool, " ***** Test Step 144 : Read attribute UNSUPPORTED\n"); - err = TestReadAttributeUnsupported_144(); - break; - case 145: - ChipLogProgress(chipTool, " ***** Test Step 145 : Writeattribute UNSUPPORTED\n"); - err = TestWriteattributeUnsupported_145(); - break; - case 146: - ChipLogProgress(chipTool, " ***** Test Step 146 : Send Test Command to unsupported endpoint\n"); - err = TestSendTestCommandToUnsupportedEndpoint_146(); - break; - case 147: - ChipLogProgress(chipTool, " ***** Test Step 147 : Send Test Command to unsupported cluster\n"); - err = TestSendTestCommandToUnsupportedCluster_147(); - break; - case 148: - ChipLogProgress(chipTool, " ***** Test Step 148 : Read attribute vendor_id Default Value\n"); - err = TestReadAttributeVendorIdDefaultValue_148(); - break; - case 149: - ChipLogProgress(chipTool, " ***** Test Step 149 : Write attribute vendor_id\n"); - err = TestWriteAttributeVendorId_149(); - break; - case 150: - ChipLogProgress(chipTool, " ***** Test Step 150 : Read attribute vendor_id\n"); - err = TestReadAttributeVendorId_150(); - break; - case 151: - ChipLogProgress(chipTool, " ***** Test Step 151 : Restore attribute vendor_id\n"); - err = TestRestoreAttributeVendorId_151(); - break; - case 152: - ChipLogProgress(chipTool, " ***** Test Step 152 : Send a command with a vendor_id and enum\n"); - err = TestSendACommandWithAVendorIdAndEnum_152(); - break; - case 153: - ChipLogProgress(chipTool, " ***** Test Step 153 : Send Test Command With Struct Argument and arg1.b is true\n"); - err = TestSendTestCommandWithStructArgumentAndArg1bIsTrue_153(); - break; - case 154: - ChipLogProgress(chipTool, " ***** Test Step 154 : Send Test Command With Struct Argument and arg1.b is false\n"); - err = TestSendTestCommandWithStructArgumentAndArg1bIsFalse_154(); - break; - case 155: - ChipLogProgress( - chipTool, " ***** Test Step 155 : Send Test Command With Nested Struct Argument and arg1.c.b is true\n"); - err = TestSendTestCommandWithNestedStructArgumentAndArg1cbIsTrue_155(); - break; - case 156: - ChipLogProgress(chipTool, " ***** Test Step 156 : Send Test Command With Nested Struct Argument arg1.c.b is false\n"); - err = TestSendTestCommandWithNestedStructArgumentArg1cbIsFalse_156(); - break; - case 157: - ChipLogProgress(chipTool, - " ***** Test Step 157 : Send Test Command With Nested Struct List Argument and all fields b of arg1.d are true\n"); - err = TestSendTestCommandWithNestedStructListArgumentAndAllFieldsBOfArg1dAreTrue_157(); - break; - case 158: - ChipLogProgress(chipTool, - " ***** Test Step 158 : Send Test Command With Nested Struct List Argument and some fields b of arg1.d are " - "false\n"); - err = TestSendTestCommandWithNestedStructListArgumentAndSomeFieldsBOfArg1dAreFalse_158(); - break; - case 159: - ChipLogProgress(chipTool, " ***** Test Step 159 : Send Test Command With Struct Argument and see what we get back\n"); - err = TestSendTestCommandWithStructArgumentAndSeeWhatWeGetBack_159(); - break; - case 160: - ChipLogProgress(chipTool, " ***** Test Step 160 : Send Test Command With List of INT8U and none of them is set to 0\n"); - err = TestSendTestCommandWithListOfInt8uAndNoneOfThemIsSetTo0_160(); - break; - case 161: - ChipLogProgress(chipTool, " ***** Test Step 161 : Send Test Command With List of INT8U and one of them is set to 0\n"); - err = TestSendTestCommandWithListOfInt8uAndOneOfThemIsSetTo0_161(); - break; - case 162: - ChipLogProgress(chipTool, " ***** Test Step 162 : Send Test Command With List of INT8U and get it reversed\n"); - err = TestSendTestCommandWithListOfInt8uAndGetItReversed_162(); - break; - case 163: - ChipLogProgress( - chipTool, " ***** Test Step 163 : Send Test Command With empty List of INT8U and get an empty list back\n"); - err = TestSendTestCommandWithEmptyListOfInt8uAndGetAnEmptyListBack_163(); - break; - case 164: - ChipLogProgress(chipTool, - " ***** Test Step 164 : Send Test Command With List of Struct Argument and arg1.b of first item is true\n"); - err = TestSendTestCommandWithListOfStructArgumentAndArg1bOfFirstItemIsTrue_164(); + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : 3a: TH sends GoToTiltPercentage command with 10001 to DUT\n"); + if (ShouldSkip("WNCV_TL && WNCV_PA_TL || WNCV_TL && CR_GOTOTILTPERCENTAGE")) { + NextTest(); + return; + } + err = Test3aThSendsGoToTiltPercentageCommandWith10001ToDut_4(); break; - case 165: - ChipLogProgress(chipTool, - " ***** Test Step 165 : Send Test Command With List of Struct Argument and arg1.b of first item is false\n"); - err = TestSendTestCommandWithListOfStructArgumentAndArg1bOfFirstItemIsFalse_165(); + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : 4a: TH sends GoToTiltPercentage command with 0xFFFF to DUT\n"); + if (ShouldSkip("WNCV_TL && WNCV_PA_TL || WNCV_TL && CR_GOTOTILTPERCENTAGE")) { + NextTest(); + return; + } + err = Test4aThSendsGoToTiltPercentageCommandWith0xFFFFToDut_5(); break; - case 166: - ChipLogProgress(chipTool, - " ***** Test Step 166 : Send Test Command With List of Nested Struct List Argument and all fields b of elements of " - "arg1.d are true\n"); - err = TestSendTestCommandWithListOfNestedStructListArgumentAndAllFieldsBOfElementsOfArg1dAreTrue_166(); + } + + 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 = 6; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR Test0WaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + NSNumber * _Nullable attrCurrentPositionTiltPercent100ths; + + CHIP_ERROR Test1aIfPaTlTlThReadsCurrentPositionTiltPercent100thsFromDut_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentPositionTiltPercent100thsWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"1a: If (PA_TL & TL) TH reads CurrentPositionTiltPercent100ths from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue( + "currentPositionTiltPercent100ths", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue( + "currentPositionTiltPercent100ths", [value unsignedShortValue], 10000U)); + } + { + attrCurrentPositionTiltPercent100ths = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nullable attrCurrentPositionTiltPercentage; + + CHIP_ERROR Test1bIfPaTlTlThReadsCurrentPositionTiltPercentageFromDut_2() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster + readAttributeCurrentPositionTiltPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"1b: If (PA_TL & TL) TH reads CurrentPositionTiltPercentage from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + if (value != nil) { + VerifyOrReturn( + CheckConstraintMinValue("currentPositionTiltPercentage", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn( + CheckConstraintMaxValue("currentPositionTiltPercentage", [value unsignedCharValue], 100)); + } + { + attrCurrentPositionTiltPercentage = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test2bThSendsGoToTiltPercentageCommandWithBadParamToDut_3() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPWindowCoveringClusterGoToTiltPercentageParams alloc] init]; + params.tiltPercentageValue = [NSNumber numberWithUnsignedChar:63]; + params.tiltPercent100thsValue = [NSNumber numberWithUnsignedShort:12288U]; + [cluster goToTiltPercentageWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"2b: TH sends GoToTiltPercentage command with BadParam to DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test3aThSendsGoToTiltPercentageCommandWith10001ToDut_4() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPWindowCoveringClusterGoToTiltPercentageParams alloc] init]; + params.tiltPercentageValue = [NSNumber numberWithUnsignedChar:100]; + params.tiltPercent100thsValue = [NSNumber numberWithUnsignedShort:10001U]; + [cluster goToTiltPercentageWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"3a: TH sends GoToTiltPercentage command with 10001 to DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test4aThSendsGoToTiltPercentageCommandWith0xFFFFToDut_5() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPWindowCoveringClusterGoToTiltPercentageParams alloc] init]; + params.tiltPercentageValue = [NSNumber numberWithUnsignedChar:255]; + params.tiltPercent100thsValue = [NSNumber numberWithUnsignedShort:65535U]; + [cluster goToTiltPercentageWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"4a: TH sends GoToTiltPercentage command with 0xFFFF to DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_WNCV_4_5 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_WNCV_4_5() + : TestCommandBridge("Test_TC_WNCV_4_5") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("discriminator", 0, UINT16_MAX, &mDiscriminator); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_WNCV_4_5() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_4_5\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_4_5\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : 0a: Wait for the commissioned device to be retrieved\n"); + err = Test0aWaitForTheCommissionedDeviceToBeRetrieved_0(); break; - case 167: - ChipLogProgress(chipTool, - " ***** Test Step 167 : Send Test Command With Nested Struct List Argument and some fields b of elements of arg1.d " - "are false\n"); - err = TestSendTestCommandWithNestedStructListArgumentAndSomeFieldsBOfElementsOfArg1dAreFalse_167(); + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : 0b: TH sends UpOrOpen command to preposition the DUT\n"); + err = Test0bThSendsUpOrOpenCommandToPrepositionTheDut_1(); break; - case 168: + case 2: ChipLogProgress( - chipTool, " ***** Test Step 168 : Write attribute LIST With List of INT8U and none of them is set to 0\n"); - err = TestWriteAttributeListWithListOfInt8uAndNoneOfThemIsSetTo0_168(); - break; - case 169: - ChipLogProgress(chipTool, " ***** Test Step 169 : Read attribute LIST With List of INT8U\n"); - err = TestReadAttributeListWithListOfInt8u_169(); - break; - case 170: - ChipLogProgress(chipTool, " ***** Test Step 170 : Write attribute LIST With List of OCTET_STRING\n"); - err = TestWriteAttributeListWithListOfOctetString_170(); - break; - case 171: - ChipLogProgress(chipTool, " ***** Test Step 171 : Read attribute LIST With List of OCTET_STRING\n"); - err = TestReadAttributeListWithListOfOctetString_171(); - break; - case 172: - ChipLogProgress(chipTool, " ***** Test Step 172 : Write attribute LIST With List of LIST_STRUCT_OCTET_STRING\n"); - err = TestWriteAttributeListWithListOfListStructOctetString_172(); - break; - case 173: - ChipLogProgress(chipTool, " ***** Test Step 173 : Read attribute LIST With List of LIST_STRUCT_OCTET_STRING\n"); - err = TestReadAttributeListWithListOfListStructOctetString_173(); - break; - case 174: - ChipLogProgress(chipTool, " ***** Test Step 174 : Send Test Command with optional arg set.\n"); - err = TestSendTestCommandWithOptionalArgSet_174(); + chipTool, " ***** Test Step 2 : 1a: If (PA_LF & LF) TH sends GoToLiftPercentage command with 90%% to DUT\n"); + if (ShouldSkip("WNCV_LF && WNCV_PA_LF")) { + NextTest(); + return; + } + err = Test1aIfPaLfLfThSendsGoToLiftPercentageCommandWith90ToDut_2(); break; - case 175: - ChipLogProgress(chipTool, " ***** Test Step 175 : Send Test Command without its optional arg.\n"); - err = TestSendTestCommandWithoutItsOptionalArg_175(); + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : 1b: TH Waits for 100ms-1s\n"); + err = Test1bThWaitsFor100ms1s_3(); break; - case 176: - ChipLogProgress(chipTool, " ***** Test Step 176 : Read list of structs containing nullables and optionals\n"); - err = TestReadListOfStructsContainingNullablesAndOptionals_176(); + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : 1c: TH sends StopMotion command to DUT\n"); + err = Test1cThSendsStopMotionCommandToDut_4(); break; - case 177: - ChipLogProgress(chipTool, " ***** Test Step 177 : Write list of structs containing nullables and optionals\n"); - err = TestWriteListOfStructsContainingNullablesAndOptionals_177(); + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : 1d: TH Waits for 100ms-1s\n"); + err = Test1dThWaitsFor100ms1s_5(); break; - case 178: + case 6: ChipLogProgress( - chipTool, " ***** Test Step 178 : Read list of structs containing nullables and optionals after writing\n"); - err = TestReadListOfStructsContainingNullablesAndOptionalsAfterWriting_178(); - break; - case 179: - ChipLogProgress(chipTool, " ***** Test Step 179 : Write attribute NULLABLE_BOOLEAN null\n"); - err = TestWriteAttributeNullableBooleanNull_179(); - break; - case 180: - ChipLogProgress(chipTool, " ***** Test Step 180 : Read attribute NULLABLE_BOOLEAN null\n"); - err = TestReadAttributeNullableBooleanNull_180(); - break; - case 181: - ChipLogProgress(chipTool, " ***** Test Step 181 : Write attribute NULLABLE_BOOLEAN True\n"); - err = TestWriteAttributeNullableBooleanTrue_181(); - break; - case 182: - ChipLogProgress(chipTool, " ***** Test Step 182 : Read attribute NULLABLE_BOOLEAN True\n"); - err = TestReadAttributeNullableBooleanTrue_182(); - break; - case 183: - ChipLogProgress(chipTool, " ***** Test Step 183 : Write attribute NULLABLE_BITMAP8 Max Value\n"); - err = TestWriteAttributeNullableBitmap8MaxValue_183(); - break; - case 184: - ChipLogProgress(chipTool, " ***** Test Step 184 : Read attribute NULLABLE_BITMAP8 Max Value\n"); - err = TestReadAttributeNullableBitmap8MaxValue_184(); - break; - case 185: - ChipLogProgress(chipTool, " ***** Test Step 185 : Write attribute NULLABLE_BITMAP8 Invalid Value\n"); - err = TestWriteAttributeNullableBitmap8InvalidValue_185(); - break; - case 186: - ChipLogProgress(chipTool, " ***** Test Step 186 : Read attribute NULLABLE_BITMAP8 unchanged Value\n"); - err = TestReadAttributeNullableBitmap8UnchangedValue_186(); - break; - case 187: - ChipLogProgress(chipTool, " ***** Test Step 187 : Write attribute NULLABLE_BITMAP8 null Value\n"); - err = TestWriteAttributeNullableBitmap8NullValue_187(); - break; - case 188: - ChipLogProgress(chipTool, " ***** Test Step 188 : Read attribute NULLABLE_BITMAP8 null Value\n"); - err = TestReadAttributeNullableBitmap8NullValue_188(); - break; - case 189: - ChipLogProgress(chipTool, " ***** Test Step 189 : Write attribute NULLABLE_BITMAP16 Max Value\n"); - err = TestWriteAttributeNullableBitmap16MaxValue_189(); - break; - case 190: - ChipLogProgress(chipTool, " ***** Test Step 190 : Read attribute NULLABLE_BITMAP16 Max Value\n"); - err = TestReadAttributeNullableBitmap16MaxValue_190(); - break; - case 191: - ChipLogProgress(chipTool, " ***** Test Step 191 : Write attribute NULLABLE_BITMAP16 Invalid Value\n"); - err = TestWriteAttributeNullableBitmap16InvalidValue_191(); - break; - case 192: - ChipLogProgress(chipTool, " ***** Test Step 192 : Read attribute NULLABLE_BITMAP16 unchanged Value\n"); - err = TestReadAttributeNullableBitmap16UnchangedValue_192(); + chipTool, " ***** Test Step 6 : 2a: If (PA_TL & TL) TH sends GoToTiltPercentage command with 90%% to DUT\n"); + if (ShouldSkip("WNCV_TL && WNCV_PA_TL")) { + NextTest(); + return; + } + err = Test2aIfPaTlTlThSendsGoToTiltPercentageCommandWith90ToDut_6(); break; - case 193: - ChipLogProgress(chipTool, " ***** Test Step 193 : Write attribute NULLABLE_BITMAP16 null Value\n"); - err = TestWriteAttributeNullableBitmap16NullValue_193(); + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : 2b: TH Waits for 100ms-1s\n"); + err = Test2bThWaitsFor100ms1s_7(); break; - case 194: - ChipLogProgress(chipTool, " ***** Test Step 194 : Read attribute NULLABLE_BITMAP16 null Value\n"); - err = TestReadAttributeNullableBitmap16NullValue_194(); + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : 2c: TH sends StopMotion command to DUT\n"); + err = Test2cThSendsStopMotionCommandToDut_8(); break; - case 195: - ChipLogProgress(chipTool, " ***** Test Step 195 : Write attribute NULLABLE_BITMAP32 Max Value\n"); - err = TestWriteAttributeNullableBitmap32MaxValue_195(); + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : 2d: TH Waits for 100ms-1s\n"); + err = Test2dThWaitsFor100ms1s_9(); break; - case 196: - ChipLogProgress(chipTool, " ***** Test Step 196 : Read attribute NULLABLE_BITMAP32 Max Value\n"); - err = TestReadAttributeNullableBitmap32MaxValue_196(); + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : 3a: TH reads CurrentPositionLiftPercent100ths from DUT\n"); + if (ShouldSkip("WNCV_LF && WNCV_PA_LF")) { + NextTest(); + return; + } + err = Test3aThReadsCurrentPositionLiftPercent100thsFromDut_10(); break; - case 197: - ChipLogProgress(chipTool, " ***** Test Step 197 : Write attribute NULLABLE_BITMAP32 Invalid Value\n"); - err = TestWriteAttributeNullableBitmap32InvalidValue_197(); + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : 3b: TH reads CurrentPositionTiltPercent100ths from DUT\n"); + if (ShouldSkip("WNCV_TL && WNCV_PA_TL")) { + NextTest(); + return; + } + err = Test3bThReadsCurrentPositionTiltPercent100thsFromDut_11(); break; - case 198: - ChipLogProgress(chipTool, " ***** Test Step 198 : Read attribute NULLABLE_BITMAP32 unchanged Value\n"); - err = TestReadAttributeNullableBitmap32UnchangedValue_198(); + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : 3c: reboot/restart the DUT\n"); + err = Test3cRebootRestartTheDut_12(); break; - case 199: - ChipLogProgress(chipTool, " ***** Test Step 199 : Write attribute NULLABLE_BITMAP32 null Value\n"); - err = TestWriteAttributeNullableBitmap32NullValue_199(); + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : 3d: Wait for the commissioned device to be retrieved\n"); + err = Test3dWaitForTheCommissionedDeviceToBeRetrieved_13(); break; - case 200: - ChipLogProgress(chipTool, " ***** Test Step 200 : Read attribute NULLABLE_BITMAP32 null Value\n"); - err = TestReadAttributeNullableBitmap32NullValue_200(); + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : 3e: TH reads CurrentPositionLiftPercent100ths from DUT\n"); + if (ShouldSkip("WNCV_LF && WNCV_PA_LF")) { + NextTest(); + return; + } + err = Test3eThReadsCurrentPositionLiftPercent100thsFromDut_14(); break; - case 201: - ChipLogProgress(chipTool, " ***** Test Step 201 : Write attribute NULLABLE_BITMAP64 Max Value\n"); - err = TestWriteAttributeNullableBitmap64MaxValue_201(); + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : 3f: TH reads CurrentPositionTiltPercent100ths from DUT\n"); + if (ShouldSkip("WNCV_TL && WNCV_PA_TL")) { + NextTest(); + return; + } + err = Test3fThReadsCurrentPositionTiltPercent100thsFromDut_15(); break; - case 202: - ChipLogProgress(chipTool, " ***** Test Step 202 : Read attribute NULLABLE_BITMAP64 Max Value\n"); - err = TestReadAttributeNullableBitmap64MaxValue_202(); - break; - case 203: - ChipLogProgress(chipTool, " ***** Test Step 203 : Write attribute NULLABLE_BITMAP64 Invalid Value\n"); - err = TestWriteAttributeNullableBitmap64InvalidValue_203(); - break; - case 204: - ChipLogProgress(chipTool, " ***** Test Step 204 : Read attribute NULLABLE_BITMAP64 unchanged Value\n"); - err = TestReadAttributeNullableBitmap64UnchangedValue_204(); - break; - case 205: - ChipLogProgress(chipTool, " ***** Test Step 205 : Write attribute NULLABLE_BITMAP64 null Value\n"); - err = TestWriteAttributeNullableBitmap64NullValue_205(); - break; - case 206: - ChipLogProgress(chipTool, " ***** Test Step 206 : Read attribute NULLABLE_BITMAP64 null Value\n"); - err = TestReadAttributeNullableBitmap64NullValue_206(); - break; - case 207: - ChipLogProgress(chipTool, " ***** Test Step 207 : Write attribute NULLABLE_INT8U Min Value\n"); - err = TestWriteAttributeNullableInt8uMinValue_207(); - break; - case 208: - ChipLogProgress(chipTool, " ***** Test Step 208 : Read attribute NULLABLE_INT8U Min Value\n"); - err = TestReadAttributeNullableInt8uMinValue_208(); - break; - case 209: - ChipLogProgress(chipTool, " ***** Test Step 209 : Write attribute NULLABLE_INT8U Max Value\n"); - err = TestWriteAttributeNullableInt8uMaxValue_209(); - break; - case 210: - ChipLogProgress(chipTool, " ***** Test Step 210 : Read attribute NULLABLE_INT8U Max Value\n"); - err = TestReadAttributeNullableInt8uMaxValue_210(); - break; - case 211: - ChipLogProgress(chipTool, " ***** Test Step 211 : Write attribute NULLABLE_INT8U Invalid Value\n"); - err = TestWriteAttributeNullableInt8uInvalidValue_211(); - break; - case 212: - ChipLogProgress(chipTool, " ***** Test Step 212 : Read attribute NULLABLE_INT8U unchanged Value\n"); - err = TestReadAttributeNullableInt8uUnchangedValue_212(); - break; - case 213: - ChipLogProgress(chipTool, " ***** Test Step 213 : Read attribute NULLABLE_INT8U unchanged Value with constraint\n"); - err = TestReadAttributeNullableInt8uUnchangedValueWithConstraint_213(); - break; - case 214: - ChipLogProgress(chipTool, " ***** Test Step 214 : Write attribute NULLABLE_INT8U null Value\n"); - err = TestWriteAttributeNullableInt8uNullValue_214(); - break; - case 215: - ChipLogProgress(chipTool, " ***** Test Step 215 : Read attribute NULLABLE_INT8U null Value\n"); - err = TestReadAttributeNullableInt8uNullValue_215(); - break; - case 216: - ChipLogProgress(chipTool, " ***** Test Step 216 : Read attribute NULLABLE_INT8U null Value & range\n"); - err = TestReadAttributeNullableInt8uNullValueRange_216(); - break; - case 217: - ChipLogProgress(chipTool, " ***** Test Step 217 : Read attribute NULLABLE_INT8U null Value & not\n"); - err = TestReadAttributeNullableInt8uNullValueNot_217(); - break; - case 218: - ChipLogProgress(chipTool, " ***** Test Step 218 : Write attribute NULLABLE_INT8U Value\n"); - err = TestWriteAttributeNullableInt8uValue_218(); - break; - case 219: - ChipLogProgress(chipTool, " ***** Test Step 219 : Read attribute NULLABLE_INT8U Value in range\n"); - err = TestReadAttributeNullableInt8uValueInRange_219(); - break; - case 220: - ChipLogProgress(chipTool, " ***** Test Step 220 : Read attribute NULLABLE_INT8U notValue OK\n"); - err = TestReadAttributeNullableInt8uNotValueOk_220(); - break; - case 221: - ChipLogProgress(chipTool, " ***** Test Step 221 : Write attribute NULLABLE_INT16U Min Value\n"); - err = TestWriteAttributeNullableInt16uMinValue_221(); - break; - case 222: - ChipLogProgress(chipTool, " ***** Test Step 222 : Read attribute NULLABLE_INT16U Min Value\n"); - err = TestReadAttributeNullableInt16uMinValue_222(); - break; - case 223: - ChipLogProgress(chipTool, " ***** Test Step 223 : Write attribute NULLABLE_INT16U Max Value\n"); - err = TestWriteAttributeNullableInt16uMaxValue_223(); - break; - case 224: - ChipLogProgress(chipTool, " ***** Test Step 224 : Read attribute NULLABLE_INT16U Max Value\n"); - err = TestReadAttributeNullableInt16uMaxValue_224(); - break; - case 225: - ChipLogProgress(chipTool, " ***** Test Step 225 : Write attribute NULLABLE_INT16U Invalid Value\n"); - err = TestWriteAttributeNullableInt16uInvalidValue_225(); - break; - case 226: - ChipLogProgress(chipTool, " ***** Test Step 226 : Read attribute NULLABLE_INT16U unchanged Value\n"); - err = TestReadAttributeNullableInt16uUnchangedValue_226(); - break; - case 227: - ChipLogProgress(chipTool, " ***** Test Step 227 : Write attribute NULLABLE_INT16U null Value\n"); - err = TestWriteAttributeNullableInt16uNullValue_227(); + } + + 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 = 16; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mDiscriminator; + chip::Optional mTimeout; + + CHIP_ERROR Test0aWaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test0bThSendsUpOrOpenCommandToPrepositionTheDut_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster upOrOpenWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"0b: TH sends UpOrOpen command to preposition the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test1aIfPaLfLfThSendsGoToLiftPercentageCommandWith90ToDut_2() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPWindowCoveringClusterGoToLiftPercentageParams alloc] init]; + params.liftPercentageValue = [NSNumber numberWithUnsignedChar:90]; + params.liftPercent100thsValue = [NSNumber numberWithUnsignedShort:9000U]; + [cluster goToLiftPercentageWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"1a: If (PA_LF & LF) TH sends GoToLiftPercentage command with 90%% to DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test1bThWaitsFor100ms1s_3() + { + WaitForMs(500); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test1cThSendsStopMotionCommandToDut_4() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster stopMotionWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"1c: TH sends StopMotion command to DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test1dThWaitsFor100ms1s_5() + { + WaitForMs(500); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test2aIfPaTlTlThSendsGoToTiltPercentageCommandWith90ToDut_6() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPWindowCoveringClusterGoToTiltPercentageParams alloc] init]; + params.tiltPercentageValue = [NSNumber numberWithUnsignedChar:90]; + params.tiltPercent100thsValue = [NSNumber numberWithUnsignedShort:9000U]; + [cluster goToTiltPercentageWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"2a: If (PA_TL & TL) TH sends GoToTiltPercentage command with 90%% to DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test2bThWaitsFor100ms1s_7() + { + WaitForMs(500); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test2cThSendsStopMotionCommandToDut_8() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster stopMotionWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"2c: TH sends StopMotion command to DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test2dThWaitsFor100ms1s_9() + { + WaitForMs(500); + return CHIP_NO_ERROR; + } + NSNumber * _Nullable attrCurrentPositionLiftPercent100ths; + + CHIP_ERROR Test3aThReadsCurrentPositionLiftPercent100thsFromDut_10() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentPositionLiftPercent100thsWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3a: TH reads CurrentPositionLiftPercent100ths from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("currentPositionLiftPercent100ths", value, 0U)); + } + { + attrCurrentPositionLiftPercent100ths = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nullable attrCurrentPositionTiltPercent100ths; + + CHIP_ERROR Test3bThReadsCurrentPositionTiltPercent100thsFromDut_11() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentPositionTiltPercent100thsWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3b: TH reads CurrentPositionTiltPercent100ths from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("currentPositionTiltPercent100ths", value, 0U)); + } + { + attrCurrentPositionTiltPercent100ths = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test3cRebootRestartTheDut_12() + { + Reboot(mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test3dWaitForTheCommissionedDeviceToBeRetrieved_13() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test3eThReadsCurrentPositionLiftPercent100thsFromDut_14() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentPositionLiftPercent100thsWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3e: TH reads CurrentPositionLiftPercent100ths from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + if (attrCurrentPositionLiftPercent100ths == nil) { + VerifyOrReturn(CheckValueNull("CurrentPositionLiftPercent100ths", actualValue)); + } else { + VerifyOrReturn(CheckValueNonNull("CurrentPositionLiftPercent100ths", actualValue)); + VerifyOrReturn( + CheckValue("CurrentPositionLiftPercent100ths", actualValue, attrCurrentPositionLiftPercent100ths)); + } + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test3fThReadsCurrentPositionTiltPercent100thsFromDut_15() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentPositionTiltPercent100thsWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3f: TH reads CurrentPositionTiltPercent100ths from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + if (attrCurrentPositionTiltPercent100ths == nil) { + VerifyOrReturn(CheckValueNull("CurrentPositionTiltPercent100ths", actualValue)); + } else { + VerifyOrReturn(CheckValueNonNull("CurrentPositionTiltPercent100ths", actualValue)); + VerifyOrReturn( + CheckValue("CurrentPositionTiltPercent100ths", actualValue, attrCurrentPositionTiltPercent100ths)); + } + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class TV_TargetNavigatorCluster : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + TV_TargetNavigatorCluster() + : TestCommandBridge("TV_TargetNavigatorCluster") + , 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) + + ~TV_TargetNavigatorCluster() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: TV_TargetNavigatorCluster\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: TV_TargetNavigatorCluster\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 228: - ChipLogProgress(chipTool, " ***** Test Step 228 : Read attribute NULLABLE_INT16U null Value\n"); - err = TestReadAttributeNullableInt16uNullValue_228(); + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read attribute Target Navigator list\n"); + err = TestReadAttributeTargetNavigatorList_1(); break; - case 229: - ChipLogProgress(chipTool, " ***** Test Step 229 : Read attribute NULLABLE_INT16U null Value & range\n"); - err = TestReadAttributeNullableInt16uNullValueRange_229(); + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read attribute current navigator target\n"); + err = TestReadAttributeCurrentNavigatorTarget_2(); break; - case 230: - ChipLogProgress(chipTool, " ***** Test Step 230 : Read attribute NULLABLE_INT16U null Value & not\n"); - err = TestReadAttributeNullableInt16uNullValueNot_230(); + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Navigate Target Request Command\n"); + err = TestNavigateTargetRequestCommand_3(); break; - case 231: - ChipLogProgress(chipTool, " ***** Test Step 231 : Write attribute NULLABLE_INT16U Value\n"); - err = TestWriteAttributeNullableInt16uValue_231(); + } + + 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 = 4; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeTargetNavigatorList_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTargetNavigator * cluster = [[CHIPTestTargetNavigator alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeTargetListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute Target Navigator list Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("TargetList", [actualValue count], static_cast(2))); + VerifyOrReturn(CheckValue("identifier", ((CHIPTargetNavigatorClusterTargetInfo *) actualValue[0]).identifier, 1)); + VerifyOrReturn( + CheckValueAsString("name", ((CHIPTargetNavigatorClusterTargetInfo *) actualValue[0]).name, @"exampleName")); + VerifyOrReturn(CheckValue("identifier", ((CHIPTargetNavigatorClusterTargetInfo *) actualValue[1]).identifier, 2)); + VerifyOrReturn( + CheckValueAsString("name", ((CHIPTargetNavigatorClusterTargetInfo *) actualValue[1]).name, @"exampleName")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeCurrentNavigatorTarget_2() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTargetNavigator * cluster = [[CHIPTestTargetNavigator alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentTargetWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute current navigator target Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("CurrentTarget", actualValue, 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestNavigateTargetRequestCommand_3() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTargetNavigator * cluster = [[CHIPTestTargetNavigator alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPTargetNavigatorClusterNavigateTargetParams alloc] init]; + params.target = [NSNumber numberWithUnsignedChar:1]; + params.data = @"1"; + [cluster navigateTargetWithParams:params + completionHandler:^( + CHIPTargetNavigatorClusterNavigateTargetResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Navigate Target Request Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0)); + } + + { + id actualValue = values.data; + VerifyOrReturn(CheckValueAsString("data", actualValue, @"data response")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class TV_AudioOutputCluster : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + TV_AudioOutputCluster() + : TestCommandBridge("TV_AudioOutputCluster") + , 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) + + ~TV_AudioOutputCluster() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: TV_AudioOutputCluster\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: TV_AudioOutputCluster\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 232: - ChipLogProgress(chipTool, " ***** Test Step 232 : Read attribute NULLABLE_INT16U Value in range\n"); - err = TestReadAttributeNullableInt16uValueInRange_232(); + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read attribute Audio Output list\n"); + err = TestReadAttributeAudioOutputList_1(); break; - case 233: - ChipLogProgress(chipTool, " ***** Test Step 233 : Read attribute NULLABLE_INT16U notValue OK\n"); - err = TestReadAttributeNullableInt16uNotValueOk_233(); + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read attribute current audio output\n"); + err = TestReadAttributeCurrentAudioOutput_2(); break; - case 234: - ChipLogProgress(chipTool, " ***** Test Step 234 : Write attribute NULLABLE_INT32U Min Value\n"); - err = TestWriteAttributeNullableInt32uMinValue_234(); + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Select Output Command\n"); + err = TestSelectOutputCommand_3(); break; - case 235: - ChipLogProgress(chipTool, " ***** Test Step 235 : Read attribute NULLABLE_INT32U Min Value\n"); - err = TestReadAttributeNullableInt32uMinValue_235(); + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Rename Output Command\n"); + err = TestRenameOutputCommand_4(); break; - case 236: - ChipLogProgress(chipTool, " ***** Test Step 236 : Write attribute NULLABLE_INT32U Max Value\n"); - err = TestWriteAttributeNullableInt32uMaxValue_236(); + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read attribute Audio Output list\n"); + err = TestReadAttributeAudioOutputList_5(); break; - case 237: - ChipLogProgress(chipTool, " ***** Test Step 237 : Read attribute NULLABLE_INT32U Max Value\n"); - err = TestReadAttributeNullableInt32uMaxValue_237(); - break; - case 238: - ChipLogProgress(chipTool, " ***** Test Step 238 : Write attribute NULLABLE_INT32U Invalid Value\n"); - err = TestWriteAttributeNullableInt32uInvalidValue_238(); - break; - case 239: - ChipLogProgress(chipTool, " ***** Test Step 239 : Read attribute NULLABLE_INT32U unchanged Value\n"); - err = TestReadAttributeNullableInt32uUnchangedValue_239(); - break; - case 240: - ChipLogProgress(chipTool, " ***** Test Step 240 : Write attribute NULLABLE_INT32U null Value\n"); - err = TestWriteAttributeNullableInt32uNullValue_240(); - break; - case 241: - ChipLogProgress(chipTool, " ***** Test Step 241 : Read attribute NULLABLE_INT32U null Value\n"); - err = TestReadAttributeNullableInt32uNullValue_241(); - break; - case 242: - ChipLogProgress(chipTool, " ***** Test Step 242 : Read attribute NULLABLE_INT32U null Value & range\n"); - err = TestReadAttributeNullableInt32uNullValueRange_242(); - break; - case 243: - ChipLogProgress(chipTool, " ***** Test Step 243 : Read attribute NULLABLE_INT32U null Value & not\n"); - err = TestReadAttributeNullableInt32uNullValueNot_243(); - break; - case 244: - ChipLogProgress(chipTool, " ***** Test Step 244 : Write attribute NULLABLE_INT32U Value\n"); - err = TestWriteAttributeNullableInt32uValue_244(); - break; - case 245: - ChipLogProgress(chipTool, " ***** Test Step 245 : Read attribute NULLABLE_INT32U Value in range\n"); - err = TestReadAttributeNullableInt32uValueInRange_245(); - break; - case 246: - ChipLogProgress(chipTool, " ***** Test Step 246 : Read attribute NULLABLE_INT32U notValue OK\n"); - err = TestReadAttributeNullableInt32uNotValueOk_246(); - break; - case 247: - ChipLogProgress(chipTool, " ***** Test Step 247 : Write attribute NULLABLE_INT64U Min Value\n"); - err = TestWriteAttributeNullableInt64uMinValue_247(); - break; - case 248: - ChipLogProgress(chipTool, " ***** Test Step 248 : Read attribute NULLABLE_INT64U Min Value\n"); - err = TestReadAttributeNullableInt64uMinValue_248(); - break; - case 249: - ChipLogProgress(chipTool, " ***** Test Step 249 : Write attribute NULLABLE_INT64U Max Value\n"); - err = TestWriteAttributeNullableInt64uMaxValue_249(); - break; - case 250: - ChipLogProgress(chipTool, " ***** Test Step 250 : Read attribute NULLABLE_INT64U Max Value\n"); - err = TestReadAttributeNullableInt64uMaxValue_250(); - break; - case 251: - ChipLogProgress(chipTool, " ***** Test Step 251 : Write attribute NULLABLE_INT64U Invalid Value\n"); - err = TestWriteAttributeNullableInt64uInvalidValue_251(); - break; - case 252: - ChipLogProgress(chipTool, " ***** Test Step 252 : Read attribute NULLABLE_INT64U unchanged Value\n"); - err = TestReadAttributeNullableInt64uUnchangedValue_252(); - break; - case 253: - ChipLogProgress(chipTool, " ***** Test Step 253 : Write attribute NULLABLE_INT64U null Value\n"); - err = TestWriteAttributeNullableInt64uNullValue_253(); + } + + 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 = 6; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeAudioOutputList_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestAudioOutput * cluster = [[CHIPTestAudioOutput alloc] initWithDevice:device endpoint:2 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOutputListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute Audio Output list Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("OutputList", [actualValue count], static_cast(3))); + VerifyOrReturn(CheckValue("index", ((CHIPAudioOutputClusterOutputInfo *) actualValue[0]).index, 1)); + VerifyOrReturn(CheckValue("outputType", ((CHIPAudioOutputClusterOutputInfo *) actualValue[0]).outputType, 0)); + VerifyOrReturn(CheckValueAsString("name", ((CHIPAudioOutputClusterOutputInfo *) actualValue[0]).name, @"HDMI")); + VerifyOrReturn(CheckValue("index", ((CHIPAudioOutputClusterOutputInfo *) actualValue[1]).index, 2)); + VerifyOrReturn(CheckValue("outputType", ((CHIPAudioOutputClusterOutputInfo *) actualValue[1]).outputType, 0)); + VerifyOrReturn(CheckValueAsString("name", ((CHIPAudioOutputClusterOutputInfo *) actualValue[1]).name, @"HDMI")); + VerifyOrReturn(CheckValue("index", ((CHIPAudioOutputClusterOutputInfo *) actualValue[2]).index, 3)); + VerifyOrReturn(CheckValue("outputType", ((CHIPAudioOutputClusterOutputInfo *) actualValue[2]).outputType, 0)); + VerifyOrReturn(CheckValueAsString("name", ((CHIPAudioOutputClusterOutputInfo *) actualValue[2]).name, @"HDMI")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeCurrentAudioOutput_2() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestAudioOutput * cluster = [[CHIPTestAudioOutput alloc] initWithDevice:device endpoint:2 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentOutputWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute current audio output Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("CurrentOutput", actualValue, 1)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSelectOutputCommand_3() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestAudioOutput * cluster = [[CHIPTestAudioOutput alloc] initWithDevice:device endpoint:2 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPAudioOutputClusterSelectOutputParams alloc] init]; + params.index = [NSNumber numberWithUnsignedChar:1]; + [cluster selectOutputWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Select Output Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestRenameOutputCommand_4() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestAudioOutput * cluster = [[CHIPTestAudioOutput alloc] initWithDevice:device endpoint:2 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPAudioOutputClusterRenameOutputParams alloc] init]; + params.index = [NSNumber numberWithUnsignedChar:1]; + params.name = @"HDMI Test"; + [cluster renameOutputWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Rename Output Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeAudioOutputList_5() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestAudioOutput * cluster = [[CHIPTestAudioOutput alloc] initWithDevice:device endpoint:2 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOutputListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute Audio Output list Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("OutputList", [actualValue count], static_cast(3))); + VerifyOrReturn(CheckValue("index", ((CHIPAudioOutputClusterOutputInfo *) actualValue[0]).index, 1)); + VerifyOrReturn(CheckValue("outputType", ((CHIPAudioOutputClusterOutputInfo *) actualValue[0]).outputType, 0)); + VerifyOrReturn( + CheckValueAsString("name", ((CHIPAudioOutputClusterOutputInfo *) actualValue[0]).name, @"HDMI Test")); + VerifyOrReturn(CheckValue("index", ((CHIPAudioOutputClusterOutputInfo *) actualValue[1]).index, 2)); + VerifyOrReturn(CheckValue("outputType", ((CHIPAudioOutputClusterOutputInfo *) actualValue[1]).outputType, 0)); + VerifyOrReturn(CheckValueAsString("name", ((CHIPAudioOutputClusterOutputInfo *) actualValue[1]).name, @"HDMI")); + VerifyOrReturn(CheckValue("index", ((CHIPAudioOutputClusterOutputInfo *) actualValue[2]).index, 3)); + VerifyOrReturn(CheckValue("outputType", ((CHIPAudioOutputClusterOutputInfo *) actualValue[2]).outputType, 0)); + VerifyOrReturn(CheckValueAsString("name", ((CHIPAudioOutputClusterOutputInfo *) actualValue[2]).name, @"HDMI")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class TV_ApplicationLauncherCluster : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + TV_ApplicationLauncherCluster() + : TestCommandBridge("TV_ApplicationLauncherCluster") + , 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) + + ~TV_ApplicationLauncherCluster() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: TV_ApplicationLauncherCluster\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: TV_ApplicationLauncherCluster\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 254: - ChipLogProgress(chipTool, " ***** Test Step 254 : Read attribute NULLABLE_INT64U null Value\n"); - err = TestReadAttributeNullableInt64uNullValue_254(); + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read attribute Application Launcher list\n"); + err = TestReadAttributeApplicationLauncherList_1(); break; - case 255: - ChipLogProgress(chipTool, " ***** Test Step 255 : Read attribute NULLABLE_INT64U null Value & range\n"); - err = TestReadAttributeNullableInt64uNullValueRange_255(); + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read attribute application launcher app\n"); + err = TestReadAttributeApplicationLauncherApp_2(); break; - case 256: - ChipLogProgress(chipTool, " ***** Test Step 256 : Read attribute NULLABLE_INT64U null Value & not\n"); - err = TestReadAttributeNullableInt64uNullValueNot_256(); + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Launch App Command\n"); + err = TestLaunchAppCommand_3(); break; - case 257: - ChipLogProgress(chipTool, " ***** Test Step 257 : Write attribute NULLABLE_INT64U Value\n"); - err = TestWriteAttributeNullableInt64uValue_257(); + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Stop App Command\n"); + err = TestStopAppCommand_4(); break; - case 258: - ChipLogProgress(chipTool, " ***** Test Step 258 : Read attribute NULLABLE_INT64U Value in range\n"); - err = TestReadAttributeNullableInt64uValueInRange_258(); + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Hide App Command\n"); + err = TestHideAppCommand_5(); break; - case 259: - ChipLogProgress(chipTool, " ***** Test Step 259 : Read attribute NULLABLE_INT64U notValue OK\n"); - err = TestReadAttributeNullableInt64uNotValueOk_259(); + } + + 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 = 6; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeApplicationLauncherList_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestApplicationLauncher * cluster = [[CHIPTestApplicationLauncher alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCatalogListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute Application Launcher list Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("CatalogList", [actualValue count], static_cast(2))); + VerifyOrReturn(CheckValue("", actualValue[0], 123U)); + VerifyOrReturn(CheckValue("", actualValue[1], 456U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeApplicationLauncherApp_2() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestApplicationLauncher * cluster = [[CHIPTestApplicationLauncher alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentAppWithCompletionHandler:^( + CHIPApplicationLauncherClusterApplicationEP * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute application launcher app Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNull("CurrentApp", actualValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestLaunchAppCommand_3() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestApplicationLauncher * cluster = [[CHIPTestApplicationLauncher alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPApplicationLauncherClusterLaunchAppParams alloc] init]; + params.application = [[CHIPApplicationLauncherClusterApplication alloc] init]; + ((CHIPApplicationLauncherClusterApplication *) params.application).catalogVendorId = + [NSNumber numberWithUnsignedShort:123U]; + ((CHIPApplicationLauncherClusterApplication *) params.application).applicationId = @"applicationId"; + + params.data = [[NSData alloc] initWithBytes:"data" length:4]; + [cluster launchAppWithParams:params + completionHandler:^( + CHIPApplicationLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Launch App Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0)); + } + + { + id actualValue = values.data; + VerifyOrReturn(CheckValueAsString("data", actualValue, [[NSData alloc] initWithBytes:"data" length:4])); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStopAppCommand_4() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestApplicationLauncher * cluster = [[CHIPTestApplicationLauncher alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPApplicationLauncherClusterStopAppParams alloc] init]; + params.application = [[CHIPApplicationLauncherClusterApplication alloc] init]; + ((CHIPApplicationLauncherClusterApplication *) params.application).catalogVendorId = + [NSNumber numberWithUnsignedShort:123U]; + ((CHIPApplicationLauncherClusterApplication *) params.application).applicationId = @"applicationId"; + + [cluster + stopAppWithParams:params + completionHandler:^(CHIPApplicationLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Stop App Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0)); + } + + { + id actualValue = values.data; + VerifyOrReturn(CheckValueAsString("data", actualValue, [[NSData alloc] initWithBytes:"data" length:4])); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestHideAppCommand_5() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestApplicationLauncher * cluster = [[CHIPTestApplicationLauncher alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPApplicationLauncherClusterHideAppParams alloc] init]; + params.application = [[CHIPApplicationLauncherClusterApplication alloc] init]; + ((CHIPApplicationLauncherClusterApplication *) params.application).catalogVendorId = + [NSNumber numberWithUnsignedShort:123U]; + ((CHIPApplicationLauncherClusterApplication *) params.application).applicationId = @"applicationId"; + + [cluster + hideAppWithParams:params + completionHandler:^(CHIPApplicationLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Hide App Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0)); + } + + { + id actualValue = values.data; + VerifyOrReturn(CheckValueAsString("data", actualValue, [[NSData alloc] initWithBytes:"data" length:4])); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class TV_KeypadInputCluster : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + TV_KeypadInputCluster() + : TestCommandBridge("TV_KeypadInputCluster") + , 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) + + ~TV_KeypadInputCluster() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: TV_KeypadInputCluster\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: TV_KeypadInputCluster\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 260: - ChipLogProgress(chipTool, " ***** Test Step 260 : Write attribute NULLABLE_INT8S Min Value\n"); - err = TestWriteAttributeNullableInt8sMinValue_260(); + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Send Key Command\n"); + err = TestSendKeyCommand_1(); break; - case 261: - ChipLogProgress(chipTool, " ***** Test Step 261 : Read attribute NULLABLE_INT8S Min Value\n"); - err = TestReadAttributeNullableInt8sMinValue_261(); + } + + 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; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSendKeyCommand_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPKeypadInputClusterSendKeyParams alloc] init]; + params.keyCode = [NSNumber numberWithUnsignedChar:3]; + [cluster sendKeyWithParams:params + completionHandler:^(CHIPKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send Key Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class TV_AccountLoginCluster : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + TV_AccountLoginCluster() + : TestCommandBridge("TV_AccountLoginCluster") + , 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) + + ~TV_AccountLoginCluster() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: TV_AccountLoginCluster\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: TV_AccountLoginCluster\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 262: - ChipLogProgress(chipTool, " ***** Test Step 262 : Write attribute NULLABLE_INT8S Invalid Value\n"); - err = TestWriteAttributeNullableInt8sInvalidValue_262(); + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Get Setup PIN Command\n"); + err = TestGetSetupPinCommand_1(); break; - case 263: - ChipLogProgress(chipTool, " ***** Test Step 263 : Read attribute NULLABLE_INT8S unchanged Value\n"); - err = TestReadAttributeNullableInt8sUnchangedValue_263(); + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Login Command\n"); + err = TestLoginCommand_2(); break; - case 264: - ChipLogProgress(chipTool, " ***** Test Step 264 : Write attribute NULLABLE_INT8S null Value\n"); - err = TestWriteAttributeNullableInt8sNullValue_264(); + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Logout Command\n"); + err = TestLogoutCommand_3(); break; - case 265: - ChipLogProgress(chipTool, " ***** Test Step 265 : Read attribute NULLABLE_INT8S null Value\n"); - err = TestReadAttributeNullableInt8sNullValue_265(); + } + + 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 = 4; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGetSetupPinCommand_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestAccountLogin * cluster = [[CHIPTestAccountLogin alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPAccountLoginClusterGetSetupPINParams alloc] init]; + params.tempAccountIdentifier = @"asdf"; + [cluster + getSetupPINWithParams:params + completionHandler:^(CHIPAccountLoginClusterGetSetupPINResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Get Setup PIN Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.setupPIN; + VerifyOrReturn(CheckValueAsString("setupPIN", actualValue, @"tempPin123")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestLoginCommand_2() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestAccountLogin * cluster = [[CHIPTestAccountLogin alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPAccountLoginClusterLoginParams alloc] init]; + params.tempAccountIdentifier = @"asdf"; + params.setupPIN = @"tempPin123"; + [cluster loginWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Login Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestLogoutCommand_3() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestAccountLogin * cluster = [[CHIPTestAccountLogin alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster logoutWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Logout Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class TV_WakeOnLanCluster : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + TV_WakeOnLanCluster() + : TestCommandBridge("TV_WakeOnLanCluster") + , 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) + + ~TV_WakeOnLanCluster() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: TV_WakeOnLanCluster\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: TV_WakeOnLanCluster\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 266: - ChipLogProgress(chipTool, " ***** Test Step 266 : Read attribute NULLABLE_INT8S null Value & range\n"); - err = TestReadAttributeNullableInt8sNullValueRange_266(); + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read mac address\n"); + err = TestReadMacAddress_1(); break; - case 267: - ChipLogProgress(chipTool, " ***** Test Step 267 : Read attribute NULLABLE_INT8S null Value & not\n"); - err = TestReadAttributeNullableInt8sNullValueNot_267(); + } + + 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; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadMacAddress_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWakeOnLan * cluster = [[CHIPTestWakeOnLan alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMACAddressWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read mac address Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueAsString("MACAddress", actualValue, @"00:00:00:00:00")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class TV_ApplicationBasicCluster : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + TV_ApplicationBasicCluster() + : TestCommandBridge("TV_ApplicationBasicCluster") + , 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) + + ~TV_ApplicationBasicCluster() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: TV_ApplicationBasicCluster\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: TV_ApplicationBasicCluster\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 268: - ChipLogProgress(chipTool, " ***** Test Step 268 : Write attribute NULLABLE_INT8S Value\n"); - err = TestWriteAttributeNullableInt8sValue_268(); + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read attribute vendor name\n"); + err = TestReadAttributeVendorName_1(); break; - case 269: - ChipLogProgress(chipTool, " ***** Test Step 269 : Read attribute NULLABLE_INT8S Value in range\n"); - err = TestReadAttributeNullableInt8sValueInRange_269(); + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read attribute vendor id\n"); + err = TestReadAttributeVendorId_2(); break; - case 270: - ChipLogProgress(chipTool, " ***** Test Step 270 : Read attribute NULLABLE_INT8S notValue OK\n"); - err = TestReadAttributeNullableInt8sNotValueOk_270(); + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Read attribute application name\n"); + err = TestReadAttributeApplicationName_3(); break; - case 271: - ChipLogProgress(chipTool, " ***** Test Step 271 : Write attribute NULLABLE_INT16S Min Value\n"); - err = TestWriteAttributeNullableInt16sMinValue_271(); + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Read attribute product id\n"); + err = TestReadAttributeProductId_4(); break; - case 272: - ChipLogProgress(chipTool, " ***** Test Step 272 : Read attribute NULLABLE_INT16S Min Value\n"); - err = TestReadAttributeNullableInt16sMinValue_272(); + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read attribute application status\n"); + err = TestReadAttributeApplicationStatus_5(); break; - case 273: - ChipLogProgress(chipTool, " ***** Test Step 273 : Write attribute NULLABLE_INT16S Invalid Value\n"); - err = TestWriteAttributeNullableInt16sInvalidValue_273(); + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Read attribute application status\n"); + err = TestReadAttributeApplicationStatus_6(); break; - case 274: - ChipLogProgress(chipTool, " ***** Test Step 274 : Read attribute NULLABLE_INT16S unchanged Value\n"); - err = TestReadAttributeNullableInt16sUnchangedValue_274(); + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Read attribute application version\n"); + err = TestReadAttributeApplicationVersion_7(); break; - case 275: - ChipLogProgress(chipTool, " ***** Test Step 275 : Write attribute NULLABLE_INT16S null Value\n"); - err = TestWriteAttributeNullableInt16sNullValue_275(); + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Read attribute application allowed vendor list\n"); + err = TestReadAttributeApplicationAllowedVendorList_8(); break; - case 276: - ChipLogProgress(chipTool, " ***** Test Step 276 : Read attribute NULLABLE_INT16S null Value\n"); - err = TestReadAttributeNullableInt16sNullValue_276(); + } + + 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 = 9; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeVendorName_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestApplicationBasic * cluster = [[CHIPTestApplicationBasic alloc] initWithDevice:device + endpoint:3 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeVendorNameWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute vendor name Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueAsString("VendorName", actualValue, @"exampleVendorName1")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeVendorId_2() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestApplicationBasic * cluster = [[CHIPTestApplicationBasic alloc] initWithDevice:device + endpoint:3 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeVendorIDWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute vendor id Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("VendorID", actualValue, 1U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeApplicationName_3() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestApplicationBasic * cluster = [[CHIPTestApplicationBasic alloc] initWithDevice:device + endpoint:3 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeApplicationNameWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute application name Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueAsString("ApplicationName", actualValue, @"exampleName1")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeProductId_4() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestApplicationBasic * cluster = [[CHIPTestApplicationBasic alloc] initWithDevice:device + endpoint:3 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeProductIDWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute product id Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ProductID", actualValue, 1U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeApplicationStatus_5() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestApplicationBasic * cluster = [[CHIPTestApplicationBasic alloc] initWithDevice:device + endpoint:3 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute application status Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("Status", actualValue, 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeApplicationStatus_6() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestApplicationBasic * cluster = [[CHIPTestApplicationBasic alloc] initWithDevice:device + endpoint:3 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeApplicationWithCompletionHandler:^( + CHIPApplicationBasicClusterApplicationBasicApplication * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute application status Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("catalogVendorId", + ((CHIPApplicationBasicClusterApplicationBasicApplication *) actualValue).catalogVendorId, 123U)); + VerifyOrReturn(CheckValueAsString("applicationId", + ((CHIPApplicationBasicClusterApplicationBasicApplication *) actualValue).applicationId, @"applicationId")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeApplicationVersion_7() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestApplicationBasic * cluster = [[CHIPTestApplicationBasic alloc] initWithDevice:device + endpoint:3 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeApplicationVersionWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute application version Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueAsString("ApplicationVersion", actualValue, @"exampleVersion")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeApplicationAllowedVendorList_8() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestApplicationBasic * cluster = [[CHIPTestApplicationBasic alloc] initWithDevice:device + endpoint:3 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAllowedVendorListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute application allowed vendor list Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("AllowedVendorList", [actualValue count], static_cast(2))); + VerifyOrReturn(CheckValue("", actualValue[0], 1U)); + VerifyOrReturn(CheckValue("", actualValue[1], 456U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class TV_MediaPlaybackCluster : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + TV_MediaPlaybackCluster() + : TestCommandBridge("TV_MediaPlaybackCluster") + , 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) + + ~TV_MediaPlaybackCluster() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: TV_MediaPlaybackCluster\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: TV_MediaPlaybackCluster\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 277: - ChipLogProgress(chipTool, " ***** Test Step 277 : Read attribute NULLABLE_INT16S null Value & range\n"); - err = TestReadAttributeNullableInt16sNullValueRange_277(); + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read attribute playback state\n"); + err = TestReadAttributePlaybackState_1(); break; - case 278: - ChipLogProgress(chipTool, " ***** Test Step 278 : Read attribute NULLABLE_INT16S null Value & not\n"); - err = TestReadAttributeNullableInt16sNullValueNot_278(); + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read attribute start time\n"); + err = TestReadAttributeStartTime_2(); break; - case 279: - ChipLogProgress(chipTool, " ***** Test Step 279 : Write attribute NULLABLE_INT16S Value\n"); - err = TestWriteAttributeNullableInt16sValue_279(); + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Read attribute duration\n"); + err = TestReadAttributeDuration_3(); break; - case 280: - ChipLogProgress(chipTool, " ***** Test Step 280 : Read attribute NULLABLE_INT16S Value in range\n"); - err = TestReadAttributeNullableInt16sValueInRange_280(); + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Read attribute position\n"); + err = TestReadAttributePosition_4(); break; - case 281: - ChipLogProgress(chipTool, " ***** Test Step 281 : Read attribute NULLABLE_INT16S notValue OK\n"); - err = TestReadAttributeNullableInt16sNotValueOk_281(); + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read attribute playback speed\n"); + err = TestReadAttributePlaybackSpeed_5(); break; - case 282: - ChipLogProgress(chipTool, " ***** Test Step 282 : Write attribute NULLABLE_INT32S Min Value\n"); - err = TestWriteAttributeNullableInt32sMinValue_282(); + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Read attribute seek range end\n"); + err = TestReadAttributeSeekRangeEnd_6(); break; - case 283: - ChipLogProgress(chipTool, " ***** Test Step 283 : Read attribute NULLABLE_INT32S Min Value\n"); - err = TestReadAttributeNullableInt32sMinValue_283(); + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Read attribute seek range start\n"); + err = TestReadAttributeSeekRangeStart_7(); break; - case 284: - ChipLogProgress(chipTool, " ***** Test Step 284 : Write attribute NULLABLE_INT32S Invalid Value\n"); - err = TestWriteAttributeNullableInt32sInvalidValue_284(); + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Media Playback Play Command\n"); + err = TestMediaPlaybackPlayCommand_8(); break; - case 285: - ChipLogProgress(chipTool, " ***** Test Step 285 : Read attribute NULLABLE_INT32S unchanged Value\n"); - err = TestReadAttributeNullableInt32sUnchangedValue_285(); + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Media Playback Pause Command\n"); + err = TestMediaPlaybackPauseCommand_9(); break; - case 286: - ChipLogProgress(chipTool, " ***** Test Step 286 : Write attribute NULLABLE_INT32S null Value\n"); - err = TestWriteAttributeNullableInt32sNullValue_286(); + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Media Playback Stop Command\n"); + err = TestMediaPlaybackStopCommand_10(); break; - case 287: - ChipLogProgress(chipTool, " ***** Test Step 287 : Read attribute NULLABLE_INT32S null Value\n"); - err = TestReadAttributeNullableInt32sNullValue_287(); + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Media Playback Start Over Command\n"); + err = TestMediaPlaybackStartOverCommand_11(); break; - case 288: - ChipLogProgress(chipTool, " ***** Test Step 288 : Read attribute NULLABLE_INT32S null Value & range\n"); - err = TestReadAttributeNullableInt32sNullValueRange_288(); + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Media Playback Previous Command\n"); + err = TestMediaPlaybackPreviousCommand_12(); break; - case 289: - ChipLogProgress(chipTool, " ***** Test Step 289 : Read attribute NULLABLE_INT32S null Value & not\n"); - err = TestReadAttributeNullableInt32sNullValueNot_289(); + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : Media Playback Next Command\n"); + err = TestMediaPlaybackNextCommand_13(); break; - case 290: - ChipLogProgress(chipTool, " ***** Test Step 290 : Write attribute NULLABLE_INT32S Value\n"); - err = TestWriteAttributeNullableInt32sValue_290(); + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Media Playback Rewind Command\n"); + err = TestMediaPlaybackRewindCommand_14(); break; - case 291: - ChipLogProgress(chipTool, " ***** Test Step 291 : Read attribute NULLABLE_INT32S Value in range\n"); - err = TestReadAttributeNullableInt32sValueInRange_291(); - break; - case 292: - ChipLogProgress(chipTool, " ***** Test Step 292 : Read attribute NULLABLE_INT32S notValue OK\n"); - err = TestReadAttributeNullableInt32sNotValueOk_292(); - break; - case 293: - ChipLogProgress(chipTool, " ***** Test Step 293 : Write attribute NULLABLE_INT64S Min Value\n"); - err = TestWriteAttributeNullableInt64sMinValue_293(); - break; - case 294: - ChipLogProgress(chipTool, " ***** Test Step 294 : Read attribute NULLABLE_INT64S Min Value\n"); - err = TestReadAttributeNullableInt64sMinValue_294(); - break; - case 295: - ChipLogProgress(chipTool, " ***** Test Step 295 : Write attribute NULLABLE_INT64S Invalid Value\n"); - err = TestWriteAttributeNullableInt64sInvalidValue_295(); - break; - case 296: - ChipLogProgress(chipTool, " ***** Test Step 296 : Read attribute NULLABLE_INT64S unchanged Value\n"); - err = TestReadAttributeNullableInt64sUnchangedValue_296(); + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Media Playback Fast Forward Command\n"); + err = TestMediaPlaybackFastForwardCommand_15(); break; - case 297: - ChipLogProgress(chipTool, " ***** Test Step 297 : Write attribute NULLABLE_INT64S null Value\n"); - err = TestWriteAttributeNullableInt64sNullValue_297(); + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : Media Playback Skip Forward Command\n"); + err = TestMediaPlaybackSkipForwardCommand_16(); break; - case 298: - ChipLogProgress(chipTool, " ***** Test Step 298 : Read attribute NULLABLE_INT64S null Value\n"); - err = TestReadAttributeNullableInt64sNullValue_298(); + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : Read attribute position after skip forward\n"); + err = TestReadAttributePositionAfterSkipForward_17(); break; - case 299: - ChipLogProgress(chipTool, " ***** Test Step 299 : Read attribute NULLABLE_INT64S null Value & range\n"); - err = TestReadAttributeNullableInt64sNullValueRange_299(); + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : Media Playback Skip Backward Command\n"); + err = TestMediaPlaybackSkipBackwardCommand_18(); break; - case 300: - ChipLogProgress(chipTool, " ***** Test Step 300 : Read attribute NULLABLE_INT64S null Value & not\n"); - err = TestReadAttributeNullableInt64sNullValueNot_300(); + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : Read attribute position after skip backward\n"); + err = TestReadAttributePositionAfterSkipBackward_19(); break; - case 301: - ChipLogProgress(chipTool, " ***** Test Step 301 : Write attribute NULLABLE_INT64S Value\n"); - err = TestWriteAttributeNullableInt64sValue_301(); + case 20: + ChipLogProgress(chipTool, " ***** Test Step 20 : Media Playback Seek Command\n"); + err = TestMediaPlaybackSeekCommand_20(); break; - case 302: - ChipLogProgress(chipTool, " ***** Test Step 302 : Read attribute NULLABLE_INT64S Value in range\n"); - err = TestReadAttributeNullableInt64sValueInRange_302(); + case 21: + ChipLogProgress(chipTool, " ***** Test Step 21 : Read attribute position after seek\n"); + err = TestReadAttributePositionAfterSeek_21(); break; - case 303: - ChipLogProgress(chipTool, " ***** Test Step 303 : Read attribute NULLABLE_INT64S notValue OK\n"); - err = TestReadAttributeNullableInt64sNotValueOk_303(); + } + + 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 = 22; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributePlaybackState_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute playback state Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("CurrentState", actualValue, 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeStartTime_2() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeStartTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute start time Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("StartTime", actualValue)); + VerifyOrReturn(CheckValue("StartTime", actualValue, 0ULL)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeDuration_3() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeDurationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute duration Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("Duration", actualValue)); + VerifyOrReturn(CheckValue("Duration", actualValue, 80000ULL)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributePosition_4() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeSampledPositionWithCompletionHandler:^( + CHIPMediaPlaybackClusterPlaybackPosition * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute position Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("SampledPosition", actualValue)); + VerifyOrReturn(CheckValue("updatedAt", ((CHIPMediaPlaybackClusterPlaybackPosition *) actualValue).updatedAt, 0ULL)); + VerifyOrReturn(CheckValueNonNull("position", ((CHIPMediaPlaybackClusterPlaybackPosition *) actualValue).position)); + VerifyOrReturn(CheckValue("position", ((CHIPMediaPlaybackClusterPlaybackPosition *) actualValue).position, 0ULL)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributePlaybackSpeed_5() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributePlaybackSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute playback speed Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("PlaybackSpeed", actualValue, 0.0f)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeSeekRangeEnd_6() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeSeekRangeEndWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute seek range end Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("SeekRangeEnd", actualValue)); + VerifyOrReturn(CheckValue("SeekRangeEnd", actualValue, 80000ULL)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeSeekRangeStart_7() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeSeekRangeStartWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute seek range start Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("SeekRangeStart", actualValue)); + VerifyOrReturn(CheckValue("SeekRangeStart", actualValue, 0ULL)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestMediaPlaybackPlayCommand_8() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster playWithCompletionHandler:^( + CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Media Playback Play Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0)); + } + + { + id actualValue = values.data; + VerifyOrReturn(CheckValueAsString("data", actualValue, @"data response")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestMediaPlaybackPauseCommand_9() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster pauseWithCompletionHandler:^( + CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Media Playback Pause Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0)); + } + + { + id actualValue = values.data; + VerifyOrReturn(CheckValueAsString("data", actualValue, @"data response")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestMediaPlaybackStopCommand_10() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster stopPlaybackWithCompletionHandler:^( + CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Media Playback Stop Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0)); + } + + { + id actualValue = values.data; + VerifyOrReturn(CheckValueAsString("data", actualValue, @"data response")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestMediaPlaybackStartOverCommand_11() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster startOverWithCompletionHandler:^( + CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Media Playback Start Over Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0)); + } + + { + id actualValue = values.data; + VerifyOrReturn(CheckValueAsString("data", actualValue, @"data response")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestMediaPlaybackPreviousCommand_12() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster previousWithCompletionHandler:^( + CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Media Playback Previous Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0)); + } + + { + id actualValue = values.data; + VerifyOrReturn(CheckValueAsString("data", actualValue, @"data response")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestMediaPlaybackNextCommand_13() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster nextWithCompletionHandler:^( + CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Media Playback Next Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0)); + } + + { + id actualValue = values.data; + VerifyOrReturn(CheckValueAsString("data", actualValue, @"data response")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestMediaPlaybackRewindCommand_14() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster rewindWithCompletionHandler:^( + CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Media Playback Rewind Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0)); + } + + { + id actualValue = values.data; + VerifyOrReturn(CheckValueAsString("data", actualValue, @"data response")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestMediaPlaybackFastForwardCommand_15() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster fastForwardWithCompletionHandler:^( + CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Media Playback Fast Forward Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0)); + } + + { + id actualValue = values.data; + VerifyOrReturn(CheckValueAsString("data", actualValue, @"data response")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestMediaPlaybackSkipForwardCommand_16() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPMediaPlaybackClusterSkipForwardParams alloc] init]; + params.deltaPositionMilliseconds = [NSNumber numberWithUnsignedLongLong:500ULL]; + [cluster + skipForwardWithParams:params + completionHandler:^(CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Media Playback Skip Forward Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0)); + } + + { + id actualValue = values.data; + VerifyOrReturn(CheckValueAsString("data", actualValue, @"data response")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributePositionAfterSkipForward_17() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeSampledPositionWithCompletionHandler:^( + CHIPMediaPlaybackClusterPlaybackPosition * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute position after skip forward Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("SampledPosition", actualValue)); + VerifyOrReturn(CheckValue("updatedAt", ((CHIPMediaPlaybackClusterPlaybackPosition *) actualValue).updatedAt, 0ULL)); + VerifyOrReturn(CheckValueNonNull("position", ((CHIPMediaPlaybackClusterPlaybackPosition *) actualValue).position)); + VerifyOrReturn(CheckValue("position", ((CHIPMediaPlaybackClusterPlaybackPosition *) actualValue).position, 500ULL)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestMediaPlaybackSkipBackwardCommand_18() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPMediaPlaybackClusterSkipBackwardParams alloc] init]; + params.deltaPositionMilliseconds = [NSNumber numberWithUnsignedLongLong:100ULL]; + [cluster + skipBackwardWithParams:params + completionHandler:^(CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Media Playback Skip Backward Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0)); + } + + { + id actualValue = values.data; + VerifyOrReturn(CheckValueAsString("data", actualValue, @"data response")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributePositionAfterSkipBackward_19() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeSampledPositionWithCompletionHandler:^( + CHIPMediaPlaybackClusterPlaybackPosition * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute position after skip backward Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("SampledPosition", actualValue)); + VerifyOrReturn(CheckValue("updatedAt", ((CHIPMediaPlaybackClusterPlaybackPosition *) actualValue).updatedAt, 0ULL)); + VerifyOrReturn(CheckValueNonNull("position", ((CHIPMediaPlaybackClusterPlaybackPosition *) actualValue).position)); + VerifyOrReturn(CheckValue("position", ((CHIPMediaPlaybackClusterPlaybackPosition *) actualValue).position, 400ULL)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestMediaPlaybackSeekCommand_20() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPMediaPlaybackClusterSeekParams alloc] init]; + params.position = [NSNumber numberWithUnsignedLongLong:1000ULL]; + [cluster seekWithParams:params + completionHandler:^(CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Media Playback Seek Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0)); + } + + { + id actualValue = values.data; + VerifyOrReturn(CheckValueAsString("data", actualValue, @"data response")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributePositionAfterSeek_21() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeSampledPositionWithCompletionHandler:^( + CHIPMediaPlaybackClusterPlaybackPosition * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute position after seek Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("SampledPosition", actualValue)); + VerifyOrReturn(CheckValue("updatedAt", ((CHIPMediaPlaybackClusterPlaybackPosition *) actualValue).updatedAt, 0ULL)); + VerifyOrReturn(CheckValueNonNull("position", ((CHIPMediaPlaybackClusterPlaybackPosition *) actualValue).position)); + VerifyOrReturn( + CheckValue("position", ((CHIPMediaPlaybackClusterPlaybackPosition *) actualValue).position, 1000ULL)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class TV_ChannelCluster : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + TV_ChannelCluster() + : TestCommandBridge("TV_ChannelCluster") + , 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) + + ~TV_ChannelCluster() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: TV_ChannelCluster\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: TV_ChannelCluster\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 304: - ChipLogProgress(chipTool, " ***** Test Step 304 : Write attribute NULLABLE_SINGLE medium Value\n"); - err = TestWriteAttributeNullableSingleMediumValue_304(); + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read attribute Channel list\n"); + err = TestReadAttributeChannelList_1(); break; - case 305: - ChipLogProgress(chipTool, " ***** Test Step 305 : Read attribute NULLABLE_SINGLE medium Value\n"); - err = TestReadAttributeNullableSingleMediumValue_305(); + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read attribute channel lineup\n"); + err = TestReadAttributeChannelLineup_2(); break; - case 306: - ChipLogProgress(chipTool, " ***** Test Step 306 : Write attribute NULLABLE_SINGLE largest Value\n"); - err = TestWriteAttributeNullableSingleLargestValue_306(); + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Read attribute current channel\n"); + err = TestReadAttributeCurrentChannel_3(); break; - case 307: - ChipLogProgress(chipTool, " ***** Test Step 307 : Read attribute NULLABLE_SINGLE largest Value\n"); - err = TestReadAttributeNullableSingleLargestValue_307(); + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Change Channel Command\n"); + err = TestChangeChannelCommand_4(); break; - case 308: - ChipLogProgress(chipTool, " ***** Test Step 308 : Write attribute NULLABLE_SINGLE smallest Value\n"); - err = TestWriteAttributeNullableSingleSmallestValue_308(); + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Change Channel By Number Command\n"); + err = TestChangeChannelByNumberCommand_5(); break; - case 309: - ChipLogProgress(chipTool, " ***** Test Step 309 : Read attribute NULLABLE_SINGLE smallest Value\n"); - err = TestReadAttributeNullableSingleSmallestValue_309(); + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Skip Channel Command\n"); + err = TestSkipChannelCommand_6(); break; - case 310: - ChipLogProgress(chipTool, " ***** Test Step 310 : Write attribute NULLABLE_SINGLE null Value\n"); - err = TestWriteAttributeNullableSingleNullValue_310(); - break; - case 311: - ChipLogProgress(chipTool, " ***** Test Step 311 : Read attribute NULLABLE_SINGLE null Value\n"); - err = TestReadAttributeNullableSingleNullValue_311(); - break; - case 312: - ChipLogProgress(chipTool, " ***** Test Step 312 : Write attribute NULLABLE_SINGLE 0 Value\n"); - err = TestWriteAttributeNullableSingle0Value_312(); - break; - case 313: - ChipLogProgress(chipTool, " ***** Test Step 313 : Read attribute NULLABLE_SINGLE 0 Value\n"); - err = TestReadAttributeNullableSingle0Value_313(); - break; - case 314: - ChipLogProgress(chipTool, " ***** Test Step 314 : Write attribute NULLABLE_DOUBLE medium Value\n"); - err = TestWriteAttributeNullableDoubleMediumValue_314(); - break; - case 315: - ChipLogProgress(chipTool, " ***** Test Step 315 : Read attribute NULLABLE_DOUBLE medium Value\n"); - err = TestReadAttributeNullableDoubleMediumValue_315(); - break; - case 316: - ChipLogProgress(chipTool, " ***** Test Step 316 : Write attribute NULLABLE_DOUBLE largest Value\n"); - err = TestWriteAttributeNullableDoubleLargestValue_316(); - break; - case 317: - ChipLogProgress(chipTool, " ***** Test Step 317 : Read attribute NULLABLE_DOUBLE largest Value\n"); - err = TestReadAttributeNullableDoubleLargestValue_317(); - break; - case 318: - ChipLogProgress(chipTool, " ***** Test Step 318 : Write attribute NULLABLE_DOUBLE smallest Value\n"); - err = TestWriteAttributeNullableDoubleSmallestValue_318(); - break; - case 319: - ChipLogProgress(chipTool, " ***** Test Step 319 : Read attribute NULLABLE_DOUBLE smallest Value\n"); - err = TestReadAttributeNullableDoubleSmallestValue_319(); + } + + 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 = 7; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeChannelList_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestChannel * cluster = [[CHIPTestChannel alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeChannelListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute Channel list Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ChannelList", [actualValue count], static_cast(4))); + VerifyOrReturn(CheckValue("majorNumber", ((CHIPChannelClusterChannelInfo *) actualValue[0]).majorNumber, 6U)); + VerifyOrReturn(CheckValue("minorNumber", ((CHIPChannelClusterChannelInfo *) actualValue[0]).minorNumber, 0U)); + VerifyOrReturn(CheckValueAsString("name", ((CHIPChannelClusterChannelInfo *) actualValue[0]).name, @"ABC")); + VerifyOrReturn( + CheckValueAsString("callSign", ((CHIPChannelClusterChannelInfo *) actualValue[0]).callSign, @"KAAL-TV")); + VerifyOrReturn(CheckValueAsString( + "affiliateCallSign", ((CHIPChannelClusterChannelInfo *) actualValue[0]).affiliateCallSign, @"KAAL")); + VerifyOrReturn(CheckValue("majorNumber", ((CHIPChannelClusterChannelInfo *) actualValue[1]).majorNumber, 9U)); + VerifyOrReturn(CheckValue("minorNumber", ((CHIPChannelClusterChannelInfo *) actualValue[1]).minorNumber, 1U)); + VerifyOrReturn(CheckValueAsString("name", ((CHIPChannelClusterChannelInfo *) actualValue[1]).name, @"PBS")); + VerifyOrReturn( + CheckValueAsString("callSign", ((CHIPChannelClusterChannelInfo *) actualValue[1]).callSign, @"KCTS-TV")); + VerifyOrReturn(CheckValueAsString( + "affiliateCallSign", ((CHIPChannelClusterChannelInfo *) actualValue[1]).affiliateCallSign, @"KCTS")); + VerifyOrReturn(CheckValue("majorNumber", ((CHIPChannelClusterChannelInfo *) actualValue[2]).majorNumber, 9U)); + VerifyOrReturn(CheckValue("minorNumber", ((CHIPChannelClusterChannelInfo *) actualValue[2]).minorNumber, 2U)); + VerifyOrReturn(CheckValueAsString("name", ((CHIPChannelClusterChannelInfo *) actualValue[2]).name, @"PBS Kids")); + VerifyOrReturn( + CheckValueAsString("callSign", ((CHIPChannelClusterChannelInfo *) actualValue[2]).callSign, @"KCTS-TV")); + VerifyOrReturn(CheckValueAsString( + "affiliateCallSign", ((CHIPChannelClusterChannelInfo *) actualValue[2]).affiliateCallSign, @"KCTS")); + VerifyOrReturn(CheckValue("majorNumber", ((CHIPChannelClusterChannelInfo *) actualValue[3]).majorNumber, 9U)); + VerifyOrReturn(CheckValue("minorNumber", ((CHIPChannelClusterChannelInfo *) actualValue[3]).minorNumber, 3U)); + VerifyOrReturn( + CheckValueAsString("name", ((CHIPChannelClusterChannelInfo *) actualValue[3]).name, @"World Channel")); + VerifyOrReturn( + CheckValueAsString("callSign", ((CHIPChannelClusterChannelInfo *) actualValue[3]).callSign, @"KCTS-TV")); + VerifyOrReturn(CheckValueAsString( + "affiliateCallSign", ((CHIPChannelClusterChannelInfo *) actualValue[3]).affiliateCallSign, @"KCTS")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeChannelLineup_2() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestChannel * cluster = [[CHIPTestChannel alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster + readAttributeLineupWithCompletionHandler:^(CHIPChannelClusterLineupInfo * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute channel lineup Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("Lineup", actualValue)); + VerifyOrReturn(CheckValueAsString( + "operatorName", ((CHIPChannelClusterLineupInfo *) actualValue).operatorName, @"Comcast")); + VerifyOrReturn(CheckValueAsString( + "lineupName", ((CHIPChannelClusterLineupInfo *) actualValue).lineupName, @"Comcast King County")); + VerifyOrReturn( + CheckValueAsString("postalCode", ((CHIPChannelClusterLineupInfo *) actualValue).postalCode, @"98052")); + VerifyOrReturn(CheckValue("lineupInfoType", ((CHIPChannelClusterLineupInfo *) actualValue).lineupInfoType, 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeCurrentChannel_3() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestChannel * cluster = [[CHIPTestChannel alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentChannelWithCompletionHandler:^( + CHIPChannelClusterChannelInfo * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute current channel Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentChannel", actualValue)); + VerifyOrReturn(CheckValue("majorNumber", ((CHIPChannelClusterChannelInfo *) actualValue).majorNumber, 6U)); + VerifyOrReturn(CheckValue("minorNumber", ((CHIPChannelClusterChannelInfo *) actualValue).minorNumber, 0U)); + VerifyOrReturn(CheckValueAsString("name", ((CHIPChannelClusterChannelInfo *) actualValue).name, @"ABC")); + VerifyOrReturn( + CheckValueAsString("callSign", ((CHIPChannelClusterChannelInfo *) actualValue).callSign, @"KAAL-TV")); + VerifyOrReturn(CheckValueAsString( + "affiliateCallSign", ((CHIPChannelClusterChannelInfo *) actualValue).affiliateCallSign, @"KAAL")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestChangeChannelCommand_4() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestChannel * cluster = [[CHIPTestChannel alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPChannelClusterChangeChannelParams alloc] init]; + params.match = @"PBS"; + [cluster + changeChannelWithParams:params + completionHandler:^(CHIPChannelClusterChangeChannelResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Change Channel Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0)); + } + + { + id actualValue = values.data; + VerifyOrReturn(CheckValueAsString("data", actualValue, @"data response")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestChangeChannelByNumberCommand_5() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestChannel * cluster = [[CHIPTestChannel alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPChannelClusterChangeChannelByNumberParams alloc] init]; + params.majorNumber = [NSNumber numberWithUnsignedShort:6U]; + params.minorNumber = [NSNumber numberWithUnsignedShort:0U]; + [cluster changeChannelByNumberWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Change Channel By Number Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSkipChannelCommand_6() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestChannel * cluster = [[CHIPTestChannel alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPChannelClusterSkipChannelParams alloc] init]; + params.count = [NSNumber numberWithUnsignedShort:1U]; + [cluster skipChannelWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Skip Channel Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class TV_LowPowerCluster : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + TV_LowPowerCluster() + : TestCommandBridge("TV_LowPowerCluster") + , 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) + + ~TV_LowPowerCluster() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: TV_LowPowerCluster\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: TV_LowPowerCluster\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 320: - ChipLogProgress(chipTool, " ***** Test Step 320 : Write attribute NULLABLE_DOUBLE null Value\n"); - err = TestWriteAttributeNullableDoubleNullValue_320(); + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Sleep Input Status Command\n"); + err = TestSleepInputStatusCommand_1(); break; - case 321: - ChipLogProgress(chipTool, " ***** Test Step 321 : Read attribute NULLABLE_DOUBLE null Value\n"); - err = TestReadAttributeNullableDoubleNullValue_321(); + } + + 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; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSleepInputStatusCommand_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestLowPower * cluster = [[CHIPTestLowPower alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster sleepWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Sleep Input Status Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class TV_ContentLauncherCluster : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + TV_ContentLauncherCluster() + : TestCommandBridge("TV_ContentLauncherCluster") + , 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) + + ~TV_ContentLauncherCluster() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: TV_ContentLauncherCluster\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: TV_ContentLauncherCluster\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 322: - ChipLogProgress(chipTool, " ***** Test Step 322 : Write attribute NULLABLE_DOUBLE 0 Value\n"); - err = TestWriteAttributeNullableDouble0Value_322(); + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read attribute accept header list\n"); + err = TestReadAttributeAcceptHeaderList_1(); break; - case 323: - ChipLogProgress(chipTool, " ***** Test Step 323 : Read attribute NULLABLE_DOUBLE 0 Value\n"); - err = TestReadAttributeNullableDouble0Value_323(); + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read attribute supported streaming protocols\n"); + err = TestReadAttributeSupportedStreamingProtocols_2(); break; - case 324: - ChipLogProgress(chipTool, " ***** Test Step 324 : Write attribute NULLABLE_ENUM8 Min Value\n"); - err = TestWriteAttributeNullableEnum8MinValue_324(); + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Launch Content Command\n"); + err = TestLaunchContentCommand_3(); break; - case 325: - ChipLogProgress(chipTool, " ***** Test Step 325 : Read attribute NULLABLE_ENUM8 Min Value\n"); - err = TestReadAttributeNullableEnum8MinValue_325(); + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Launch URL Command\n"); + err = TestLaunchUrlCommand_4(); break; - case 326: - ChipLogProgress(chipTool, " ***** Test Step 326 : Write attribute NULLABLE_ENUM8 Max Value\n"); - err = TestWriteAttributeNullableEnum8MaxValue_326(); + } + + 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 = 5; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeAcceptHeaderList_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestContentLauncher * cluster = [[CHIPTestContentLauncher alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptHeaderWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute accept header list Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptHeader", [actualValue count], static_cast(2))); + VerifyOrReturn(CheckValueAsString("", actualValue[0], @"example")); + VerifyOrReturn(CheckValueAsString("", actualValue[1], @"example")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeSupportedStreamingProtocols_2() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestContentLauncher * cluster = [[CHIPTestContentLauncher alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster + readAttributeSupportedStreamingProtocolsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute supported streaming protocols Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("SupportedStreamingProtocols", actualValue, 0UL)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestLaunchContentCommand_3() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestContentLauncher * cluster = [[CHIPTestContentLauncher alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPContentLauncherClusterLaunchContentParams alloc] init]; + params.search = [[CHIPContentLauncherClusterContentSearch alloc] init]; + { + NSMutableArray * temp_1 = [[NSMutableArray alloc] init]; + temp_1[0] = [[CHIPContentLauncherClusterParameter alloc] init]; + ((CHIPContentLauncherClusterParameter *) temp_1[0]).type = [NSNumber numberWithUnsignedChar:1]; + ((CHIPContentLauncherClusterParameter *) temp_1[0]).value = @"exampleValue"; + { + NSMutableArray * temp_4 = [[NSMutableArray alloc] init]; + temp_4[0] = [[CHIPContentLauncherClusterAdditionalInfo alloc] init]; + ((CHIPContentLauncherClusterAdditionalInfo *) temp_4[0]).name = @"name"; + ((CHIPContentLauncherClusterAdditionalInfo *) temp_4[0]).value = @"value"; + + ((CHIPContentLauncherClusterParameter *) temp_1[0]).externalIDList = temp_4; + } + + ((CHIPContentLauncherClusterContentSearch *) params.search).parameterList = temp_1; + } + + params.autoPlay = [NSNumber numberWithBool:true]; + params.data = @"exampleData"; + [cluster + launchContentWithParams:params + completionHandler:^(CHIPContentLauncherClusterLaunchResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Launch Content Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0)); + } + + { + id actualValue = values.data; + VerifyOrReturn(CheckValueAsString("data", actualValue, @"exampleData")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestLaunchUrlCommand_4() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestContentLauncher * cluster = [[CHIPTestContentLauncher alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPContentLauncherClusterLaunchURLParams alloc] init]; + params.contentURL = @"exampleUrl"; + params.displayString = @"exampleDisplayString"; + params.brandingInformation = [[CHIPContentLauncherClusterBrandingInformation alloc] init]; + ((CHIPContentLauncherClusterBrandingInformation *) params.brandingInformation).providerName = @"exampleName"; + ((CHIPContentLauncherClusterBrandingInformation *) params.brandingInformation).background = + [[CHIPContentLauncherClusterStyleInformation alloc] init]; + ((CHIPContentLauncherClusterStyleInformation *) ((CHIPContentLauncherClusterBrandingInformation *) + params.brandingInformation) + .background) + .imageUrl + = @"exampleUrl"; + ((CHIPContentLauncherClusterStyleInformation *) ((CHIPContentLauncherClusterBrandingInformation *) + params.brandingInformation) + .background) + .color + = @"exampleColor"; + ((CHIPContentLauncherClusterStyleInformation *) ((CHIPContentLauncherClusterBrandingInformation *) + params.brandingInformation) + .background) + .size + = [[CHIPContentLauncherClusterDimension alloc] init]; + ((CHIPContentLauncherClusterDimension *) ((CHIPContentLauncherClusterStyleInformation *) ((CHIPContentLauncherClusterBrandingInformation *) + params.brandingInformation) + .background) + .size) + .width + = [NSNumber numberWithDouble:0]; + ((CHIPContentLauncherClusterDimension *) ((CHIPContentLauncherClusterStyleInformation *) ((CHIPContentLauncherClusterBrandingInformation *) + params.brandingInformation) + .background) + .size) + .height + = [NSNumber numberWithDouble:0]; + ((CHIPContentLauncherClusterDimension *) ((CHIPContentLauncherClusterStyleInformation *) ((CHIPContentLauncherClusterBrandingInformation *) + params.brandingInformation) + .background) + .size) + .metric + = [NSNumber numberWithUnsignedChar:0]; + + ((CHIPContentLauncherClusterBrandingInformation *) params.brandingInformation).logo = + [[CHIPContentLauncherClusterStyleInformation alloc] init]; + ((CHIPContentLauncherClusterStyleInformation *) ((CHIPContentLauncherClusterBrandingInformation *) + params.brandingInformation) + .logo) + .imageUrl + = @"exampleUrl"; + ((CHIPContentLauncherClusterStyleInformation *) ((CHIPContentLauncherClusterBrandingInformation *) + params.brandingInformation) + .logo) + .color + = @"exampleColor"; + ((CHIPContentLauncherClusterStyleInformation *) ((CHIPContentLauncherClusterBrandingInformation *) + params.brandingInformation) + .logo) + .size + = [[CHIPContentLauncherClusterDimension alloc] init]; + ((CHIPContentLauncherClusterDimension *) ((CHIPContentLauncherClusterStyleInformation *) ((CHIPContentLauncherClusterBrandingInformation *) + params.brandingInformation) + .logo) + .size) + .width + = [NSNumber numberWithDouble:0]; + ((CHIPContentLauncherClusterDimension *) ((CHIPContentLauncherClusterStyleInformation *) ((CHIPContentLauncherClusterBrandingInformation *) + params.brandingInformation) + .logo) + .size) + .height + = [NSNumber numberWithDouble:0]; + ((CHIPContentLauncherClusterDimension *) ((CHIPContentLauncherClusterStyleInformation *) ((CHIPContentLauncherClusterBrandingInformation *) + params.brandingInformation) + .logo) + .size) + .metric + = [NSNumber numberWithUnsignedChar:0]; + + ((CHIPContentLauncherClusterBrandingInformation *) params.brandingInformation).progressBar = + [[CHIPContentLauncherClusterStyleInformation alloc] init]; + ((CHIPContentLauncherClusterStyleInformation *) ((CHIPContentLauncherClusterBrandingInformation *) + params.brandingInformation) + .progressBar) + .imageUrl + = @"exampleUrl"; + ((CHIPContentLauncherClusterStyleInformation *) ((CHIPContentLauncherClusterBrandingInformation *) + params.brandingInformation) + .progressBar) + .color + = @"exampleColor"; + ((CHIPContentLauncherClusterStyleInformation *) ((CHIPContentLauncherClusterBrandingInformation *) + params.brandingInformation) + .progressBar) + .size + = [[CHIPContentLauncherClusterDimension alloc] init]; + ((CHIPContentLauncherClusterDimension *) ((CHIPContentLauncherClusterStyleInformation *) ((CHIPContentLauncherClusterBrandingInformation *) + params.brandingInformation) + .progressBar) + .size) + .width + = [NSNumber numberWithDouble:0]; + ((CHIPContentLauncherClusterDimension *) ((CHIPContentLauncherClusterStyleInformation *) ((CHIPContentLauncherClusterBrandingInformation *) + params.brandingInformation) + .progressBar) + .size) + .height + = [NSNumber numberWithDouble:0]; + ((CHIPContentLauncherClusterDimension *) ((CHIPContentLauncherClusterStyleInformation *) ((CHIPContentLauncherClusterBrandingInformation *) + params.brandingInformation) + .progressBar) + .size) + .metric + = [NSNumber numberWithUnsignedChar:0]; + + ((CHIPContentLauncherClusterBrandingInformation *) params.brandingInformation).splash = + [[CHIPContentLauncherClusterStyleInformation alloc] init]; + ((CHIPContentLauncherClusterStyleInformation *) ((CHIPContentLauncherClusterBrandingInformation *) + params.brandingInformation) + .splash) + .imageUrl + = @"exampleUrl"; + ((CHIPContentLauncherClusterStyleInformation *) ((CHIPContentLauncherClusterBrandingInformation *) + params.brandingInformation) + .splash) + .color + = @"exampleColor"; + ((CHIPContentLauncherClusterStyleInformation *) ((CHIPContentLauncherClusterBrandingInformation *) + params.brandingInformation) + .splash) + .size + = [[CHIPContentLauncherClusterDimension alloc] init]; + ((CHIPContentLauncherClusterDimension *) ((CHIPContentLauncherClusterStyleInformation *) ((CHIPContentLauncherClusterBrandingInformation *) + params.brandingInformation) + .splash) + .size) + .width + = [NSNumber numberWithDouble:0]; + ((CHIPContentLauncherClusterDimension *) ((CHIPContentLauncherClusterStyleInformation *) ((CHIPContentLauncherClusterBrandingInformation *) + params.brandingInformation) + .splash) + .size) + .height + = [NSNumber numberWithDouble:0]; + ((CHIPContentLauncherClusterDimension *) ((CHIPContentLauncherClusterStyleInformation *) ((CHIPContentLauncherClusterBrandingInformation *) + params.brandingInformation) + .splash) + .size) + .metric + = [NSNumber numberWithUnsignedChar:0]; + + ((CHIPContentLauncherClusterBrandingInformation *) params.brandingInformation).waterMark = + [[CHIPContentLauncherClusterStyleInformation alloc] init]; + ((CHIPContentLauncherClusterStyleInformation *) ((CHIPContentLauncherClusterBrandingInformation *) + params.brandingInformation) + .waterMark) + .imageUrl + = @"exampleUrl"; + ((CHIPContentLauncherClusterStyleInformation *) ((CHIPContentLauncherClusterBrandingInformation *) + params.brandingInformation) + .waterMark) + .color + = @"exampleColor"; + ((CHIPContentLauncherClusterStyleInformation *) ((CHIPContentLauncherClusterBrandingInformation *) + params.brandingInformation) + .waterMark) + .size + = [[CHIPContentLauncherClusterDimension alloc] init]; + ((CHIPContentLauncherClusterDimension *) ((CHIPContentLauncherClusterStyleInformation *) ((CHIPContentLauncherClusterBrandingInformation *) + params.brandingInformation) + .waterMark) + .size) + .width + = [NSNumber numberWithDouble:0]; + ((CHIPContentLauncherClusterDimension *) ((CHIPContentLauncherClusterStyleInformation *) ((CHIPContentLauncherClusterBrandingInformation *) + params.brandingInformation) + .waterMark) + .size) + .height + = [NSNumber numberWithDouble:0]; + ((CHIPContentLauncherClusterDimension *) ((CHIPContentLauncherClusterStyleInformation *) ((CHIPContentLauncherClusterBrandingInformation *) + params.brandingInformation) + .waterMark) + .size) + .metric + = [NSNumber numberWithUnsignedChar:0]; + + [cluster launchURLWithParams:params + completionHandler:^(CHIPContentLauncherClusterLaunchResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Launch URL Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0)); + } + + { + id actualValue = values.data; + VerifyOrReturn(CheckValueAsString("data", actualValue, @"exampleData")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class TV_MediaInputCluster : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + TV_MediaInputCluster() + : TestCommandBridge("TV_MediaInputCluster") + , 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) + + ~TV_MediaInputCluster() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: TV_MediaInputCluster\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: TV_MediaInputCluster\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 327: - ChipLogProgress(chipTool, " ***** Test Step 327 : Read attribute NULLABLE_ENUM8 Max Value\n"); - err = TestReadAttributeNullableEnum8MaxValue_327(); + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read attribute media input list\n"); + err = TestReadAttributeMediaInputList_1(); break; - case 328: - ChipLogProgress(chipTool, " ***** Test Step 328 : Write attribute NULLABLE_ENUM8 Invalid Value\n"); - err = TestWriteAttributeNullableEnum8InvalidValue_328(); + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read current media input\n"); + err = TestReadCurrentMediaInput_2(); break; - case 329: - ChipLogProgress(chipTool, " ***** Test Step 329 : Read attribute NULLABLE_ENUM8 unchanged Value\n"); - err = TestReadAttributeNullableEnum8UnchangedValue_329(); + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Select Input Command\n"); + err = TestSelectInputCommand_3(); break; - case 330: - ChipLogProgress(chipTool, " ***** Test Step 330 : Write attribute NULLABLE_ENUM8 null Value\n"); - err = TestWriteAttributeNullableEnum8NullValue_330(); + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Hide Input Status Command\n"); + err = TestHideInputStatusCommand_4(); break; - case 331: - ChipLogProgress(chipTool, " ***** Test Step 331 : Read attribute NULLABLE_ENUM8 null Value\n"); - err = TestReadAttributeNullableEnum8NullValue_331(); + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Show Input Status Command\n"); + err = TestShowInputStatusCommand_5(); break; - case 332: - ChipLogProgress(chipTool, " ***** Test Step 332 : Write attribute NULLABLE_ENUM16 Min Value\n"); - err = TestWriteAttributeNullableEnum16MinValue_332(); + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Rename Input Command\n"); + err = TestRenameInputCommand_6(); break; - case 333: - ChipLogProgress(chipTool, " ***** Test Step 333 : Read attribute NULLABLE_ENUM16 Min Value\n"); - err = TestReadAttributeNullableEnum16MinValue_333(); + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Read attribute media input list\n"); + err = TestReadAttributeMediaInputList_7(); break; - case 334: - ChipLogProgress(chipTool, " ***** Test Step 334 : Write attribute NULLABLE_ENUM16 Max Value\n"); - err = TestWriteAttributeNullableEnum16MaxValue_334(); + } + + 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 = 8; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeMediaInputList_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestMediaInput * cluster = [[CHIPTestMediaInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeInputListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute media input list Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("InputList", [actualValue count], static_cast(2))); + VerifyOrReturn(CheckValue("index", ((CHIPMediaInputClusterInputInfo *) actualValue[0]).index, 1)); + VerifyOrReturn(CheckValue("inputType", ((CHIPMediaInputClusterInputInfo *) actualValue[0]).inputType, 4)); + VerifyOrReturn(CheckValueAsString("name", ((CHIPMediaInputClusterInputInfo *) actualValue[0]).name, @"HDMI")); + VerifyOrReturn( + CheckValueAsString("description", ((CHIPMediaInputClusterInputInfo *) actualValue[0]).descriptionString, + @"High-Definition Multimedia Interface")); + VerifyOrReturn(CheckValue("index", ((CHIPMediaInputClusterInputInfo *) actualValue[1]).index, 2)); + VerifyOrReturn(CheckValue("inputType", ((CHIPMediaInputClusterInputInfo *) actualValue[1]).inputType, 4)); + VerifyOrReturn(CheckValueAsString("name", ((CHIPMediaInputClusterInputInfo *) actualValue[1]).name, @"HDMI")); + VerifyOrReturn( + CheckValueAsString("description", ((CHIPMediaInputClusterInputInfo *) actualValue[1]).descriptionString, + @"High-Definition Multimedia Interface")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadCurrentMediaInput_2() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestMediaInput * cluster = [[CHIPTestMediaInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentInputWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read current media input Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("CurrentInput", actualValue, 1)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSelectInputCommand_3() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestMediaInput * cluster = [[CHIPTestMediaInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPMediaInputClusterSelectInputParams alloc] init]; + params.index = [NSNumber numberWithUnsignedChar:1]; + [cluster selectInputWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Select Input Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestHideInputStatusCommand_4() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestMediaInput * cluster = [[CHIPTestMediaInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster hideInputStatusWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Hide Input Status Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestShowInputStatusCommand_5() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestMediaInput * cluster = [[CHIPTestMediaInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster showInputStatusWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Show Input Status Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestRenameInputCommand_6() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestMediaInput * cluster = [[CHIPTestMediaInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPMediaInputClusterRenameInputParams alloc] init]; + params.index = [NSNumber numberWithUnsignedChar:1]; + params.name = @"HDMI Test"; + [cluster renameInputWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Rename Input Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeMediaInputList_7() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestMediaInput * cluster = [[CHIPTestMediaInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeInputListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute media input list Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("InputList", [actualValue count], static_cast(2))); + VerifyOrReturn(CheckValue("index", ((CHIPMediaInputClusterInputInfo *) actualValue[0]).index, 1)); + VerifyOrReturn(CheckValue("inputType", ((CHIPMediaInputClusterInputInfo *) actualValue[0]).inputType, 4)); + VerifyOrReturn(CheckValueAsString("name", ((CHIPMediaInputClusterInputInfo *) actualValue[0]).name, @"HDMI Test")); + VerifyOrReturn( + CheckValueAsString("description", ((CHIPMediaInputClusterInputInfo *) actualValue[0]).descriptionString, + @"High-Definition Multimedia Interface")); + VerifyOrReturn(CheckValue("index", ((CHIPMediaInputClusterInputInfo *) actualValue[1]).index, 2)); + VerifyOrReturn(CheckValue("inputType", ((CHIPMediaInputClusterInputInfo *) actualValue[1]).inputType, 4)); + VerifyOrReturn(CheckValueAsString("name", ((CHIPMediaInputClusterInputInfo *) actualValue[1]).name, @"HDMI")); + VerifyOrReturn( + CheckValueAsString("description", ((CHIPMediaInputClusterInputInfo *) actualValue[1]).descriptionString, + @"High-Definition Multimedia Interface")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class TestCluster : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + TestCluster() + : TestCommandBridge("TestCluster") + , 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) + + ~TestCluster() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: TestCluster\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: TestCluster\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 335: - ChipLogProgress(chipTool, " ***** Test Step 335 : Read attribute NULLABLE_ENUM16 Max Value\n"); - err = TestReadAttributeNullableEnum16MaxValue_335(); + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Send Test Command\n"); + err = TestSendTestCommand_1(); break; - case 336: - ChipLogProgress(chipTool, " ***** Test Step 336 : Write attribute NULLABLE_ENUM16 Invalid Value\n"); - err = TestWriteAttributeNullableEnum16InvalidValue_336(); + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Send Test Not Handled Command\n"); + err = TestSendTestNotHandledCommand_2(); break; - case 337: - ChipLogProgress(chipTool, " ***** Test Step 337 : Read attribute NULLABLE_ENUM16 unchanged Value\n"); - err = TestReadAttributeNullableEnum16UnchangedValue_337(); + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Send Test Specific Command\n"); + err = TestSendTestSpecificCommand_3(); break; - case 338: - ChipLogProgress(chipTool, " ***** Test Step 338 : Write attribute NULLABLE_ENUM16 null Value\n"); - err = TestWriteAttributeNullableEnum16NullValue_338(); + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Send Test Add Arguments Command\n"); + err = TestSendTestAddArgumentsCommand_4(); break; - case 339: - ChipLogProgress(chipTool, " ***** Test Step 339 : Read attribute NULLABLE_ENUM16 null Value\n"); - err = TestReadAttributeNullableEnum16NullValue_339(); + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Send failing Test Add Arguments Command\n"); + err = TestSendFailingTestAddArgumentsCommand_5(); break; - case 340: - ChipLogProgress(chipTool, " ***** Test Step 340 : Write attribute NULLABLE_SIMPLE_ENUM Min Value\n"); - err = TestWriteAttributeNullableSimpleEnumMinValue_340(); + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Read attribute BOOLEAN Default Value\n"); + err = TestReadAttributeBooleanDefaultValue_6(); break; - case 341: - ChipLogProgress(chipTool, " ***** Test Step 341 : Read attribute NULLABLE_SIMPLE_ENUM Min Value\n"); - err = TestReadAttributeNullableSimpleEnumMinValue_341(); + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Write attribute BOOLEAN True\n"); + err = TestWriteAttributeBooleanTrue_7(); break; - case 342: - ChipLogProgress(chipTool, " ***** Test Step 342 : Write attribute NULLABLE_SIMPLE_ENUM Max Value\n"); - err = TestWriteAttributeNullableSimpleEnumMaxValue_342(); + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Read attribute BOOLEAN True\n"); + err = TestReadAttributeBooleanTrue_8(); break; - case 343: - ChipLogProgress(chipTool, " ***** Test Step 343 : Read attribute NULLABLE_SIMPLE_ENUM Max Value\n"); - err = TestReadAttributeNullableSimpleEnumMaxValue_343(); + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Write attribute BOOLEAN False\n"); + err = TestWriteAttributeBooleanFalse_9(); break; - case 344: - ChipLogProgress(chipTool, " ***** Test Step 344 : Write attribute NULLABLE_SIMPLE_ENUM Invalid Value\n"); - err = TestWriteAttributeNullableSimpleEnumInvalidValue_344(); + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Read attribute BOOLEAN False\n"); + err = TestReadAttributeBooleanFalse_10(); break; - case 345: - ChipLogProgress(chipTool, " ***** Test Step 345 : Read attribute NULLABLE_SIMPLE_ENUM unchanged Value\n"); - err = TestReadAttributeNullableSimpleEnumUnchangedValue_345(); + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Read attribute BITMAP8 Default Value\n"); + err = TestReadAttributeBitmap8DefaultValue_11(); break; - case 346: - ChipLogProgress(chipTool, " ***** Test Step 346 : Write attribute NULLABLE_SIMPLE_ENUM null Value\n"); - err = TestWriteAttributeNullableSimpleEnumNullValue_346(); + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Write attribute BITMAP8 Max Value\n"); + err = TestWriteAttributeBitmap8MaxValue_12(); break; - case 347: - ChipLogProgress(chipTool, " ***** Test Step 347 : Read attribute NULLABLE_SIMPLE_ENUM null Value\n"); - err = TestReadAttributeNullableSimpleEnumNullValue_347(); + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : Read attribute BITMAP8 Max Value\n"); + err = TestReadAttributeBitmap8MaxValue_13(); break; - case 348: - ChipLogProgress(chipTool, " ***** Test Step 348 : Read attribute NULLABLE_OCTET_STRING Default Value\n"); - err = TestReadAttributeNullableOctetStringDefaultValue_348(); + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Write attribute BITMAP8 Min Value\n"); + err = TestWriteAttributeBitmap8MinValue_14(); break; - case 349: - ChipLogProgress(chipTool, " ***** Test Step 349 : Write attribute NULLABLE_OCTET_STRING\n"); - err = TestWriteAttributeNullableOctetString_349(); + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Read attribute BITMAP8 Min Value\n"); + err = TestReadAttributeBitmap8MinValue_15(); break; - case 350: - ChipLogProgress(chipTool, " ***** Test Step 350 : Read attribute NULLABLE_OCTET_STRING\n"); - err = TestReadAttributeNullableOctetString_350(); + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : Read attribute BITMAP16 Default Value\n"); + err = TestReadAttributeBitmap16DefaultValue_16(); break; - case 351: - ChipLogProgress(chipTool, " ***** Test Step 351 : Write attribute NULLABLE_OCTET_STRING\n"); - err = TestWriteAttributeNullableOctetString_351(); + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : Write attribute BITMAP16 Max Value\n"); + err = TestWriteAttributeBitmap16MaxValue_17(); break; - case 352: - ChipLogProgress(chipTool, " ***** Test Step 352 : Read attribute NULLABLE_OCTET_STRING\n"); - err = TestReadAttributeNullableOctetString_352(); + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : Read attribute BITMAP16 Max Value\n"); + err = TestReadAttributeBitmap16MaxValue_18(); break; - case 353: - ChipLogProgress(chipTool, " ***** Test Step 353 : Write attribute NULLABLE_OCTET_STRING\n"); - err = TestWriteAttributeNullableOctetString_353(); + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : Write attribute BITMAP16 Min Value\n"); + err = TestWriteAttributeBitmap16MinValue_19(); break; - case 354: - ChipLogProgress(chipTool, " ***** Test Step 354 : Read attribute NULLABLE_OCTET_STRING\n"); - err = TestReadAttributeNullableOctetString_354(); + case 20: + ChipLogProgress(chipTool, " ***** Test Step 20 : Read attribute BITMAP16 Min Value\n"); + err = TestReadAttributeBitmap16MinValue_20(); break; - case 355: - ChipLogProgress(chipTool, " ***** Test Step 355 : Read attribute NULLABLE_CHAR_STRING Default Value\n"); - err = TestReadAttributeNullableCharStringDefaultValue_355(); + case 21: + ChipLogProgress(chipTool, " ***** Test Step 21 : Read attribute BITMAP32 Default Value\n"); + err = TestReadAttributeBitmap32DefaultValue_21(); break; - case 356: - ChipLogProgress(chipTool, " ***** Test Step 356 : Write attribute NULLABLE_CHAR_STRING\n"); - err = TestWriteAttributeNullableCharString_356(); + case 22: + ChipLogProgress(chipTool, " ***** Test Step 22 : Write attribute BITMAP32 Max Value\n"); + err = TestWriteAttributeBitmap32MaxValue_22(); break; - case 357: - ChipLogProgress(chipTool, " ***** Test Step 357 : Read attribute NULLABLE_CHAR_STRING\n"); - err = TestReadAttributeNullableCharString_357(); + case 23: + ChipLogProgress(chipTool, " ***** Test Step 23 : Read attribute BITMAP32 Max Value\n"); + err = TestReadAttributeBitmap32MaxValue_23(); break; - case 358: - ChipLogProgress(chipTool, " ***** Test Step 358 : Write attribute NULLABLE_CHAR_STRING - Value too long\n"); - err = TestWriteAttributeNullableCharStringValueTooLong_358(); + case 24: + ChipLogProgress(chipTool, " ***** Test Step 24 : Write attribute BITMAP32 Min Value\n"); + err = TestWriteAttributeBitmap32MinValue_24(); break; - case 359: - ChipLogProgress(chipTool, " ***** Test Step 359 : Read attribute NULLABLE_CHAR_STRING\n"); - err = TestReadAttributeNullableCharString_359(); + case 25: + ChipLogProgress(chipTool, " ***** Test Step 25 : Read attribute BITMAP32 Min Value\n"); + err = TestReadAttributeBitmap32MinValue_25(); break; - case 360: - ChipLogProgress(chipTool, " ***** Test Step 360 : Write attribute NULLABLE_CHAR_STRING - Empty\n"); - err = TestWriteAttributeNullableCharStringEmpty_360(); + case 26: + ChipLogProgress(chipTool, " ***** Test Step 26 : Read attribute BITMAP64 Default Value\n"); + err = TestReadAttributeBitmap64DefaultValue_26(); break; - case 361: - ChipLogProgress(chipTool, " ***** Test Step 361 : Read attribute NULLABLE_CHAR_STRING\n"); - err = TestReadAttributeNullableCharString_361(); + case 27: + ChipLogProgress(chipTool, " ***** Test Step 27 : Write attribute BITMAP64 Max Value\n"); + err = TestWriteAttributeBitmap64MaxValue_27(); break; - case 362: - ChipLogProgress(chipTool, " ***** Test Step 362 : Read attribute from nonexistent endpoint.\n"); - err = TestReadAttributeFromNonexistentEndpoint_362(); + case 28: + ChipLogProgress(chipTool, " ***** Test Step 28 : Read attribute BITMAP64 Max Value\n"); + err = TestReadAttributeBitmap64MaxValue_28(); break; - case 363: - ChipLogProgress(chipTool, " ***** Test Step 363 : Read attribute from nonexistent cluster.\n"); - err = TestReadAttributeFromNonexistentCluster_363(); + case 29: + ChipLogProgress(chipTool, " ***** Test Step 29 : Write attribute BITMAP64 Min Value\n"); + err = TestWriteAttributeBitmap64MinValue_29(); break; - case 364: - ChipLogProgress( - chipTool, " ***** Test Step 364 : Send a command that takes an optional parameter but do not set it.\n"); - err = TestSendACommandThatTakesAnOptionalParameterButDoNotSetIt_364(); + case 30: + ChipLogProgress(chipTool, " ***** Test Step 30 : Read attribute BITMAP64 Min Value\n"); + err = TestReadAttributeBitmap64MinValue_30(); break; - case 365: - ChipLogProgress( - chipTool, " ***** Test Step 365 : Send a command that takes an optional parameter but do not set it.\n"); - err = TestSendACommandThatTakesAnOptionalParameterButDoNotSetIt_365(); + case 31: + ChipLogProgress(chipTool, " ***** Test Step 31 : Read attribute INT8U Default Value\n"); + err = TestReadAttributeInt8uDefaultValue_31(); break; - case 366: - ChipLogProgress(chipTool, " ***** Test Step 366 : Report: Subscribe to list attribute\n"); - err = TestReportSubscribeToListAttribute_366(); + case 32: + ChipLogProgress(chipTool, " ***** Test Step 32 : Write attribute INT8U Max Value\n"); + err = TestWriteAttributeInt8uMaxValue_32(); break; - case 367: - ChipLogProgress(chipTool, " ***** Test Step 367 : Subscribe to list attribute\n"); - err = TestSubscribeToListAttribute_367(); + case 33: + ChipLogProgress(chipTool, " ***** Test Step 33 : Read attribute INT8U Max Value\n"); + err = TestReadAttributeInt8uMaxValue_33(); break; - case 368: - ChipLogProgress(chipTool, " ***** Test Step 368 : Write subscribed-to list attribute\n"); - err = TestWriteSubscribedToListAttribute_368(); + case 34: + ChipLogProgress(chipTool, " ***** Test Step 34 : Write attribute INT8U Min Value\n"); + err = TestWriteAttributeInt8uMinValue_34(); break; - case 369: - ChipLogProgress(chipTool, " ***** Test Step 369 : Check for list attribute report\n"); - err = TestCheckForListAttributeReport_369(); + case 35: + ChipLogProgress(chipTool, " ***** Test Step 35 : Read attribute INT8U Min Value\n"); + err = TestReadAttributeInt8uMinValue_35(); break; - case 370: - ChipLogProgress(chipTool, " ***** Test Step 370 : Read range-restricted unsigned 8-bit integer\n"); - err = TestReadRangeRestrictedUnsigned8BitInteger_370(); + case 36: + ChipLogProgress(chipTool, " ***** Test Step 36 : Read attribute INT16U Default Value\n"); + err = TestReadAttributeInt16uDefaultValue_36(); break; - case 371: - ChipLogProgress(chipTool, " ***** Test Step 371 : Write min value to a range-restricted unsigned 8-bit integer\n"); - err = TestWriteMinValueToARangeRestrictedUnsigned8BitInteger_371(); + case 37: + ChipLogProgress(chipTool, " ***** Test Step 37 : Write attribute INT16U Max Value\n"); + err = TestWriteAttributeInt16uMaxValue_37(); break; - case 372: - ChipLogProgress( - chipTool, " ***** Test Step 372 : Write just-below-range value to a range-restricted unsigned 8-bit integer\n"); - err = TestWriteJustBelowRangeValueToARangeRestrictedUnsigned8BitInteger_372(); + case 38: + ChipLogProgress(chipTool, " ***** Test Step 38 : Read attribute INT16U Max Value\n"); + err = TestReadAttributeInt16uMaxValue_38(); break; - case 373: - ChipLogProgress( - chipTool, " ***** Test Step 373 : Write just-above-range value to a range-restricted unsigned 8-bit integer\n"); - err = TestWriteJustAboveRangeValueToARangeRestrictedUnsigned8BitInteger_373(); + case 39: + ChipLogProgress(chipTool, " ***** Test Step 39 : Write attribute INT16U Min Value\n"); + err = TestWriteAttributeInt16uMinValue_39(); break; - case 374: - ChipLogProgress(chipTool, " ***** Test Step 374 : Write max value to a range-restricted unsigned 8-bit integer\n"); - err = TestWriteMaxValueToARangeRestrictedUnsigned8BitInteger_374(); + case 40: + ChipLogProgress(chipTool, " ***** Test Step 40 : Read attribute INT16U Min Value\n"); + err = TestReadAttributeInt16uMinValue_40(); break; - case 375: - ChipLogProgress( - chipTool, " ***** Test Step 375 : Verify range-restricted unsigned 8-bit integer value has not changed\n"); - err = TestVerifyRangeRestrictedUnsigned8BitIntegerValueHasNotChanged_375(); + case 41: + ChipLogProgress(chipTool, " ***** Test Step 41 : Read attribute INT32U Default Value\n"); + err = TestReadAttributeInt32uDefaultValue_41(); break; - case 376: - ChipLogProgress( - chipTool, " ***** Test Step 376 : Write min valid value to a range-restricted unsigned 8-bit integer\n"); - err = TestWriteMinValidValueToARangeRestrictedUnsigned8BitInteger_376(); + case 42: + ChipLogProgress(chipTool, " ***** Test Step 42 : Write attribute INT32U Max Value\n"); + err = TestWriteAttributeInt32uMaxValue_42(); break; - case 377: - ChipLogProgress( - chipTool, " ***** Test Step 377 : Verify range-restricted unsigned 8-bit integer value is at min valid\n"); - err = TestVerifyRangeRestrictedUnsigned8BitIntegerValueIsAtMinValid_377(); + case 43: + ChipLogProgress(chipTool, " ***** Test Step 43 : Read attribute INT32U Max Value\n"); + err = TestReadAttributeInt32uMaxValue_43(); break; - case 378: - ChipLogProgress( - chipTool, " ***** Test Step 378 : Write max valid value to a range-restricted unsigned 8-bit integer\n"); - err = TestWriteMaxValidValueToARangeRestrictedUnsigned8BitInteger_378(); + case 44: + ChipLogProgress(chipTool, " ***** Test Step 44 : Write attribute INT32U Min Value\n"); + err = TestWriteAttributeInt32uMinValue_44(); break; - case 379: - ChipLogProgress( - chipTool, " ***** Test Step 379 : Verify range-restricted unsigned 8-bit integer value is at max valid\n"); - err = TestVerifyRangeRestrictedUnsigned8BitIntegerValueIsAtMaxValid_379(); + case 45: + ChipLogProgress(chipTool, " ***** Test Step 45 : Read attribute INT32U Min Value\n"); + err = TestReadAttributeInt32uMinValue_45(); break; - case 380: - ChipLogProgress( - chipTool, " ***** Test Step 380 : Write middle valid value to a range-restricted unsigned 8-bit integer\n"); - err = TestWriteMiddleValidValueToARangeRestrictedUnsigned8BitInteger_380(); + case 46: + ChipLogProgress(chipTool, " ***** Test Step 46 : Read attribute INT64U Default Value\n"); + err = TestReadAttributeInt64uDefaultValue_46(); break; - case 381: - ChipLogProgress( - chipTool, " ***** Test Step 381 : Verify range-restricted unsigned 8-bit integer value is at mid valid\n"); - err = TestVerifyRangeRestrictedUnsigned8BitIntegerValueIsAtMidValid_381(); + case 47: + ChipLogProgress(chipTool, " ***** Test Step 47 : Write attribute INT64U Max Value\n"); + err = TestWriteAttributeInt64uMaxValue_47(); break; - case 382: - ChipLogProgress(chipTool, " ***** Test Step 382 : Read range-restricted unsigned 16-bit integer\n"); - err = TestReadRangeRestrictedUnsigned16BitInteger_382(); + case 48: + ChipLogProgress(chipTool, " ***** Test Step 48 : Read attribute INT64U Max Value\n"); + err = TestReadAttributeInt64uMaxValue_48(); break; - case 383: - ChipLogProgress(chipTool, " ***** Test Step 383 : Write min value to a range-restricted unsigned 16-bit integer\n"); - err = TestWriteMinValueToARangeRestrictedUnsigned16BitInteger_383(); + case 49: + ChipLogProgress(chipTool, " ***** Test Step 49 : Write attribute INT64U Min Value\n"); + err = TestWriteAttributeInt64uMinValue_49(); break; - case 384: - ChipLogProgress( - chipTool, " ***** Test Step 384 : Write just-below-range value to a range-restricted unsigned 16-bit integer\n"); - err = TestWriteJustBelowRangeValueToARangeRestrictedUnsigned16BitInteger_384(); + case 50: + ChipLogProgress(chipTool, " ***** Test Step 50 : Read attribute INT64U Min Value\n"); + err = TestReadAttributeInt64uMinValue_50(); break; - case 385: - ChipLogProgress( - chipTool, " ***** Test Step 385 : Write just-above-range value to a range-restricted unsigned 16-bit integer\n"); - err = TestWriteJustAboveRangeValueToARangeRestrictedUnsigned16BitInteger_385(); + case 51: + ChipLogProgress(chipTool, " ***** Test Step 51 : Read attribute INT8S Default Value\n"); + err = TestReadAttributeInt8sDefaultValue_51(); break; - case 386: - ChipLogProgress(chipTool, " ***** Test Step 386 : Write max value to a range-restricted unsigned 16-bit integer\n"); - err = TestWriteMaxValueToARangeRestrictedUnsigned16BitInteger_386(); + case 52: + ChipLogProgress(chipTool, " ***** Test Step 52 : Write attribute INT8S Max Value\n"); + err = TestWriteAttributeInt8sMaxValue_52(); break; - case 387: - ChipLogProgress( - chipTool, " ***** Test Step 387 : Verify range-restricted unsigned 16-bit integer value has not changed\n"); - err = TestVerifyRangeRestrictedUnsigned16BitIntegerValueHasNotChanged_387(); + case 53: + ChipLogProgress(chipTool, " ***** Test Step 53 : Read attribute INT8S Max Value\n"); + err = TestReadAttributeInt8sMaxValue_53(); break; - case 388: - ChipLogProgress( - chipTool, " ***** Test Step 388 : Write min valid value to a range-restricted unsigned 16-bit integer\n"); - err = TestWriteMinValidValueToARangeRestrictedUnsigned16BitInteger_388(); + case 54: + ChipLogProgress(chipTool, " ***** Test Step 54 : Write attribute INT8S Min Value\n"); + err = TestWriteAttributeInt8sMinValue_54(); break; - case 389: - ChipLogProgress( - chipTool, " ***** Test Step 389 : Verify range-restricted unsigned 16-bit integer value is at min valid\n"); - err = TestVerifyRangeRestrictedUnsigned16BitIntegerValueIsAtMinValid_389(); + case 55: + ChipLogProgress(chipTool, " ***** Test Step 55 : Read attribute INT8S Min Value\n"); + err = TestReadAttributeInt8sMinValue_55(); break; - case 390: - ChipLogProgress( - chipTool, " ***** Test Step 390 : Write max valid value to a range-restricted unsigned 16-bit integer\n"); - err = TestWriteMaxValidValueToARangeRestrictedUnsigned16BitInteger_390(); + case 56: + ChipLogProgress(chipTool, " ***** Test Step 56 : Write attribute INT8S Default Value\n"); + err = TestWriteAttributeInt8sDefaultValue_56(); break; - case 391: - ChipLogProgress( - chipTool, " ***** Test Step 391 : Verify range-restricted unsigned 16-bit integer value is at max valid\n"); - err = TestVerifyRangeRestrictedUnsigned16BitIntegerValueIsAtMaxValid_391(); + case 57: + ChipLogProgress(chipTool, " ***** Test Step 57 : Read attribute INT8S Default Value\n"); + err = TestReadAttributeInt8sDefaultValue_57(); break; - case 392: - ChipLogProgress( - chipTool, " ***** Test Step 392 : Write middle valid value to a range-restricted unsigned 16-bit integer\n"); - err = TestWriteMiddleValidValueToARangeRestrictedUnsigned16BitInteger_392(); + case 58: + ChipLogProgress(chipTool, " ***** Test Step 58 : Read attribute INT16S Default Value\n"); + err = TestReadAttributeInt16sDefaultValue_58(); break; - case 393: - ChipLogProgress( - chipTool, " ***** Test Step 393 : Verify range-restricted unsigned 16-bit integer value is at mid valid\n"); - err = TestVerifyRangeRestrictedUnsigned16BitIntegerValueIsAtMidValid_393(); + case 59: + ChipLogProgress(chipTool, " ***** Test Step 59 : Write attribute INT16S Max Value\n"); + err = TestWriteAttributeInt16sMaxValue_59(); break; - case 394: - ChipLogProgress(chipTool, " ***** Test Step 394 : Read range-restricted signed 8-bit integer\n"); - err = TestReadRangeRestrictedSigned8BitInteger_394(); + case 60: + ChipLogProgress(chipTool, " ***** Test Step 60 : Read attribute INT16S Max Value\n"); + err = TestReadAttributeInt16sMaxValue_60(); break; - case 395: - ChipLogProgress(chipTool, " ***** Test Step 395 : Write min value to a range-restricted signed 8-bit integer\n"); - err = TestWriteMinValueToARangeRestrictedSigned8BitInteger_395(); + case 61: + ChipLogProgress(chipTool, " ***** Test Step 61 : Write attribute INT16S Min Value\n"); + err = TestWriteAttributeInt16sMinValue_61(); break; - case 396: - ChipLogProgress( - chipTool, " ***** Test Step 396 : Write just-below-range value to a range-restricted signed 8-bit integer\n"); - err = TestWriteJustBelowRangeValueToARangeRestrictedSigned8BitInteger_396(); + case 62: + ChipLogProgress(chipTool, " ***** Test Step 62 : Read attribute INT16S Min Value\n"); + err = TestReadAttributeInt16sMinValue_62(); break; - case 397: - ChipLogProgress( - chipTool, " ***** Test Step 397 : Write just-above-range value to a range-restricted signed 8-bit integer\n"); - err = TestWriteJustAboveRangeValueToARangeRestrictedSigned8BitInteger_397(); + case 63: + ChipLogProgress(chipTool, " ***** Test Step 63 : Write attribute INT16S Default Value\n"); + err = TestWriteAttributeInt16sDefaultValue_63(); break; - case 398: - ChipLogProgress(chipTool, " ***** Test Step 398 : Write max value to a range-restricted signed 8-bit integer\n"); - err = TestWriteMaxValueToARangeRestrictedSigned8BitInteger_398(); + case 64: + ChipLogProgress(chipTool, " ***** Test Step 64 : Read attribute INT16S Default Value\n"); + err = TestReadAttributeInt16sDefaultValue_64(); break; - case 399: - ChipLogProgress( - chipTool, " ***** Test Step 399 : Verify range-restricted signed 8-bit integer value has not changed\n"); - err = TestVerifyRangeRestrictedSigned8BitIntegerValueHasNotChanged_399(); + case 65: + ChipLogProgress(chipTool, " ***** Test Step 65 : Read attribute INT32S Default Value\n"); + err = TestReadAttributeInt32sDefaultValue_65(); break; - case 400: - ChipLogProgress(chipTool, " ***** Test Step 400 : Write min valid value to a range-restricted signed 8-bit integer\n"); - err = TestWriteMinValidValueToARangeRestrictedSigned8BitInteger_400(); + case 66: + ChipLogProgress(chipTool, " ***** Test Step 66 : Write attribute INT32S Max Value\n"); + err = TestWriteAttributeInt32sMaxValue_66(); break; - case 401: - ChipLogProgress( - chipTool, " ***** Test Step 401 : Verify range-restricted signed 8-bit integer value is at min valid\n"); - err = TestVerifyRangeRestrictedSigned8BitIntegerValueIsAtMinValid_401(); + case 67: + ChipLogProgress(chipTool, " ***** Test Step 67 : Read attribute INT32S Max Value\n"); + err = TestReadAttributeInt32sMaxValue_67(); break; - case 402: - ChipLogProgress(chipTool, " ***** Test Step 402 : Write max valid value to a range-restricted signed 8-bit integer\n"); - err = TestWriteMaxValidValueToARangeRestrictedSigned8BitInteger_402(); + case 68: + ChipLogProgress(chipTool, " ***** Test Step 68 : Write attribute INT32S Min Value\n"); + err = TestWriteAttributeInt32sMinValue_68(); break; - case 403: - ChipLogProgress( - chipTool, " ***** Test Step 403 : Verify range-restricted signed 8-bit integer value is at max valid\n"); - err = TestVerifyRangeRestrictedSigned8BitIntegerValueIsAtMaxValid_403(); + case 69: + ChipLogProgress(chipTool, " ***** Test Step 69 : Read attribute INT32S Min Value\n"); + err = TestReadAttributeInt32sMinValue_69(); break; - case 404: - ChipLogProgress( - chipTool, " ***** Test Step 404 : Write middle valid value to a range-restricted signed 8-bit integer\n"); - err = TestWriteMiddleValidValueToARangeRestrictedSigned8BitInteger_404(); + case 70: + ChipLogProgress(chipTool, " ***** Test Step 70 : Write attribute INT32S Default Value\n"); + err = TestWriteAttributeInt32sDefaultValue_70(); break; - case 405: - ChipLogProgress( - chipTool, " ***** Test Step 405 : Verify range-restricted signed 8-bit integer value is at mid valid\n"); - err = TestVerifyRangeRestrictedSigned8BitIntegerValueIsAtMidValid_405(); + case 71: + ChipLogProgress(chipTool, " ***** Test Step 71 : Read attribute INT32S Default Value\n"); + err = TestReadAttributeInt32sDefaultValue_71(); break; - case 406: - ChipLogProgress(chipTool, " ***** Test Step 406 : Read range-restricted signed 16-bit integer\n"); - err = TestReadRangeRestrictedSigned16BitInteger_406(); + case 72: + ChipLogProgress(chipTool, " ***** Test Step 72 : Read attribute INT64S Default Value\n"); + err = TestReadAttributeInt64sDefaultValue_72(); break; - case 407: - ChipLogProgress(chipTool, " ***** Test Step 407 : Write min value to a range-restricted signed 16-bit integer\n"); - err = TestWriteMinValueToARangeRestrictedSigned16BitInteger_407(); + case 73: + ChipLogProgress(chipTool, " ***** Test Step 73 : Write attribute INT64S Max Value\n"); + err = TestWriteAttributeInt64sMaxValue_73(); break; - case 408: - ChipLogProgress( - chipTool, " ***** Test Step 408 : Write just-below-range value to a range-restricted signed 16-bit integer\n"); - err = TestWriteJustBelowRangeValueToARangeRestrictedSigned16BitInteger_408(); + case 74: + ChipLogProgress(chipTool, " ***** Test Step 74 : Read attribute INT64S Max Value\n"); + err = TestReadAttributeInt64sMaxValue_74(); break; - case 409: - ChipLogProgress( - chipTool, " ***** Test Step 409 : Write just-above-range value to a range-restricted signed 16-bit integer\n"); - err = TestWriteJustAboveRangeValueToARangeRestrictedSigned16BitInteger_409(); + case 75: + ChipLogProgress(chipTool, " ***** Test Step 75 : Write attribute INT64S Min Value\n"); + err = TestWriteAttributeInt64sMinValue_75(); break; - case 410: - ChipLogProgress(chipTool, " ***** Test Step 410 : Write max value to a range-restricted signed 16-bit integer\n"); - err = TestWriteMaxValueToARangeRestrictedSigned16BitInteger_410(); + case 76: + ChipLogProgress(chipTool, " ***** Test Step 76 : Read attribute INT64S Min Value\n"); + err = TestReadAttributeInt64sMinValue_76(); break; - case 411: - ChipLogProgress( - chipTool, " ***** Test Step 411 : Verify range-restricted signed 16-bit integer value has not changed\n"); - err = TestVerifyRangeRestrictedSigned16BitIntegerValueHasNotChanged_411(); + case 77: + ChipLogProgress(chipTool, " ***** Test Step 77 : Write attribute INT64S Default Value\n"); + err = TestWriteAttributeInt64sDefaultValue_77(); break; - case 412: - ChipLogProgress(chipTool, " ***** Test Step 412 : Write min valid value to a range-restricted signed 16-bit integer\n"); - err = TestWriteMinValidValueToARangeRestrictedSigned16BitInteger_412(); + case 78: + ChipLogProgress(chipTool, " ***** Test Step 78 : Read attribute INT64S Default Value\n"); + err = TestReadAttributeInt64sDefaultValue_78(); break; - case 413: - ChipLogProgress( - chipTool, " ***** Test Step 413 : Verify range-restricted signed 16-bit integer value is at min valid\n"); - err = TestVerifyRangeRestrictedSigned16BitIntegerValueIsAtMinValid_413(); + case 79: + ChipLogProgress(chipTool, " ***** Test Step 79 : Read attribute SINGLE Default Value\n"); + err = TestReadAttributeSingleDefaultValue_79(); break; - case 414: - ChipLogProgress(chipTool, " ***** Test Step 414 : Write max valid value to a range-restricted signed 16-bit integer\n"); - err = TestWriteMaxValidValueToARangeRestrictedSigned16BitInteger_414(); + case 80: + ChipLogProgress(chipTool, " ***** Test Step 80 : Write attribute SINGLE medium Value\n"); + err = TestWriteAttributeSingleMediumValue_80(); break; - case 415: - ChipLogProgress( - chipTool, " ***** Test Step 415 : Verify range-restricted signed 16-bit integer value is at max valid\n"); - err = TestVerifyRangeRestrictedSigned16BitIntegerValueIsAtMaxValid_415(); + case 81: + ChipLogProgress(chipTool, " ***** Test Step 81 : Read attribute SINGLE medium Value\n"); + err = TestReadAttributeSingleMediumValue_81(); break; - case 416: - ChipLogProgress( - chipTool, " ***** Test Step 416 : Write middle valid value to a range-restricted signed 16-bit integer\n"); - err = TestWriteMiddleValidValueToARangeRestrictedSigned16BitInteger_416(); + case 82: + ChipLogProgress(chipTool, " ***** Test Step 82 : Write attribute SINGLE large Value\n"); + err = TestWriteAttributeSingleLargeValue_82(); break; - case 417: - ChipLogProgress( - chipTool, " ***** Test Step 417 : Verify range-restricted signed 16-bit integer value is at mid valid\n"); - err = TestVerifyRangeRestrictedSigned16BitIntegerValueIsAtMidValid_417(); + case 83: + ChipLogProgress(chipTool, " ***** Test Step 83 : Read attribute SINGLE large Value\n"); + err = TestReadAttributeSingleLargeValue_83(); break; - case 418: - ChipLogProgress(chipTool, " ***** Test Step 418 : Read nullable range-restricted unsigned 8-bit integer\n"); - err = TestReadNullableRangeRestrictedUnsigned8BitInteger_418(); + case 84: + ChipLogProgress(chipTool, " ***** Test Step 84 : Write attribute SINGLE small Value\n"); + err = TestWriteAttributeSingleSmallValue_84(); break; - case 419: - ChipLogProgress( - chipTool, " ***** Test Step 419 : Write min value to a nullable range-restricted unsigned 8-bit integer\n"); - err = TestWriteMinValueToANullableRangeRestrictedUnsigned8BitInteger_419(); + case 85: + ChipLogProgress(chipTool, " ***** Test Step 85 : Read attribute SINGLE small Value\n"); + err = TestReadAttributeSingleSmallValue_85(); break; - case 420: - ChipLogProgress(chipTool, - " ***** Test Step 420 : Write just-below-range value to a nullable range-restricted unsigned 8-bit integer\n"); - err = TestWriteJustBelowRangeValueToANullableRangeRestrictedUnsigned8BitInteger_420(); + case 86: + ChipLogProgress(chipTool, " ***** Test Step 86 : Write attribute SINGLE Default Value\n"); + err = TestWriteAttributeSingleDefaultValue_86(); break; - case 421: - ChipLogProgress(chipTool, - " ***** Test Step 421 : Write just-above-range value to a nullable range-restricted unsigned 8-bit integer\n"); - err = TestWriteJustAboveRangeValueToANullableRangeRestrictedUnsigned8BitInteger_421(); + case 87: + ChipLogProgress(chipTool, " ***** Test Step 87 : Read attribute SINGLE Default Value\n"); + err = TestReadAttributeSingleDefaultValue_87(); break; - case 422: - ChipLogProgress( - chipTool, " ***** Test Step 422 : Write max value to a nullable range-restricted unsigned 8-bit integer\n"); - err = TestWriteMaxValueToANullableRangeRestrictedUnsigned8BitInteger_422(); + case 88: + ChipLogProgress(chipTool, " ***** Test Step 88 : Read attribute DOUBLE Default Value\n"); + err = TestReadAttributeDoubleDefaultValue_88(); break; - case 423: - ChipLogProgress( - chipTool, " ***** Test Step 423 : Verify nullable range-restricted unsigned 8-bit integer value has not changed\n"); - err = TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueHasNotChanged_423(); + case 89: + ChipLogProgress(chipTool, " ***** Test Step 89 : Write attribute DOUBLE medium Value\n"); + err = TestWriteAttributeDoubleMediumValue_89(); break; - case 424: - ChipLogProgress( - chipTool, " ***** Test Step 424 : Write min valid value to a nullable range-restricted unsigned 8-bit integer\n"); - err = TestWriteMinValidValueToANullableRangeRestrictedUnsigned8BitInteger_424(); + case 90: + ChipLogProgress(chipTool, " ***** Test Step 90 : Read attribute DOUBLE medium Value\n"); + err = TestReadAttributeDoubleMediumValue_90(); break; - case 425: - ChipLogProgress( - chipTool, " ***** Test Step 425 : Verify nullable range-restricted unsigned 8-bit integer value is at min valid\n"); - err = TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueIsAtMinValid_425(); + case 91: + ChipLogProgress(chipTool, " ***** Test Step 91 : Write attribute DOUBLE large Value\n"); + err = TestWriteAttributeDoubleLargeValue_91(); break; - case 426: - ChipLogProgress( - chipTool, " ***** Test Step 426 : Write max valid value to a nullable range-restricted unsigned 8-bit integer\n"); - err = TestWriteMaxValidValueToANullableRangeRestrictedUnsigned8BitInteger_426(); + case 92: + ChipLogProgress(chipTool, " ***** Test Step 92 : Read attribute DOUBLE large Value\n"); + err = TestReadAttributeDoubleLargeValue_92(); break; - case 427: - ChipLogProgress( - chipTool, " ***** Test Step 427 : Verify nullable range-restricted unsigned 8-bit integer value is at max valid\n"); - err = TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueIsAtMaxValid_427(); + case 93: + ChipLogProgress(chipTool, " ***** Test Step 93 : Write attribute DOUBLE small Value\n"); + err = TestWriteAttributeDoubleSmallValue_93(); break; - case 428: - ChipLogProgress(chipTool, - " ***** Test Step 428 : Write middle valid value to a nullable range-restricted unsigned 8-bit integer\n"); - err = TestWriteMiddleValidValueToANullableRangeRestrictedUnsigned8BitInteger_428(); + case 94: + ChipLogProgress(chipTool, " ***** Test Step 94 : Read attribute DOUBLE small Value\n"); + err = TestReadAttributeDoubleSmallValue_94(); break; - case 429: - ChipLogProgress( - chipTool, " ***** Test Step 429 : Verify nullable range-restricted unsigned 8-bit integer value is at mid valid\n"); - err = TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueIsAtMidValid_429(); + case 95: + ChipLogProgress(chipTool, " ***** Test Step 95 : Write attribute DOUBLE Default Value\n"); + err = TestWriteAttributeDoubleDefaultValue_95(); break; - case 430: - ChipLogProgress( - chipTool, " ***** Test Step 430 : Write null value to a nullable range-restricted unsigned 8-bit integer\n"); - err = TestWriteNullValueToANullableRangeRestrictedUnsigned8BitInteger_430(); + case 96: + ChipLogProgress(chipTool, " ***** Test Step 96 : Read attribute DOUBLE Default Value\n"); + err = TestReadAttributeDoubleDefaultValue_96(); break; - case 431: - ChipLogProgress( - chipTool, " ***** Test Step 431 : Verify nullable range-restricted unsigned 8-bit integer value is null\n"); - err = TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueIsNull_431(); + case 97: + ChipLogProgress(chipTool, " ***** Test Step 97 : Read attribute ENUM8 Default Value\n"); + err = TestReadAttributeEnum8DefaultValue_97(); break; - case 432: - ChipLogProgress(chipTool, " ***** Test Step 432 : Read nullable range-restricted unsigned 16-bit integer\n"); - err = TestReadNullableRangeRestrictedUnsigned16BitInteger_432(); + case 98: + ChipLogProgress(chipTool, " ***** Test Step 98 : Write attribute ENUM8 Max Value\n"); + err = TestWriteAttributeEnum8MaxValue_98(); break; - case 433: - ChipLogProgress( - chipTool, " ***** Test Step 433 : Write min value to a nullable range-restricted unsigned 16-bit integer\n"); - err = TestWriteMinValueToANullableRangeRestrictedUnsigned16BitInteger_433(); + case 99: + ChipLogProgress(chipTool, " ***** Test Step 99 : Read attribute ENUM8 Max Value\n"); + err = TestReadAttributeEnum8MaxValue_99(); break; - case 434: - ChipLogProgress(chipTool, - " ***** Test Step 434 : Write just-below-range value to a nullable range-restricted unsigned 16-bit integer\n"); - err = TestWriteJustBelowRangeValueToANullableRangeRestrictedUnsigned16BitInteger_434(); + case 100: + ChipLogProgress(chipTool, " ***** Test Step 100 : Write attribute ENUM8 Min Value\n"); + err = TestWriteAttributeEnum8MinValue_100(); break; - case 435: - ChipLogProgress(chipTool, - " ***** Test Step 435 : Write just-above-range value to a nullable range-restricted unsigned 16-bit integer\n"); - err = TestWriteJustAboveRangeValueToANullableRangeRestrictedUnsigned16BitInteger_435(); + case 101: + ChipLogProgress(chipTool, " ***** Test Step 101 : Read attribute ENUM8 Min Value\n"); + err = TestReadAttributeEnum8MinValue_101(); break; - case 436: - ChipLogProgress( - chipTool, " ***** Test Step 436 : Write max value to a nullable range-restricted unsigned 16-bit integer\n"); - err = TestWriteMaxValueToANullableRangeRestrictedUnsigned16BitInteger_436(); + case 102: + ChipLogProgress(chipTool, " ***** Test Step 102 : Read attribute ENUM16 Default Value\n"); + err = TestReadAttributeEnum16DefaultValue_102(); break; - case 437: - ChipLogProgress(chipTool, - " ***** Test Step 437 : Verify nullable range-restricted unsigned 16-bit integer value has not changed\n"); - err = TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueHasNotChanged_437(); + case 103: + ChipLogProgress(chipTool, " ***** Test Step 103 : Write attribute ENUM16 Max Value\n"); + err = TestWriteAttributeEnum16MaxValue_103(); break; - case 438: - ChipLogProgress( - chipTool, " ***** Test Step 438 : Write min valid value to a nullable range-restricted unsigned 16-bit integer\n"); - err = TestWriteMinValidValueToANullableRangeRestrictedUnsigned16BitInteger_438(); + case 104: + ChipLogProgress(chipTool, " ***** Test Step 104 : Read attribute ENUM16 Max Value\n"); + err = TestReadAttributeEnum16MaxValue_104(); break; - case 439: - ChipLogProgress(chipTool, - " ***** Test Step 439 : Verify nullable range-restricted unsigned 16-bit integer value is at min valid\n"); - err = TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueIsAtMinValid_439(); + case 105: + ChipLogProgress(chipTool, " ***** Test Step 105 : Write attribute ENUM16 Min Value\n"); + err = TestWriteAttributeEnum16MinValue_105(); break; - case 440: - ChipLogProgress( - chipTool, " ***** Test Step 440 : Write max valid value to a nullable range-restricted unsigned 16-bit integer\n"); - err = TestWriteMaxValidValueToANullableRangeRestrictedUnsigned16BitInteger_440(); + case 106: + ChipLogProgress(chipTool, " ***** Test Step 106 : Read attribute ENUM16 Min Value\n"); + err = TestReadAttributeEnum16MinValue_106(); break; - case 441: - ChipLogProgress(chipTool, - " ***** Test Step 441 : Verify nullable range-restricted unsigned 16-bit integer value is at max valid\n"); - err = TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueIsAtMaxValid_441(); + case 107: + ChipLogProgress(chipTool, " ***** Test Step 107 : Read attribute OCTET_STRING Default Value\n"); + err = TestReadAttributeOctetStringDefaultValue_107(); break; - case 442: - ChipLogProgress(chipTool, - " ***** Test Step 442 : Write middle valid value to a nullable range-restricted unsigned 16-bit integer\n"); - err = TestWriteMiddleValidValueToANullableRangeRestrictedUnsigned16BitInteger_442(); + case 108: + ChipLogProgress(chipTool, " ***** Test Step 108 : Write attribute OCTET_STRING with embedded null\n"); + err = TestWriteAttributeOctetStringWithEmbeddedNull_108(); break; - case 443: - ChipLogProgress(chipTool, - " ***** Test Step 443 : Verify nullable range-restricted unsigned 16-bit integer value is at mid valid\n"); - err = TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueIsAtMidValid_443(); + case 109: + ChipLogProgress(chipTool, " ***** Test Step 109 : Read attribute OCTET_STRING with embedded null\n"); + err = TestReadAttributeOctetStringWithEmbeddedNull_109(); break; - case 444: - ChipLogProgress( - chipTool, " ***** Test Step 444 : Write null value to a nullable range-restricted unsigned 16-bit integer\n"); - err = TestWriteNullValueToANullableRangeRestrictedUnsigned16BitInteger_444(); + case 110: + ChipLogProgress(chipTool, " ***** Test Step 110 : Write attribute OCTET_STRING with weird chars\n"); + err = TestWriteAttributeOctetStringWithWeirdChars_110(); break; - case 445: - ChipLogProgress( - chipTool, " ***** Test Step 445 : Verify nullable range-restricted unsigned 16-bit integer value is null\n"); - err = TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueIsNull_445(); + case 111: + ChipLogProgress(chipTool, " ***** Test Step 111 : Read attribute OCTET_STRING with weird chars\n"); + err = TestReadAttributeOctetStringWithWeirdChars_111(); break; - case 446: - ChipLogProgress(chipTool, " ***** Test Step 446 : Read nullable range-restricted signed 8-bit integer\n"); - err = TestReadNullableRangeRestrictedSigned8BitInteger_446(); + case 112: + ChipLogProgress(chipTool, " ***** Test Step 112 : Write attribute OCTET_STRING\n"); + err = TestWriteAttributeOctetString_112(); break; - case 447: - ChipLogProgress( - chipTool, " ***** Test Step 447 : Write min value to a nullable range-restricted signed 8-bit integer\n"); - err = TestWriteMinValueToANullableRangeRestrictedSigned8BitInteger_447(); + case 113: + ChipLogProgress(chipTool, " ***** Test Step 113 : Read attribute OCTET_STRING\n"); + err = TestReadAttributeOctetString_113(); break; - case 448: - ChipLogProgress(chipTool, - " ***** Test Step 448 : Write just-below-range value to a nullable range-restricted signed 8-bit integer\n"); - err = TestWriteJustBelowRangeValueToANullableRangeRestrictedSigned8BitInteger_448(); + case 114: + ChipLogProgress(chipTool, " ***** Test Step 114 : Write attribute OCTET_STRING\n"); + err = TestWriteAttributeOctetString_114(); break; - case 449: - ChipLogProgress(chipTool, - " ***** Test Step 449 : Write just-above-range value to a nullable range-restricted signed 8-bit integer\n"); - err = TestWriteJustAboveRangeValueToANullableRangeRestrictedSigned8BitInteger_449(); + case 115: + ChipLogProgress(chipTool, " ***** Test Step 115 : Read attribute OCTET_STRING\n"); + err = TestReadAttributeOctetString_115(); break; - case 450: - ChipLogProgress( - chipTool, " ***** Test Step 450 : Write max value to a nullable range-restricted signed 8-bit integer\n"); - err = TestWriteMaxValueToANullableRangeRestrictedSigned8BitInteger_450(); + case 116: + ChipLogProgress(chipTool, " ***** Test Step 116 : Write attribute OCTET_STRING\n"); + err = TestWriteAttributeOctetString_116(); break; - case 451: - ChipLogProgress( - chipTool, " ***** Test Step 451 : Verify nullable range-restricted signed 8-bit integer value has not changed\n"); - err = TestVerifyNullableRangeRestrictedSigned8BitIntegerValueHasNotChanged_451(); + case 117: + ChipLogProgress(chipTool, " ***** Test Step 117 : Read attribute LONG_OCTET_STRING Default Value\n"); + err = TestReadAttributeLongOctetStringDefaultValue_117(); break; - case 452: - ChipLogProgress( - chipTool, " ***** Test Step 452 : Write min valid value to a nullable range-restricted signed 8-bit integer\n"); - err = TestWriteMinValidValueToANullableRangeRestrictedSigned8BitInteger_452(); + case 118: + ChipLogProgress(chipTool, " ***** Test Step 118 : Write attribute LONG_OCTET_STRING\n"); + err = TestWriteAttributeLongOctetString_118(); break; - case 453: - ChipLogProgress( - chipTool, " ***** Test Step 453 : Verify nullable range-restricted signed 8-bit integer value is at min valid\n"); - err = TestVerifyNullableRangeRestrictedSigned8BitIntegerValueIsAtMinValid_453(); + case 119: + ChipLogProgress(chipTool, " ***** Test Step 119 : Read attribute LONG_OCTET_STRING\n"); + err = TestReadAttributeLongOctetString_119(); break; - case 454: - ChipLogProgress( - chipTool, " ***** Test Step 454 : Write max valid value to a nullable range-restricted signed 8-bit integer\n"); - err = TestWriteMaxValidValueToANullableRangeRestrictedSigned8BitInteger_454(); + case 120: + ChipLogProgress(chipTool, " ***** Test Step 120 : Write attribute LONG_OCTET_STRING\n"); + err = TestWriteAttributeLongOctetString_120(); break; - case 455: - ChipLogProgress( - chipTool, " ***** Test Step 455 : Verify nullable range-restricted signed 8-bit integer value is at max valid\n"); - err = TestVerifyNullableRangeRestrictedSigned8BitIntegerValueIsAtMaxValid_455(); + case 121: + ChipLogProgress(chipTool, " ***** Test Step 121 : Read attribute CHAR_STRING Default Value\n"); + err = TestReadAttributeCharStringDefaultValue_121(); break; - case 456: - ChipLogProgress( - chipTool, " ***** Test Step 456 : Write middle valid value to a nullable range-restricted signed 8-bit integer\n"); - err = TestWriteMiddleValidValueToANullableRangeRestrictedSigned8BitInteger_456(); + case 122: + ChipLogProgress(chipTool, " ***** Test Step 122 : Write attribute CHAR_STRING\n"); + err = TestWriteAttributeCharString_122(); break; - case 457: - ChipLogProgress( - chipTool, " ***** Test Step 457 : Verify nullable range-restricted signed 8-bit integer value is at mid valid\n"); - err = TestVerifyNullableRangeRestrictedSigned8BitIntegerValueIsAtMidValid_457(); + case 123: + ChipLogProgress(chipTool, " ***** Test Step 123 : Read attribute CHAR_STRING\n"); + err = TestReadAttributeCharString_123(); break; - case 458: - ChipLogProgress( - chipTool, " ***** Test Step 458 : Write null value to a nullable range-restricted signed 8-bit integer\n"); - err = TestWriteNullValueToANullableRangeRestrictedSigned8BitInteger_458(); + case 124: + ChipLogProgress(chipTool, " ***** Test Step 124 : Write attribute CHAR_STRING - Value too long\n"); + err = TestWriteAttributeCharStringValueTooLong_124(); break; - case 459: - ChipLogProgress( - chipTool, " ***** Test Step 459 : Verify nullable range-restricted signed 8-bit integer value is at null\n"); - err = TestVerifyNullableRangeRestrictedSigned8BitIntegerValueIsAtNull_459(); + case 125: + ChipLogProgress(chipTool, " ***** Test Step 125 : Read attribute CHAR_STRING\n"); + err = TestReadAttributeCharString_125(); break; - case 460: - ChipLogProgress(chipTool, " ***** Test Step 460 : Read nullable range-restricted signed 16-bit integer\n"); - err = TestReadNullableRangeRestrictedSigned16BitInteger_460(); + case 126: + ChipLogProgress(chipTool, " ***** Test Step 126 : Write attribute CHAR_STRING - Empty\n"); + err = TestWriteAttributeCharStringEmpty_126(); break; - case 461: - ChipLogProgress( - chipTool, " ***** Test Step 461 : Write min value to a nullable range-restricted signed 16-bit integer\n"); - err = TestWriteMinValueToANullableRangeRestrictedSigned16BitInteger_461(); + case 127: + ChipLogProgress(chipTool, " ***** Test Step 127 : Read attribute LONG_CHAR_STRING Default Value\n"); + err = TestReadAttributeLongCharStringDefaultValue_127(); break; - case 462: + case 128: + ChipLogProgress(chipTool, " ***** Test Step 128 : Write attribute LONG_CHAR_STRING\n"); + err = TestWriteAttributeLongCharString_128(); + break; + case 129: + ChipLogProgress(chipTool, " ***** Test Step 129 : Read attribute LONG_CHAR_STRING\n"); + err = TestReadAttributeLongCharString_129(); + break; + case 130: + ChipLogProgress(chipTool, " ***** Test Step 130 : Write attribute LONG_CHAR_STRING\n"); + err = TestWriteAttributeLongCharString_130(); + break; + case 131: + ChipLogProgress(chipTool, " ***** Test Step 131 : Read attribute LIST_LONG_OCTET_STRING (for chunked read)\n"); + err = TestReadAttributeListLongOctetStringForChunkedRead_131(); + break; + case 132: + ChipLogProgress(chipTool, " ***** Test Step 132 : Write attribute LIST_LONG_OCTET_STRING (for chunked write)\n"); + err = TestWriteAttributeListLongOctetStringForChunkedWrite_132(); + break; + case 133: + ChipLogProgress(chipTool, " ***** Test Step 133 : Read attribute LIST_LONG_OCTET_STRING (for chunked read)\n"); + err = TestReadAttributeListLongOctetStringForChunkedRead_133(); + break; + case 134: + ChipLogProgress(chipTool, " ***** Test Step 134 : Read attribute EPOCH_US Default Value\n"); + err = TestReadAttributeEpochUsDefaultValue_134(); + break; + case 135: + ChipLogProgress(chipTool, " ***** Test Step 135 : Write attribute EPOCH_US Max Value\n"); + err = TestWriteAttributeEpochUsMaxValue_135(); + break; + case 136: + ChipLogProgress(chipTool, " ***** Test Step 136 : Read attribute EPOCH_US Max Value\n"); + err = TestReadAttributeEpochUsMaxValue_136(); + break; + case 137: + ChipLogProgress(chipTool, " ***** Test Step 137 : Write attribute EPOCH_US Min Value\n"); + err = TestWriteAttributeEpochUsMinValue_137(); + break; + case 138: + ChipLogProgress(chipTool, " ***** Test Step 138 : Read attribute EPOCH_US Min Value\n"); + err = TestReadAttributeEpochUsMinValue_138(); + break; + case 139: + ChipLogProgress(chipTool, " ***** Test Step 139 : Read attribute EPOCH_S Default Value\n"); + err = TestReadAttributeEpochSDefaultValue_139(); + break; + case 140: + ChipLogProgress(chipTool, " ***** Test Step 140 : Write attribute EPOCH_S Max Value\n"); + err = TestWriteAttributeEpochSMaxValue_140(); + break; + case 141: + ChipLogProgress(chipTool, " ***** Test Step 141 : Read attribute EPOCH_S Max Value\n"); + err = TestReadAttributeEpochSMaxValue_141(); + break; + case 142: + ChipLogProgress(chipTool, " ***** Test Step 142 : Write attribute EPOCH_S Min Value\n"); + err = TestWriteAttributeEpochSMinValue_142(); + break; + case 143: + ChipLogProgress(chipTool, " ***** Test Step 143 : Read attribute EPOCH_S Min Value\n"); + err = TestReadAttributeEpochSMinValue_143(); + break; + case 144: + ChipLogProgress(chipTool, " ***** Test Step 144 : Read attribute UNSUPPORTED\n"); + err = TestReadAttributeUnsupported_144(); + break; + case 145: + ChipLogProgress(chipTool, " ***** Test Step 145 : Writeattribute UNSUPPORTED\n"); + err = TestWriteattributeUnsupported_145(); + break; + case 146: + ChipLogProgress(chipTool, " ***** Test Step 146 : Send Test Command to unsupported endpoint\n"); + err = TestSendTestCommandToUnsupportedEndpoint_146(); + break; + case 147: + ChipLogProgress(chipTool, " ***** Test Step 147 : Send Test Command to unsupported cluster\n"); + err = TestSendTestCommandToUnsupportedCluster_147(); + break; + case 148: + ChipLogProgress(chipTool, " ***** Test Step 148 : Read attribute vendor_id Default Value\n"); + err = TestReadAttributeVendorIdDefaultValue_148(); + break; + case 149: + ChipLogProgress(chipTool, " ***** Test Step 149 : Write attribute vendor_id\n"); + err = TestWriteAttributeVendorId_149(); + break; + case 150: + ChipLogProgress(chipTool, " ***** Test Step 150 : Read attribute vendor_id\n"); + err = TestReadAttributeVendorId_150(); + break; + case 151: + ChipLogProgress(chipTool, " ***** Test Step 151 : Restore attribute vendor_id\n"); + err = TestRestoreAttributeVendorId_151(); + break; + case 152: + ChipLogProgress(chipTool, " ***** Test Step 152 : Send a command with a vendor_id and enum\n"); + err = TestSendACommandWithAVendorIdAndEnum_152(); + break; + case 153: + ChipLogProgress(chipTool, " ***** Test Step 153 : Send Test Command With Struct Argument and arg1.b is true\n"); + err = TestSendTestCommandWithStructArgumentAndArg1bIsTrue_153(); + break; + case 154: + ChipLogProgress(chipTool, " ***** Test Step 154 : Send Test Command With Struct Argument and arg1.b is false\n"); + err = TestSendTestCommandWithStructArgumentAndArg1bIsFalse_154(); + break; + case 155: + ChipLogProgress( + chipTool, " ***** Test Step 155 : Send Test Command With Nested Struct Argument and arg1.c.b is true\n"); + err = TestSendTestCommandWithNestedStructArgumentAndArg1cbIsTrue_155(); + break; + case 156: + ChipLogProgress(chipTool, " ***** Test Step 156 : Send Test Command With Nested Struct Argument arg1.c.b is false\n"); + err = TestSendTestCommandWithNestedStructArgumentArg1cbIsFalse_156(); + break; + case 157: ChipLogProgress(chipTool, - " ***** Test Step 462 : Write just-below-range value to a nullable range-restricted signed 16-bit integer\n"); - err = TestWriteJustBelowRangeValueToANullableRangeRestrictedSigned16BitInteger_462(); + " ***** Test Step 157 : Send Test Command With Nested Struct List Argument and all fields b of arg1.d are true\n"); + err = TestSendTestCommandWithNestedStructListArgumentAndAllFieldsBOfArg1dAreTrue_157(); break; - case 463: + case 158: ChipLogProgress(chipTool, - " ***** Test Step 463 : Write just-above-range value to a nullable range-restricted signed 16-bit integer\n"); - err = TestWriteJustAboveRangeValueToANullableRangeRestrictedSigned16BitInteger_463(); + " ***** Test Step 158 : Send Test Command With Nested Struct List Argument and some fields b of arg1.d are " + "false\n"); + err = TestSendTestCommandWithNestedStructListArgumentAndSomeFieldsBOfArg1dAreFalse_158(); break; - case 464: - ChipLogProgress( - chipTool, " ***** Test Step 464 : Write max value to a nullable range-restricted signed 16-bit integer\n"); - err = TestWriteMaxValueToANullableRangeRestrictedSigned16BitInteger_464(); + case 159: + ChipLogProgress(chipTool, " ***** Test Step 159 : Send Test Command With Struct Argument and see what we get back\n"); + err = TestSendTestCommandWithStructArgumentAndSeeWhatWeGetBack_159(); break; - case 465: - ChipLogProgress( - chipTool, " ***** Test Step 465 : Verify nullable range-restricted signed 16-bit integer value has not changed\n"); - err = TestVerifyNullableRangeRestrictedSigned16BitIntegerValueHasNotChanged_465(); + case 160: + ChipLogProgress(chipTool, " ***** Test Step 160 : Send Test Command With List of INT8U and none of them is set to 0\n"); + err = TestSendTestCommandWithListOfInt8uAndNoneOfThemIsSetTo0_160(); break; - case 466: - ChipLogProgress( - chipTool, " ***** Test Step 466 : Write min valid value to a nullable range-restricted signed 16-bit integer\n"); - err = TestWriteMinValidValueToANullableRangeRestrictedSigned16BitInteger_466(); + case 161: + ChipLogProgress(chipTool, " ***** Test Step 161 : Send Test Command With List of INT8U and one of them is set to 0\n"); + err = TestSendTestCommandWithListOfInt8uAndOneOfThemIsSetTo0_161(); break; - case 467: - ChipLogProgress( - chipTool, " ***** Test Step 467 : Verify nullable range-restricted signed 16-bit integer value is at min valid\n"); - err = TestVerifyNullableRangeRestrictedSigned16BitIntegerValueIsAtMinValid_467(); + case 162: + ChipLogProgress(chipTool, " ***** Test Step 162 : Send Test Command With List of INT8U and get it reversed\n"); + err = TestSendTestCommandWithListOfInt8uAndGetItReversed_162(); break; - case 468: + case 163: ChipLogProgress( - chipTool, " ***** Test Step 468 : Write max valid value to a nullable range-restricted signed 16-bit integer\n"); - err = TestWriteMaxValidValueToANullableRangeRestrictedSigned16BitInteger_468(); + chipTool, " ***** Test Step 163 : Send Test Command With empty List of INT8U and get an empty list back\n"); + err = TestSendTestCommandWithEmptyListOfInt8uAndGetAnEmptyListBack_163(); break; - case 469: - ChipLogProgress( - chipTool, " ***** Test Step 469 : Verify nullable range-restricted signed 16-bit integer value is at max valid\n"); - err = TestVerifyNullableRangeRestrictedSigned16BitIntegerValueIsAtMaxValid_469(); + case 164: + ChipLogProgress(chipTool, + " ***** Test Step 164 : Send Test Command With List of Struct Argument and arg1.b of first item is true\n"); + err = TestSendTestCommandWithListOfStructArgumentAndArg1bOfFirstItemIsTrue_164(); break; - case 470: - ChipLogProgress( - chipTool, " ***** Test Step 470 : Write middle valid value to a nullable range-restricted signed 16-bit integer\n"); - err = TestWriteMiddleValidValueToANullableRangeRestrictedSigned16BitInteger_470(); + case 165: + ChipLogProgress(chipTool, + " ***** Test Step 165 : Send Test Command With List of Struct Argument and arg1.b of first item is false\n"); + err = TestSendTestCommandWithListOfStructArgumentAndArg1bOfFirstItemIsFalse_165(); break; - case 471: - ChipLogProgress( - chipTool, " ***** Test Step 471 : Verify nullable range-restricted signed 16-bit integer value is at mid valid\n"); - err = TestVerifyNullableRangeRestrictedSigned16BitIntegerValueIsAtMidValid_471(); + case 166: + ChipLogProgress(chipTool, + " ***** Test Step 166 : Send Test Command With List of Nested Struct List Argument and all fields b of elements of " + "arg1.d are true\n"); + err = TestSendTestCommandWithListOfNestedStructListArgumentAndAllFieldsBOfElementsOfArg1dAreTrue_166(); break; - case 472: + case 167: + ChipLogProgress(chipTool, + " ***** Test Step 167 : Send Test Command With Nested Struct List Argument and some fields b of elements of arg1.d " + "are false\n"); + err = TestSendTestCommandWithNestedStructListArgumentAndSomeFieldsBOfElementsOfArg1dAreFalse_167(); + break; + case 168: ChipLogProgress( - chipTool, " ***** Test Step 472 : Write null value to a nullable range-restricted signed 16-bit integer\n"); - err = TestWriteNullValueToANullableRangeRestrictedSigned16BitInteger_472(); + chipTool, " ***** Test Step 168 : Write attribute LIST With List of INT8U and none of them is set to 0\n"); + err = TestWriteAttributeListWithListOfInt8uAndNoneOfThemIsSetTo0_168(); break; - case 473: + case 169: + ChipLogProgress(chipTool, " ***** Test Step 169 : Read attribute LIST With List of INT8U\n"); + err = TestReadAttributeListWithListOfInt8u_169(); + break; + case 170: + ChipLogProgress(chipTool, " ***** Test Step 170 : Write attribute LIST With List of OCTET_STRING\n"); + err = TestWriteAttributeListWithListOfOctetString_170(); + break; + case 171: + ChipLogProgress(chipTool, " ***** Test Step 171 : Read attribute LIST With List of OCTET_STRING\n"); + err = TestReadAttributeListWithListOfOctetString_171(); + break; + case 172: + ChipLogProgress(chipTool, " ***** Test Step 172 : Write attribute LIST With List of LIST_STRUCT_OCTET_STRING\n"); + err = TestWriteAttributeListWithListOfListStructOctetString_172(); + break; + case 173: + ChipLogProgress(chipTool, " ***** Test Step 173 : Read attribute LIST With List of LIST_STRUCT_OCTET_STRING\n"); + err = TestReadAttributeListWithListOfListStructOctetString_173(); + break; + case 174: + ChipLogProgress(chipTool, " ***** Test Step 174 : Send Test Command with optional arg set.\n"); + err = TestSendTestCommandWithOptionalArgSet_174(); + break; + case 175: + ChipLogProgress(chipTool, " ***** Test Step 175 : Send Test Command without its optional arg.\n"); + err = TestSendTestCommandWithoutItsOptionalArg_175(); + break; + case 176: + ChipLogProgress(chipTool, " ***** Test Step 176 : Read list of structs containing nullables and optionals\n"); + err = TestReadListOfStructsContainingNullablesAndOptionals_176(); + break; + case 177: + ChipLogProgress(chipTool, " ***** Test Step 177 : Write list of structs containing nullables and optionals\n"); + err = TestWriteListOfStructsContainingNullablesAndOptionals_177(); + break; + case 178: ChipLogProgress( - chipTool, " ***** Test Step 473 : Verify nullable range-restricted signed 16-bit integer value is null\n"); - err = TestVerifyNullableRangeRestrictedSigned16BitIntegerValueIsNull_473(); + chipTool, " ***** Test Step 178 : Read list of structs containing nullables and optionals after writing\n"); + err = TestReadListOfStructsContainingNullablesAndOptionalsAfterWriting_178(); break; - case 474: - ChipLogProgress(chipTool, " ***** Test Step 474 : Write attribute that returns general status on write\n"); - err = TestWriteAttributeThatReturnsGeneralStatusOnWrite_474(); + case 179: + ChipLogProgress(chipTool, " ***** Test Step 179 : Write attribute NULLABLE_BOOLEAN null\n"); + err = TestWriteAttributeNullableBooleanNull_179(); break; - case 475: - ChipLogProgress(chipTool, " ***** Test Step 475 : Write attribute that returns cluster-specific status on write\n"); - err = TestWriteAttributeThatReturnsClusterSpecificStatusOnWrite_475(); + case 180: + ChipLogProgress(chipTool, " ***** Test Step 180 : Read attribute NULLABLE_BOOLEAN null\n"); + err = TestReadAttributeNullableBooleanNull_180(); break; - case 476: - ChipLogProgress(chipTool, " ***** Test Step 476 : Read attribute that returns general status on read\n"); - err = TestReadAttributeThatReturnsGeneralStatusOnRead_476(); + case 181: + ChipLogProgress(chipTool, " ***** Test Step 181 : Write attribute NULLABLE_BOOLEAN True\n"); + err = TestWriteAttributeNullableBooleanTrue_181(); break; - case 477: - ChipLogProgress(chipTool, " ***** Test Step 477 : read attribute that returns cluster-specific status on read\n"); - err = TestReadAttributeThatReturnsClusterSpecificStatusOnRead_477(); + case 182: + ChipLogProgress(chipTool, " ***** Test Step 182 : Read attribute NULLABLE_BOOLEAN True\n"); + err = TestReadAttributeNullableBooleanTrue_182(); break; - case 478: - ChipLogProgress(chipTool, " ***** Test Step 478 : read AcceptedCommandList attribute\n"); - err = TestReadAcceptedCommandListAttribute_478(); + case 183: + ChipLogProgress(chipTool, " ***** Test Step 183 : Write attribute NULLABLE_BITMAP8 Max Value\n"); + err = TestWriteAttributeNullableBitmap8MaxValue_183(); break; - case 479: - ChipLogProgress(chipTool, " ***** Test Step 479 : read GeneratedCommandList attribute\n"); - err = TestReadGeneratedCommandListAttribute_479(); + case 184: + ChipLogProgress(chipTool, " ***** Test Step 184 : Read attribute NULLABLE_BITMAP8 Max Value\n"); + err = TestReadAttributeNullableBitmap8MaxValue_184(); break; - case 480: - ChipLogProgress(chipTool, " ***** Test Step 480 : Write struct-typed attribute\n"); - err = TestWriteStructTypedAttribute_480(); + case 185: + ChipLogProgress(chipTool, " ***** Test Step 185 : Write attribute NULLABLE_BITMAP8 Invalid Value\n"); + err = TestWriteAttributeNullableBitmap8InvalidValue_185(); break; - case 481: - ChipLogProgress(chipTool, " ***** Test Step 481 : Read struct-typed attribute\n"); - err = TestReadStructTypedAttribute_481(); + case 186: + ChipLogProgress(chipTool, " ***** Test Step 186 : Read attribute NULLABLE_BITMAP8 unchanged Value\n"); + err = TestReadAttributeNullableBitmap8UnchangedValue_186(); break; - } + case 187: + ChipLogProgress(chipTool, " ***** Test Step 187 : Write attribute NULLABLE_BITMAP8 null Value\n"); + err = TestWriteAttributeNullableBitmap8NullValue_187(); + break; + case 188: + ChipLogProgress(chipTool, " ***** Test Step 188 : Read attribute NULLABLE_BITMAP8 null Value\n"); + err = TestReadAttributeNullableBitmap8NullValue_188(); + break; + case 189: + ChipLogProgress(chipTool, " ***** Test Step 189 : Write attribute NULLABLE_BITMAP16 Max Value\n"); + err = TestWriteAttributeNullableBitmap16MaxValue_189(); + break; + case 190: + ChipLogProgress(chipTool, " ***** Test Step 190 : Read attribute NULLABLE_BITMAP16 Max Value\n"); + err = TestReadAttributeNullableBitmap16MaxValue_190(); + break; + case 191: + ChipLogProgress(chipTool, " ***** Test Step 191 : Write attribute NULLABLE_BITMAP16 Invalid Value\n"); + err = TestWriteAttributeNullableBitmap16InvalidValue_191(); + break; + case 192: + ChipLogProgress(chipTool, " ***** Test Step 192 : Read attribute NULLABLE_BITMAP16 unchanged Value\n"); + err = TestReadAttributeNullableBitmap16UnchangedValue_192(); + break; + case 193: + ChipLogProgress(chipTool, " ***** Test Step 193 : Write attribute NULLABLE_BITMAP16 null Value\n"); + err = TestWriteAttributeNullableBitmap16NullValue_193(); + break; + case 194: + ChipLogProgress(chipTool, " ***** Test Step 194 : Read attribute NULLABLE_BITMAP16 null Value\n"); + err = TestReadAttributeNullableBitmap16NullValue_194(); + break; + case 195: + ChipLogProgress(chipTool, " ***** Test Step 195 : Write attribute NULLABLE_BITMAP32 Max Value\n"); + err = TestWriteAttributeNullableBitmap32MaxValue_195(); + break; + case 196: + ChipLogProgress(chipTool, " ***** Test Step 196 : Read attribute NULLABLE_BITMAP32 Max Value\n"); + err = TestReadAttributeNullableBitmap32MaxValue_196(); + break; + case 197: + ChipLogProgress(chipTool, " ***** Test Step 197 : Write attribute NULLABLE_BITMAP32 Invalid Value\n"); + err = TestWriteAttributeNullableBitmap32InvalidValue_197(); + break; + case 198: + ChipLogProgress(chipTool, " ***** Test Step 198 : Read attribute NULLABLE_BITMAP32 unchanged Value\n"); + err = TestReadAttributeNullableBitmap32UnchangedValue_198(); + break; + case 199: + ChipLogProgress(chipTool, " ***** Test Step 199 : Write attribute NULLABLE_BITMAP32 null Value\n"); + err = TestWriteAttributeNullableBitmap32NullValue_199(); + break; + case 200: + ChipLogProgress(chipTool, " ***** Test Step 200 : Read attribute NULLABLE_BITMAP32 null Value\n"); + err = TestReadAttributeNullableBitmap32NullValue_200(); + break; + case 201: + ChipLogProgress(chipTool, " ***** Test Step 201 : Write attribute NULLABLE_BITMAP64 Max Value\n"); + err = TestWriteAttributeNullableBitmap64MaxValue_201(); + break; + case 202: + ChipLogProgress(chipTool, " ***** Test Step 202 : Read attribute NULLABLE_BITMAP64 Max Value\n"); + err = TestReadAttributeNullableBitmap64MaxValue_202(); + break; + case 203: + ChipLogProgress(chipTool, " ***** Test Step 203 : Write attribute NULLABLE_BITMAP64 Invalid Value\n"); + err = TestWriteAttributeNullableBitmap64InvalidValue_203(); + break; + case 204: + ChipLogProgress(chipTool, " ***** Test Step 204 : Read attribute NULLABLE_BITMAP64 unchanged Value\n"); + err = TestReadAttributeNullableBitmap64UnchangedValue_204(); + break; + case 205: + ChipLogProgress(chipTool, " ***** Test Step 205 : Write attribute NULLABLE_BITMAP64 null Value\n"); + err = TestWriteAttributeNullableBitmap64NullValue_205(); + break; + case 206: + ChipLogProgress(chipTool, " ***** Test Step 206 : Read attribute NULLABLE_BITMAP64 null Value\n"); + err = TestReadAttributeNullableBitmap64NullValue_206(); + break; + case 207: + ChipLogProgress(chipTool, " ***** Test Step 207 : Write attribute NULLABLE_INT8U Min Value\n"); + err = TestWriteAttributeNullableInt8uMinValue_207(); + break; + case 208: + ChipLogProgress(chipTool, " ***** Test Step 208 : Read attribute NULLABLE_INT8U Min Value\n"); + err = TestReadAttributeNullableInt8uMinValue_208(); + break; + case 209: + ChipLogProgress(chipTool, " ***** Test Step 209 : Write attribute NULLABLE_INT8U Max Value\n"); + err = TestWriteAttributeNullableInt8uMaxValue_209(); + break; + case 210: + ChipLogProgress(chipTool, " ***** Test Step 210 : Read attribute NULLABLE_INT8U Max Value\n"); + err = TestReadAttributeNullableInt8uMaxValue_210(); + break; + case 211: + ChipLogProgress(chipTool, " ***** Test Step 211 : Write attribute NULLABLE_INT8U Invalid Value\n"); + err = TestWriteAttributeNullableInt8uInvalidValue_211(); + break; + case 212: + ChipLogProgress(chipTool, " ***** Test Step 212 : Read attribute NULLABLE_INT8U unchanged Value\n"); + err = TestReadAttributeNullableInt8uUnchangedValue_212(); + break; + case 213: + ChipLogProgress(chipTool, " ***** Test Step 213 : Read attribute NULLABLE_INT8U unchanged Value with constraint\n"); + err = TestReadAttributeNullableInt8uUnchangedValueWithConstraint_213(); + break; + case 214: + ChipLogProgress(chipTool, " ***** Test Step 214 : Write attribute NULLABLE_INT8U null Value\n"); + err = TestWriteAttributeNullableInt8uNullValue_214(); + break; + case 215: + ChipLogProgress(chipTool, " ***** Test Step 215 : Read attribute NULLABLE_INT8U null Value\n"); + err = TestReadAttributeNullableInt8uNullValue_215(); + break; + case 216: + ChipLogProgress(chipTool, " ***** Test Step 216 : Read attribute NULLABLE_INT8U null Value & range\n"); + err = TestReadAttributeNullableInt8uNullValueRange_216(); + break; + case 217: + ChipLogProgress(chipTool, " ***** Test Step 217 : Read attribute NULLABLE_INT8U null Value & not\n"); + err = TestReadAttributeNullableInt8uNullValueNot_217(); + break; + case 218: + ChipLogProgress(chipTool, " ***** Test Step 218 : Write attribute NULLABLE_INT8U Value\n"); + err = TestWriteAttributeNullableInt8uValue_218(); + break; + case 219: + ChipLogProgress(chipTool, " ***** Test Step 219 : Read attribute NULLABLE_INT8U Value in range\n"); + err = TestReadAttributeNullableInt8uValueInRange_219(); + break; + case 220: + ChipLogProgress(chipTool, " ***** Test Step 220 : Read attribute NULLABLE_INT8U notValue OK\n"); + err = TestReadAttributeNullableInt8uNotValueOk_220(); + break; + case 221: + ChipLogProgress(chipTool, " ***** Test Step 221 : Write attribute NULLABLE_INT16U Min Value\n"); + err = TestWriteAttributeNullableInt16uMinValue_221(); + break; + case 222: + ChipLogProgress(chipTool, " ***** Test Step 222 : Read attribute NULLABLE_INT16U Min Value\n"); + err = TestReadAttributeNullableInt16uMinValue_222(); + break; + case 223: + ChipLogProgress(chipTool, " ***** Test Step 223 : Write attribute NULLABLE_INT16U Max Value\n"); + err = TestWriteAttributeNullableInt16uMaxValue_223(); + break; + case 224: + ChipLogProgress(chipTool, " ***** Test Step 224 : Read attribute NULLABLE_INT16U Max Value\n"); + err = TestReadAttributeNullableInt16uMaxValue_224(); + break; + case 225: + ChipLogProgress(chipTool, " ***** Test Step 225 : Write attribute NULLABLE_INT16U Invalid Value\n"); + err = TestWriteAttributeNullableInt16uInvalidValue_225(); + break; + case 226: + ChipLogProgress(chipTool, " ***** Test Step 226 : Read attribute NULLABLE_INT16U unchanged Value\n"); + err = TestReadAttributeNullableInt16uUnchangedValue_226(); + break; + case 227: + ChipLogProgress(chipTool, " ***** Test Step 227 : Write attribute NULLABLE_INT16U null Value\n"); + err = TestWriteAttributeNullableInt16uNullValue_227(); + break; + case 228: + ChipLogProgress(chipTool, " ***** Test Step 228 : Read attribute NULLABLE_INT16U null Value\n"); + err = TestReadAttributeNullableInt16uNullValue_228(); + break; + case 229: + ChipLogProgress(chipTool, " ***** Test Step 229 : Read attribute NULLABLE_INT16U null Value & range\n"); + err = TestReadAttributeNullableInt16uNullValueRange_229(); + break; + case 230: + ChipLogProgress(chipTool, " ***** Test Step 230 : Read attribute NULLABLE_INT16U null Value & not\n"); + err = TestReadAttributeNullableInt16uNullValueNot_230(); + break; + case 231: + ChipLogProgress(chipTool, " ***** Test Step 231 : Write attribute NULLABLE_INT16U Value\n"); + err = TestWriteAttributeNullableInt16uValue_231(); + break; + case 232: + ChipLogProgress(chipTool, " ***** Test Step 232 : Read attribute NULLABLE_INT16U Value in range\n"); + err = TestReadAttributeNullableInt16uValueInRange_232(); + break; + case 233: + ChipLogProgress(chipTool, " ***** Test Step 233 : Read attribute NULLABLE_INT16U notValue OK\n"); + err = TestReadAttributeNullableInt16uNotValueOk_233(); + break; + case 234: + ChipLogProgress(chipTool, " ***** Test Step 234 : Write attribute NULLABLE_INT32U Min Value\n"); + err = TestWriteAttributeNullableInt32uMinValue_234(); + break; + case 235: + ChipLogProgress(chipTool, " ***** Test Step 235 : Read attribute NULLABLE_INT32U Min Value\n"); + err = TestReadAttributeNullableInt32uMinValue_235(); + break; + case 236: + ChipLogProgress(chipTool, " ***** Test Step 236 : Write attribute NULLABLE_INT32U Max Value\n"); + err = TestWriteAttributeNullableInt32uMaxValue_236(); + break; + case 237: + ChipLogProgress(chipTool, " ***** Test Step 237 : Read attribute NULLABLE_INT32U Max Value\n"); + err = TestReadAttributeNullableInt32uMaxValue_237(); + break; + case 238: + ChipLogProgress(chipTool, " ***** Test Step 238 : Write attribute NULLABLE_INT32U Invalid Value\n"); + err = TestWriteAttributeNullableInt32uInvalidValue_238(); + break; + case 239: + ChipLogProgress(chipTool, " ***** Test Step 239 : Read attribute NULLABLE_INT32U unchanged Value\n"); + err = TestReadAttributeNullableInt32uUnchangedValue_239(); + break; + case 240: + ChipLogProgress(chipTool, " ***** Test Step 240 : Write attribute NULLABLE_INT32U null Value\n"); + err = TestWriteAttributeNullableInt32uNullValue_240(); + break; + case 241: + ChipLogProgress(chipTool, " ***** Test Step 241 : Read attribute NULLABLE_INT32U null Value\n"); + err = TestReadAttributeNullableInt32uNullValue_241(); + break; + case 242: + ChipLogProgress(chipTool, " ***** Test Step 242 : Read attribute NULLABLE_INT32U null Value & range\n"); + err = TestReadAttributeNullableInt32uNullValueRange_242(); + break; + case 243: + ChipLogProgress(chipTool, " ***** Test Step 243 : Read attribute NULLABLE_INT32U null Value & not\n"); + err = TestReadAttributeNullableInt32uNullValueNot_243(); + break; + case 244: + ChipLogProgress(chipTool, " ***** Test Step 244 : Write attribute NULLABLE_INT32U Value\n"); + err = TestWriteAttributeNullableInt32uValue_244(); + break; + case 245: + ChipLogProgress(chipTool, " ***** Test Step 245 : Read attribute NULLABLE_INT32U Value in range\n"); + err = TestReadAttributeNullableInt32uValueInRange_245(); + break; + case 246: + ChipLogProgress(chipTool, " ***** Test Step 246 : Read attribute NULLABLE_INT32U notValue OK\n"); + err = TestReadAttributeNullableInt32uNotValueOk_246(); + break; + case 247: + ChipLogProgress(chipTool, " ***** Test Step 247 : Write attribute NULLABLE_INT64U Min Value\n"); + err = TestWriteAttributeNullableInt64uMinValue_247(); + break; + case 248: + ChipLogProgress(chipTool, " ***** Test Step 248 : Read attribute NULLABLE_INT64U Min Value\n"); + err = TestReadAttributeNullableInt64uMinValue_248(); + break; + case 249: + ChipLogProgress(chipTool, " ***** Test Step 249 : Write attribute NULLABLE_INT64U Max Value\n"); + err = TestWriteAttributeNullableInt64uMaxValue_249(); + break; + case 250: + ChipLogProgress(chipTool, " ***** Test Step 250 : Read attribute NULLABLE_INT64U Max Value\n"); + err = TestReadAttributeNullableInt64uMaxValue_250(); + break; + case 251: + ChipLogProgress(chipTool, " ***** Test Step 251 : Write attribute NULLABLE_INT64U Invalid Value\n"); + err = TestWriteAttributeNullableInt64uInvalidValue_251(); + break; + case 252: + ChipLogProgress(chipTool, " ***** Test Step 252 : Read attribute NULLABLE_INT64U unchanged Value\n"); + err = TestReadAttributeNullableInt64uUnchangedValue_252(); + break; + case 253: + ChipLogProgress(chipTool, " ***** Test Step 253 : Write attribute NULLABLE_INT64U null Value\n"); + err = TestWriteAttributeNullableInt64uNullValue_253(); + break; + case 254: + ChipLogProgress(chipTool, " ***** Test Step 254 : Read attribute NULLABLE_INT64U null Value\n"); + err = TestReadAttributeNullableInt64uNullValue_254(); + break; + case 255: + ChipLogProgress(chipTool, " ***** Test Step 255 : Read attribute NULLABLE_INT64U null Value & range\n"); + err = TestReadAttributeNullableInt64uNullValueRange_255(); + break; + case 256: + ChipLogProgress(chipTool, " ***** Test Step 256 : Read attribute NULLABLE_INT64U null Value & not\n"); + err = TestReadAttributeNullableInt64uNullValueNot_256(); + break; + case 257: + ChipLogProgress(chipTool, " ***** Test Step 257 : Write attribute NULLABLE_INT64U Value\n"); + err = TestWriteAttributeNullableInt64uValue_257(); + break; + case 258: + ChipLogProgress(chipTool, " ***** Test Step 258 : Read attribute NULLABLE_INT64U Value in range\n"); + err = TestReadAttributeNullableInt64uValueInRange_258(); + break; + case 259: + ChipLogProgress(chipTool, " ***** Test Step 259 : Read attribute NULLABLE_INT64U notValue OK\n"); + err = TestReadAttributeNullableInt64uNotValueOk_259(); + break; + case 260: + ChipLogProgress(chipTool, " ***** Test Step 260 : Write attribute NULLABLE_INT8S Min Value\n"); + err = TestWriteAttributeNullableInt8sMinValue_260(); + break; + case 261: + ChipLogProgress(chipTool, " ***** Test Step 261 : Read attribute NULLABLE_INT8S Min Value\n"); + err = TestReadAttributeNullableInt8sMinValue_261(); + break; + case 262: + ChipLogProgress(chipTool, " ***** Test Step 262 : Write attribute NULLABLE_INT8S Invalid Value\n"); + err = TestWriteAttributeNullableInt8sInvalidValue_262(); + break; + case 263: + ChipLogProgress(chipTool, " ***** Test Step 263 : Read attribute NULLABLE_INT8S unchanged Value\n"); + err = TestReadAttributeNullableInt8sUnchangedValue_263(); + break; + case 264: + ChipLogProgress(chipTool, " ***** Test Step 264 : Write attribute NULLABLE_INT8S null Value\n"); + err = TestWriteAttributeNullableInt8sNullValue_264(); + break; + case 265: + ChipLogProgress(chipTool, " ***** Test Step 265 : Read attribute NULLABLE_INT8S null Value\n"); + err = TestReadAttributeNullableInt8sNullValue_265(); + break; + case 266: + ChipLogProgress(chipTool, " ***** Test Step 266 : Read attribute NULLABLE_INT8S null Value & range\n"); + err = TestReadAttributeNullableInt8sNullValueRange_266(); + break; + case 267: + ChipLogProgress(chipTool, " ***** Test Step 267 : Read attribute NULLABLE_INT8S null Value & not\n"); + err = TestReadAttributeNullableInt8sNullValueNot_267(); + break; + case 268: + ChipLogProgress(chipTool, " ***** Test Step 268 : Write attribute NULLABLE_INT8S Value\n"); + err = TestWriteAttributeNullableInt8sValue_268(); + break; + case 269: + ChipLogProgress(chipTool, " ***** Test Step 269 : Read attribute NULLABLE_INT8S Value in range\n"); + err = TestReadAttributeNullableInt8sValueInRange_269(); + break; + case 270: + ChipLogProgress(chipTool, " ***** Test Step 270 : Read attribute NULLABLE_INT8S notValue OK\n"); + err = TestReadAttributeNullableInt8sNotValueOk_270(); + break; + case 271: + ChipLogProgress(chipTool, " ***** Test Step 271 : Write attribute NULLABLE_INT16S Min Value\n"); + err = TestWriteAttributeNullableInt16sMinValue_271(); + break; + case 272: + ChipLogProgress(chipTool, " ***** Test Step 272 : Read attribute NULLABLE_INT16S Min Value\n"); + err = TestReadAttributeNullableInt16sMinValue_272(); + break; + case 273: + ChipLogProgress(chipTool, " ***** Test Step 273 : Write attribute NULLABLE_INT16S Invalid Value\n"); + err = TestWriteAttributeNullableInt16sInvalidValue_273(); + break; + case 274: + ChipLogProgress(chipTool, " ***** Test Step 274 : Read attribute NULLABLE_INT16S unchanged Value\n"); + err = TestReadAttributeNullableInt16sUnchangedValue_274(); + break; + case 275: + ChipLogProgress(chipTool, " ***** Test Step 275 : Write attribute NULLABLE_INT16S null Value\n"); + err = TestWriteAttributeNullableInt16sNullValue_275(); + break; + case 276: + ChipLogProgress(chipTool, " ***** Test Step 276 : Read attribute NULLABLE_INT16S null Value\n"); + err = TestReadAttributeNullableInt16sNullValue_276(); + break; + case 277: + ChipLogProgress(chipTool, " ***** Test Step 277 : Read attribute NULLABLE_INT16S null Value & range\n"); + err = TestReadAttributeNullableInt16sNullValueRange_277(); + break; + case 278: + ChipLogProgress(chipTool, " ***** Test Step 278 : Read attribute NULLABLE_INT16S null Value & not\n"); + err = TestReadAttributeNullableInt16sNullValueNot_278(); + break; + case 279: + ChipLogProgress(chipTool, " ***** Test Step 279 : Write attribute NULLABLE_INT16S Value\n"); + err = TestWriteAttributeNullableInt16sValue_279(); + break; + case 280: + ChipLogProgress(chipTool, " ***** Test Step 280 : Read attribute NULLABLE_INT16S Value in range\n"); + err = TestReadAttributeNullableInt16sValueInRange_280(); + break; + case 281: + ChipLogProgress(chipTool, " ***** Test Step 281 : Read attribute NULLABLE_INT16S notValue OK\n"); + err = TestReadAttributeNullableInt16sNotValueOk_281(); + break; + case 282: + ChipLogProgress(chipTool, " ***** Test Step 282 : Write attribute NULLABLE_INT32S Min Value\n"); + err = TestWriteAttributeNullableInt32sMinValue_282(); + break; + case 283: + ChipLogProgress(chipTool, " ***** Test Step 283 : Read attribute NULLABLE_INT32S Min Value\n"); + err = TestReadAttributeNullableInt32sMinValue_283(); + break; + case 284: + ChipLogProgress(chipTool, " ***** Test Step 284 : Write attribute NULLABLE_INT32S Invalid Value\n"); + err = TestWriteAttributeNullableInt32sInvalidValue_284(); + break; + case 285: + ChipLogProgress(chipTool, " ***** Test Step 285 : Read attribute NULLABLE_INT32S unchanged Value\n"); + err = TestReadAttributeNullableInt32sUnchangedValue_285(); + break; + case 286: + ChipLogProgress(chipTool, " ***** Test Step 286 : Write attribute NULLABLE_INT32S null Value\n"); + err = TestWriteAttributeNullableInt32sNullValue_286(); + break; + case 287: + ChipLogProgress(chipTool, " ***** Test Step 287 : Read attribute NULLABLE_INT32S null Value\n"); + err = TestReadAttributeNullableInt32sNullValue_287(); + break; + case 288: + ChipLogProgress(chipTool, " ***** Test Step 288 : Read attribute NULLABLE_INT32S null Value & range\n"); + err = TestReadAttributeNullableInt32sNullValueRange_288(); + break; + case 289: + ChipLogProgress(chipTool, " ***** Test Step 289 : Read attribute NULLABLE_INT32S null Value & not\n"); + err = TestReadAttributeNullableInt32sNullValueNot_289(); + break; + case 290: + ChipLogProgress(chipTool, " ***** Test Step 290 : Write attribute NULLABLE_INT32S Value\n"); + err = TestWriteAttributeNullableInt32sValue_290(); + break; + case 291: + ChipLogProgress(chipTool, " ***** Test Step 291 : Read attribute NULLABLE_INT32S Value in range\n"); + err = TestReadAttributeNullableInt32sValueInRange_291(); + break; + case 292: + ChipLogProgress(chipTool, " ***** Test Step 292 : Read attribute NULLABLE_INT32S notValue OK\n"); + err = TestReadAttributeNullableInt32sNotValueOk_292(); + break; + case 293: + ChipLogProgress(chipTool, " ***** Test Step 293 : Write attribute NULLABLE_INT64S Min Value\n"); + err = TestWriteAttributeNullableInt64sMinValue_293(); + break; + case 294: + ChipLogProgress(chipTool, " ***** Test Step 294 : Read attribute NULLABLE_INT64S Min Value\n"); + err = TestReadAttributeNullableInt64sMinValue_294(); + break; + case 295: + ChipLogProgress(chipTool, " ***** Test Step 295 : Write attribute NULLABLE_INT64S Invalid Value\n"); + err = TestWriteAttributeNullableInt64sInvalidValue_295(); + break; + case 296: + ChipLogProgress(chipTool, " ***** Test Step 296 : Read attribute NULLABLE_INT64S unchanged Value\n"); + err = TestReadAttributeNullableInt64sUnchangedValue_296(); + break; + case 297: + ChipLogProgress(chipTool, " ***** Test Step 297 : Write attribute NULLABLE_INT64S null Value\n"); + err = TestWriteAttributeNullableInt64sNullValue_297(); + break; + case 298: + ChipLogProgress(chipTool, " ***** Test Step 298 : Read attribute NULLABLE_INT64S null Value\n"); + err = TestReadAttributeNullableInt64sNullValue_298(); + break; + case 299: + ChipLogProgress(chipTool, " ***** Test Step 299 : Read attribute NULLABLE_INT64S null Value & range\n"); + err = TestReadAttributeNullableInt64sNullValueRange_299(); + break; + case 300: + ChipLogProgress(chipTool, " ***** Test Step 300 : Read attribute NULLABLE_INT64S null Value & not\n"); + err = TestReadAttributeNullableInt64sNullValueNot_300(); + break; + case 301: + ChipLogProgress(chipTool, " ***** Test Step 301 : Write attribute NULLABLE_INT64S Value\n"); + err = TestWriteAttributeNullableInt64sValue_301(); + break; + case 302: + ChipLogProgress(chipTool, " ***** Test Step 302 : Read attribute NULLABLE_INT64S Value in range\n"); + err = TestReadAttributeNullableInt64sValueInRange_302(); + break; + case 303: + ChipLogProgress(chipTool, " ***** Test Step 303 : Read attribute NULLABLE_INT64S notValue OK\n"); + err = TestReadAttributeNullableInt64sNotValueOk_303(); + break; + case 304: + ChipLogProgress(chipTool, " ***** Test Step 304 : Write attribute NULLABLE_SINGLE medium Value\n"); + err = TestWriteAttributeNullableSingleMediumValue_304(); + break; + case 305: + ChipLogProgress(chipTool, " ***** Test Step 305 : Read attribute NULLABLE_SINGLE medium Value\n"); + err = TestReadAttributeNullableSingleMediumValue_305(); + break; + case 306: + ChipLogProgress(chipTool, " ***** Test Step 306 : Write attribute NULLABLE_SINGLE largest Value\n"); + err = TestWriteAttributeNullableSingleLargestValue_306(); + break; + case 307: + ChipLogProgress(chipTool, " ***** Test Step 307 : Read attribute NULLABLE_SINGLE largest Value\n"); + err = TestReadAttributeNullableSingleLargestValue_307(); + break; + case 308: + ChipLogProgress(chipTool, " ***** Test Step 308 : Write attribute NULLABLE_SINGLE smallest Value\n"); + err = TestWriteAttributeNullableSingleSmallestValue_308(); + break; + case 309: + ChipLogProgress(chipTool, " ***** Test Step 309 : Read attribute NULLABLE_SINGLE smallest Value\n"); + err = TestReadAttributeNullableSingleSmallestValue_309(); + break; + case 310: + ChipLogProgress(chipTool, " ***** Test Step 310 : Write attribute NULLABLE_SINGLE null Value\n"); + err = TestWriteAttributeNullableSingleNullValue_310(); + break; + case 311: + ChipLogProgress(chipTool, " ***** Test Step 311 : Read attribute NULLABLE_SINGLE null Value\n"); + err = TestReadAttributeNullableSingleNullValue_311(); + break; + case 312: + ChipLogProgress(chipTool, " ***** Test Step 312 : Write attribute NULLABLE_SINGLE 0 Value\n"); + err = TestWriteAttributeNullableSingle0Value_312(); + break; + case 313: + ChipLogProgress(chipTool, " ***** Test Step 313 : Read attribute NULLABLE_SINGLE 0 Value\n"); + err = TestReadAttributeNullableSingle0Value_313(); + break; + case 314: + ChipLogProgress(chipTool, " ***** Test Step 314 : Write attribute NULLABLE_DOUBLE medium Value\n"); + err = TestWriteAttributeNullableDoubleMediumValue_314(); + break; + case 315: + ChipLogProgress(chipTool, " ***** Test Step 315 : Read attribute NULLABLE_DOUBLE medium Value\n"); + err = TestReadAttributeNullableDoubleMediumValue_315(); + break; + case 316: + ChipLogProgress(chipTool, " ***** Test Step 316 : Write attribute NULLABLE_DOUBLE largest Value\n"); + err = TestWriteAttributeNullableDoubleLargestValue_316(); + break; + case 317: + ChipLogProgress(chipTool, " ***** Test Step 317 : Read attribute NULLABLE_DOUBLE largest Value\n"); + err = TestReadAttributeNullableDoubleLargestValue_317(); + break; + case 318: + ChipLogProgress(chipTool, " ***** Test Step 318 : Write attribute NULLABLE_DOUBLE smallest Value\n"); + err = TestWriteAttributeNullableDoubleSmallestValue_318(); + break; + case 319: + ChipLogProgress(chipTool, " ***** Test Step 319 : Read attribute NULLABLE_DOUBLE smallest Value\n"); + err = TestReadAttributeNullableDoubleSmallestValue_319(); + break; + case 320: + ChipLogProgress(chipTool, " ***** Test Step 320 : Write attribute NULLABLE_DOUBLE null Value\n"); + err = TestWriteAttributeNullableDoubleNullValue_320(); + break; + case 321: + ChipLogProgress(chipTool, " ***** Test Step 321 : Read attribute NULLABLE_DOUBLE null Value\n"); + err = TestReadAttributeNullableDoubleNullValue_321(); + break; + case 322: + ChipLogProgress(chipTool, " ***** Test Step 322 : Write attribute NULLABLE_DOUBLE 0 Value\n"); + err = TestWriteAttributeNullableDouble0Value_322(); + break; + case 323: + ChipLogProgress(chipTool, " ***** Test Step 323 : Read attribute NULLABLE_DOUBLE 0 Value\n"); + err = TestReadAttributeNullableDouble0Value_323(); + break; + case 324: + ChipLogProgress(chipTool, " ***** Test Step 324 : Write attribute NULLABLE_ENUM8 Min Value\n"); + err = TestWriteAttributeNullableEnum8MinValue_324(); + break; + case 325: + ChipLogProgress(chipTool, " ***** Test Step 325 : Read attribute NULLABLE_ENUM8 Min Value\n"); + err = TestReadAttributeNullableEnum8MinValue_325(); + break; + case 326: + ChipLogProgress(chipTool, " ***** Test Step 326 : Write attribute NULLABLE_ENUM8 Max Value\n"); + err = TestWriteAttributeNullableEnum8MaxValue_326(); + break; + case 327: + ChipLogProgress(chipTool, " ***** Test Step 327 : Read attribute NULLABLE_ENUM8 Max Value\n"); + err = TestReadAttributeNullableEnum8MaxValue_327(); + break; + case 328: + ChipLogProgress(chipTool, " ***** Test Step 328 : Write attribute NULLABLE_ENUM8 Invalid Value\n"); + err = TestWriteAttributeNullableEnum8InvalidValue_328(); + break; + case 329: + ChipLogProgress(chipTool, " ***** Test Step 329 : Read attribute NULLABLE_ENUM8 unchanged Value\n"); + err = TestReadAttributeNullableEnum8UnchangedValue_329(); + break; + case 330: + ChipLogProgress(chipTool, " ***** Test Step 330 : Write attribute NULLABLE_ENUM8 null Value\n"); + err = TestWriteAttributeNullableEnum8NullValue_330(); + break; + case 331: + ChipLogProgress(chipTool, " ***** Test Step 331 : Read attribute NULLABLE_ENUM8 null Value\n"); + err = TestReadAttributeNullableEnum8NullValue_331(); + break; + case 332: + ChipLogProgress(chipTool, " ***** Test Step 332 : Write attribute NULLABLE_ENUM16 Min Value\n"); + err = TestWriteAttributeNullableEnum16MinValue_332(); + break; + case 333: + ChipLogProgress(chipTool, " ***** Test Step 333 : Read attribute NULLABLE_ENUM16 Min Value\n"); + err = TestReadAttributeNullableEnum16MinValue_333(); + break; + case 334: + ChipLogProgress(chipTool, " ***** Test Step 334 : Write attribute NULLABLE_ENUM16 Max Value\n"); + err = TestWriteAttributeNullableEnum16MaxValue_334(); + break; + case 335: + ChipLogProgress(chipTool, " ***** Test Step 335 : Read attribute NULLABLE_ENUM16 Max Value\n"); + err = TestReadAttributeNullableEnum16MaxValue_335(); + break; + case 336: + ChipLogProgress(chipTool, " ***** Test Step 336 : Write attribute NULLABLE_ENUM16 Invalid Value\n"); + err = TestWriteAttributeNullableEnum16InvalidValue_336(); + break; + case 337: + ChipLogProgress(chipTool, " ***** Test Step 337 : Read attribute NULLABLE_ENUM16 unchanged Value\n"); + err = TestReadAttributeNullableEnum16UnchangedValue_337(); + break; + case 338: + ChipLogProgress(chipTool, " ***** Test Step 338 : Write attribute NULLABLE_ENUM16 null Value\n"); + err = TestWriteAttributeNullableEnum16NullValue_338(); + break; + case 339: + ChipLogProgress(chipTool, " ***** Test Step 339 : Read attribute NULLABLE_ENUM16 null Value\n"); + err = TestReadAttributeNullableEnum16NullValue_339(); + break; + case 340: + ChipLogProgress(chipTool, " ***** Test Step 340 : Write attribute NULLABLE_SIMPLE_ENUM Min Value\n"); + err = TestWriteAttributeNullableSimpleEnumMinValue_340(); + break; + case 341: + ChipLogProgress(chipTool, " ***** Test Step 341 : Read attribute NULLABLE_SIMPLE_ENUM Min Value\n"); + err = TestReadAttributeNullableSimpleEnumMinValue_341(); + break; + case 342: + ChipLogProgress(chipTool, " ***** Test Step 342 : Write attribute NULLABLE_SIMPLE_ENUM Max Value\n"); + err = TestWriteAttributeNullableSimpleEnumMaxValue_342(); + break; + case 343: + ChipLogProgress(chipTool, " ***** Test Step 343 : Read attribute NULLABLE_SIMPLE_ENUM Max Value\n"); + err = TestReadAttributeNullableSimpleEnumMaxValue_343(); + break; + case 344: + ChipLogProgress(chipTool, " ***** Test Step 344 : Write attribute NULLABLE_SIMPLE_ENUM Invalid Value\n"); + err = TestWriteAttributeNullableSimpleEnumInvalidValue_344(); + break; + case 345: + ChipLogProgress(chipTool, " ***** Test Step 345 : Read attribute NULLABLE_SIMPLE_ENUM unchanged Value\n"); + err = TestReadAttributeNullableSimpleEnumUnchangedValue_345(); + break; + case 346: + ChipLogProgress(chipTool, " ***** Test Step 346 : Write attribute NULLABLE_SIMPLE_ENUM null Value\n"); + err = TestWriteAttributeNullableSimpleEnumNullValue_346(); + break; + case 347: + ChipLogProgress(chipTool, " ***** Test Step 347 : Read attribute NULLABLE_SIMPLE_ENUM null Value\n"); + err = TestReadAttributeNullableSimpleEnumNullValue_347(); + break; + case 348: + ChipLogProgress(chipTool, " ***** Test Step 348 : Read attribute NULLABLE_OCTET_STRING Default Value\n"); + err = TestReadAttributeNullableOctetStringDefaultValue_348(); + break; + case 349: + ChipLogProgress(chipTool, " ***** Test Step 349 : Write attribute NULLABLE_OCTET_STRING\n"); + err = TestWriteAttributeNullableOctetString_349(); + break; + case 350: + ChipLogProgress(chipTool, " ***** Test Step 350 : Read attribute NULLABLE_OCTET_STRING\n"); + err = TestReadAttributeNullableOctetString_350(); + break; + case 351: + ChipLogProgress(chipTool, " ***** Test Step 351 : Write attribute NULLABLE_OCTET_STRING\n"); + err = TestWriteAttributeNullableOctetString_351(); + break; + case 352: + ChipLogProgress(chipTool, " ***** Test Step 352 : Read attribute NULLABLE_OCTET_STRING\n"); + err = TestReadAttributeNullableOctetString_352(); + break; + case 353: + ChipLogProgress(chipTool, " ***** Test Step 353 : Write attribute NULLABLE_OCTET_STRING\n"); + err = TestWriteAttributeNullableOctetString_353(); + break; + case 354: + ChipLogProgress(chipTool, " ***** Test Step 354 : Read attribute NULLABLE_OCTET_STRING\n"); + err = TestReadAttributeNullableOctetString_354(); + break; + case 355: + ChipLogProgress(chipTool, " ***** Test Step 355 : Read attribute NULLABLE_CHAR_STRING Default Value\n"); + err = TestReadAttributeNullableCharStringDefaultValue_355(); + break; + case 356: + ChipLogProgress(chipTool, " ***** Test Step 356 : Write attribute NULLABLE_CHAR_STRING\n"); + err = TestWriteAttributeNullableCharString_356(); + break; + case 357: + ChipLogProgress(chipTool, " ***** Test Step 357 : Read attribute NULLABLE_CHAR_STRING\n"); + err = TestReadAttributeNullableCharString_357(); + break; + case 358: + ChipLogProgress(chipTool, " ***** Test Step 358 : Write attribute NULLABLE_CHAR_STRING - Value too long\n"); + err = TestWriteAttributeNullableCharStringValueTooLong_358(); + break; + case 359: + ChipLogProgress(chipTool, " ***** Test Step 359 : Read attribute NULLABLE_CHAR_STRING\n"); + err = TestReadAttributeNullableCharString_359(); + break; + case 360: + ChipLogProgress(chipTool, " ***** Test Step 360 : Write attribute NULLABLE_CHAR_STRING - Empty\n"); + err = TestWriteAttributeNullableCharStringEmpty_360(); + break; + case 361: + ChipLogProgress(chipTool, " ***** Test Step 361 : Read attribute NULLABLE_CHAR_STRING\n"); + err = TestReadAttributeNullableCharString_361(); + break; + case 362: + ChipLogProgress(chipTool, " ***** Test Step 362 : Read attribute from nonexistent endpoint.\n"); + err = TestReadAttributeFromNonexistentEndpoint_362(); + break; + case 363: + ChipLogProgress(chipTool, " ***** Test Step 363 : Read attribute from nonexistent cluster.\n"); + err = TestReadAttributeFromNonexistentCluster_363(); + break; + case 364: + ChipLogProgress( + chipTool, " ***** Test Step 364 : Send a command that takes an optional parameter but do not set it.\n"); + err = TestSendACommandThatTakesAnOptionalParameterButDoNotSetIt_364(); + break; + case 365: + ChipLogProgress( + chipTool, " ***** Test Step 365 : Send a command that takes an optional parameter but do not set it.\n"); + err = TestSendACommandThatTakesAnOptionalParameterButDoNotSetIt_365(); + break; + case 366: + ChipLogProgress(chipTool, " ***** Test Step 366 : Report: Subscribe to list attribute\n"); + err = TestReportSubscribeToListAttribute_366(); + break; + case 367: + ChipLogProgress(chipTool, " ***** Test Step 367 : Subscribe to list attribute\n"); + err = TestSubscribeToListAttribute_367(); + break; + case 368: + ChipLogProgress(chipTool, " ***** Test Step 368 : Write subscribed-to list attribute\n"); + err = TestWriteSubscribedToListAttribute_368(); + break; + case 369: + ChipLogProgress(chipTool, " ***** Test Step 369 : Check for list attribute report\n"); + err = TestCheckForListAttributeReport_369(); + break; + case 370: + ChipLogProgress(chipTool, " ***** Test Step 370 : Read range-restricted unsigned 8-bit integer\n"); + err = TestReadRangeRestrictedUnsigned8BitInteger_370(); + break; + case 371: + ChipLogProgress(chipTool, " ***** Test Step 371 : Write min value to a range-restricted unsigned 8-bit integer\n"); + err = TestWriteMinValueToARangeRestrictedUnsigned8BitInteger_371(); + break; + case 372: + ChipLogProgress( + chipTool, " ***** Test Step 372 : Write just-below-range value to a range-restricted unsigned 8-bit integer\n"); + err = TestWriteJustBelowRangeValueToARangeRestrictedUnsigned8BitInteger_372(); + break; + case 373: + ChipLogProgress( + chipTool, " ***** Test Step 373 : Write just-above-range value to a range-restricted unsigned 8-bit integer\n"); + err = TestWriteJustAboveRangeValueToARangeRestrictedUnsigned8BitInteger_373(); + break; + case 374: + ChipLogProgress(chipTool, " ***** Test Step 374 : Write max value to a range-restricted unsigned 8-bit integer\n"); + err = TestWriteMaxValueToARangeRestrictedUnsigned8BitInteger_374(); + break; + case 375: + ChipLogProgress( + chipTool, " ***** Test Step 375 : Verify range-restricted unsigned 8-bit integer value has not changed\n"); + err = TestVerifyRangeRestrictedUnsigned8BitIntegerValueHasNotChanged_375(); + break; + case 376: + ChipLogProgress( + chipTool, " ***** Test Step 376 : Write min valid value to a range-restricted unsigned 8-bit integer\n"); + err = TestWriteMinValidValueToARangeRestrictedUnsigned8BitInteger_376(); + break; + case 377: + ChipLogProgress( + chipTool, " ***** Test Step 377 : Verify range-restricted unsigned 8-bit integer value is at min valid\n"); + err = TestVerifyRangeRestrictedUnsigned8BitIntegerValueIsAtMinValid_377(); + break; + case 378: + ChipLogProgress( + chipTool, " ***** Test Step 378 : Write max valid value to a range-restricted unsigned 8-bit integer\n"); + err = TestWriteMaxValidValueToARangeRestrictedUnsigned8BitInteger_378(); + break; + case 379: + ChipLogProgress( + chipTool, " ***** Test Step 379 : Verify range-restricted unsigned 8-bit integer value is at max valid\n"); + err = TestVerifyRangeRestrictedUnsigned8BitIntegerValueIsAtMaxValid_379(); + break; + case 380: + ChipLogProgress( + chipTool, " ***** Test Step 380 : Write middle valid value to a range-restricted unsigned 8-bit integer\n"); + err = TestWriteMiddleValidValueToARangeRestrictedUnsigned8BitInteger_380(); + break; + case 381: + ChipLogProgress( + chipTool, " ***** Test Step 381 : Verify range-restricted unsigned 8-bit integer value is at mid valid\n"); + err = TestVerifyRangeRestrictedUnsigned8BitIntegerValueIsAtMidValid_381(); + break; + case 382: + ChipLogProgress(chipTool, " ***** Test Step 382 : Read range-restricted unsigned 16-bit integer\n"); + err = TestReadRangeRestrictedUnsigned16BitInteger_382(); + break; + case 383: + ChipLogProgress(chipTool, " ***** Test Step 383 : Write min value to a range-restricted unsigned 16-bit integer\n"); + err = TestWriteMinValueToARangeRestrictedUnsigned16BitInteger_383(); + break; + case 384: + ChipLogProgress( + chipTool, " ***** Test Step 384 : Write just-below-range value to a range-restricted unsigned 16-bit integer\n"); + err = TestWriteJustBelowRangeValueToARangeRestrictedUnsigned16BitInteger_384(); + break; + case 385: + ChipLogProgress( + chipTool, " ***** Test Step 385 : Write just-above-range value to a range-restricted unsigned 16-bit integer\n"); + err = TestWriteJustAboveRangeValueToARangeRestrictedUnsigned16BitInteger_385(); + break; + case 386: + ChipLogProgress(chipTool, " ***** Test Step 386 : Write max value to a range-restricted unsigned 16-bit integer\n"); + err = TestWriteMaxValueToARangeRestrictedUnsigned16BitInteger_386(); + break; + case 387: + ChipLogProgress( + chipTool, " ***** Test Step 387 : Verify range-restricted unsigned 16-bit integer value has not changed\n"); + err = TestVerifyRangeRestrictedUnsigned16BitIntegerValueHasNotChanged_387(); + break; + case 388: + ChipLogProgress( + chipTool, " ***** Test Step 388 : Write min valid value to a range-restricted unsigned 16-bit integer\n"); + err = TestWriteMinValidValueToARangeRestrictedUnsigned16BitInteger_388(); + break; + case 389: + ChipLogProgress( + chipTool, " ***** Test Step 389 : Verify range-restricted unsigned 16-bit integer value is at min valid\n"); + err = TestVerifyRangeRestrictedUnsigned16BitIntegerValueIsAtMinValid_389(); + break; + case 390: + ChipLogProgress( + chipTool, " ***** Test Step 390 : Write max valid value to a range-restricted unsigned 16-bit integer\n"); + err = TestWriteMaxValidValueToARangeRestrictedUnsigned16BitInteger_390(); + break; + case 391: + ChipLogProgress( + chipTool, " ***** Test Step 391 : Verify range-restricted unsigned 16-bit integer value is at max valid\n"); + err = TestVerifyRangeRestrictedUnsigned16BitIntegerValueIsAtMaxValid_391(); + break; + case 392: + ChipLogProgress( + chipTool, " ***** Test Step 392 : Write middle valid value to a range-restricted unsigned 16-bit integer\n"); + err = TestWriteMiddleValidValueToARangeRestrictedUnsigned16BitInteger_392(); + break; + case 393: + ChipLogProgress( + chipTool, " ***** Test Step 393 : Verify range-restricted unsigned 16-bit integer value is at mid valid\n"); + err = TestVerifyRangeRestrictedUnsigned16BitIntegerValueIsAtMidValid_393(); + break; + case 394: + ChipLogProgress(chipTool, " ***** Test Step 394 : Read range-restricted signed 8-bit integer\n"); + err = TestReadRangeRestrictedSigned8BitInteger_394(); + break; + case 395: + ChipLogProgress(chipTool, " ***** Test Step 395 : Write min value to a range-restricted signed 8-bit integer\n"); + err = TestWriteMinValueToARangeRestrictedSigned8BitInteger_395(); + break; + case 396: + ChipLogProgress( + chipTool, " ***** Test Step 396 : Write just-below-range value to a range-restricted signed 8-bit integer\n"); + err = TestWriteJustBelowRangeValueToARangeRestrictedSigned8BitInteger_396(); + break; + case 397: + ChipLogProgress( + chipTool, " ***** Test Step 397 : Write just-above-range value to a range-restricted signed 8-bit integer\n"); + err = TestWriteJustAboveRangeValueToARangeRestrictedSigned8BitInteger_397(); + break; + case 398: + ChipLogProgress(chipTool, " ***** Test Step 398 : Write max value to a range-restricted signed 8-bit integer\n"); + err = TestWriteMaxValueToARangeRestrictedSigned8BitInteger_398(); + break; + case 399: + ChipLogProgress( + chipTool, " ***** Test Step 399 : Verify range-restricted signed 8-bit integer value has not changed\n"); + err = TestVerifyRangeRestrictedSigned8BitIntegerValueHasNotChanged_399(); + break; + case 400: + ChipLogProgress(chipTool, " ***** Test Step 400 : Write min valid value to a range-restricted signed 8-bit integer\n"); + err = TestWriteMinValidValueToARangeRestrictedSigned8BitInteger_400(); + break; + case 401: + ChipLogProgress( + chipTool, " ***** Test Step 401 : Verify range-restricted signed 8-bit integer value is at min valid\n"); + err = TestVerifyRangeRestrictedSigned8BitIntegerValueIsAtMinValid_401(); + break; + case 402: + ChipLogProgress(chipTool, " ***** Test Step 402 : Write max valid value to a range-restricted signed 8-bit integer\n"); + err = TestWriteMaxValidValueToARangeRestrictedSigned8BitInteger_402(); + break; + case 403: + ChipLogProgress( + chipTool, " ***** Test Step 403 : Verify range-restricted signed 8-bit integer value is at max valid\n"); + err = TestVerifyRangeRestrictedSigned8BitIntegerValueIsAtMaxValid_403(); + break; + case 404: + ChipLogProgress( + chipTool, " ***** Test Step 404 : Write middle valid value to a range-restricted signed 8-bit integer\n"); + err = TestWriteMiddleValidValueToARangeRestrictedSigned8BitInteger_404(); + break; + case 405: + ChipLogProgress( + chipTool, " ***** Test Step 405 : Verify range-restricted signed 8-bit integer value is at mid valid\n"); + err = TestVerifyRangeRestrictedSigned8BitIntegerValueIsAtMidValid_405(); + break; + case 406: + ChipLogProgress(chipTool, " ***** Test Step 406 : Read range-restricted signed 16-bit integer\n"); + err = TestReadRangeRestrictedSigned16BitInteger_406(); + break; + case 407: + ChipLogProgress(chipTool, " ***** Test Step 407 : Write min value to a range-restricted signed 16-bit integer\n"); + err = TestWriteMinValueToARangeRestrictedSigned16BitInteger_407(); + break; + case 408: + ChipLogProgress( + chipTool, " ***** Test Step 408 : Write just-below-range value to a range-restricted signed 16-bit integer\n"); + err = TestWriteJustBelowRangeValueToARangeRestrictedSigned16BitInteger_408(); + break; + case 409: + ChipLogProgress( + chipTool, " ***** Test Step 409 : Write just-above-range value to a range-restricted signed 16-bit integer\n"); + err = TestWriteJustAboveRangeValueToARangeRestrictedSigned16BitInteger_409(); + break; + case 410: + ChipLogProgress(chipTool, " ***** Test Step 410 : Write max value to a range-restricted signed 16-bit integer\n"); + err = TestWriteMaxValueToARangeRestrictedSigned16BitInteger_410(); + break; + case 411: + ChipLogProgress( + chipTool, " ***** Test Step 411 : Verify range-restricted signed 16-bit integer value has not changed\n"); + err = TestVerifyRangeRestrictedSigned16BitIntegerValueHasNotChanged_411(); + break; + case 412: + ChipLogProgress(chipTool, " ***** Test Step 412 : Write min valid value to a range-restricted signed 16-bit integer\n"); + err = TestWriteMinValidValueToARangeRestrictedSigned16BitInteger_412(); + break; + case 413: + ChipLogProgress( + chipTool, " ***** Test Step 413 : Verify range-restricted signed 16-bit integer value is at min valid\n"); + err = TestVerifyRangeRestrictedSigned16BitIntegerValueIsAtMinValid_413(); + break; + case 414: + ChipLogProgress(chipTool, " ***** Test Step 414 : Write max valid value to a range-restricted signed 16-bit integer\n"); + err = TestWriteMaxValidValueToARangeRestrictedSigned16BitInteger_414(); + break; + case 415: + ChipLogProgress( + chipTool, " ***** Test Step 415 : Verify range-restricted signed 16-bit integer value is at max valid\n"); + err = TestVerifyRangeRestrictedSigned16BitIntegerValueIsAtMaxValid_415(); + break; + case 416: + ChipLogProgress( + chipTool, " ***** Test Step 416 : Write middle valid value to a range-restricted signed 16-bit integer\n"); + err = TestWriteMiddleValidValueToARangeRestrictedSigned16BitInteger_416(); + break; + case 417: + ChipLogProgress( + chipTool, " ***** Test Step 417 : Verify range-restricted signed 16-bit integer value is at mid valid\n"); + err = TestVerifyRangeRestrictedSigned16BitIntegerValueIsAtMidValid_417(); + break; + case 418: + ChipLogProgress(chipTool, " ***** Test Step 418 : Read nullable range-restricted unsigned 8-bit integer\n"); + err = TestReadNullableRangeRestrictedUnsigned8BitInteger_418(); + break; + case 419: + ChipLogProgress( + chipTool, " ***** Test Step 419 : Write min value to a nullable range-restricted unsigned 8-bit integer\n"); + err = TestWriteMinValueToANullableRangeRestrictedUnsigned8BitInteger_419(); + break; + case 420: + ChipLogProgress(chipTool, + " ***** Test Step 420 : Write just-below-range value to a nullable range-restricted unsigned 8-bit integer\n"); + err = TestWriteJustBelowRangeValueToANullableRangeRestrictedUnsigned8BitInteger_420(); + break; + case 421: + ChipLogProgress(chipTool, + " ***** Test Step 421 : Write just-above-range value to a nullable range-restricted unsigned 8-bit integer\n"); + err = TestWriteJustAboveRangeValueToANullableRangeRestrictedUnsigned8BitInteger_421(); + break; + case 422: + ChipLogProgress( + chipTool, " ***** Test Step 422 : Write max value to a nullable range-restricted unsigned 8-bit integer\n"); + err = TestWriteMaxValueToANullableRangeRestrictedUnsigned8BitInteger_422(); + break; + case 423: + ChipLogProgress( + chipTool, " ***** Test Step 423 : Verify nullable range-restricted unsigned 8-bit integer value has not changed\n"); + err = TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueHasNotChanged_423(); + break; + case 424: + ChipLogProgress( + chipTool, " ***** Test Step 424 : Write min valid value to a nullable range-restricted unsigned 8-bit integer\n"); + err = TestWriteMinValidValueToANullableRangeRestrictedUnsigned8BitInteger_424(); + break; + case 425: + ChipLogProgress( + chipTool, " ***** Test Step 425 : Verify nullable range-restricted unsigned 8-bit integer value is at min valid\n"); + err = TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueIsAtMinValid_425(); + break; + case 426: + ChipLogProgress( + chipTool, " ***** Test Step 426 : Write max valid value to a nullable range-restricted unsigned 8-bit integer\n"); + err = TestWriteMaxValidValueToANullableRangeRestrictedUnsigned8BitInteger_426(); + break; + case 427: + ChipLogProgress( + chipTool, " ***** Test Step 427 : Verify nullable range-restricted unsigned 8-bit integer value is at max valid\n"); + err = TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueIsAtMaxValid_427(); + break; + case 428: + ChipLogProgress(chipTool, + " ***** Test Step 428 : Write middle valid value to a nullable range-restricted unsigned 8-bit integer\n"); + err = TestWriteMiddleValidValueToANullableRangeRestrictedUnsigned8BitInteger_428(); + break; + case 429: + ChipLogProgress( + chipTool, " ***** Test Step 429 : Verify nullable range-restricted unsigned 8-bit integer value is at mid valid\n"); + err = TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueIsAtMidValid_429(); + break; + case 430: + ChipLogProgress( + chipTool, " ***** Test Step 430 : Write null value to a nullable range-restricted unsigned 8-bit integer\n"); + err = TestWriteNullValueToANullableRangeRestrictedUnsigned8BitInteger_430(); + break; + case 431: + ChipLogProgress( + chipTool, " ***** Test Step 431 : Verify nullable range-restricted unsigned 8-bit integer value is null\n"); + err = TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueIsNull_431(); + break; + case 432: + ChipLogProgress(chipTool, " ***** Test Step 432 : Read nullable range-restricted unsigned 16-bit integer\n"); + err = TestReadNullableRangeRestrictedUnsigned16BitInteger_432(); + break; + case 433: + ChipLogProgress( + chipTool, " ***** Test Step 433 : Write min value to a nullable range-restricted unsigned 16-bit integer\n"); + err = TestWriteMinValueToANullableRangeRestrictedUnsigned16BitInteger_433(); + break; + case 434: + ChipLogProgress(chipTool, + " ***** Test Step 434 : Write just-below-range value to a nullable range-restricted unsigned 16-bit integer\n"); + err = TestWriteJustBelowRangeValueToANullableRangeRestrictedUnsigned16BitInteger_434(); + break; + case 435: + ChipLogProgress(chipTool, + " ***** Test Step 435 : Write just-above-range value to a nullable range-restricted unsigned 16-bit integer\n"); + err = TestWriteJustAboveRangeValueToANullableRangeRestrictedUnsigned16BitInteger_435(); + break; + case 436: + ChipLogProgress( + chipTool, " ***** Test Step 436 : Write max value to a nullable range-restricted unsigned 16-bit integer\n"); + err = TestWriteMaxValueToANullableRangeRestrictedUnsigned16BitInteger_436(); + break; + case 437: + ChipLogProgress(chipTool, + " ***** Test Step 437 : Verify nullable range-restricted unsigned 16-bit integer value has not changed\n"); + err = TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueHasNotChanged_437(); + break; + case 438: + ChipLogProgress( + chipTool, " ***** Test Step 438 : Write min valid value to a nullable range-restricted unsigned 16-bit integer\n"); + err = TestWriteMinValidValueToANullableRangeRestrictedUnsigned16BitInteger_438(); + break; + case 439: + ChipLogProgress(chipTool, + " ***** Test Step 439 : Verify nullable range-restricted unsigned 16-bit integer value is at min valid\n"); + err = TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueIsAtMinValid_439(); + break; + case 440: + ChipLogProgress( + chipTool, " ***** Test Step 440 : Write max valid value to a nullable range-restricted unsigned 16-bit integer\n"); + err = TestWriteMaxValidValueToANullableRangeRestrictedUnsigned16BitInteger_440(); + break; + case 441: + ChipLogProgress(chipTool, + " ***** Test Step 441 : Verify nullable range-restricted unsigned 16-bit integer value is at max valid\n"); + err = TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueIsAtMaxValid_441(); + break; + case 442: + ChipLogProgress(chipTool, + " ***** Test Step 442 : Write middle valid value to a nullable range-restricted unsigned 16-bit integer\n"); + err = TestWriteMiddleValidValueToANullableRangeRestrictedUnsigned16BitInteger_442(); + break; + case 443: + ChipLogProgress(chipTool, + " ***** Test Step 443 : Verify nullable range-restricted unsigned 16-bit integer value is at mid valid\n"); + err = TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueIsAtMidValid_443(); + break; + case 444: + ChipLogProgress( + chipTool, " ***** Test Step 444 : Write null value to a nullable range-restricted unsigned 16-bit integer\n"); + err = TestWriteNullValueToANullableRangeRestrictedUnsigned16BitInteger_444(); + break; + case 445: + ChipLogProgress( + chipTool, " ***** Test Step 445 : Verify nullable range-restricted unsigned 16-bit integer value is null\n"); + err = TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueIsNull_445(); + break; + case 446: + ChipLogProgress(chipTool, " ***** Test Step 446 : Read nullable range-restricted signed 8-bit integer\n"); + err = TestReadNullableRangeRestrictedSigned8BitInteger_446(); + break; + case 447: + ChipLogProgress( + chipTool, " ***** Test Step 447 : Write min value to a nullable range-restricted signed 8-bit integer\n"); + err = TestWriteMinValueToANullableRangeRestrictedSigned8BitInteger_447(); + break; + case 448: + ChipLogProgress(chipTool, + " ***** Test Step 448 : Write just-below-range value to a nullable range-restricted signed 8-bit integer\n"); + err = TestWriteJustBelowRangeValueToANullableRangeRestrictedSigned8BitInteger_448(); + break; + case 449: + ChipLogProgress(chipTool, + " ***** Test Step 449 : Write just-above-range value to a nullable range-restricted signed 8-bit integer\n"); + err = TestWriteJustAboveRangeValueToANullableRangeRestrictedSigned8BitInteger_449(); + break; + case 450: + ChipLogProgress( + chipTool, " ***** Test Step 450 : Write max value to a nullable range-restricted signed 8-bit integer\n"); + err = TestWriteMaxValueToANullableRangeRestrictedSigned8BitInteger_450(); + break; + case 451: + ChipLogProgress( + chipTool, " ***** Test Step 451 : Verify nullable range-restricted signed 8-bit integer value has not changed\n"); + err = TestVerifyNullableRangeRestrictedSigned8BitIntegerValueHasNotChanged_451(); + break; + case 452: + ChipLogProgress( + chipTool, " ***** Test Step 452 : Write min valid value to a nullable range-restricted signed 8-bit integer\n"); + err = TestWriteMinValidValueToANullableRangeRestrictedSigned8BitInteger_452(); + break; + case 453: + ChipLogProgress( + chipTool, " ***** Test Step 453 : Verify nullable range-restricted signed 8-bit integer value is at min valid\n"); + err = TestVerifyNullableRangeRestrictedSigned8BitIntegerValueIsAtMinValid_453(); + break; + case 454: + ChipLogProgress( + chipTool, " ***** Test Step 454 : Write max valid value to a nullable range-restricted signed 8-bit integer\n"); + err = TestWriteMaxValidValueToANullableRangeRestrictedSigned8BitInteger_454(); + break; + case 455: + ChipLogProgress( + chipTool, " ***** Test Step 455 : Verify nullable range-restricted signed 8-bit integer value is at max valid\n"); + err = TestVerifyNullableRangeRestrictedSigned8BitIntegerValueIsAtMaxValid_455(); + break; + case 456: + ChipLogProgress( + chipTool, " ***** Test Step 456 : Write middle valid value to a nullable range-restricted signed 8-bit integer\n"); + err = TestWriteMiddleValidValueToANullableRangeRestrictedSigned8BitInteger_456(); + break; + case 457: + ChipLogProgress( + chipTool, " ***** Test Step 457 : Verify nullable range-restricted signed 8-bit integer value is at mid valid\n"); + err = TestVerifyNullableRangeRestrictedSigned8BitIntegerValueIsAtMidValid_457(); + break; + case 458: + ChipLogProgress( + chipTool, " ***** Test Step 458 : Write null value to a nullable range-restricted signed 8-bit integer\n"); + err = TestWriteNullValueToANullableRangeRestrictedSigned8BitInteger_458(); + break; + case 459: + ChipLogProgress( + chipTool, " ***** Test Step 459 : Verify nullable range-restricted signed 8-bit integer value is at null\n"); + err = TestVerifyNullableRangeRestrictedSigned8BitIntegerValueIsAtNull_459(); + break; + case 460: + ChipLogProgress(chipTool, " ***** Test Step 460 : Read nullable range-restricted signed 16-bit integer\n"); + err = TestReadNullableRangeRestrictedSigned16BitInteger_460(); + break; + case 461: + ChipLogProgress( + chipTool, " ***** Test Step 461 : Write min value to a nullable range-restricted signed 16-bit integer\n"); + err = TestWriteMinValueToANullableRangeRestrictedSigned16BitInteger_461(); + break; + case 462: + ChipLogProgress(chipTool, + " ***** Test Step 462 : Write just-below-range value to a nullable range-restricted signed 16-bit integer\n"); + err = TestWriteJustBelowRangeValueToANullableRangeRestrictedSigned16BitInteger_462(); + break; + case 463: + ChipLogProgress(chipTool, + " ***** Test Step 463 : Write just-above-range value to a nullable range-restricted signed 16-bit integer\n"); + err = TestWriteJustAboveRangeValueToANullableRangeRestrictedSigned16BitInteger_463(); + break; + case 464: + ChipLogProgress( + chipTool, " ***** Test Step 464 : Write max value to a nullable range-restricted signed 16-bit integer\n"); + err = TestWriteMaxValueToANullableRangeRestrictedSigned16BitInteger_464(); + break; + case 465: + ChipLogProgress( + chipTool, " ***** Test Step 465 : Verify nullable range-restricted signed 16-bit integer value has not changed\n"); + err = TestVerifyNullableRangeRestrictedSigned16BitIntegerValueHasNotChanged_465(); + break; + case 466: + ChipLogProgress( + chipTool, " ***** Test Step 466 : Write min valid value to a nullable range-restricted signed 16-bit integer\n"); + err = TestWriteMinValidValueToANullableRangeRestrictedSigned16BitInteger_466(); + break; + case 467: + ChipLogProgress( + chipTool, " ***** Test Step 467 : Verify nullable range-restricted signed 16-bit integer value is at min valid\n"); + err = TestVerifyNullableRangeRestrictedSigned16BitIntegerValueIsAtMinValid_467(); + break; + case 468: + ChipLogProgress( + chipTool, " ***** Test Step 468 : Write max valid value to a nullable range-restricted signed 16-bit integer\n"); + err = TestWriteMaxValidValueToANullableRangeRestrictedSigned16BitInteger_468(); + break; + case 469: + ChipLogProgress( + chipTool, " ***** Test Step 469 : Verify nullable range-restricted signed 16-bit integer value is at max valid\n"); + err = TestVerifyNullableRangeRestrictedSigned16BitIntegerValueIsAtMaxValid_469(); + break; + case 470: + ChipLogProgress( + chipTool, " ***** Test Step 470 : Write middle valid value to a nullable range-restricted signed 16-bit integer\n"); + err = TestWriteMiddleValidValueToANullableRangeRestrictedSigned16BitInteger_470(); + break; + case 471: + ChipLogProgress( + chipTool, " ***** Test Step 471 : Verify nullable range-restricted signed 16-bit integer value is at mid valid\n"); + err = TestVerifyNullableRangeRestrictedSigned16BitIntegerValueIsAtMidValid_471(); + break; + case 472: + ChipLogProgress( + chipTool, " ***** Test Step 472 : Write null value to a nullable range-restricted signed 16-bit integer\n"); + err = TestWriteNullValueToANullableRangeRestrictedSigned16BitInteger_472(); + break; + case 473: + ChipLogProgress( + chipTool, " ***** Test Step 473 : Verify nullable range-restricted signed 16-bit integer value is null\n"); + err = TestVerifyNullableRangeRestrictedSigned16BitIntegerValueIsNull_473(); + break; + case 474: + ChipLogProgress(chipTool, " ***** Test Step 474 : Write attribute that returns general status on write\n"); + err = TestWriteAttributeThatReturnsGeneralStatusOnWrite_474(); + break; + case 475: + ChipLogProgress(chipTool, " ***** Test Step 475 : Write attribute that returns cluster-specific status on write\n"); + err = TestWriteAttributeThatReturnsClusterSpecificStatusOnWrite_475(); + break; + case 476: + ChipLogProgress(chipTool, " ***** Test Step 476 : Read attribute that returns general status on read\n"); + err = TestReadAttributeThatReturnsGeneralStatusOnRead_476(); + break; + case 477: + ChipLogProgress(chipTool, " ***** Test Step 477 : read attribute that returns cluster-specific status on read\n"); + err = TestReadAttributeThatReturnsClusterSpecificStatusOnRead_477(); + break; + case 478: + ChipLogProgress(chipTool, " ***** Test Step 478 : read AcceptedCommandList attribute\n"); + err = TestReadAcceptedCommandListAttribute_478(); + break; + case 479: + ChipLogProgress(chipTool, " ***** Test Step 479 : read GeneratedCommandList attribute\n"); + err = TestReadGeneratedCommandListAttribute_479(); + break; + case 480: + ChipLogProgress(chipTool, " ***** Test Step 480 : Write struct-typed attribute\n"); + err = TestWriteStructTypedAttribute_480(); + break; + case 481: + ChipLogProgress(chipTool, " ***** Test Step 481 : Read struct-typed attribute\n"); + err = TestReadStructTypedAttribute_481(); + 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 = 482; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSendTestCommand_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster testWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Send Test Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSendTestNotHandledCommand_2() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster testNotHandledWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Send Test Not Handled Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_INVALID_COMMAND)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSendTestSpecificCommand_3() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster testSpecificWithCompletionHandler:^( + CHIPTestClusterClusterTestSpecificResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send Test Specific Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.returnValue; + VerifyOrReturn(CheckValue("returnValue", actualValue, 7)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSendTestAddArgumentsCommand_4() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPTestClusterClusterTestAddArgumentsParams alloc] init]; + params.arg1 = [NSNumber numberWithUnsignedChar:3]; + params.arg2 = [NSNumber numberWithUnsignedChar:17]; + [cluster testAddArgumentsWithParams:params + completionHandler:^( + CHIPTestClusterClusterTestAddArgumentsResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send Test Add Arguments Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.returnValue; + VerifyOrReturn(CheckValue("returnValue", actualValue, 20)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSendFailingTestAddArgumentsCommand_5() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPTestClusterClusterTestAddArgumentsParams alloc] init]; + params.arg1 = [NSNumber numberWithUnsignedChar:250]; + params.arg2 = [NSNumber numberWithUnsignedChar:6]; + [cluster testAddArgumentsWithParams:params + completionHandler:^( + CHIPTestClusterClusterTestAddArgumentsResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send failing Test Add Arguments Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_INVALID_COMMAND)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeBooleanDefaultValue_6() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BOOLEAN Default Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("boolean", actualValue, 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeBooleanTrue_7() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id booleanArgument; + booleanArgument = [NSNumber numberWithBool:1]; + [cluster writeAttributeBooleanWithValue:booleanArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute BOOLEAN True Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeBooleanTrue_8() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BOOLEAN True Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("boolean", actualValue, 1)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeBooleanFalse_9() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id booleanArgument; + booleanArgument = [NSNumber numberWithBool:0]; + [cluster writeAttributeBooleanWithValue:booleanArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute BOOLEAN False Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeBooleanFalse_10() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BOOLEAN False Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("boolean", actualValue, 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeBitmap8DefaultValue_11() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeBitmap8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BITMAP8 Default Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("bitmap8", actualValue, 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeBitmap8MaxValue_12() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id bitmap8Argument; + bitmap8Argument = [NSNumber numberWithUnsignedChar:255]; + [cluster writeAttributeBitmap8WithValue:bitmap8Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute BITMAP8 Max Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeBitmap8MaxValue_13() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeBitmap8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BITMAP8 Max Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("bitmap8", actualValue, 255)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeBitmap8MinValue_14() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id bitmap8Argument; + bitmap8Argument = [NSNumber numberWithUnsignedChar:0]; + [cluster writeAttributeBitmap8WithValue:bitmap8Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute BITMAP8 Min Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeBitmap8MinValue_15() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeBitmap8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BITMAP8 Min Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("bitmap8", actualValue, 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeBitmap16DefaultValue_16() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeBitmap16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BITMAP16 Default Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("bitmap16", actualValue, 0U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeBitmap16MaxValue_17() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id bitmap16Argument; + bitmap16Argument = [NSNumber numberWithUnsignedShort:65535U]; + [cluster writeAttributeBitmap16WithValue:bitmap16Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute BITMAP16 Max Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeBitmap16MaxValue_18() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeBitmap16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BITMAP16 Max Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("bitmap16", actualValue, 65535U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeBitmap16MinValue_19() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id bitmap16Argument; + bitmap16Argument = [NSNumber numberWithUnsignedShort:0U]; + [cluster writeAttributeBitmap16WithValue:bitmap16Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute BITMAP16 Min Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeBitmap16MinValue_20() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeBitmap16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BITMAP16 Min Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("bitmap16", actualValue, 0U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeBitmap32DefaultValue_21() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeBitmap32WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BITMAP32 Default Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("bitmap32", actualValue, 0UL)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeBitmap32MaxValue_22() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id bitmap32Argument; + bitmap32Argument = [NSNumber numberWithUnsignedInt:4294967295UL]; + [cluster writeAttributeBitmap32WithValue:bitmap32Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute BITMAP32 Max Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeBitmap32MaxValue_23() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeBitmap32WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BITMAP32 Max Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("bitmap32", actualValue, 4294967295UL)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeBitmap32MinValue_24() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id bitmap32Argument; + bitmap32Argument = [NSNumber numberWithUnsignedInt:0UL]; + [cluster writeAttributeBitmap32WithValue:bitmap32Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute BITMAP32 Min Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeBitmap32MinValue_25() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeBitmap32WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BITMAP32 Min Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("bitmap32", actualValue, 0UL)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeBitmap64DefaultValue_26() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeBitmap64WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BITMAP64 Default Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("bitmap64", actualValue, 0ULL)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeBitmap64MaxValue_27() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id bitmap64Argument; + bitmap64Argument = [NSNumber numberWithUnsignedLongLong:18446744073709551615ULL]; + [cluster writeAttributeBitmap64WithValue:bitmap64Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute BITMAP64 Max Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeBitmap64MaxValue_28() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeBitmap64WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BITMAP64 Max Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("bitmap64", actualValue, 18446744073709551615ULL)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeBitmap64MinValue_29() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id bitmap64Argument; + bitmap64Argument = [NSNumber numberWithUnsignedLongLong:0ULL]; + [cluster writeAttributeBitmap64WithValue:bitmap64Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute BITMAP64 Min Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeBitmap64MinValue_30() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeBitmap64WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BITMAP64 Min Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("bitmap64", actualValue, 0ULL)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeInt8uDefaultValue_31() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT8U Default Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("int8u", actualValue, 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeInt8uMaxValue_32() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id int8uArgument; + int8uArgument = [NSNumber numberWithUnsignedChar:255]; + [cluster writeAttributeInt8uWithValue:int8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT8U Max Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeInt8uMaxValue_33() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT8U Max Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("int8u", actualValue, 255)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeInt8uMinValue_34() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id int8uArgument; + int8uArgument = [NSNumber numberWithUnsignedChar:0]; + [cluster writeAttributeInt8uWithValue:int8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT8U Min Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeInt8uMinValue_35() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT8U Min Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("int8u", actualValue, 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeInt16uDefaultValue_36() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT16U Default Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("int16u", actualValue, 0U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeInt16uMaxValue_37() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id int16uArgument; + int16uArgument = [NSNumber numberWithUnsignedShort:65535U]; + [cluster writeAttributeInt16uWithValue:int16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT16U Max Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeInt16uMaxValue_38() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT16U Max Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("int16u", actualValue, 65535U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeInt16uMinValue_39() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id int16uArgument; + int16uArgument = [NSNumber numberWithUnsignedShort:0U]; + [cluster writeAttributeInt16uWithValue:int16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT16U Min Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeInt16uMinValue_40() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT16U Min Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("int16u", actualValue, 0U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeInt32uDefaultValue_41() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT32U Default Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("int32u", actualValue, 0UL)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeInt32uMaxValue_42() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id int32uArgument; + int32uArgument = [NSNumber numberWithUnsignedInt:4294967295UL]; + [cluster writeAttributeInt32uWithValue:int32uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT32U Max Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeInt32uMaxValue_43() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT32U Max Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("int32u", actualValue, 4294967295UL)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeInt32uMinValue_44() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id int32uArgument; + int32uArgument = [NSNumber numberWithUnsignedInt:0UL]; + [cluster writeAttributeInt32uWithValue:int32uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT32U Min Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeInt32uMinValue_45() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT32U Min Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("int32u", actualValue, 0UL)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeInt64uDefaultValue_46() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT64U Default Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("int64u", actualValue, 0ULL)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeInt64uMaxValue_47() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id int64uArgument; + int64uArgument = [NSNumber numberWithUnsignedLongLong:18446744073709551615ULL]; + [cluster writeAttributeInt64uWithValue:int64uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT64U Max Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeInt64uMaxValue_48() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT64U Max Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("int64u", actualValue, 18446744073709551615ULL)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeInt64uMinValue_49() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id int64uArgument; + int64uArgument = [NSNumber numberWithUnsignedLongLong:0ULL]; + [cluster writeAttributeInt64uWithValue:int64uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT64U Min Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeInt64uMinValue_50() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT64U Min Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("int64u", actualValue, 0ULL)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeInt8sDefaultValue_51() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT8S Default Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("int8s", actualValue, 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeInt8sMaxValue_52() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id int8sArgument; + int8sArgument = [NSNumber numberWithChar:127]; + [cluster writeAttributeInt8sWithValue:int8sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT8S Max Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeInt8sMaxValue_53() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT8S Max Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("int8s", actualValue, 127)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeInt8sMinValue_54() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id int8sArgument; + int8sArgument = [NSNumber numberWithChar:-128]; + [cluster writeAttributeInt8sWithValue:int8sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT8S Min Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeInt8sMinValue_55() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT8S Min Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("int8s", actualValue, -128)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeInt8sDefaultValue_56() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id int8sArgument; + int8sArgument = [NSNumber numberWithChar:0]; + [cluster writeAttributeInt8sWithValue:int8sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT8S Default Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeInt8sDefaultValue_57() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT8S Default Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("int8s", actualValue, 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeInt16sDefaultValue_58() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT16S Default Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("int16s", actualValue, 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeInt16sMaxValue_59() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id int16sArgument; + int16sArgument = [NSNumber numberWithShort:32767]; + [cluster writeAttributeInt16sWithValue:int16sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT16S Max Value Error: %@", err); - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; } - chip::System::Clock::Timeout GetWaitDuration() const override + CHIP_ERROR TestReadAttributeInt16sMaxValue_60() { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 482; + [cluster readAttributeInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT16S Max Value Error: %@", err); - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; + VerifyOrReturn(CheckValue("status", err, 0)); - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + id actualValue = value; + VerifyOrReturn(CheckValue("int16s", actualValue, 32767)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeInt16sMinValue_61() { - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id int16sArgument; + int16sArgument = [NSNumber numberWithShort:-32768]; + [cluster writeAttributeInt16sWithValue:int16sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT16S Min Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + return CHIP_NO_ERROR; } - CHIP_ERROR TestSendTestCommand_1() + CHIP_ERROR TestReadAttributeInt16sMinValue_62() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster testWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Send Test Command Error: %@", err); + [cluster readAttributeInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT16S Min Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("int16s", actualValue, -32768)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendTestNotHandledCommand_2() + CHIP_ERROR TestWriteAttributeInt16sDefaultValue_63() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster testNotHandledWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Send Test Not Handled Command Error: %@", err); + id int16sArgument; + int16sArgument = [NSNumber numberWithShort:0]; + [cluster writeAttributeInt16sWithValue:int16sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT16S Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_INVALID_COMMAND)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendTestSpecificCommand_3() + CHIP_ERROR TestReadAttributeInt16sDefaultValue_64() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster testSpecificWithCompletionHandler:^( - CHIPTestClusterClusterTestSpecificResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Send Test Specific Command Error: %@", err); + [cluster readAttributeInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT16S Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { - id actualValue = values.returnValue; - VerifyOrReturn(CheckValue("returnValue", actualValue, 7)); + id actualValue = value; + VerifyOrReturn(CheckValue("int16s", actualValue, 0)); } NextTest(); @@ -49714,68 +57399,62 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestSendTestAddArgumentsCommand_4() + CHIP_ERROR TestReadAttributeInt32sDefaultValue_65() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPTestClusterClusterTestAddArgumentsParams alloc] init]; - params.arg1 = [NSNumber numberWithUnsignedChar:3]; - params.arg2 = [NSNumber numberWithUnsignedChar:17]; - [cluster testAddArgumentsWithParams:params - completionHandler:^( - CHIPTestClusterClusterTestAddArgumentsResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Send Test Add Arguments Command Error: %@", err); + [cluster readAttributeInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT32S Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = values.returnValue; - VerifyOrReturn(CheckValue("returnValue", actualValue, 20)); - } + { + id actualValue = value; + VerifyOrReturn(CheckValue("int32s", actualValue, 0L)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendFailingTestAddArgumentsCommand_5() + CHIP_ERROR TestWriteAttributeInt32sMaxValue_66() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPTestClusterClusterTestAddArgumentsParams alloc] init]; - params.arg1 = [NSNumber numberWithUnsignedChar:250]; - params.arg2 = [NSNumber numberWithUnsignedChar:6]; - [cluster testAddArgumentsWithParams:params - completionHandler:^( - CHIPTestClusterClusterTestAddArgumentsResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Send failing Test Add Arguments Command Error: %@", err); + id int32sArgument; + int32sArgument = [NSNumber numberWithInt:2147483647L]; + [cluster writeAttributeInt32sWithValue:int32sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT32S Max Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_INVALID_COMMAND)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeBooleanDefaultValue_6() + CHIP_ERROR TestReadAttributeInt32sMaxValue_67() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BOOLEAN Default Value Error: %@", err); + [cluster readAttributeInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT32S Max Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("boolean", actualValue, 0)); + VerifyOrReturn(CheckValue("int32s", actualValue, 2147483647L)); } NextTest(); @@ -49784,40 +57463,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeBooleanTrue_7() + CHIP_ERROR TestWriteAttributeInt32sMinValue_68() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id booleanArgument; - booleanArgument = [NSNumber numberWithBool:1]; - [cluster writeAttributeBooleanWithValue:booleanArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute BOOLEAN True Error: %@", err); + id int32sArgument; + int32sArgument = [NSNumber numberWithInt:-2147483648L]; + [cluster writeAttributeInt32sWithValue:int32sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT32S Min Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeBooleanTrue_8() + CHIP_ERROR TestReadAttributeInt32sMinValue_69() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BOOLEAN True Error: %@", err); + [cluster readAttributeInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT32S Min Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("boolean", actualValue, 1)); + VerifyOrReturn(CheckValue("int32s", actualValue, -2147483648L)); } NextTest(); @@ -49826,40 +57505,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeBooleanFalse_9() + CHIP_ERROR TestWriteAttributeInt32sDefaultValue_70() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id booleanArgument; - booleanArgument = [NSNumber numberWithBool:0]; - [cluster writeAttributeBooleanWithValue:booleanArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute BOOLEAN False Error: %@", err); + id int32sArgument; + int32sArgument = [NSNumber numberWithInt:0L]; + [cluster writeAttributeInt32sWithValue:int32sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT32S Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeBooleanFalse_10() + CHIP_ERROR TestReadAttributeInt32sDefaultValue_71() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BOOLEAN False Error: %@", err); + [cluster readAttributeInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT32S Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("boolean", actualValue, 0)); + VerifyOrReturn(CheckValue("int32s", actualValue, 0L)); } NextTest(); @@ -49868,20 +57547,20 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeBitmap8DefaultValue_11() + CHIP_ERROR TestReadAttributeInt64sDefaultValue_72() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBitmap8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP8 Default Value Error: %@", err); + [cluster readAttributeInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT64S Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("bitmap8", actualValue, 0)); + VerifyOrReturn(CheckValue("int64s", actualValue, 0LL)); } NextTest(); @@ -49890,40 +57569,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeBitmap8MaxValue_12() + CHIP_ERROR TestWriteAttributeInt64sMaxValue_73() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id bitmap8Argument; - bitmap8Argument = [NSNumber numberWithUnsignedChar:255]; - [cluster writeAttributeBitmap8WithValue:bitmap8Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute BITMAP8 Max Value Error: %@", err); + id int64sArgument; + int64sArgument = [NSNumber numberWithLongLong:9223372036854775807LL]; + [cluster writeAttributeInt64sWithValue:int64sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT64S Max Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeBitmap8MaxValue_13() + CHIP_ERROR TestReadAttributeInt64sMaxValue_74() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBitmap8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP8 Max Value Error: %@", err); + [cluster readAttributeInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT64S Max Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("bitmap8", actualValue, 255)); + VerifyOrReturn(CheckValue("int64s", actualValue, 9223372036854775807LL)); } NextTest(); @@ -49932,40 +57611,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeBitmap8MinValue_14() + CHIP_ERROR TestWriteAttributeInt64sMinValue_75() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id bitmap8Argument; - bitmap8Argument = [NSNumber numberWithUnsignedChar:0]; - [cluster writeAttributeBitmap8WithValue:bitmap8Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute BITMAP8 Min Value Error: %@", err); + id int64sArgument; + int64sArgument = [NSNumber numberWithLongLong:-9223372036854775807LL]; + [cluster writeAttributeInt64sWithValue:int64sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT64S Min Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeBitmap8MinValue_15() + CHIP_ERROR TestReadAttributeInt64sMinValue_76() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBitmap8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP8 Min Value Error: %@", err); + [cluster readAttributeInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT64S Min Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("bitmap8", actualValue, 0)); + VerifyOrReturn(CheckValue("int64s", actualValue, -9223372036854775807LL)); } NextTest(); @@ -49974,62 +57653,62 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeBitmap16DefaultValue_16() + CHIP_ERROR TestWriteAttributeInt64sDefaultValue_77() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBitmap16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP16 Default Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id int64sArgument; + int64sArgument = [NSNumber numberWithLongLong:0LL]; + [cluster writeAttributeInt64sWithValue:int64sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT64S Default Value Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("bitmap16", actualValue, 0U)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeBitmap16MaxValue_17() + CHIP_ERROR TestReadAttributeInt64sDefaultValue_78() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id bitmap16Argument; - bitmap16Argument = [NSNumber numberWithUnsignedShort:65535U]; - [cluster writeAttributeBitmap16WithValue:bitmap16Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute BITMAP16 Max Value Error: %@", err); + [cluster readAttributeInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT64S Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValue("int64s", actualValue, 0LL)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeBitmap16MaxValue_18() + CHIP_ERROR TestReadAttributeSingleDefaultValue_79() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBitmap16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP16 Max Value Error: %@", err); + [cluster readAttributeFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute SINGLE Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("bitmap16", actualValue, 65535U)); + VerifyOrReturn(CheckValue("float_single", actualValue, 0.0f)); } NextTest(); @@ -50038,40 +57717,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeBitmap16MinValue_19() + CHIP_ERROR TestWriteAttributeSingleMediumValue_80() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id bitmap16Argument; - bitmap16Argument = [NSNumber numberWithUnsignedShort:0U]; - [cluster writeAttributeBitmap16WithValue:bitmap16Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute BITMAP16 Min Value Error: %@", err); + id floatSingleArgument; + floatSingleArgument = [NSNumber numberWithFloat:0.1f]; + [cluster writeAttributeFloatSingleWithValue:floatSingleArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute SINGLE medium Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeBitmap16MinValue_20() + CHIP_ERROR TestReadAttributeSingleMediumValue_81() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBitmap16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP16 Min Value Error: %@", err); + [cluster readAttributeFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute SINGLE medium Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("bitmap16", actualValue, 0U)); + VerifyOrReturn(CheckValue("float_single", actualValue, 0.1f)); } NextTest(); @@ -50080,20 +57759,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeBitmap32DefaultValue_21() + CHIP_ERROR TestWriteAttributeSingleLargeValue_82() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBitmap32WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP32 Default Value Error: %@", err); + id floatSingleArgument; + floatSingleArgument = [NSNumber numberWithFloat:17000000000.0f]; + [cluster writeAttributeFloatSingleWithValue:floatSingleArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute SINGLE large Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeSingleLargeValue_83() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute SINGLE large Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("bitmap32", actualValue, 0UL)); + VerifyOrReturn(CheckValue("float_single", actualValue, 17000000000.0f)); } NextTest(); @@ -50102,40 +57801,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeBitmap32MaxValue_22() + CHIP_ERROR TestWriteAttributeSingleSmallValue_84() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id bitmap32Argument; - bitmap32Argument = [NSNumber numberWithUnsignedInt:4294967295UL]; - [cluster writeAttributeBitmap32WithValue:bitmap32Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute BITMAP32 Max Value Error: %@", err); + id floatSingleArgument; + floatSingleArgument = [NSNumber numberWithFloat:1.7e-10f]; + [cluster writeAttributeFloatSingleWithValue:floatSingleArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute SINGLE small Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeBitmap32MaxValue_23() + CHIP_ERROR TestReadAttributeSingleSmallValue_85() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBitmap32WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP32 Max Value Error: %@", err); + [cluster readAttributeFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute SINGLE small Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("bitmap32", actualValue, 4294967295UL)); + VerifyOrReturn(CheckValue("float_single", actualValue, 1.7e-10f)); } NextTest(); @@ -50144,40 +57843,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeBitmap32MinValue_24() + CHIP_ERROR TestWriteAttributeSingleDefaultValue_86() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id bitmap32Argument; - bitmap32Argument = [NSNumber numberWithUnsignedInt:0UL]; - [cluster writeAttributeBitmap32WithValue:bitmap32Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute BITMAP32 Min Value Error: %@", err); + id floatSingleArgument; + floatSingleArgument = [NSNumber numberWithFloat:0.0f]; + [cluster writeAttributeFloatSingleWithValue:floatSingleArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute SINGLE Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeBitmap32MinValue_25() + CHIP_ERROR TestReadAttributeSingleDefaultValue_87() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBitmap32WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP32 Min Value Error: %@", err); + [cluster readAttributeFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute SINGLE Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("bitmap32", actualValue, 0UL)); + VerifyOrReturn(CheckValue("float_single", actualValue, 0.0f)); } NextTest(); @@ -50186,20 +57885,20 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeBitmap64DefaultValue_26() + CHIP_ERROR TestReadAttributeDoubleDefaultValue_88() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBitmap64WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP64 Default Value Error: %@", err); + [cluster readAttributeFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute DOUBLE Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("bitmap64", actualValue, 0ULL)); + VerifyOrReturn(CheckValue("float_double", actualValue, 0)); } NextTest(); @@ -50208,40 +57907,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeBitmap64MaxValue_27() + CHIP_ERROR TestWriteAttributeDoubleMediumValue_89() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id bitmap64Argument; - bitmap64Argument = [NSNumber numberWithUnsignedLongLong:18446744073709551615ULL]; - [cluster writeAttributeBitmap64WithValue:bitmap64Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute BITMAP64 Max Value Error: %@", err); + id floatDoubleArgument; + floatDoubleArgument = [NSNumber numberWithDouble:0.1234567890123]; + [cluster writeAttributeFloatDoubleWithValue:floatDoubleArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute DOUBLE medium Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeBitmap64MaxValue_28() + CHIP_ERROR TestReadAttributeDoubleMediumValue_90() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBitmap64WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP64 Max Value Error: %@", err); + [cluster readAttributeFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute DOUBLE medium Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("bitmap64", actualValue, 18446744073709551615ULL)); + VerifyOrReturn(CheckValue("float_double", actualValue, 0.1234567890123)); } NextTest(); @@ -50250,62 +57949,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeBitmap64MinValue_29() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id bitmap64Argument; - bitmap64Argument = [NSNumber numberWithUnsignedLongLong:0ULL]; - [cluster writeAttributeBitmap64WithValue:bitmap64Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute BITMAP64 Min Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadAttributeBitmap64MinValue_30() + CHIP_ERROR TestWriteAttributeDoubleLargeValue_91() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBitmap64WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP64 Min Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id floatDoubleArgument; + floatDoubleArgument = [NSNumber numberWithDouble:1.7e+200]; + [cluster writeAttributeFloatDoubleWithValue:floatDoubleArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute DOUBLE large Value Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("bitmap64", actualValue, 0ULL)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt8uDefaultValue_31() + CHIP_ERROR TestReadAttributeDoubleLargeValue_92() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT8U Default Value Error: %@", err); + [cluster readAttributeFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute DOUBLE large Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int8u", actualValue, 0)); + VerifyOrReturn(CheckValue("float_double", actualValue, 1.7e+200)); } NextTest(); @@ -50314,40 +57991,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt8uMaxValue_32() + CHIP_ERROR TestWriteAttributeDoubleSmallValue_93() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int8uArgument; - int8uArgument = [NSNumber numberWithUnsignedChar:255]; - [cluster writeAttributeInt8uWithValue:int8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT8U Max Value Error: %@", err); + id floatDoubleArgument; + floatDoubleArgument = [NSNumber numberWithDouble:1.7e-200]; + [cluster writeAttributeFloatDoubleWithValue:floatDoubleArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute DOUBLE small Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt8uMaxValue_33() + CHIP_ERROR TestReadAttributeDoubleSmallValue_94() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT8U Max Value Error: %@", err); + [cluster readAttributeFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute DOUBLE small Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int8u", actualValue, 255)); + VerifyOrReturn(CheckValue("float_double", actualValue, 1.7e-200)); } NextTest(); @@ -50356,40 +58033,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt8uMinValue_34() + CHIP_ERROR TestWriteAttributeDoubleDefaultValue_95() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int8uArgument; - int8uArgument = [NSNumber numberWithUnsignedChar:0]; - [cluster writeAttributeInt8uWithValue:int8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT8U Min Value Error: %@", err); + id floatDoubleArgument; + floatDoubleArgument = [NSNumber numberWithDouble:0]; + [cluster writeAttributeFloatDoubleWithValue:floatDoubleArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute DOUBLE Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt8uMinValue_35() + CHIP_ERROR TestReadAttributeDoubleDefaultValue_96() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT8U Min Value Error: %@", err); + [cluster readAttributeFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute DOUBLE Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int8u", actualValue, 0)); + VerifyOrReturn(CheckValue("float_double", actualValue, 0)); } NextTest(); @@ -50398,20 +58075,20 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt16uDefaultValue_36() + CHIP_ERROR TestReadAttributeEnum8DefaultValue_97() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT16U Default Value Error: %@", err); + [cluster readAttributeEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute ENUM8 Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int16u", actualValue, 0U)); + VerifyOrReturn(CheckValue("enum8", actualValue, 0)); } NextTest(); @@ -50420,40 +58097,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt16uMaxValue_37() + CHIP_ERROR TestWriteAttributeEnum8MaxValue_98() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int16uArgument; - int16uArgument = [NSNumber numberWithUnsignedShort:65535U]; - [cluster writeAttributeInt16uWithValue:int16uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT16U Max Value Error: %@", err); + id enum8Argument; + enum8Argument = [NSNumber numberWithUnsignedChar:255]; + [cluster writeAttributeEnum8WithValue:enum8Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute ENUM8 Max Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt16uMaxValue_38() + CHIP_ERROR TestReadAttributeEnum8MaxValue_99() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT16U Max Value Error: %@", err); + [cluster readAttributeEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute ENUM8 Max Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int16u", actualValue, 65535U)); + VerifyOrReturn(CheckValue("enum8", actualValue, 255)); } NextTest(); @@ -50462,40 +58139,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt16uMinValue_39() + CHIP_ERROR TestWriteAttributeEnum8MinValue_100() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int16uArgument; - int16uArgument = [NSNumber numberWithUnsignedShort:0U]; - [cluster writeAttributeInt16uWithValue:int16uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT16U Min Value Error: %@", err); + id enum8Argument; + enum8Argument = [NSNumber numberWithUnsignedChar:0]; + [cluster writeAttributeEnum8WithValue:enum8Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute ENUM8 Min Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt16uMinValue_40() + CHIP_ERROR TestReadAttributeEnum8MinValue_101() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT16U Min Value Error: %@", err); + [cluster readAttributeEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute ENUM8 Min Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int16u", actualValue, 0U)); + VerifyOrReturn(CheckValue("enum8", actualValue, 0)); } NextTest(); @@ -50504,20 +58181,20 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt32uDefaultValue_41() + CHIP_ERROR TestReadAttributeEnum16DefaultValue_102() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT32U Default Value Error: %@", err); + [cluster readAttributeEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute ENUM16 Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int32u", actualValue, 0UL)); + VerifyOrReturn(CheckValue("enum16", actualValue, 0U)); } NextTest(); @@ -50526,17 +58203,17 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt32uMaxValue_42() + CHIP_ERROR TestWriteAttributeEnum16MaxValue_103() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int32uArgument; - int32uArgument = [NSNumber numberWithUnsignedInt:4294967295UL]; - [cluster writeAttributeInt32uWithValue:int32uArgument + id enum16Argument; + enum16Argument = [NSNumber numberWithUnsignedShort:65535U]; + [cluster writeAttributeEnum16WithValue:enum16Argument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT32U Max Value Error: %@", err); + NSLog(@"Write attribute ENUM16 Max Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -50546,20 +58223,20 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt32uMaxValue_43() + CHIP_ERROR TestReadAttributeEnum16MaxValue_104() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT32U Max Value Error: %@", err); + [cluster readAttributeEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute ENUM16 Max Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int32u", actualValue, 4294967295UL)); + VerifyOrReturn(CheckValue("enum16", actualValue, 65535U)); } NextTest(); @@ -50568,17 +58245,17 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt32uMinValue_44() + CHIP_ERROR TestWriteAttributeEnum16MinValue_105() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int32uArgument; - int32uArgument = [NSNumber numberWithUnsignedInt:0UL]; - [cluster writeAttributeInt32uWithValue:int32uArgument + id enum16Argument; + enum16Argument = [NSNumber numberWithUnsignedShort:0U]; + [cluster writeAttributeEnum16WithValue:enum16Argument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT32U Min Value Error: %@", err); + NSLog(@"Write attribute ENUM16 Min Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -50588,20 +58265,20 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt32uMinValue_45() + CHIP_ERROR TestReadAttributeEnum16MinValue_106() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT32U Min Value Error: %@", err); + [cluster readAttributeEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute ENUM16 Min Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int32u", actualValue, 0UL)); + VerifyOrReturn(CheckValue("enum16", actualValue, 0U)); } NextTest(); @@ -50610,20 +58287,20 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt64uDefaultValue_46() + CHIP_ERROR TestReadAttributeOctetStringDefaultValue_107() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT64U Default Value Error: %@", err); + [cluster readAttributeOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute OCTET_STRING Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int64u", actualValue, 0ULL)); + VerifyOrReturn(CheckValueAsString("octet_string", actualValue, [[NSData alloc] initWithBytes:"" length:0])); } NextTest(); @@ -50632,40 +58309,41 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt64uMaxValue_47() + CHIP_ERROR TestWriteAttributeOctetStringWithEmbeddedNull_108() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int64uArgument; - int64uArgument = [NSNumber numberWithUnsignedLongLong:18446744073709551615ULL]; - [cluster writeAttributeInt64uWithValue:int64uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT64U Max Value Error: %@", err); + id octetStringArgument; + octetStringArgument = [[NSData alloc] initWithBytes:"Tes\000ti\000ng" length:9]; + [cluster writeAttributeOctetStringWithValue:octetStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute OCTET_STRING with embedded null Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt64uMaxValue_48() + CHIP_ERROR TestReadAttributeOctetStringWithEmbeddedNull_109() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT64U Max Value Error: %@", err); + [cluster readAttributeOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute OCTET_STRING with embedded null Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int64u", actualValue, 18446744073709551615ULL)); + VerifyOrReturn( + CheckValueAsString("octet_string", actualValue, [[NSData alloc] initWithBytes:"Tes\000ti\000ng" length:9])); } NextTest(); @@ -50674,62 +58352,41 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt64uMinValue_49() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id int64uArgument; - int64uArgument = [NSNumber numberWithUnsignedLongLong:0ULL]; - [cluster writeAttributeInt64uWithValue:int64uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT64U Min Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadAttributeInt64uMinValue_50() + CHIP_ERROR TestWriteAttributeOctetStringWithWeirdChars_110() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT64U Min Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id octetStringArgument; + octetStringArgument = [[NSData alloc] initWithBytes:"\015\012\377\042\240" length:5]; + [cluster writeAttributeOctetStringWithValue:octetStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute OCTET_STRING with weird chars Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("int64u", actualValue, 0ULL)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt8sDefaultValue_51() + CHIP_ERROR TestReadAttributeOctetStringWithWeirdChars_111() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT8S Default Value Error: %@", err); + [cluster readAttributeOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute OCTET_STRING with weird chars Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int8s", actualValue, 0)); + VerifyOrReturn(CheckValueAsString( + "octet_string", actualValue, [[NSData alloc] initWithBytes:"\015\012\377\042\240" length:5])); } NextTest(); @@ -50738,40 +58395,41 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt8sMaxValue_52() + CHIP_ERROR TestWriteAttributeOctetString_112() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int8sArgument; - int8sArgument = [NSNumber numberWithChar:127]; - [cluster writeAttributeInt8sWithValue:int8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT8S Max Value Error: %@", err); + id octetStringArgument; + octetStringArgument = [[NSData alloc] initWithBytes:"TestValue" length:9]; + [cluster writeAttributeOctetStringWithValue:octetStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute OCTET_STRING Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt8sMaxValue_53() + CHIP_ERROR TestReadAttributeOctetString_113() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT8S Max Value Error: %@", err); + [cluster readAttributeOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute OCTET_STRING Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int8s", actualValue, 127)); + VerifyOrReturn( + CheckValueAsString("octet_string", actualValue, [[NSData alloc] initWithBytes:"TestValue" length:9])); } NextTest(); @@ -50780,40 +58438,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt8sMinValue_54() + CHIP_ERROR TestWriteAttributeOctetString_114() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int8sArgument; - int8sArgument = [NSNumber numberWithChar:-128]; - [cluster writeAttributeInt8sWithValue:int8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT8S Min Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id octetStringArgument; + octetStringArgument = [[NSData alloc] initWithBytes:"TestValueLongerThan10" length:21]; + [cluster writeAttributeOctetStringWithValue:octetStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute OCTET_STRING Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt8sMinValue_55() + CHIP_ERROR TestReadAttributeOctetString_115() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT8S Min Value Error: %@", err); + [cluster readAttributeOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute OCTET_STRING Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int8s", actualValue, -128)); + VerifyOrReturn( + CheckValueAsString("octet_string", actualValue, [[NSData alloc] initWithBytes:"TestValue" length:9])); } NextTest(); @@ -50822,62 +58480,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt8sDefaultValue_56() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id int8sArgument; - int8sArgument = [NSNumber numberWithChar:0]; - [cluster writeAttributeInt8sWithValue:int8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT8S Default Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadAttributeInt8sDefaultValue_57() + CHIP_ERROR TestWriteAttributeOctetString_116() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT8S Default Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id octetStringArgument; + octetStringArgument = [[NSData alloc] initWithBytes:"" length:0]; + [cluster writeAttributeOctetStringWithValue:octetStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute OCTET_STRING Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("int8s", actualValue, 0)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt16sDefaultValue_58() + CHIP_ERROR TestReadAttributeLongOctetStringDefaultValue_117() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT16S Default Value Error: %@", err); + [cluster readAttributeLongOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute LONG_OCTET_STRING Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int16s", actualValue, 0)); + VerifyOrReturn(CheckValueAsString("long_octet_string", actualValue, [[NSData alloc] initWithBytes:"" length:0])); } NextTest(); @@ -50886,40 +58522,50 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt16sMaxValue_59() + CHIP_ERROR TestWriteAttributeLongOctetString_118() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int16sArgument; - int16sArgument = [NSNumber numberWithShort:32767]; - [cluster writeAttributeInt16sWithValue:int16sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT16S Max Value Error: %@", err); + id longOctetStringArgument; + longOctetStringArgument = [[NSData alloc] + initWithBytes:"11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" + "11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" + "11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" + length:300]; + [cluster writeAttributeLongOctetStringWithValue:longOctetStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute LONG_OCTET_STRING Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt16sMaxValue_60() + CHIP_ERROR TestReadAttributeLongOctetString_119() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT16S Max Value Error: %@", err); + [cluster readAttributeLongOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute LONG_OCTET_STRING Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int16s", actualValue, 32767)); + VerifyOrReturn(CheckValueAsString("long_octet_string", actualValue, + [[NSData alloc] + initWithBytes: + "111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" + "111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" + "111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" + length:300])); } NextTest(); @@ -50928,40 +58574,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt16sMinValue_61() + CHIP_ERROR TestWriteAttributeLongOctetString_120() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int16sArgument; - int16sArgument = [NSNumber numberWithShort:-32768]; - [cluster writeAttributeInt16sWithValue:int16sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT16S Min Value Error: %@", err); + id longOctetStringArgument; + longOctetStringArgument = [[NSData alloc] initWithBytes:"" length:0]; + [cluster writeAttributeLongOctetStringWithValue:longOctetStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute LONG_OCTET_STRING Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt16sMinValue_62() + CHIP_ERROR TestReadAttributeCharStringDefaultValue_121() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT16S Min Value Error: %@", err); + [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute CHAR_STRING Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int16s", actualValue, -32768)); + VerifyOrReturn(CheckValueAsString("char_string", actualValue, @"")); } NextTest(); @@ -50970,40 +58616,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt16sDefaultValue_63() + CHIP_ERROR TestWriteAttributeCharString_122() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int16sArgument; - int16sArgument = [NSNumber numberWithShort:0]; - [cluster writeAttributeInt16sWithValue:int16sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT16S Default Value Error: %@", err); + id charStringArgument; + charStringArgument = @"☉T☉"; + [cluster writeAttributeCharStringWithValue:charStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute CHAR_STRING Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt16sDefaultValue_64() + CHIP_ERROR TestReadAttributeCharString_123() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT16S Default Value Error: %@", err); + [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute CHAR_STRING Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int16s", actualValue, 0)); + VerifyOrReturn(CheckValueAsString("char_string", actualValue, @"☉T☉")); } NextTest(); @@ -51012,20 +58658,39 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt32sDefaultValue_65() + CHIP_ERROR TestWriteAttributeCharStringValueTooLong_124() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT32S Default Value Error: %@", err); + id charStringArgument; + charStringArgument = @"☉TestValueLongerThan10☉"; + [cluster writeAttributeCharStringWithValue:charStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute CHAR_STRING - Value too long Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeCharString_125() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute CHAR_STRING Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int32s", actualValue, 0L)); + VerifyOrReturn(CheckValueAsString("char_string", actualValue, @"☉T☉")); } NextTest(); @@ -51034,40 +58699,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt32sMaxValue_66() + CHIP_ERROR TestWriteAttributeCharStringEmpty_126() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int32sArgument; - int32sArgument = [NSNumber numberWithInt:2147483647L]; - [cluster writeAttributeInt32sWithValue:int32sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT32S Max Value Error: %@", err); + id charStringArgument; + charStringArgument = @""; + [cluster writeAttributeCharStringWithValue:charStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute CHAR_STRING - Empty Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt32sMaxValue_67() + CHIP_ERROR TestReadAttributeLongCharStringDefaultValue_127() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT32S Max Value Error: %@", err); + [cluster readAttributeLongCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute LONG_CHAR_STRING Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int32s", actualValue, 2147483647L)); + VerifyOrReturn(CheckValueAsString("long_char_string", actualValue, @"")); } NextTest(); @@ -51076,40 +58741,46 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt32sMinValue_68() + CHIP_ERROR TestWriteAttributeLongCharString_128() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int32sArgument; - int32sArgument = [NSNumber numberWithInt:-2147483648L]; - [cluster writeAttributeInt32sWithValue:int32sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT32S Min Value Error: %@", err); + id longCharStringArgument; + longCharStringArgument + = @"☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉" + @"☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉" + @"☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉"; + [cluster writeAttributeLongCharStringWithValue:longCharStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute LONG_CHAR_STRING Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt32sMinValue_69() + CHIP_ERROR TestReadAttributeLongCharString_129() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT32S Min Value Error: %@", err); + [cluster readAttributeLongCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute LONG_CHAR_STRING Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int32s", actualValue, -2147483648L)); + VerifyOrReturn(CheckValueAsString("long_char_string", actualValue, + @"☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉" + @"☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉" + @"☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉")); } NextTest(); @@ -51118,40 +58789,76 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt32sDefaultValue_70() + CHIP_ERROR TestWriteAttributeLongCharString_130() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id int32sArgument; - int32sArgument = [NSNumber numberWithInt:0L]; - [cluster writeAttributeInt32sWithValue:int32sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT32S Default Value Error: %@", err); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - VerifyOrReturn(CheckValue("status", err, 0)); + id longCharStringArgument; + longCharStringArgument = @""; + [cluster writeAttributeLongCharStringWithValue:longCharStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute LONG_CHAR_STRING Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt32sDefaultValue_71() + CHIP_ERROR TestReadAttributeListLongOctetStringForChunkedRead_131() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT32S Default Value Error: %@", err); + [cluster readAttributeListLongOctetStringWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute LIST_LONG_OCTET_STRING (for chunked read) Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int32s", actualValue, 0L)); + VerifyOrReturn(CheckValue("list_long_octet_string", [actualValue count], static_cast(4))); + VerifyOrReturn(CheckValueAsString("", actualValue[0], + [[NSData alloc] + initWithBytes:"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" + "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" + "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123" + "456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" + "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" + "cdef0123456789abcdef0123456789abcdef0123456789abcdef" + length:512])); + VerifyOrReturn(CheckValueAsString("", actualValue[1], + [[NSData alloc] + initWithBytes:"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" + "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" + "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123" + "456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" + "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" + "cdef0123456789abcdef0123456789abcdef0123456789abcdef" + length:512])); + VerifyOrReturn(CheckValueAsString("", actualValue[2], + [[NSData alloc] + initWithBytes:"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" + "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" + "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123" + "456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" + "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" + "cdef0123456789abcdef0123456789abcdef0123456789abcdef" + length:512])); + VerifyOrReturn(CheckValueAsString("", actualValue[3], + [[NSData alloc] + initWithBytes:"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" + "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" + "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123" + "456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" + "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" + "cdef0123456789abcdef0123456789abcdef0123456789abcdef" + length:512])); } NextTest(); @@ -51160,62 +58867,150 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt64sDefaultValue_72() + CHIP_ERROR TestWriteAttributeListLongOctetStringForChunkedWrite_132() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT64S Default Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id listLongOctetStringArgument; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [[NSData alloc] + initWithBytes: + "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd" + "ef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" + "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789" + "abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" + "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" + length:512]; + temp_0[1] = [[NSData alloc] + initWithBytes: + "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd" + "ef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" + "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789" + "abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" + "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" + length:512]; + temp_0[2] = [[NSData alloc] + initWithBytes: + "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd" + "ef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" + "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789" + "abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" + "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" + length:512]; + temp_0[3] = [[NSData alloc] + initWithBytes: + "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd" + "ef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" + "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789" + "abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" + "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" + length:512]; + temp_0[4] = [[NSData alloc] + initWithBytes: + "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd" + "ef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" + "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789" + "abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" + "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" + length:512]; + listLongOctetStringArgument = temp_0; + } + [cluster writeAttributeListLongOctetStringWithValue:listLongOctetStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute LIST_LONG_OCTET_STRING (for chunked write) Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("int64s", actualValue, 0LL)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt64sMaxValue_73() + CHIP_ERROR TestReadAttributeListLongOctetStringForChunkedRead_133() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int64sArgument; - int64sArgument = [NSNumber numberWithLongLong:9223372036854775807LL]; - [cluster writeAttributeInt64sWithValue:int64sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT64S Max Value Error: %@", err); + [cluster readAttributeListLongOctetStringWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute LIST_LONG_OCTET_STRING (for chunked read) Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValue("list_long_octet_string", [actualValue count], static_cast(5))); + VerifyOrReturn(CheckValueAsString("", actualValue[0], + [[NSData alloc] + initWithBytes:"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" + "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" + "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123" + "456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" + "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" + "cdef0123456789abcdef0123456789abcdef0123456789abcdef" + length:512])); + VerifyOrReturn(CheckValueAsString("", actualValue[1], + [[NSData alloc] + initWithBytes:"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" + "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" + "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123" + "456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" + "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" + "cdef0123456789abcdef0123456789abcdef0123456789abcdef" + length:512])); + VerifyOrReturn(CheckValueAsString("", actualValue[2], + [[NSData alloc] + initWithBytes:"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" + "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" + "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123" + "456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" + "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" + "cdef0123456789abcdef0123456789abcdef0123456789abcdef" + length:512])); + VerifyOrReturn(CheckValueAsString("", actualValue[3], + [[NSData alloc] + initWithBytes:"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" + "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" + "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123" + "456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" + "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" + "cdef0123456789abcdef0123456789abcdef0123456789abcdef" + length:512])); + VerifyOrReturn(CheckValueAsString("", actualValue[4], + [[NSData alloc] + initWithBytes:"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" + "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" + "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123" + "456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" + "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" + "cdef0123456789abcdef0123456789abcdef0123456789abcdef" + length:512])); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt64sMaxValue_74() + CHIP_ERROR TestReadAttributeEpochUsDefaultValue_134() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT64S Max Value Error: %@", err); + [cluster readAttributeEpochUsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute EPOCH_US Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int64s", actualValue, 9223372036854775807LL)); + VerifyOrReturn(CheckValue("epoch_us", actualValue, 0ULL)); } NextTest(); @@ -51224,40 +59019,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt64sMinValue_75() + CHIP_ERROR TestWriteAttributeEpochUsMaxValue_135() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int64sArgument; - int64sArgument = [NSNumber numberWithLongLong:-9223372036854775807LL]; - [cluster writeAttributeInt64sWithValue:int64sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT64S Min Value Error: %@", err); + id epochUsArgument; + epochUsArgument = [NSNumber numberWithUnsignedLongLong:18446744073709551615ULL]; + [cluster writeAttributeEpochUsWithValue:epochUsArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute EPOCH_US Max Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt64sMinValue_76() + CHIP_ERROR TestReadAttributeEpochUsMaxValue_136() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT64S Min Value Error: %@", err); + [cluster readAttributeEpochUsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute EPOCH_US Max Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int64s", actualValue, -9223372036854775807LL)); + VerifyOrReturn(CheckValue("epoch_us", actualValue, 18446744073709551615ULL)); } NextTest(); @@ -51266,40 +59061,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt64sDefaultValue_77() + CHIP_ERROR TestWriteAttributeEpochUsMinValue_137() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int64sArgument; - int64sArgument = [NSNumber numberWithLongLong:0LL]; - [cluster writeAttributeInt64sWithValue:int64sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT64S Default Value Error: %@", err); + id epochUsArgument; + epochUsArgument = [NSNumber numberWithUnsignedLongLong:0ULL]; + [cluster writeAttributeEpochUsWithValue:epochUsArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute EPOCH_US Min Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt64sDefaultValue_78() + CHIP_ERROR TestReadAttributeEpochUsMinValue_138() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT64S Default Value Error: %@", err); + [cluster readAttributeEpochUsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute EPOCH_US Min Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int64s", actualValue, 0LL)); + VerifyOrReturn(CheckValue("epoch_us", actualValue, 0ULL)); } NextTest(); @@ -51308,20 +59103,20 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeSingleDefaultValue_79() + CHIP_ERROR TestReadAttributeEpochSDefaultValue_139() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute SINGLE Default Value Error: %@", err); + [cluster readAttributeEpochSWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute EPOCH_S Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("float_single", actualValue, 0.0f)); + VerifyOrReturn(CheckValue("epoch_s", actualValue, 0UL)); } NextTest(); @@ -51330,40 +59125,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeSingleMediumValue_80() + CHIP_ERROR TestWriteAttributeEpochSMaxValue_140() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id floatSingleArgument; - floatSingleArgument = [NSNumber numberWithFloat:0.1f]; - [cluster writeAttributeFloatSingleWithValue:floatSingleArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute SINGLE medium Value Error: %@", err); + id epochSArgument; + epochSArgument = [NSNumber numberWithUnsignedInt:4294967295UL]; + [cluster writeAttributeEpochSWithValue:epochSArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute EPOCH_S Max Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeSingleMediumValue_81() + CHIP_ERROR TestReadAttributeEpochSMaxValue_141() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute SINGLE medium Value Error: %@", err); + [cluster readAttributeEpochSWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute EPOCH_S Max Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("float_single", actualValue, 0.1f)); + VerifyOrReturn(CheckValue("epoch_s", actualValue, 4294967295UL)); } NextTest(); @@ -51372,40 +59167,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeSingleLargeValue_82() + CHIP_ERROR TestWriteAttributeEpochSMinValue_142() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id floatSingleArgument; - floatSingleArgument = [NSNumber numberWithFloat:17000000000.0f]; - [cluster writeAttributeFloatSingleWithValue:floatSingleArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute SINGLE large Value Error: %@", err); + id epochSArgument; + epochSArgument = [NSNumber numberWithUnsignedInt:0UL]; + [cluster writeAttributeEpochSWithValue:epochSArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute EPOCH_S Min Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeSingleLargeValue_83() + CHIP_ERROR TestReadAttributeEpochSMinValue_143() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute SINGLE large Value Error: %@", err); + [cluster readAttributeEpochSWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute EPOCH_S Min Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("float_single", actualValue, 17000000000.0f)); + VerifyOrReturn(CheckValue("epoch_s", actualValue, 0UL)); } NextTest(); @@ -51414,40 +59209,25 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeSingleSmallValue_84() + CHIP_ERROR TestReadAttributeUnsupported_144() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id floatSingleArgument; - floatSingleArgument = [NSNumber numberWithFloat:1.7e-10f]; - [cluster writeAttributeFloatSingleWithValue:floatSingleArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute SINGLE small Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadAttributeSingleSmallValue_85() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + [cluster readAttributeUnsupportedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute UNSUPPORTED Error: %@", err); - [cluster readAttributeFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute SINGLE small Value Error: %@", err); + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("float_single", actualValue, 1.7e-10f)); + VerifyOrReturn(CheckValue("unsupported", actualValue, 0)); } NextTest(); @@ -51456,17 +59236,22 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeSingleDefaultValue_86() + CHIP_ERROR TestWriteattributeUnsupported_145() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id floatSingleArgument; - floatSingleArgument = [NSNumber numberWithFloat:0.0f]; - [cluster writeAttributeFloatSingleWithValue:floatSingleArgument + id unsupportedArgument; + unsupportedArgument = [NSNumber numberWithBool:0]; + [cluster writeAttributeUnsupportedWithValue:unsupportedArgument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute SINGLE Default Value Error: %@", err); + NSLog(@"Writeattribute UNSUPPORTED Error: %@", err); + + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } VerifyOrReturn(CheckValue("status", err, 0)); @@ -51476,42 +59261,52 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeSingleDefaultValue_87() + CHIP_ERROR TestSendTestCommandToUnsupportedEndpoint_146() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:200 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute SINGLE Default Value Error: %@", err); + [cluster testWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Send Test Command to unsupported endpoint Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_ENDPOINT)); + NextTest(); + }]; - { - id actualValue = value; - VerifyOrReturn(CheckValue("float_single", actualValue, 0.0f)); - } + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSendTestCommandToUnsupportedCluster_147() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + [cluster testWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Send Test Command to unsupported cluster Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_CLUSTER)); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeDoubleDefaultValue_88() + CHIP_ERROR TestReadAttributeVendorIdDefaultValue_148() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute DOUBLE Default Value Error: %@", err); + [cluster readAttributeVendorIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute vendor_id Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("float_double", actualValue, 0)); + VerifyOrReturn(CheckValue("vendor_id", actualValue, 0U)); } NextTest(); @@ -51520,40 +59315,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeDoubleMediumValue_89() + CHIP_ERROR TestWriteAttributeVendorId_149() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id floatDoubleArgument; - floatDoubleArgument = [NSNumber numberWithDouble:0.1234567890123]; - [cluster writeAttributeFloatDoubleWithValue:floatDoubleArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute DOUBLE medium Value Error: %@", err); + id vendorIdArgument; + vendorIdArgument = [NSNumber numberWithUnsignedShort:17U]; + [cluster writeAttributeVendorIdWithValue:vendorIdArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute vendor_id Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeDoubleMediumValue_90() + CHIP_ERROR TestReadAttributeVendorId_150() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute DOUBLE medium Value Error: %@", err); + [cluster readAttributeVendorIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute vendor_id Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("float_double", actualValue, 0.1234567890123)); + VerifyOrReturn(CheckValue("vendor_id", actualValue, 17U)); } NextTest(); @@ -51562,487 +59357,948 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeDoubleLargeValue_91() + CHIP_ERROR TestRestoreAttributeVendorId_151() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id floatDoubleArgument; - floatDoubleArgument = [NSNumber numberWithDouble:1.7e+200]; - [cluster writeAttributeFloatDoubleWithValue:floatDoubleArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute DOUBLE large Value Error: %@", err); + id vendorIdArgument; + vendorIdArgument = [NSNumber numberWithUnsignedShort:0U]; + [cluster writeAttributeVendorIdWithValue:vendorIdArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Restore attribute vendor_id Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeDoubleLargeValue_92() + CHIP_ERROR TestSendACommandWithAVendorIdAndEnum_152() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute DOUBLE large Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("float_double", actualValue, 1.7e+200)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } + __auto_type * params = [[CHIPTestClusterClusterTestEnumsRequestParams alloc] init]; + params.arg1 = [NSNumber numberWithUnsignedShort:20003U]; + params.arg2 = [NSNumber numberWithUnsignedChar:101]; + [cluster testEnumsRequestWithParams:params + completionHandler:^( + CHIPTestClusterClusterTestEnumsResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send a command with a vendor_id and enum Error: %@", err); - CHIP_ERROR TestWriteAttributeDoubleSmallValue_93() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(CheckValue("status", err, 0)); - id floatDoubleArgument; - floatDoubleArgument = [NSNumber numberWithDouble:1.7e-200]; - [cluster writeAttributeFloatDoubleWithValue:floatDoubleArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute DOUBLE small Value Error: %@", err); + { + id actualValue = values.arg1; + VerifyOrReturn(CheckValue("arg1", actualValue, 20003U)); + } - VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = values.arg2; + VerifyOrReturn(CheckValue("arg2", actualValue, 101)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeDoubleSmallValue_94() + CHIP_ERROR TestSendTestCommandWithStructArgumentAndArg1bIsTrue_153() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute DOUBLE small Value Error: %@", err); + __auto_type * params = [[CHIPTestClusterClusterTestStructArgumentRequestParams alloc] init]; + params.arg1 = [[CHIPTestClusterClusterSimpleStruct alloc] init]; + ((CHIPTestClusterClusterSimpleStruct *) params.arg1).a = [NSNumber numberWithUnsignedChar:0]; + ((CHIPTestClusterClusterSimpleStruct *) params.arg1).b = [NSNumber numberWithBool:true]; + ((CHIPTestClusterClusterSimpleStruct *) params.arg1).c = [NSNumber numberWithUnsignedChar:2]; + ((CHIPTestClusterClusterSimpleStruct *) params.arg1).d = [[NSData alloc] initWithBytes:"octet_string" length:12]; + ((CHIPTestClusterClusterSimpleStruct *) params.arg1).e = @"char_string"; + ((CHIPTestClusterClusterSimpleStruct *) params.arg1).f = [NSNumber numberWithUnsignedChar:1]; + ((CHIPTestClusterClusterSimpleStruct *) params.arg1).g = [NSNumber numberWithFloat:0.0f]; + ((CHIPTestClusterClusterSimpleStruct *) params.arg1).h = [NSNumber numberWithDouble:0]; - VerifyOrReturn(CheckValue("status", err, 0)); + [cluster testStructArgumentRequestWithParams:params + completionHandler:^( + CHIPTestClusterClusterBooleanResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send Test Command With Struct Argument and arg1.b is true Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("float_double", actualValue, 1.7e-200)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = values.value; + VerifyOrReturn(CheckValue("value", actualValue, true)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeDoubleDefaultValue_95() + CHIP_ERROR TestSendTestCommandWithStructArgumentAndArg1bIsFalse_154() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id floatDoubleArgument; - floatDoubleArgument = [NSNumber numberWithDouble:0]; - [cluster writeAttributeFloatDoubleWithValue:floatDoubleArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute DOUBLE Default Value Error: %@", err); + __auto_type * params = [[CHIPTestClusterClusterTestStructArgumentRequestParams alloc] init]; + params.arg1 = [[CHIPTestClusterClusterSimpleStruct alloc] init]; + ((CHIPTestClusterClusterSimpleStruct *) params.arg1).a = [NSNumber numberWithUnsignedChar:0]; + ((CHIPTestClusterClusterSimpleStruct *) params.arg1).b = [NSNumber numberWithBool:false]; + ((CHIPTestClusterClusterSimpleStruct *) params.arg1).c = [NSNumber numberWithUnsignedChar:2]; + ((CHIPTestClusterClusterSimpleStruct *) params.arg1).d = [[NSData alloc] initWithBytes:"octet_string" length:12]; + ((CHIPTestClusterClusterSimpleStruct *) params.arg1).e = @"char_string"; + ((CHIPTestClusterClusterSimpleStruct *) params.arg1).f = [NSNumber numberWithUnsignedChar:1]; + ((CHIPTestClusterClusterSimpleStruct *) params.arg1).g = [NSNumber numberWithFloat:0.0f]; + ((CHIPTestClusterClusterSimpleStruct *) params.arg1).h = [NSNumber numberWithDouble:0]; - VerifyOrReturn(CheckValue("status", err, 0)); + [cluster testStructArgumentRequestWithParams:params + completionHandler:^( + CHIPTestClusterClusterBooleanResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send Test Command With Struct Argument and arg1.b is false Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.value; + VerifyOrReturn(CheckValue("value", actualValue, false)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeDoubleDefaultValue_96() + CHIP_ERROR TestSendTestCommandWithNestedStructArgumentAndArg1cbIsTrue_155() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute DOUBLE Default Value Error: %@", err); + __auto_type * params = [[CHIPTestClusterClusterTestNestedStructArgumentRequestParams alloc] init]; + params.arg1 = [[CHIPTestClusterClusterNestedStruct alloc] init]; + ((CHIPTestClusterClusterNestedStruct *) params.arg1).a = [NSNumber numberWithUnsignedChar:0]; + ((CHIPTestClusterClusterNestedStruct *) params.arg1).b = [NSNumber numberWithBool:true]; + ((CHIPTestClusterClusterNestedStruct *) params.arg1).c = [[CHIPTestClusterClusterSimpleStruct alloc] init]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).a = + [NSNumber numberWithUnsignedChar:0]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).b = + [NSNumber numberWithBool:true]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).c = + [NSNumber numberWithUnsignedChar:2]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).d = + [[NSData alloc] initWithBytes:"octet_string" length:12]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).e = @"char_string"; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).f = + [NSNumber numberWithUnsignedChar:1]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).g = + [NSNumber numberWithFloat:0.0f]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).h = + [NSNumber numberWithDouble:0]; - VerifyOrReturn(CheckValue("status", err, 0)); + [cluster + testNestedStructArgumentRequestWithParams:params + completionHandler:^( + CHIPTestClusterClusterBooleanResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send Test Command With Nested Struct Argument and arg1.c.b is true Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("float_double", actualValue, 0)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = values.value; + VerifyOrReturn(CheckValue("value", actualValue, true)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeEnum8DefaultValue_97() + CHIP_ERROR TestSendTestCommandWithNestedStructArgumentArg1cbIsFalse_156() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute ENUM8 Default Value Error: %@", err); + __auto_type * params = [[CHIPTestClusterClusterTestNestedStructArgumentRequestParams alloc] init]; + params.arg1 = [[CHIPTestClusterClusterNestedStruct alloc] init]; + ((CHIPTestClusterClusterNestedStruct *) params.arg1).a = [NSNumber numberWithUnsignedChar:0]; + ((CHIPTestClusterClusterNestedStruct *) params.arg1).b = [NSNumber numberWithBool:true]; + ((CHIPTestClusterClusterNestedStruct *) params.arg1).c = [[CHIPTestClusterClusterSimpleStruct alloc] init]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).a = + [NSNumber numberWithUnsignedChar:0]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).b = + [NSNumber numberWithBool:false]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).c = + [NSNumber numberWithUnsignedChar:2]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).d = + [[NSData alloc] initWithBytes:"octet_string" length:12]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).e = @"char_string"; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).f = + [NSNumber numberWithUnsignedChar:1]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).g = + [NSNumber numberWithFloat:0.0f]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).h = + [NSNumber numberWithDouble:0]; - VerifyOrReturn(CheckValue("status", err, 0)); + [cluster + testNestedStructArgumentRequestWithParams:params + completionHandler:^( + CHIPTestClusterClusterBooleanResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send Test Command With Nested Struct Argument arg1.c.b is false Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("enum8", actualValue, 0)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = values.value; + VerifyOrReturn(CheckValue("value", actualValue, false)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeEnum8MaxValue_98() + CHIP_ERROR TestSendTestCommandWithNestedStructListArgumentAndAllFieldsBOfArg1dAreTrue_157() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id enum8Argument; - enum8Argument = [NSNumber numberWithUnsignedChar:255]; - [cluster writeAttributeEnum8WithValue:enum8Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute ENUM8 Max Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + __auto_type * params = [[CHIPTestClusterClusterTestNestedStructListArgumentRequestParams alloc] init]; + params.arg1 = [[CHIPTestClusterClusterNestedStructList alloc] init]; + ((CHIPTestClusterClusterNestedStructList *) params.arg1).a = [NSNumber numberWithUnsignedChar:0]; + ((CHIPTestClusterClusterNestedStructList *) params.arg1).b = [NSNumber numberWithBool:true]; + ((CHIPTestClusterClusterNestedStructList *) params.arg1).c = [[CHIPTestClusterClusterSimpleStruct alloc] init]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).a = + [NSNumber numberWithUnsignedChar:0]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).b = + [NSNumber numberWithBool:true]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).c = + [NSNumber numberWithUnsignedChar:2]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).d = + [[NSData alloc] initWithBytes:"octet_string" length:12]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).e = @"char_string"; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).f = + [NSNumber numberWithUnsignedChar:1]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).g = + [NSNumber numberWithFloat:0.0f]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).h = + [NSNumber numberWithDouble:0]; - NextTest(); - }]; + { + NSMutableArray * temp_1 = [[NSMutableArray alloc] init]; + temp_1[0] = [[CHIPTestClusterClusterSimpleStruct alloc] init]; + ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).a = [NSNumber numberWithUnsignedChar:1]; + ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).b = [NSNumber numberWithBool:true]; + ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).c = [NSNumber numberWithUnsignedChar:3]; + ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).d = [[NSData alloc] initWithBytes:"nested_octet_string" length:19]; + ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).e = @"nested_char_string"; + ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).f = [NSNumber numberWithUnsignedChar:1]; + ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).g = [NSNumber numberWithFloat:0.0f]; + ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).h = [NSNumber numberWithDouble:0]; - return CHIP_NO_ERROR; - } + temp_1[1] = [[CHIPTestClusterClusterSimpleStruct alloc] init]; + ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).a = [NSNumber numberWithUnsignedChar:2]; + ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).b = [NSNumber numberWithBool:true]; + ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).c = [NSNumber numberWithUnsignedChar:3]; + ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).d = [[NSData alloc] initWithBytes:"nested_octet_string" length:19]; + ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).e = @"nested_char_string"; + ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).f = [NSNumber numberWithUnsignedChar:1]; + ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).g = [NSNumber numberWithFloat:0.0f]; + ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).h = [NSNumber numberWithDouble:0]; - CHIP_ERROR TestReadAttributeEnum8MaxValue_99() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + ((CHIPTestClusterClusterNestedStructList *) params.arg1).d = temp_1; + } + { + NSMutableArray * temp_1 = [[NSMutableArray alloc] init]; + temp_1[0] = [NSNumber numberWithUnsignedInt:1UL]; + temp_1[1] = [NSNumber numberWithUnsignedInt:2UL]; + temp_1[2] = [NSNumber numberWithUnsignedInt:3UL]; + ((CHIPTestClusterClusterNestedStructList *) params.arg1).e = temp_1; + } + { + NSMutableArray * temp_1 = [[NSMutableArray alloc] init]; + temp_1[0] = [[NSData alloc] initWithBytes:"octet_string_1" length:14]; + temp_1[1] = [[NSData alloc] initWithBytes:"octect_string_2" length:15]; + temp_1[2] = [[NSData alloc] initWithBytes:"octet_string_3" length:14]; + ((CHIPTestClusterClusterNestedStructList *) params.arg1).f = temp_1; + } + { + NSMutableArray * temp_1 = [[NSMutableArray alloc] init]; + temp_1[0] = [NSNumber numberWithUnsignedChar:0]; + temp_1[1] = [NSNumber numberWithUnsignedChar:255]; + ((CHIPTestClusterClusterNestedStructList *) params.arg1).g = temp_1; + } - [cluster readAttributeEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute ENUM8 Max Value Error: %@", err); + [cluster testNestedStructListArgumentRequestWithParams:params + completionHandler:^(CHIPTestClusterClusterBooleanResponseParams * _Nullable values, + NSError * _Nullable err) { + NSLog(@"Send Test Command With Nested Struct List Argument and all fields b of " + @"arg1.d are true Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("enum8", actualValue, 255)); - } + { + id actualValue = values.value; + VerifyOrReturn(CheckValue("value", actualValue, true)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeEnum8MinValue_100() + CHIP_ERROR TestSendTestCommandWithNestedStructListArgumentAndSomeFieldsBOfArg1dAreFalse_158() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id enum8Argument; - enum8Argument = [NSNumber numberWithUnsignedChar:0]; - [cluster writeAttributeEnum8WithValue:enum8Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute ENUM8 Min Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + __auto_type * params = [[CHIPTestClusterClusterTestNestedStructListArgumentRequestParams alloc] init]; + params.arg1 = [[CHIPTestClusterClusterNestedStructList alloc] init]; + ((CHIPTestClusterClusterNestedStructList *) params.arg1).a = [NSNumber numberWithUnsignedChar:0]; + ((CHIPTestClusterClusterNestedStructList *) params.arg1).b = [NSNumber numberWithBool:true]; + ((CHIPTestClusterClusterNestedStructList *) params.arg1).c = [[CHIPTestClusterClusterSimpleStruct alloc] init]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).a = + [NSNumber numberWithUnsignedChar:0]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).b = + [NSNumber numberWithBool:true]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).c = + [NSNumber numberWithUnsignedChar:2]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).d = + [[NSData alloc] initWithBytes:"octet_string" length:12]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).e = @"char_string"; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).f = + [NSNumber numberWithUnsignedChar:1]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).g = + [NSNumber numberWithFloat:0.0f]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).h = + [NSNumber numberWithDouble:0]; - NextTest(); - }]; + { + NSMutableArray * temp_1 = [[NSMutableArray alloc] init]; + temp_1[0] = [[CHIPTestClusterClusterSimpleStruct alloc] init]; + ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).a = [NSNumber numberWithUnsignedChar:1]; + ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).b = [NSNumber numberWithBool:true]; + ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).c = [NSNumber numberWithUnsignedChar:3]; + ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).d = [[NSData alloc] initWithBytes:"nested_octet_string" length:19]; + ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).e = @"nested_char_string"; + ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).f = [NSNumber numberWithUnsignedChar:1]; + ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).g = [NSNumber numberWithFloat:0.0f]; + ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).h = [NSNumber numberWithDouble:0]; - return CHIP_NO_ERROR; - } + temp_1[1] = [[CHIPTestClusterClusterSimpleStruct alloc] init]; + ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).a = [NSNumber numberWithUnsignedChar:2]; + ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).b = [NSNumber numberWithBool:false]; + ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).c = [NSNumber numberWithUnsignedChar:3]; + ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).d = [[NSData alloc] initWithBytes:"nested_octet_string" length:19]; + ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).e = @"nested_char_string"; + ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).f = [NSNumber numberWithUnsignedChar:1]; + ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).g = [NSNumber numberWithFloat:0.0f]; + ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).h = [NSNumber numberWithDouble:0]; - CHIP_ERROR TestReadAttributeEnum8MinValue_101() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + ((CHIPTestClusterClusterNestedStructList *) params.arg1).d = temp_1; + } + { + NSMutableArray * temp_1 = [[NSMutableArray alloc] init]; + temp_1[0] = [NSNumber numberWithUnsignedInt:1UL]; + temp_1[1] = [NSNumber numberWithUnsignedInt:2UL]; + temp_1[2] = [NSNumber numberWithUnsignedInt:3UL]; + ((CHIPTestClusterClusterNestedStructList *) params.arg1).e = temp_1; + } + { + NSMutableArray * temp_1 = [[NSMutableArray alloc] init]; + temp_1[0] = [[NSData alloc] initWithBytes:"octet_string_1" length:14]; + temp_1[1] = [[NSData alloc] initWithBytes:"octect_string_2" length:15]; + temp_1[2] = [[NSData alloc] initWithBytes:"octet_string_3" length:14]; + ((CHIPTestClusterClusterNestedStructList *) params.arg1).f = temp_1; + } + { + NSMutableArray * temp_1 = [[NSMutableArray alloc] init]; + temp_1[0] = [NSNumber numberWithUnsignedChar:0]; + temp_1[1] = [NSNumber numberWithUnsignedChar:255]; + ((CHIPTestClusterClusterNestedStructList *) params.arg1).g = temp_1; + } - [cluster readAttributeEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute ENUM8 Min Value Error: %@", err); + [cluster testNestedStructListArgumentRequestWithParams:params + completionHandler:^(CHIPTestClusterClusterBooleanResponseParams * _Nullable values, + NSError * _Nullable err) { + NSLog(@"Send Test Command With Nested Struct List Argument and some fields b of " + @"arg1.d are false Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("enum8", actualValue, 0)); - } + { + id actualValue = values.value; + VerifyOrReturn(CheckValue("value", actualValue, false)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeEnum16DefaultValue_102() + CHIP_ERROR TestSendTestCommandWithStructArgumentAndSeeWhatWeGetBack_159() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute ENUM16 Default Value Error: %@", err); + __auto_type * params = [[CHIPTestClusterClusterSimpleStructEchoRequestParams alloc] init]; + params.arg1 = [[CHIPTestClusterClusterSimpleStruct alloc] init]; + ((CHIPTestClusterClusterSimpleStruct *) params.arg1).a = [NSNumber numberWithUnsignedChar:17]; + ((CHIPTestClusterClusterSimpleStruct *) params.arg1).b = [NSNumber numberWithBool:false]; + ((CHIPTestClusterClusterSimpleStruct *) params.arg1).c = [NSNumber numberWithUnsignedChar:2]; + ((CHIPTestClusterClusterSimpleStruct *) params.arg1).d = [[NSData alloc] initWithBytes:"octet_string" length:12]; + ((CHIPTestClusterClusterSimpleStruct *) params.arg1).e = @"char_string"; + ((CHIPTestClusterClusterSimpleStruct *) params.arg1).f = [NSNumber numberWithUnsignedChar:1]; + ((CHIPTestClusterClusterSimpleStruct *) params.arg1).g = [NSNumber numberWithFloat:0.1f]; + ((CHIPTestClusterClusterSimpleStruct *) params.arg1).h = [NSNumber numberWithDouble:0.1]; - VerifyOrReturn(CheckValue("status", err, 0)); + [cluster + simpleStructEchoRequestWithParams:params + completionHandler:^( + CHIPTestClusterClusterSimpleStructResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send Test Command With Struct Argument and see what we get back Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("enum16", actualValue, 0U)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = values.arg1; + VerifyOrReturn(CheckValue("a", ((CHIPTestClusterClusterSimpleStruct *) actualValue).a, 17)); + VerifyOrReturn(CheckValue("b", ((CHIPTestClusterClusterSimpleStruct *) actualValue).b, false)); + VerifyOrReturn(CheckValue("c", ((CHIPTestClusterClusterSimpleStruct *) actualValue).c, 2)); + VerifyOrReturn(CheckValueAsString("d", ((CHIPTestClusterClusterSimpleStruct *) actualValue).d, + [[NSData alloc] initWithBytes:"octet_string" length:12])); + VerifyOrReturn(CheckValueAsString( + "e", ((CHIPTestClusterClusterSimpleStruct *) actualValue).e, @"char_string")); + VerifyOrReturn(CheckValue("f", ((CHIPTestClusterClusterSimpleStruct *) actualValue).f, 1)); + VerifyOrReturn(CheckValue("g", ((CHIPTestClusterClusterSimpleStruct *) actualValue).g, 0.1f)); + VerifyOrReturn(CheckValue("h", ((CHIPTestClusterClusterSimpleStruct *) actualValue).h, 0.1)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeEnum16MaxValue_103() + CHIP_ERROR TestSendTestCommandWithListOfInt8uAndNoneOfThemIsSetTo0_160() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id enum16Argument; - enum16Argument = [NSNumber numberWithUnsignedShort:65535U]; - [cluster writeAttributeEnum16WithValue:enum16Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute ENUM16 Max Value Error: %@", err); + __auto_type * params = [[CHIPTestClusterClusterTestListInt8UArgumentRequestParams alloc] init]; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [NSNumber numberWithUnsignedChar:1]; + temp_0[1] = [NSNumber numberWithUnsignedChar:2]; + temp_0[2] = [NSNumber numberWithUnsignedChar:3]; + temp_0[3] = [NSNumber numberWithUnsignedChar:4]; + temp_0[4] = [NSNumber numberWithUnsignedChar:5]; + temp_0[5] = [NSNumber numberWithUnsignedChar:6]; + temp_0[6] = [NSNumber numberWithUnsignedChar:7]; + temp_0[7] = [NSNumber numberWithUnsignedChar:8]; + temp_0[8] = [NSNumber numberWithUnsignedChar:9]; + params.arg1 = temp_0; + } + [cluster + testListInt8UArgumentRequestWithParams:params + completionHandler:^( + CHIPTestClusterClusterBooleanResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send Test Command With List of INT8U and none of them is set to 0 Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = values.value; + VerifyOrReturn(CheckValue("value", actualValue, true)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeEnum16MaxValue_104() + CHIP_ERROR TestSendTestCommandWithListOfInt8uAndOneOfThemIsSetTo0_161() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute ENUM16 Max Value Error: %@", err); + __auto_type * params = [[CHIPTestClusterClusterTestListInt8UArgumentRequestParams alloc] init]; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [NSNumber numberWithUnsignedChar:1]; + temp_0[1] = [NSNumber numberWithUnsignedChar:2]; + temp_0[2] = [NSNumber numberWithUnsignedChar:3]; + temp_0[3] = [NSNumber numberWithUnsignedChar:4]; + temp_0[4] = [NSNumber numberWithUnsignedChar:5]; + temp_0[5] = [NSNumber numberWithUnsignedChar:6]; + temp_0[6] = [NSNumber numberWithUnsignedChar:7]; + temp_0[7] = [NSNumber numberWithUnsignedChar:8]; + temp_0[8] = [NSNumber numberWithUnsignedChar:9]; + temp_0[9] = [NSNumber numberWithUnsignedChar:0]; + params.arg1 = temp_0; + } + [cluster testListInt8UArgumentRequestWithParams:params + completionHandler:^( + CHIPTestClusterClusterBooleanResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send Test Command With List of INT8U and one of them is set to 0 Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("enum16", actualValue, 65535U)); - } + { + id actualValue = values.value; + VerifyOrReturn(CheckValue("value", actualValue, false)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeEnum16MinValue_105() + CHIP_ERROR TestSendTestCommandWithListOfInt8uAndGetItReversed_162() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id enum16Argument; - enum16Argument = [NSNumber numberWithUnsignedShort:0U]; - [cluster writeAttributeEnum16WithValue:enum16Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute ENUM16 Min Value Error: %@", err); + __auto_type * params = [[CHIPTestClusterClusterTestListInt8UReverseRequestParams alloc] init]; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [NSNumber numberWithUnsignedChar:1]; + temp_0[1] = [NSNumber numberWithUnsignedChar:2]; + temp_0[2] = [NSNumber numberWithUnsignedChar:3]; + temp_0[3] = [NSNumber numberWithUnsignedChar:4]; + temp_0[4] = [NSNumber numberWithUnsignedChar:5]; + temp_0[5] = [NSNumber numberWithUnsignedChar:6]; + temp_0[6] = [NSNumber numberWithUnsignedChar:7]; + temp_0[7] = [NSNumber numberWithUnsignedChar:8]; + temp_0[8] = [NSNumber numberWithUnsignedChar:9]; + params.arg1 = temp_0; + } + [cluster + testListInt8UReverseRequestWithParams:params + completionHandler:^(CHIPTestClusterClusterTestListInt8UReverseResponseParams * _Nullable values, + NSError * _Nullable err) { + NSLog(@"Send Test Command With List of INT8U and get it reversed Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = values.arg1; + VerifyOrReturn(CheckValue("arg1", [actualValue count], static_cast(9))); + VerifyOrReturn(CheckValue("", actualValue[0], 9)); + VerifyOrReturn(CheckValue("", actualValue[1], 8)); + VerifyOrReturn(CheckValue("", actualValue[2], 7)); + VerifyOrReturn(CheckValue("", actualValue[3], 6)); + VerifyOrReturn(CheckValue("", actualValue[4], 5)); + VerifyOrReturn(CheckValue("", actualValue[5], 4)); + VerifyOrReturn(CheckValue("", actualValue[6], 3)); + VerifyOrReturn(CheckValue("", actualValue[7], 2)); + VerifyOrReturn(CheckValue("", actualValue[8], 1)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeEnum16MinValue_106() + CHIP_ERROR TestSendTestCommandWithEmptyListOfInt8uAndGetAnEmptyListBack_163() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute ENUM16 Min Value Error: %@", err); + __auto_type * params = [[CHIPTestClusterClusterTestListInt8UReverseRequestParams alloc] init]; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + params.arg1 = temp_0; + } + [cluster + testListInt8UReverseRequestWithParams:params + completionHandler:^(CHIPTestClusterClusterTestListInt8UReverseResponseParams * _Nullable values, + NSError * _Nullable err) { + NSLog(@"Send Test Command With empty List of INT8U and get an empty list back Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("enum16", actualValue, 0U)); - } + { + id actualValue = values.arg1; + VerifyOrReturn(CheckValue("arg1", [actualValue count], static_cast(0))); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeOctetStringDefaultValue_107() + CHIP_ERROR TestSendTestCommandWithListOfStructArgumentAndArg1bOfFirstItemIsTrue_164() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute OCTET_STRING Default Value Error: %@", err); + __auto_type * params = [[CHIPTestClusterClusterTestListStructArgumentRequestParams alloc] init]; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [[CHIPTestClusterClusterSimpleStruct alloc] init]; + ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).a = [NSNumber numberWithUnsignedChar:0]; + ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).b = [NSNumber numberWithBool:true]; + ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).c = [NSNumber numberWithUnsignedChar:2]; + ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).d = [[NSData alloc] initWithBytes:"first_octet_string" length:18]; + ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).e = @"first_char_string"; + ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).f = [NSNumber numberWithUnsignedChar:1]; + ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).g = [NSNumber numberWithFloat:0.0f]; + ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).h = [NSNumber numberWithDouble:0]; - VerifyOrReturn(CheckValue("status", err, 0)); + temp_0[1] = [[CHIPTestClusterClusterSimpleStruct alloc] init]; + ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).a = [NSNumber numberWithUnsignedChar:1]; + ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).b = [NSNumber numberWithBool:true]; + ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).c = [NSNumber numberWithUnsignedChar:3]; + ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).d = [[NSData alloc] initWithBytes:"second_octet_string" length:19]; + ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).e = @"second_char_string"; + ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).f = [NSNumber numberWithUnsignedChar:1]; + ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).g = [NSNumber numberWithFloat:0.0f]; + ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).h = [NSNumber numberWithDouble:0]; - { - id actualValue = value; - VerifyOrReturn(CheckValueAsString("octet_string", actualValue, [[NSData alloc] initWithBytes:"" length:0])); - } + params.arg1 = temp_0; + } + [cluster testListStructArgumentRequestWithParams:params + completionHandler:^(CHIPTestClusterClusterBooleanResponseParams * _Nullable values, + NSError * _Nullable err) { + NSLog(@"Send Test Command With List of Struct Argument and arg1.b of first item is true " + @"Error: %@", + err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.value; + VerifyOrReturn(CheckValue("value", actualValue, true)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeOctetStringWithEmbeddedNull_108() + CHIP_ERROR TestSendTestCommandWithListOfStructArgumentAndArg1bOfFirstItemIsFalse_165() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id octetStringArgument; - octetStringArgument = [[NSData alloc] initWithBytes:"Tes\000ti\000ng" length:9]; - [cluster writeAttributeOctetStringWithValue:octetStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute OCTET_STRING with embedded null Error: %@", err); + __auto_type * params = [[CHIPTestClusterClusterTestListStructArgumentRequestParams alloc] init]; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [[CHIPTestClusterClusterSimpleStruct alloc] init]; + ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).a = [NSNumber numberWithUnsignedChar:1]; + ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).b = [NSNumber numberWithBool:true]; + ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).c = [NSNumber numberWithUnsignedChar:3]; + ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).d = [[NSData alloc] initWithBytes:"second_octet_string" length:19]; + ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).e = @"second_char_string"; + ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).f = [NSNumber numberWithUnsignedChar:1]; + ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).g = [NSNumber numberWithFloat:0.0f]; + ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).h = [NSNumber numberWithDouble:0]; - VerifyOrReturn(CheckValue("status", err, 0)); + temp_0[1] = [[CHIPTestClusterClusterSimpleStruct alloc] init]; + ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).a = [NSNumber numberWithUnsignedChar:0]; + ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).b = [NSNumber numberWithBool:false]; + ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).c = [NSNumber numberWithUnsignedChar:2]; + ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).d = [[NSData alloc] initWithBytes:"first_octet_string" length:18]; + ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).e = @"first_char_string"; + ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).f = [NSNumber numberWithUnsignedChar:1]; + ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).g = [NSNumber numberWithFloat:0.0f]; + ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).h = [NSNumber numberWithDouble:0]; - NextTest(); - }]; + params.arg1 = temp_0; + } + [cluster testListStructArgumentRequestWithParams:params + completionHandler:^(CHIPTestClusterClusterBooleanResponseParams * _Nullable values, + NSError * _Nullable err) { + NSLog(@"Send Test Command With List of Struct Argument and arg1.b of first item is " + @"false Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.value; + VerifyOrReturn(CheckValue("value", actualValue, false)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeOctetStringWithEmbeddedNull_109() + CHIP_ERROR TestSendTestCommandWithListOfNestedStructListArgumentAndAllFieldsBOfElementsOfArg1dAreTrue_166() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute OCTET_STRING with embedded null Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + __auto_type * params = [[CHIPTestClusterClusterTestListNestedStructListArgumentRequestParams alloc] init]; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [[CHIPTestClusterClusterNestedStructList alloc] init]; + ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).a = [NSNumber numberWithUnsignedChar:0]; + ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).b = [NSNumber numberWithBool:true]; + ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c = [[CHIPTestClusterClusterSimpleStruct alloc] init]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).a = + [NSNumber numberWithUnsignedChar:0]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).b = + [NSNumber numberWithBool:true]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).c = + [NSNumber numberWithUnsignedChar:2]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).d = + [[NSData alloc] initWithBytes:"octet_string" length:12]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).e = @"char_string"; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).f = + [NSNumber numberWithUnsignedChar:1]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).g = + [NSNumber numberWithFloat:0.0f]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).h = + [NSNumber numberWithDouble:0]; { - id actualValue = value; - VerifyOrReturn( - CheckValueAsString("octet_string", actualValue, [[NSData alloc] initWithBytes:"Tes\000ti\000ng" length:9])); - } + NSMutableArray * temp_2 = [[NSMutableArray alloc] init]; + temp_2[0] = [[CHIPTestClusterClusterSimpleStruct alloc] init]; + ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).a = [NSNumber numberWithUnsignedChar:1]; + ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).b = [NSNumber numberWithBool:true]; + ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).c = [NSNumber numberWithUnsignedChar:3]; + ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).d = [[NSData alloc] initWithBytes:"nested_octet_string" + length:19]; + ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).e = @"nested_char_string"; + ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).f = [NSNumber numberWithUnsignedChar:1]; + ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).g = [NSNumber numberWithFloat:0.0f]; + ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).h = [NSNumber numberWithDouble:0]; - NextTest(); - }]; + temp_2[1] = [[CHIPTestClusterClusterSimpleStruct alloc] init]; + ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).a = [NSNumber numberWithUnsignedChar:2]; + ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).b = [NSNumber numberWithBool:true]; + ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).c = [NSNumber numberWithUnsignedChar:3]; + ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).d = [[NSData alloc] initWithBytes:"nested_octet_string" + length:19]; + ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).e = @"nested_char_string"; + ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).f = [NSNumber numberWithUnsignedChar:1]; + ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).g = [NSNumber numberWithFloat:0.0f]; + ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).h = [NSNumber numberWithDouble:0]; - return CHIP_NO_ERROR; - } + ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).d = temp_2; + } + { + NSMutableArray * temp_2 = [[NSMutableArray alloc] init]; + temp_2[0] = [NSNumber numberWithUnsignedInt:1UL]; + temp_2[1] = [NSNumber numberWithUnsignedInt:2UL]; + temp_2[2] = [NSNumber numberWithUnsignedInt:3UL]; + ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).e = temp_2; + } + { + NSMutableArray * temp_2 = [[NSMutableArray alloc] init]; + temp_2[0] = [[NSData alloc] initWithBytes:"octet_string_1" length:14]; + temp_2[1] = [[NSData alloc] initWithBytes:"octect_string_2" length:15]; + temp_2[2] = [[NSData alloc] initWithBytes:"octet_string_3" length:14]; + ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).f = temp_2; + } + { + NSMutableArray * temp_2 = [[NSMutableArray alloc] init]; + temp_2[0] = [NSNumber numberWithUnsignedChar:0]; + temp_2[1] = [NSNumber numberWithUnsignedChar:255]; + ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).g = temp_2; + } - CHIP_ERROR TestWriteAttributeOctetStringWithWeirdChars_110() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + params.arg1 = temp_0; + } + [cluster testListNestedStructListArgumentRequestWithParams:params + completionHandler:^(CHIPTestClusterClusterBooleanResponseParams * _Nullable values, + NSError * _Nullable err) { + NSLog(@"Send Test Command With List of Nested Struct List Argument and all " + @"fields b of elements of arg1.d are true Error: %@", + err); - id octetStringArgument; - octetStringArgument = [[NSData alloc] initWithBytes:"\015\012\377\042\240" length:5]; - [cluster writeAttributeOctetStringWithValue:octetStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute OCTET_STRING with weird chars Error: %@", err); + VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = values.value; + VerifyOrReturn(CheckValue("value", actualValue, true)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeOctetStringWithWeirdChars_111() + CHIP_ERROR TestSendTestCommandWithNestedStructListArgumentAndSomeFieldsBOfElementsOfArg1dAreFalse_167() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute OCTET_STRING with weird chars Error: %@", err); + __auto_type * params = [[CHIPTestClusterClusterTestListNestedStructListArgumentRequestParams alloc] init]; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [[CHIPTestClusterClusterNestedStructList alloc] init]; + ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).a = [NSNumber numberWithUnsignedChar:0]; + ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).b = [NSNumber numberWithBool:true]; + ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c = [[CHIPTestClusterClusterSimpleStruct alloc] init]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).a = + [NSNumber numberWithUnsignedChar:0]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).b = + [NSNumber numberWithBool:true]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).c = + [NSNumber numberWithUnsignedChar:2]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).d = + [[NSData alloc] initWithBytes:"octet_string" length:12]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).e = @"char_string"; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).f = + [NSNumber numberWithUnsignedChar:1]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).g = + [NSNumber numberWithFloat:0.0f]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).h = + [NSNumber numberWithDouble:0]; - VerifyOrReturn(CheckValue("status", err, 0)); + { + NSMutableArray * temp_2 = [[NSMutableArray alloc] init]; + temp_2[0] = [[CHIPTestClusterClusterSimpleStruct alloc] init]; + ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).a = [NSNumber numberWithUnsignedChar:1]; + ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).b = [NSNumber numberWithBool:true]; + ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).c = [NSNumber numberWithUnsignedChar:3]; + ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).d = [[NSData alloc] initWithBytes:"nested_octet_string" + length:19]; + ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).e = @"nested_char_string"; + ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).f = [NSNumber numberWithUnsignedChar:1]; + ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).g = [NSNumber numberWithFloat:0.0f]; + ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).h = [NSNumber numberWithDouble:0]; + + temp_2[1] = [[CHIPTestClusterClusterSimpleStruct alloc] init]; + ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).a = [NSNumber numberWithUnsignedChar:2]; + ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).b = [NSNumber numberWithBool:false]; + ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).c = [NSNumber numberWithUnsignedChar:3]; + ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).d = [[NSData alloc] initWithBytes:"nested_octet_string" + length:19]; + ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).e = @"nested_char_string"; + ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).f = [NSNumber numberWithUnsignedChar:1]; + ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).g = [NSNumber numberWithFloat:0.0f]; + ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).h = [NSNumber numberWithDouble:0]; + ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).d = temp_2; + } { - id actualValue = value; - VerifyOrReturn(CheckValueAsString( - "octet_string", actualValue, [[NSData alloc] initWithBytes:"\015\012\377\042\240" length:5])); + NSMutableArray * temp_2 = [[NSMutableArray alloc] init]; + temp_2[0] = [NSNumber numberWithUnsignedInt:1UL]; + temp_2[1] = [NSNumber numberWithUnsignedInt:2UL]; + temp_2[2] = [NSNumber numberWithUnsignedInt:3UL]; + ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).e = temp_2; + } + { + NSMutableArray * temp_2 = [[NSMutableArray alloc] init]; + temp_2[0] = [[NSData alloc] initWithBytes:"octet_string_1" length:14]; + temp_2[1] = [[NSData alloc] initWithBytes:"octect_string_2" length:15]; + temp_2[2] = [[NSData alloc] initWithBytes:"octet_string_3" length:14]; + ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).f = temp_2; + } + { + NSMutableArray * temp_2 = [[NSMutableArray alloc] init]; + temp_2[0] = [NSNumber numberWithUnsignedChar:0]; + temp_2[1] = [NSNumber numberWithUnsignedChar:255]; + ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).g = temp_2; } - NextTest(); - }]; + params.arg1 = temp_0; + } + [cluster testListNestedStructListArgumentRequestWithParams:params + completionHandler:^(CHIPTestClusterClusterBooleanResponseParams * _Nullable values, + NSError * _Nullable err) { + NSLog(@"Send Test Command With Nested Struct List Argument and some fields b " + @"of elements of arg1.d are false Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.value; + VerifyOrReturn(CheckValue("value", actualValue, false)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeOctetString_112() + CHIP_ERROR TestWriteAttributeListWithListOfInt8uAndNoneOfThemIsSetTo0_168() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id octetStringArgument; - octetStringArgument = [[NSData alloc] initWithBytes:"TestValue" length:9]; - [cluster writeAttributeOctetStringWithValue:octetStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute OCTET_STRING Error: %@", err); + id listInt8uArgument; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [NSNumber numberWithUnsignedChar:1]; + temp_0[1] = [NSNumber numberWithUnsignedChar:2]; + temp_0[2] = [NSNumber numberWithUnsignedChar:3]; + temp_0[3] = [NSNumber numberWithUnsignedChar:4]; + listInt8uArgument = temp_0; + } + [cluster writeAttributeListInt8uWithValue:listInt8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute LIST With List of INT8U and none of them is set to 0 Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeOctetString_113() + CHIP_ERROR TestReadAttributeListWithListOfInt8u_169() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute OCTET_STRING Error: %@", err); + [cluster readAttributeListInt8uWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute LIST With List of INT8U Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn( - CheckValueAsString("octet_string", actualValue, [[NSData alloc] initWithBytes:"TestValue" length:9])); + VerifyOrReturn(CheckValue("list_int8u", [actualValue count], static_cast(4))); + VerifyOrReturn(CheckValue("", actualValue[0], 1)); + VerifyOrReturn(CheckValue("", actualValue[1], 2)); + VerifyOrReturn(CheckValue("", actualValue[2], 3)); + VerifyOrReturn(CheckValue("", actualValue[3], 4)); } NextTest(); @@ -52051,40 +60307,51 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeOctetString_114() + CHIP_ERROR TestWriteAttributeListWithListOfOctetString_170() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id octetStringArgument; - octetStringArgument = [[NSData alloc] initWithBytes:"TestValueLongerThan10" length:21]; - [cluster writeAttributeOctetStringWithValue:octetStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute OCTET_STRING Error: %@", err); + id listOctetStringArgument; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [[NSData alloc] initWithBytes:"Test0" length:5]; + temp_0[1] = [[NSData alloc] initWithBytes:"Test1" length:5]; + temp_0[2] = [[NSData alloc] initWithBytes:"Test2" length:5]; + temp_0[3] = [[NSData alloc] initWithBytes:"Test3" length:5]; + listOctetStringArgument = temp_0; + } + [cluster writeAttributeListOctetStringWithValue:listOctetStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute LIST With List of OCTET_STRING Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeOctetString_115() + CHIP_ERROR TestReadAttributeListWithListOfOctetString_171() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute OCTET_STRING Error: %@", err); + [cluster readAttributeListOctetStringWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute LIST With List of OCTET_STRING Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn( - CheckValueAsString("octet_string", actualValue, [[NSData alloc] initWithBytes:"TestValue" length:9])); + VerifyOrReturn(CheckValue("list_octet_string", [actualValue count], static_cast(4))); + VerifyOrReturn(CheckValueAsString("", actualValue[0], [[NSData alloc] initWithBytes:"Test0" length:5])); + VerifyOrReturn(CheckValueAsString("", actualValue[1], [[NSData alloc] initWithBytes:"Test1" length:5])); + VerifyOrReturn(CheckValueAsString("", actualValue[2], [[NSData alloc] initWithBytes:"Test2" length:5])); + VerifyOrReturn(CheckValueAsString("", actualValue[3], [[NSData alloc] initWithBytes:"Test3" length:5])); } NextTest(); @@ -52093,40 +60360,83 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeOctetString_116() + CHIP_ERROR TestWriteAttributeListWithListOfListStructOctetString_172() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id octetStringArgument; - octetStringArgument = [[NSData alloc] initWithBytes:"" length:0]; - [cluster writeAttributeOctetStringWithValue:octetStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute OCTET_STRING Error: %@", err); + id listStructOctetStringArgument; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [[CHIPTestClusterClusterTestListStructOctet alloc] init]; + ((CHIPTestClusterClusterTestListStructOctet *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedLongLong:0ULL]; + ((CHIPTestClusterClusterTestListStructOctet *) temp_0[0]).operationalCert = [[NSData alloc] initWithBytes:"Test0" + length:5]; - VerifyOrReturn(CheckValue("status", err, 0)); + temp_0[1] = [[CHIPTestClusterClusterTestListStructOctet alloc] init]; + ((CHIPTestClusterClusterTestListStructOctet *) temp_0[1]).fabricIndex = [NSNumber numberWithUnsignedLongLong:1ULL]; + ((CHIPTestClusterClusterTestListStructOctet *) temp_0[1]).operationalCert = [[NSData alloc] initWithBytes:"Test1" + length:5]; - NextTest(); - }]; + temp_0[2] = [[CHIPTestClusterClusterTestListStructOctet alloc] init]; + ((CHIPTestClusterClusterTestListStructOctet *) temp_0[2]).fabricIndex = [NSNumber numberWithUnsignedLongLong:2ULL]; + ((CHIPTestClusterClusterTestListStructOctet *) temp_0[2]).operationalCert = [[NSData alloc] initWithBytes:"Test2" + length:5]; + + temp_0[3] = [[CHIPTestClusterClusterTestListStructOctet alloc] init]; + ((CHIPTestClusterClusterTestListStructOctet *) temp_0[3]).fabricIndex = [NSNumber numberWithUnsignedLongLong:3ULL]; + ((CHIPTestClusterClusterTestListStructOctet *) temp_0[3]).operationalCert = [[NSData alloc] initWithBytes:"Test3" + length:5]; + + listStructOctetStringArgument = temp_0; + } + [cluster writeAttributeListStructOctetStringWithValue:listStructOctetStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute LIST With List of LIST_STRUCT_OCTET_STRING Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeLongOctetStringDefaultValue_117() + CHIP_ERROR TestReadAttributeListWithListOfListStructOctetString_173() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeLongOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute LONG_OCTET_STRING Default Value Error: %@", err); + [cluster readAttributeListStructOctetStringWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute LIST With List of LIST_STRUCT_OCTET_STRING Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueAsString("long_octet_string", actualValue, [[NSData alloc] initWithBytes:"" length:0])); + VerifyOrReturn(CheckValue("list_struct_octet_string", [actualValue count], static_cast(4))); + VerifyOrReturn( + CheckValue("fabricIndex", ((CHIPTestClusterClusterTestListStructOctet *) actualValue[0]).fabricIndex, 0ULL)); + VerifyOrReturn(CheckValueAsString("operationalCert", + ((CHIPTestClusterClusterTestListStructOctet *) actualValue[0]).operationalCert, + [[NSData alloc] initWithBytes:"Test0" length:5])); + VerifyOrReturn( + CheckValue("fabricIndex", ((CHIPTestClusterClusterTestListStructOctet *) actualValue[1]).fabricIndex, 1ULL)); + VerifyOrReturn(CheckValueAsString("operationalCert", + ((CHIPTestClusterClusterTestListStructOctet *) actualValue[1]).operationalCert, + [[NSData alloc] initWithBytes:"Test1" length:5])); + VerifyOrReturn( + CheckValue("fabricIndex", ((CHIPTestClusterClusterTestListStructOctet *) actualValue[2]).fabricIndex, 2ULL)); + VerifyOrReturn(CheckValueAsString("operationalCert", + ((CHIPTestClusterClusterTestListStructOctet *) actualValue[2]).operationalCert, + [[NSData alloc] initWithBytes:"Test2" length:5])); + VerifyOrReturn( + CheckValue("fabricIndex", ((CHIPTestClusterClusterTestListStructOctet *) actualValue[3]).fabricIndex, 3ULL)); + VerifyOrReturn(CheckValueAsString("operationalCert", + ((CHIPTestClusterClusterTestListStructOctet *) actualValue[3]).operationalCert, + [[NSData alloc] initWithBytes:"Test3" length:5])); } NextTest(); @@ -52135,92 +60445,98 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeLongOctetString_118() + CHIP_ERROR TestSendTestCommandWithOptionalArgSet_174() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id longOctetStringArgument; - longOctetStringArgument = [[NSData alloc] - initWithBytes:"11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" - "11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" - "11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" - length:300]; - [cluster writeAttributeLongOctetStringWithValue:longOctetStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute LONG_OCTET_STRING Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; + __auto_type * params = [[CHIPTestClusterClusterTestNullableOptionalRequestParams alloc] init]; + params.arg1 = [NSNumber numberWithUnsignedChar:5]; + [cluster + testNullableOptionalRequestWithParams:params + completionHandler:^(CHIPTestClusterClusterTestNullableOptionalResponseParams * _Nullable values, + NSError * _Nullable err) { + NSLog(@"Send Test Command with optional arg set. Error: %@", err); - return CHIP_NO_ERROR; - } + VerifyOrReturn(CheckValue("status", err, 0)); - CHIP_ERROR TestReadAttributeLongOctetString_119() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + { + id actualValue = values.wasPresent; + VerifyOrReturn(CheckValue("wasPresent", actualValue, true)); + } - [cluster readAttributeLongOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute LONG_OCTET_STRING Error: %@", err); + { + id actualValue = values.wasNull; + VerifyOrReturn(CheckValue("wasNull", actualValue, false)); + } - VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = values.value; + VerifyOrReturn(CheckValue("value", actualValue, 5)); + } - { - id actualValue = value; - VerifyOrReturn(CheckValueAsString("long_octet_string", actualValue, - [[NSData alloc] - initWithBytes: - "111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" - "111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" - "111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" - length:300])); - } + { + id actualValue = values.originalValue; + VerifyOrReturn(CheckValueNonNull("originalValue", actualValue)); + VerifyOrReturn(CheckValue("originalValue", actualValue, 5)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeLongOctetString_120() + CHIP_ERROR TestSendTestCommandWithoutItsOptionalArg_175() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id longOctetStringArgument; - longOctetStringArgument = [[NSData alloc] initWithBytes:"" length:0]; - [cluster writeAttributeLongOctetStringWithValue:longOctetStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute LONG_OCTET_STRING Error: %@", err); + __auto_type * params = [[CHIPTestClusterClusterTestNullableOptionalRequestParams alloc] init]; + [cluster + testNullableOptionalRequestWithParams:params + completionHandler:^(CHIPTestClusterClusterTestNullableOptionalResponseParams * _Nullable values, + NSError * _Nullable err) { + NSLog(@"Send Test Command without its optional arg. Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = values.wasPresent; + VerifyOrReturn(CheckValue("wasPresent", actualValue, false)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeCharStringDefaultValue_121() + CHIP_ERROR TestReadListOfStructsContainingNullablesAndOptionals_176() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute CHAR_STRING Default Value Error: %@", err); + [cluster readAttributeListNullablesAndOptionalsStructWithCompletionHandler:^( + NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read list of structs containing nullables and optionals Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueAsString("char_string", actualValue, @"")); + VerifyOrReturn(CheckValue("list_nullables_and_optionals_struct", [actualValue count], static_cast(1))); + VerifyOrReturn(CheckValueNull( + "NullableInt", ((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableInt)); + VerifyOrReturn(CheckValueNull( + "NullableString", ((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableString)); + VerifyOrReturn(CheckValueNull( + "NullableStruct", ((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableStruct)); + VerifyOrReturn(CheckValueNull( + "NullableList", ((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableList)); } NextTest(); @@ -52229,40 +60545,72 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeCharString_122() + CHIP_ERROR TestWriteListOfStructsContainingNullablesAndOptionals_177() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id charStringArgument; - charStringArgument = @"☉T☉"; - [cluster writeAttributeCharStringWithValue:charStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute CHAR_STRING Error: %@", err); + id listNullablesAndOptionalsStructArgument; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [[CHIPTestClusterClusterNullablesAndOptionalsStruct alloc] init]; + ((CHIPTestClusterClusterNullablesAndOptionalsStruct *) temp_0[0]).nullableInt = nil; + ((CHIPTestClusterClusterNullablesAndOptionalsStruct *) temp_0[0]).nullableString = nil; + ((CHIPTestClusterClusterNullablesAndOptionalsStruct *) temp_0[0]).nullableStruct = nil; + { + NSMutableArray * temp_3 = [[NSMutableArray alloc] init]; + temp_3[0] = [NSNumber numberWithUnsignedChar:1]; + temp_3[1] = [NSNumber numberWithUnsignedChar:2]; + ((CHIPTestClusterClusterNullablesAndOptionalsStruct *) temp_0[0]).nullableList = temp_3; + } - VerifyOrReturn(CheckValue("status", err, 0)); + listNullablesAndOptionalsStructArgument = temp_0; + } + [cluster + writeAttributeListNullablesAndOptionalsStructWithValue:listNullablesAndOptionalsStructArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write list of structs containing nullables and optionals Error: %@", + err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeCharString_123() + CHIP_ERROR TestReadListOfStructsContainingNullablesAndOptionalsAfterWriting_178() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute CHAR_STRING Error: %@", err); + [cluster readAttributeListNullablesAndOptionalsStructWithCompletionHandler:^( + NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read list of structs containing nullables and optionals after writing Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueAsString("char_string", actualValue, @"☉T☉")); + VerifyOrReturn(CheckValue("list_nullables_and_optionals_struct", [actualValue count], static_cast(1))); + VerifyOrReturn(CheckValueNull( + "NullableInt", ((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableInt)); + VerifyOrReturn(CheckValueNull( + "NullableString", ((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableString)); + VerifyOrReturn(CheckValueNull( + "NullableStruct", ((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableStruct)); + VerifyOrReturn(CheckValueNonNull( + "NullableList", ((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableList)); + VerifyOrReturn(CheckValue("NullableList", + [((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableList count], + static_cast(2))); + VerifyOrReturn( + CheckValue("", ((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableList[0], 1)); + VerifyOrReturn( + CheckValue("", ((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableList[1], 2)); } NextTest(); @@ -52271,39 +60619,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeCharStringValueTooLong_124() + CHIP_ERROR TestWriteAttributeNullableBooleanNull_179() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id charStringArgument; - charStringArgument = @"☉TestValueLongerThan10☉"; - [cluster writeAttributeCharStringWithValue:charStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute CHAR_STRING - Value too long Error: %@", err); + id nullableBooleanArgument; + nullableBooleanArgument = nil; + [cluster writeAttributeNullableBooleanWithValue:nullableBooleanArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_BOOLEAN null Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeCharString_125() + CHIP_ERROR TestReadAttributeNullableBooleanNull_180() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute CHAR_STRING Error: %@", err); + [cluster readAttributeNullableBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_BOOLEAN null Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueAsString("char_string", actualValue, @"☉T☉")); + VerifyOrReturn(CheckValueNull("nullable_boolean", actualValue)); } NextTest(); @@ -52312,40 +60661,41 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeCharStringEmpty_126() + CHIP_ERROR TestWriteAttributeNullableBooleanTrue_181() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id charStringArgument; - charStringArgument = @""; - [cluster writeAttributeCharStringWithValue:charStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute CHAR_STRING - Empty Error: %@", err); + id nullableBooleanArgument; + nullableBooleanArgument = [NSNumber numberWithBool:true]; + [cluster writeAttributeNullableBooleanWithValue:nullableBooleanArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_BOOLEAN True Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeLongCharStringDefaultValue_127() + CHIP_ERROR TestReadAttributeNullableBooleanTrue_182() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeLongCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute LONG_CHAR_STRING Default Value Error: %@", err); + [cluster readAttributeNullableBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_BOOLEAN True Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueAsString("long_char_string", actualValue, @"")); + VerifyOrReturn(CheckValueNonNull("nullable_boolean", actualValue)); + VerifyOrReturn(CheckValue("nullable_boolean", actualValue, true)); } NextTest(); @@ -52354,46 +60704,41 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeLongCharString_128() + CHIP_ERROR TestWriteAttributeNullableBitmap8MaxValue_183() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id longCharStringArgument; - longCharStringArgument - = @"☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉" - @"☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉" - @"☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉"; - [cluster writeAttributeLongCharStringWithValue:longCharStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute LONG_CHAR_STRING Error: %@", err); + id nullableBitmap8Argument; + nullableBitmap8Argument = [NSNumber numberWithUnsignedChar:254]; + [cluster writeAttributeNullableBitmap8WithValue:nullableBitmap8Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_BITMAP8 Max Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeLongCharString_129() + CHIP_ERROR TestReadAttributeNullableBitmap8MaxValue_184() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeLongCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute LONG_CHAR_STRING Error: %@", err); + [cluster readAttributeNullableBitmap8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_BITMAP8 Max Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueAsString("long_char_string", actualValue, - @"☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉" - @"☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉" - @"☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉")); + VerifyOrReturn(CheckValueNonNull("nullable_bitmap8", actualValue)); + VerifyOrReturn(CheckValue("nullable_bitmap8", actualValue, 254)); } NextTest(); @@ -52402,76 +60747,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeLongCharString_130() + CHIP_ERROR TestWriteAttributeNullableBitmap8InvalidValue_185() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id longCharStringArgument; - longCharStringArgument = @""; - [cluster writeAttributeLongCharStringWithValue:longCharStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute LONG_CHAR_STRING Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id nullableBitmap8Argument; + nullableBitmap8Argument = [NSNumber numberWithUnsignedChar:255]; + [cluster writeAttributeNullableBitmap8WithValue:nullableBitmap8Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_BITMAP8 Invalid Value Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeListLongOctetStringForChunkedRead_131() + CHIP_ERROR TestReadAttributeNullableBitmap8UnchangedValue_186() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeListLongOctetStringWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute LIST_LONG_OCTET_STRING (for chunked read) Error: %@", err); + [cluster readAttributeNullableBitmap8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_BITMAP8 unchanged Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("list_long_octet_string", [actualValue count], static_cast(4))); - VerifyOrReturn(CheckValueAsString("", actualValue[0], - [[NSData alloc] - initWithBytes:"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" - "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123" - "456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" - "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef" - length:512])); - VerifyOrReturn(CheckValueAsString("", actualValue[1], - [[NSData alloc] - initWithBytes:"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" - "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123" - "456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" - "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef" - length:512])); - VerifyOrReturn(CheckValueAsString("", actualValue[2], - [[NSData alloc] - initWithBytes:"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" - "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123" - "456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" - "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef" - length:512])); - VerifyOrReturn(CheckValueAsString("", actualValue[3], - [[NSData alloc] - initWithBytes:"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" - "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123" - "456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" - "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef" - length:512])); + VerifyOrReturn(CheckValueNonNull("nullable_bitmap8", actualValue)); + VerifyOrReturn(CheckValue("nullable_bitmap8", actualValue, 254)); } NextTest(); @@ -52480,150 +60789,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeListLongOctetStringForChunkedWrite_132() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id listLongOctetStringArgument; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [[NSData alloc] - initWithBytes: - "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd" - "ef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789" - "abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" - "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" - length:512]; - temp_0[1] = [[NSData alloc] - initWithBytes: - "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd" - "ef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789" - "abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" - "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" - length:512]; - temp_0[2] = [[NSData alloc] - initWithBytes: - "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd" - "ef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789" - "abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" - "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" - length:512]; - temp_0[3] = [[NSData alloc] - initWithBytes: - "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd" - "ef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789" - "abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" - "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" - length:512]; - temp_0[4] = [[NSData alloc] - initWithBytes: - "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd" - "ef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789" - "abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" - "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" - length:512]; - listLongOctetStringArgument = temp_0; - } - [cluster writeAttributeListLongOctetStringWithValue:listLongOctetStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute LIST_LONG_OCTET_STRING (for chunked write) Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadAttributeListLongOctetStringForChunkedRead_133() + CHIP_ERROR TestWriteAttributeNullableBitmap8NullValue_187() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeListLongOctetStringWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute LIST_LONG_OCTET_STRING (for chunked read) Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id nullableBitmap8Argument; + nullableBitmap8Argument = nil; + [cluster writeAttributeNullableBitmap8WithValue:nullableBitmap8Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_BITMAP8 null Value Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("list_long_octet_string", [actualValue count], static_cast(5))); - VerifyOrReturn(CheckValueAsString("", actualValue[0], - [[NSData alloc] - initWithBytes:"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" - "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123" - "456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" - "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef" - length:512])); - VerifyOrReturn(CheckValueAsString("", actualValue[1], - [[NSData alloc] - initWithBytes:"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" - "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123" - "456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" - "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef" - length:512])); - VerifyOrReturn(CheckValueAsString("", actualValue[2], - [[NSData alloc] - initWithBytes:"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" - "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123" - "456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" - "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef" - length:512])); - VerifyOrReturn(CheckValueAsString("", actualValue[3], - [[NSData alloc] - initWithBytes:"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" - "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123" - "456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" - "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef" - length:512])); - VerifyOrReturn(CheckValueAsString("", actualValue[4], - [[NSData alloc] - initWithBytes:"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" - "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123" - "456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" - "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef" - length:512])); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeEpochUsDefaultValue_134() + CHIP_ERROR TestReadAttributeNullableBitmap8NullValue_188() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEpochUsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute EPOCH_US Default Value Error: %@", err); + [cluster readAttributeNullableBitmap8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_BITMAP8 null Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("epoch_us", actualValue, 0ULL)); + VerifyOrReturn(CheckValueNull("nullable_bitmap8", actualValue)); } NextTest(); @@ -52632,40 +60831,41 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeEpochUsMaxValue_135() + CHIP_ERROR TestWriteAttributeNullableBitmap16MaxValue_189() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id epochUsArgument; - epochUsArgument = [NSNumber numberWithUnsignedLongLong:18446744073709551615ULL]; - [cluster writeAttributeEpochUsWithValue:epochUsArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute EPOCH_US Max Value Error: %@", err); + id nullableBitmap16Argument; + nullableBitmap16Argument = [NSNumber numberWithUnsignedShort:65534U]; + [cluster writeAttributeNullableBitmap16WithValue:nullableBitmap16Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_BITMAP16 Max Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeEpochUsMaxValue_136() + CHIP_ERROR TestReadAttributeNullableBitmap16MaxValue_190() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEpochUsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute EPOCH_US Max Value Error: %@", err); + [cluster readAttributeNullableBitmap16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_BITMAP16 Max Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("epoch_us", actualValue, 18446744073709551615ULL)); + VerifyOrReturn(CheckValueNonNull("nullable_bitmap16", actualValue)); + VerifyOrReturn(CheckValue("nullable_bitmap16", actualValue, 65534U)); } NextTest(); @@ -52674,40 +60874,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeEpochUsMinValue_137() + CHIP_ERROR TestWriteAttributeNullableBitmap16InvalidValue_191() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id epochUsArgument; - epochUsArgument = [NSNumber numberWithUnsignedLongLong:0ULL]; - [cluster writeAttributeEpochUsWithValue:epochUsArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute EPOCH_US Min Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id nullableBitmap16Argument; + nullableBitmap16Argument = [NSNumber numberWithUnsignedShort:65535U]; + [cluster writeAttributeNullableBitmap16WithValue:nullableBitmap16Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_BITMAP16 Invalid Value Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeEpochUsMinValue_138() + CHIP_ERROR TestReadAttributeNullableBitmap16UnchangedValue_192() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEpochUsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute EPOCH_US Min Value Error: %@", err); + [cluster readAttributeNullableBitmap16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_BITMAP16 unchanged Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("epoch_us", actualValue, 0ULL)); + VerifyOrReturn(CheckValueNonNull("nullable_bitmap16", actualValue)); + VerifyOrReturn(CheckValue("nullable_bitmap16", actualValue, 65534U)); } NextTest(); @@ -52716,20 +60916,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeEpochSDefaultValue_139() + CHIP_ERROR TestWriteAttributeNullableBitmap16NullValue_193() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEpochSWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute EPOCH_S Default Value Error: %@", err); + id nullableBitmap16Argument; + nullableBitmap16Argument = nil; + [cluster writeAttributeNullableBitmap16WithValue:nullableBitmap16Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_BITMAP16 null Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeNullableBitmap16NullValue_194() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeNullableBitmap16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_BITMAP16 null Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("epoch_s", actualValue, 0UL)); + VerifyOrReturn(CheckValueNull("nullable_bitmap16", actualValue)); } NextTest(); @@ -52738,40 +60958,41 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeEpochSMaxValue_140() + CHIP_ERROR TestWriteAttributeNullableBitmap32MaxValue_195() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id epochSArgument; - epochSArgument = [NSNumber numberWithUnsignedInt:4294967295UL]; - [cluster writeAttributeEpochSWithValue:epochSArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute EPOCH_S Max Value Error: %@", err); + id nullableBitmap32Argument; + nullableBitmap32Argument = [NSNumber numberWithUnsignedInt:4294967294UL]; + [cluster writeAttributeNullableBitmap32WithValue:nullableBitmap32Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_BITMAP32 Max Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeEpochSMaxValue_141() + CHIP_ERROR TestReadAttributeNullableBitmap32MaxValue_196() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEpochSWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute EPOCH_S Max Value Error: %@", err); + [cluster readAttributeNullableBitmap32WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_BITMAP32 Max Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("epoch_s", actualValue, 4294967295UL)); + VerifyOrReturn(CheckValueNonNull("nullable_bitmap32", actualValue)); + VerifyOrReturn(CheckValue("nullable_bitmap32", actualValue, 4294967294UL)); } NextTest(); @@ -52780,40 +61001,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeEpochSMinValue_142() + CHIP_ERROR TestWriteAttributeNullableBitmap32InvalidValue_197() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id epochSArgument; - epochSArgument = [NSNumber numberWithUnsignedInt:0UL]; - [cluster writeAttributeEpochSWithValue:epochSArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute EPOCH_S Min Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id nullableBitmap32Argument; + nullableBitmap32Argument = [NSNumber numberWithUnsignedInt:4294967295UL]; + [cluster writeAttributeNullableBitmap32WithValue:nullableBitmap32Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_BITMAP32 Invalid Value Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeEpochSMinValue_143() + CHIP_ERROR TestReadAttributeNullableBitmap32UnchangedValue_198() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEpochSWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute EPOCH_S Min Value Error: %@", err); + [cluster readAttributeNullableBitmap32WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_BITMAP32 unchanged Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("epoch_s", actualValue, 0UL)); + VerifyOrReturn(CheckValueNonNull("nullable_bitmap32", actualValue)); + VerifyOrReturn(CheckValue("nullable_bitmap32", actualValue, 4294967294UL)); } NextTest(); @@ -52822,25 +61043,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeUnsupported_144() + CHIP_ERROR TestWriteAttributeNullableBitmap32NullValue_199() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeUnsupportedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute UNSUPPORTED Error: %@", err); + id nullableBitmap32Argument; + nullableBitmap32Argument = nil; + [cluster writeAttributeNullableBitmap32WithValue:nullableBitmap32Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_BITMAP32 null Value Error: %@", err); - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeNullableBitmap32NullValue_200() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeNullableBitmap32WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_BITMAP32 null Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("unsupported", actualValue, 0)); + VerifyOrReturn(CheckValueNull("nullable_bitmap32", actualValue)); } NextTest(); @@ -52849,77 +61085,83 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteattributeUnsupported_145() + CHIP_ERROR TestWriteAttributeNullableBitmap64MaxValue_201() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id unsupportedArgument; - unsupportedArgument = [NSNumber numberWithBool:0]; - [cluster writeAttributeUnsupportedWithValue:unsupportedArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writeattribute UNSUPPORTED Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + id nullableBitmap64Argument; + nullableBitmap64Argument = [NSNumber numberWithUnsignedLongLong:18446744073709551614ULL]; + [cluster writeAttributeNullableBitmap64WithValue:nullableBitmap64Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_BITMAP64 Max Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendTestCommandToUnsupportedEndpoint_146() + CHIP_ERROR TestReadAttributeNullableBitmap64MaxValue_202() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:200 queue:mCallbackQueue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster testWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Send Test Command to unsupported endpoint Error: %@", err); + [cluster readAttributeNullableBitmap64WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_BITMAP64 Max Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_bitmap64", actualValue)); + VerifyOrReturn(CheckValue("nullable_bitmap64", actualValue, 18446744073709551614ULL)); + } - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_ENDPOINT)); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendTestCommandToUnsupportedCluster_147() + CHIP_ERROR TestWriteAttributeNullableBitmap64InvalidValue_203() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster testWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Send Test Command to unsupported cluster Error: %@", err); + id nullableBitmap64Argument; + nullableBitmap64Argument = [NSNumber numberWithUnsignedLongLong:18446744073709551615ULL]; + [cluster writeAttributeNullableBitmap64WithValue:nullableBitmap64Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_BITMAP64 Invalid Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_CLUSTER)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeVendorIdDefaultValue_148() + CHIP_ERROR TestReadAttributeNullableBitmap64UnchangedValue_204() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeVendorIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute vendor_id Default Value Error: %@", err); + [cluster readAttributeNullableBitmap64WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_BITMAP64 unchanged Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("vendor_id", actualValue, 0U)); + VerifyOrReturn(CheckValueNonNull("nullable_bitmap64", actualValue)); + VerifyOrReturn(CheckValue("nullable_bitmap64", actualValue, 18446744073709551614ULL)); } NextTest(); @@ -52928,40 +61170,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeVendorId_149() + CHIP_ERROR TestWriteAttributeNullableBitmap64NullValue_205() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id vendorIdArgument; - vendorIdArgument = [NSNumber numberWithUnsignedShort:17U]; - [cluster writeAttributeVendorIdWithValue:vendorIdArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute vendor_id Error: %@", err); + id nullableBitmap64Argument; + nullableBitmap64Argument = nil; + [cluster writeAttributeNullableBitmap64WithValue:nullableBitmap64Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_BITMAP64 null Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeVendorId_150() + CHIP_ERROR TestReadAttributeNullableBitmap64NullValue_206() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeVendorIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute vendor_id Error: %@", err); + [cluster readAttributeNullableBitmap64WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_BITMAP64 null Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("vendor_id", actualValue, 17U)); + VerifyOrReturn(CheckValueNull("nullable_bitmap64", actualValue)); } NextTest(); @@ -52970,948 +61212,425 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestRestoreAttributeVendorId_151() + CHIP_ERROR TestWriteAttributeNullableInt8uMinValue_207() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id vendorIdArgument; - vendorIdArgument = [NSNumber numberWithUnsignedShort:0U]; - [cluster writeAttributeVendorIdWithValue:vendorIdArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Restore attribute vendor_id Error: %@", err); + id nullableInt8uArgument; + nullableInt8uArgument = [NSNumber numberWithUnsignedChar:0]; + [cluster writeAttributeNullableInt8uWithValue:nullableInt8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT8U Min Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendACommandWithAVendorIdAndEnum_152() + CHIP_ERROR TestReadAttributeNullableInt8uMinValue_208() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPTestClusterClusterTestEnumsRequestParams alloc] init]; - params.arg1 = [NSNumber numberWithUnsignedShort:20003U]; - params.arg2 = [NSNumber numberWithUnsignedChar:101]; - [cluster testEnumsRequestWithParams:params - completionHandler:^( - CHIPTestClusterClusterTestEnumsResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Send a command with a vendor_id and enum Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + [cluster readAttributeNullableInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT8U Min Value Error: %@", err); - { - id actualValue = values.arg1; - VerifyOrReturn(CheckValue("arg1", actualValue, 20003U)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = values.arg2; - VerifyOrReturn(CheckValue("arg2", actualValue, 101)); - } + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_int8u", actualValue)); + VerifyOrReturn(CheckValue("nullable_int8u", actualValue, 0)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendTestCommandWithStructArgumentAndArg1bIsTrue_153() + CHIP_ERROR TestWriteAttributeNullableInt8uMaxValue_209() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPTestClusterClusterTestStructArgumentRequestParams alloc] init]; - params.arg1 = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).a = [NSNumber numberWithUnsignedChar:0]; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).b = [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).c = [NSNumber numberWithUnsignedChar:2]; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).d = [[NSData alloc] initWithBytes:"octet_string" length:12]; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).e = @"char_string"; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).f = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).g = [NSNumber numberWithFloat:0.0f]; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).h = [NSNumber numberWithDouble:0]; - - [cluster testStructArgumentRequestWithParams:params - completionHandler:^( - CHIPTestClusterClusterBooleanResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Send Test Command With Struct Argument and arg1.b is true Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id nullableInt8uArgument; + nullableInt8uArgument = [NSNumber numberWithUnsignedChar:254]; + [cluster writeAttributeNullableInt8uWithValue:nullableInt8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT8U Max Value Error: %@", err); - { - id actualValue = values.value; - VerifyOrReturn(CheckValue("value", actualValue, true)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendTestCommandWithStructArgumentAndArg1bIsFalse_154() + CHIP_ERROR TestReadAttributeNullableInt8uMaxValue_210() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPTestClusterClusterTestStructArgumentRequestParams alloc] init]; - params.arg1 = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).a = [NSNumber numberWithUnsignedChar:0]; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).b = [NSNumber numberWithBool:false]; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).c = [NSNumber numberWithUnsignedChar:2]; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).d = [[NSData alloc] initWithBytes:"octet_string" length:12]; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).e = @"char_string"; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).f = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).g = [NSNumber numberWithFloat:0.0f]; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).h = [NSNumber numberWithDouble:0]; - - [cluster testStructArgumentRequestWithParams:params - completionHandler:^( - CHIPTestClusterClusterBooleanResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Send Test Command With Struct Argument and arg1.b is false Error: %@", err); + [cluster readAttributeNullableInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT8U Max Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = values.value; - VerifyOrReturn(CheckValue("value", actualValue, false)); - } + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_int8u", actualValue)); + VerifyOrReturn(CheckValue("nullable_int8u", actualValue, 254)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendTestCommandWithNestedStructArgumentAndArg1cbIsTrue_155() + CHIP_ERROR TestWriteAttributeNullableInt8uInvalidValue_211() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPTestClusterClusterTestNestedStructArgumentRequestParams alloc] init]; - params.arg1 = [[CHIPTestClusterClusterNestedStruct alloc] init]; - ((CHIPTestClusterClusterNestedStruct *) params.arg1).a = [NSNumber numberWithUnsignedChar:0]; - ((CHIPTestClusterClusterNestedStruct *) params.arg1).b = [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterNestedStruct *) params.arg1).c = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).a = - [NSNumber numberWithUnsignedChar:0]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).b = - [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).c = - [NSNumber numberWithUnsignedChar:2]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).d = - [[NSData alloc] initWithBytes:"octet_string" length:12]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).e = @"char_string"; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).f = - [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).g = - [NSNumber numberWithFloat:0.0f]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).h = - [NSNumber numberWithDouble:0]; - - [cluster - testNestedStructArgumentRequestWithParams:params - completionHandler:^( - CHIPTestClusterClusterBooleanResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Send Test Command With Nested Struct Argument and arg1.c.b is true Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = values.value; - VerifyOrReturn(CheckValue("value", actualValue, true)); - } + id nullableInt8uArgument; + nullableInt8uArgument = [NSNumber numberWithUnsignedChar:255]; + [cluster writeAttributeNullableInt8uWithValue:nullableInt8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT8U Invalid Value Error: %@", err); + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendTestCommandWithNestedStructArgumentArg1cbIsFalse_156() + CHIP_ERROR TestReadAttributeNullableInt8uUnchangedValue_212() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPTestClusterClusterTestNestedStructArgumentRequestParams alloc] init]; - params.arg1 = [[CHIPTestClusterClusterNestedStruct alloc] init]; - ((CHIPTestClusterClusterNestedStruct *) params.arg1).a = [NSNumber numberWithUnsignedChar:0]; - ((CHIPTestClusterClusterNestedStruct *) params.arg1).b = [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterNestedStruct *) params.arg1).c = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).a = - [NSNumber numberWithUnsignedChar:0]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).b = - [NSNumber numberWithBool:false]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).c = - [NSNumber numberWithUnsignedChar:2]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).d = - [[NSData alloc] initWithBytes:"octet_string" length:12]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).e = @"char_string"; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).f = - [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).g = - [NSNumber numberWithFloat:0.0f]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).h = - [NSNumber numberWithDouble:0]; - - [cluster - testNestedStructArgumentRequestWithParams:params - completionHandler:^( - CHIPTestClusterClusterBooleanResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Send Test Command With Nested Struct Argument arg1.c.b is false Error: %@", err); + [cluster readAttributeNullableInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT8U unchanged Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = values.value; - VerifyOrReturn(CheckValue("value", actualValue, false)); - } + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_int8u", actualValue)); + VerifyOrReturn(CheckValue("nullable_int8u", actualValue, 254)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendTestCommandWithNestedStructListArgumentAndAllFieldsBOfArg1dAreTrue_157() + CHIP_ERROR TestReadAttributeNullableInt8uUnchangedValueWithConstraint_213() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPTestClusterClusterTestNestedStructListArgumentRequestParams alloc] init]; - params.arg1 = [[CHIPTestClusterClusterNestedStructList alloc] init]; - ((CHIPTestClusterClusterNestedStructList *) params.arg1).a = [NSNumber numberWithUnsignedChar:0]; - ((CHIPTestClusterClusterNestedStructList *) params.arg1).b = [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterNestedStructList *) params.arg1).c = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).a = - [NSNumber numberWithUnsignedChar:0]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).b = - [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).c = - [NSNumber numberWithUnsignedChar:2]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).d = - [[NSData alloc] initWithBytes:"octet_string" length:12]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).e = @"char_string"; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).f = - [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).g = - [NSNumber numberWithFloat:0.0f]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).h = - [NSNumber numberWithDouble:0]; - - { - NSMutableArray * temp_1 = [[NSMutableArray alloc] init]; - temp_1[0] = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).a = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).b = [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).c = [NSNumber numberWithUnsignedChar:3]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).d = [[NSData alloc] initWithBytes:"nested_octet_string" length:19]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).e = @"nested_char_string"; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).f = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).g = [NSNumber numberWithFloat:0.0f]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).h = [NSNumber numberWithDouble:0]; - - temp_1[1] = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).a = [NSNumber numberWithUnsignedChar:2]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).b = [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).c = [NSNumber numberWithUnsignedChar:3]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).d = [[NSData alloc] initWithBytes:"nested_octet_string" length:19]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).e = @"nested_char_string"; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).f = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).g = [NSNumber numberWithFloat:0.0f]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).h = [NSNumber numberWithDouble:0]; - - ((CHIPTestClusterClusterNestedStructList *) params.arg1).d = temp_1; - } - { - NSMutableArray * temp_1 = [[NSMutableArray alloc] init]; - temp_1[0] = [NSNumber numberWithUnsignedInt:1UL]; - temp_1[1] = [NSNumber numberWithUnsignedInt:2UL]; - temp_1[2] = [NSNumber numberWithUnsignedInt:3UL]; - ((CHIPTestClusterClusterNestedStructList *) params.arg1).e = temp_1; - } - { - NSMutableArray * temp_1 = [[NSMutableArray alloc] init]; - temp_1[0] = [[NSData alloc] initWithBytes:"octet_string_1" length:14]; - temp_1[1] = [[NSData alloc] initWithBytes:"octect_string_2" length:15]; - temp_1[2] = [[NSData alloc] initWithBytes:"octet_string_3" length:14]; - ((CHIPTestClusterClusterNestedStructList *) params.arg1).f = temp_1; - } - { - NSMutableArray * temp_1 = [[NSMutableArray alloc] init]; - temp_1[0] = [NSNumber numberWithUnsignedChar:0]; - temp_1[1] = [NSNumber numberWithUnsignedChar:255]; - ((CHIPTestClusterClusterNestedStructList *) params.arg1).g = temp_1; - } - - [cluster testNestedStructListArgumentRequestWithParams:params - completionHandler:^(CHIPTestClusterClusterBooleanResponseParams * _Nullable values, - NSError * _Nullable err) { - NSLog(@"Send Test Command With Nested Struct List Argument and all fields b of " - @"arg1.d are true Error: %@", - err); + [cluster readAttributeNullableInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT8U unchanged Value with constraint Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = values.value; - VerifyOrReturn(CheckValue("value", actualValue, true)); - } + VerifyOrReturn(CheckValueNonNull("nullableInt8u", value)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendTestCommandWithNestedStructListArgumentAndSomeFieldsBOfArg1dAreFalse_158() + CHIP_ERROR TestWriteAttributeNullableInt8uNullValue_214() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPTestClusterClusterTestNestedStructListArgumentRequestParams alloc] init]; - params.arg1 = [[CHIPTestClusterClusterNestedStructList alloc] init]; - ((CHIPTestClusterClusterNestedStructList *) params.arg1).a = [NSNumber numberWithUnsignedChar:0]; - ((CHIPTestClusterClusterNestedStructList *) params.arg1).b = [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterNestedStructList *) params.arg1).c = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).a = - [NSNumber numberWithUnsignedChar:0]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).b = - [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).c = - [NSNumber numberWithUnsignedChar:2]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).d = - [[NSData alloc] initWithBytes:"octet_string" length:12]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).e = @"char_string"; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).f = - [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).g = - [NSNumber numberWithFloat:0.0f]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).h = - [NSNumber numberWithDouble:0]; - - { - NSMutableArray * temp_1 = [[NSMutableArray alloc] init]; - temp_1[0] = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).a = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).b = [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).c = [NSNumber numberWithUnsignedChar:3]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).d = [[NSData alloc] initWithBytes:"nested_octet_string" length:19]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).e = @"nested_char_string"; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).f = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).g = [NSNumber numberWithFloat:0.0f]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).h = [NSNumber numberWithDouble:0]; - - temp_1[1] = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).a = [NSNumber numberWithUnsignedChar:2]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).b = [NSNumber numberWithBool:false]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).c = [NSNumber numberWithUnsignedChar:3]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).d = [[NSData alloc] initWithBytes:"nested_octet_string" length:19]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).e = @"nested_char_string"; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).f = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).g = [NSNumber numberWithFloat:0.0f]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).h = [NSNumber numberWithDouble:0]; - - ((CHIPTestClusterClusterNestedStructList *) params.arg1).d = temp_1; - } - { - NSMutableArray * temp_1 = [[NSMutableArray alloc] init]; - temp_1[0] = [NSNumber numberWithUnsignedInt:1UL]; - temp_1[1] = [NSNumber numberWithUnsignedInt:2UL]; - temp_1[2] = [NSNumber numberWithUnsignedInt:3UL]; - ((CHIPTestClusterClusterNestedStructList *) params.arg1).e = temp_1; - } - { - NSMutableArray * temp_1 = [[NSMutableArray alloc] init]; - temp_1[0] = [[NSData alloc] initWithBytes:"octet_string_1" length:14]; - temp_1[1] = [[NSData alloc] initWithBytes:"octect_string_2" length:15]; - temp_1[2] = [[NSData alloc] initWithBytes:"octet_string_3" length:14]; - ((CHIPTestClusterClusterNestedStructList *) params.arg1).f = temp_1; - } - { - NSMutableArray * temp_1 = [[NSMutableArray alloc] init]; - temp_1[0] = [NSNumber numberWithUnsignedChar:0]; - temp_1[1] = [NSNumber numberWithUnsignedChar:255]; - ((CHIPTestClusterClusterNestedStructList *) params.arg1).g = temp_1; - } - - [cluster testNestedStructListArgumentRequestWithParams:params - completionHandler:^(CHIPTestClusterClusterBooleanResponseParams * _Nullable values, - NSError * _Nullable err) { - NSLog(@"Send Test Command With Nested Struct List Argument and some fields b of " - @"arg1.d are false Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id nullableInt8uArgument; + nullableInt8uArgument = nil; + [cluster writeAttributeNullableInt8uWithValue:nullableInt8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT8U null Value Error: %@", err); - { - id actualValue = values.value; - VerifyOrReturn(CheckValue("value", actualValue, false)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendTestCommandWithStructArgumentAndSeeWhatWeGetBack_159() + CHIP_ERROR TestReadAttributeNullableInt8uNullValue_215() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPTestClusterClusterSimpleStructEchoRequestParams alloc] init]; - params.arg1 = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).a = [NSNumber numberWithUnsignedChar:17]; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).b = [NSNumber numberWithBool:false]; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).c = [NSNumber numberWithUnsignedChar:2]; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).d = [[NSData alloc] initWithBytes:"octet_string" length:12]; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).e = @"char_string"; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).f = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).g = [NSNumber numberWithFloat:0.1f]; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).h = [NSNumber numberWithDouble:0.1]; - - [cluster - simpleStructEchoRequestWithParams:params - completionHandler:^( - CHIPTestClusterClusterSimpleStructResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Send Test Command With Struct Argument and see what we get back Error: %@", err); + [cluster readAttributeNullableInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT8U null Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = values.arg1; - VerifyOrReturn(CheckValue("a", ((CHIPTestClusterClusterSimpleStruct *) actualValue).a, 17)); - VerifyOrReturn(CheckValue("b", ((CHIPTestClusterClusterSimpleStruct *) actualValue).b, false)); - VerifyOrReturn(CheckValue("c", ((CHIPTestClusterClusterSimpleStruct *) actualValue).c, 2)); - VerifyOrReturn(CheckValueAsString("d", ((CHIPTestClusterClusterSimpleStruct *) actualValue).d, - [[NSData alloc] initWithBytes:"octet_string" length:12])); - VerifyOrReturn(CheckValueAsString( - "e", ((CHIPTestClusterClusterSimpleStruct *) actualValue).e, @"char_string")); - VerifyOrReturn(CheckValue("f", ((CHIPTestClusterClusterSimpleStruct *) actualValue).f, 1)); - VerifyOrReturn(CheckValue("g", ((CHIPTestClusterClusterSimpleStruct *) actualValue).g, 0.1f)); - VerifyOrReturn(CheckValue("h", ((CHIPTestClusterClusterSimpleStruct *) actualValue).h, 0.1)); - } + { + id actualValue = value; + VerifyOrReturn(CheckValueNull("nullable_int8u", actualValue)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendTestCommandWithListOfInt8uAndNoneOfThemIsSetTo0_160() + CHIP_ERROR TestReadAttributeNullableInt8uNullValueRange_216() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPTestClusterClusterTestListInt8UArgumentRequestParams alloc] init]; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [NSNumber numberWithUnsignedChar:1]; - temp_0[1] = [NSNumber numberWithUnsignedChar:2]; - temp_0[2] = [NSNumber numberWithUnsignedChar:3]; - temp_0[3] = [NSNumber numberWithUnsignedChar:4]; - temp_0[4] = [NSNumber numberWithUnsignedChar:5]; - temp_0[5] = [NSNumber numberWithUnsignedChar:6]; - temp_0[6] = [NSNumber numberWithUnsignedChar:7]; - temp_0[7] = [NSNumber numberWithUnsignedChar:8]; - temp_0[8] = [NSNumber numberWithUnsignedChar:9]; - params.arg1 = temp_0; - } - [cluster - testListInt8UArgumentRequestWithParams:params - completionHandler:^( - CHIPTestClusterClusterBooleanResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Send Test Command With List of INT8U and none of them is set to 0 Error: %@", err); + [cluster readAttributeNullableInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT8U null Value & range Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = values.value; - VerifyOrReturn(CheckValue("value", actualValue, true)); - } + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("nullableInt8u", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("nullableInt8u", [value unsignedCharValue], 254)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendTestCommandWithListOfInt8uAndOneOfThemIsSetTo0_161() + CHIP_ERROR TestReadAttributeNullableInt8uNullValueNot_217() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPTestClusterClusterTestListInt8UArgumentRequestParams alloc] init]; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [NSNumber numberWithUnsignedChar:1]; - temp_0[1] = [NSNumber numberWithUnsignedChar:2]; - temp_0[2] = [NSNumber numberWithUnsignedChar:3]; - temp_0[3] = [NSNumber numberWithUnsignedChar:4]; - temp_0[4] = [NSNumber numberWithUnsignedChar:5]; - temp_0[5] = [NSNumber numberWithUnsignedChar:6]; - temp_0[6] = [NSNumber numberWithUnsignedChar:7]; - temp_0[7] = [NSNumber numberWithUnsignedChar:8]; - temp_0[8] = [NSNumber numberWithUnsignedChar:9]; - temp_0[9] = [NSNumber numberWithUnsignedChar:0]; - params.arg1 = temp_0; - } - [cluster testListInt8UArgumentRequestWithParams:params - completionHandler:^( - CHIPTestClusterClusterBooleanResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Send Test Command With List of INT8U and one of them is set to 0 Error: %@", err); + [cluster readAttributeNullableInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT8U null Value & not Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = values.value; - VerifyOrReturn(CheckValue("value", actualValue, false)); - } + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("nullableInt8u", value, 254)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendTestCommandWithListOfInt8uAndGetItReversed_162() + CHIP_ERROR TestWriteAttributeNullableInt8uValue_218() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPTestClusterClusterTestListInt8UReverseRequestParams alloc] init]; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [NSNumber numberWithUnsignedChar:1]; - temp_0[1] = [NSNumber numberWithUnsignedChar:2]; - temp_0[2] = [NSNumber numberWithUnsignedChar:3]; - temp_0[3] = [NSNumber numberWithUnsignedChar:4]; - temp_0[4] = [NSNumber numberWithUnsignedChar:5]; - temp_0[5] = [NSNumber numberWithUnsignedChar:6]; - temp_0[6] = [NSNumber numberWithUnsignedChar:7]; - temp_0[7] = [NSNumber numberWithUnsignedChar:8]; - temp_0[8] = [NSNumber numberWithUnsignedChar:9]; - params.arg1 = temp_0; - } - [cluster - testListInt8UReverseRequestWithParams:params - completionHandler:^(CHIPTestClusterClusterTestListInt8UReverseResponseParams * _Nullable values, - NSError * _Nullable err) { - NSLog(@"Send Test Command With List of INT8U and get it reversed Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id nullableInt8uArgument; + nullableInt8uArgument = [NSNumber numberWithUnsignedChar:128]; + [cluster writeAttributeNullableInt8uWithValue:nullableInt8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT8U Value Error: %@", err); - { - id actualValue = values.arg1; - VerifyOrReturn(CheckValue("arg1", [actualValue count], static_cast(9))); - VerifyOrReturn(CheckValue("", actualValue[0], 9)); - VerifyOrReturn(CheckValue("", actualValue[1], 8)); - VerifyOrReturn(CheckValue("", actualValue[2], 7)); - VerifyOrReturn(CheckValue("", actualValue[3], 6)); - VerifyOrReturn(CheckValue("", actualValue[4], 5)); - VerifyOrReturn(CheckValue("", actualValue[5], 4)); - VerifyOrReturn(CheckValue("", actualValue[6], 3)); - VerifyOrReturn(CheckValue("", actualValue[7], 2)); - VerifyOrReturn(CheckValue("", actualValue[8], 1)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendTestCommandWithEmptyListOfInt8uAndGetAnEmptyListBack_163() + CHIP_ERROR TestReadAttributeNullableInt8uValueInRange_219() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPTestClusterClusterTestListInt8UReverseRequestParams alloc] init]; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - params.arg1 = temp_0; - } - [cluster - testListInt8UReverseRequestWithParams:params - completionHandler:^(CHIPTestClusterClusterTestListInt8UReverseResponseParams * _Nullable values, - NSError * _Nullable err) { - NSLog(@"Send Test Command With empty List of INT8U and get an empty list back Error: %@", err); + [cluster readAttributeNullableInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT8U Value in range Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = values.arg1; - VerifyOrReturn(CheckValue("arg1", [actualValue count], static_cast(0))); - } + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("nullableInt8u", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("nullableInt8u", [value unsignedCharValue], 254)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendTestCommandWithListOfStructArgumentAndArg1bOfFirstItemIsTrue_164() + CHIP_ERROR TestReadAttributeNullableInt8uNotValueOk_220() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPTestClusterClusterTestListStructArgumentRequestParams alloc] init]; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).a = [NSNumber numberWithUnsignedChar:0]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).b = [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).c = [NSNumber numberWithUnsignedChar:2]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).d = [[NSData alloc] initWithBytes:"first_octet_string" length:18]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).e = @"first_char_string"; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).f = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).g = [NSNumber numberWithFloat:0.0f]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).h = [NSNumber numberWithDouble:0]; - - temp_0[1] = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).a = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).b = [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).c = [NSNumber numberWithUnsignedChar:3]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).d = [[NSData alloc] initWithBytes:"second_octet_string" length:19]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).e = @"second_char_string"; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).f = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).g = [NSNumber numberWithFloat:0.0f]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).h = [NSNumber numberWithDouble:0]; - - params.arg1 = temp_0; - } - [cluster testListStructArgumentRequestWithParams:params - completionHandler:^(CHIPTestClusterClusterBooleanResponseParams * _Nullable values, - NSError * _Nullable err) { - NSLog(@"Send Test Command With List of Struct Argument and arg1.b of first item is true " - @"Error: %@", - err); + [cluster readAttributeNullableInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT8U notValue OK Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = values.value; - VerifyOrReturn(CheckValue("value", actualValue, true)); - } + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("nullableInt8u", value, 129)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendTestCommandWithListOfStructArgumentAndArg1bOfFirstItemIsFalse_165() + CHIP_ERROR TestWriteAttributeNullableInt16uMinValue_221() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPTestClusterClusterTestListStructArgumentRequestParams alloc] init]; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).a = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).b = [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).c = [NSNumber numberWithUnsignedChar:3]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).d = [[NSData alloc] initWithBytes:"second_octet_string" length:19]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).e = @"second_char_string"; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).f = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).g = [NSNumber numberWithFloat:0.0f]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).h = [NSNumber numberWithDouble:0]; - - temp_0[1] = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).a = [NSNumber numberWithUnsignedChar:0]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).b = [NSNumber numberWithBool:false]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).c = [NSNumber numberWithUnsignedChar:2]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).d = [[NSData alloc] initWithBytes:"first_octet_string" length:18]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).e = @"first_char_string"; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).f = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).g = [NSNumber numberWithFloat:0.0f]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).h = [NSNumber numberWithDouble:0]; - - params.arg1 = temp_0; - } - [cluster testListStructArgumentRequestWithParams:params - completionHandler:^(CHIPTestClusterClusterBooleanResponseParams * _Nullable values, - NSError * _Nullable err) { - NSLog(@"Send Test Command With List of Struct Argument and arg1.b of first item is " - @"false Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id nullableInt16uArgument; + nullableInt16uArgument = [NSNumber numberWithUnsignedShort:0U]; + [cluster writeAttributeNullableInt16uWithValue:nullableInt16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT16U Min Value Error: %@", err); - { - id actualValue = values.value; - VerifyOrReturn(CheckValue("value", actualValue, false)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendTestCommandWithListOfNestedStructListArgumentAndAllFieldsBOfElementsOfArg1dAreTrue_166() + CHIP_ERROR TestReadAttributeNullableInt16uMinValue_222() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPTestClusterClusterTestListNestedStructListArgumentRequestParams alloc] init]; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [[CHIPTestClusterClusterNestedStructList alloc] init]; - ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).a = [NSNumber numberWithUnsignedChar:0]; - ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).b = [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).a = - [NSNumber numberWithUnsignedChar:0]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).b = - [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).c = - [NSNumber numberWithUnsignedChar:2]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).d = - [[NSData alloc] initWithBytes:"octet_string" length:12]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).e = @"char_string"; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).f = - [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).g = - [NSNumber numberWithFloat:0.0f]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).h = - [NSNumber numberWithDouble:0]; - - { - NSMutableArray * temp_2 = [[NSMutableArray alloc] init]; - temp_2[0] = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).a = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).b = [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).c = [NSNumber numberWithUnsignedChar:3]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).d = [[NSData alloc] initWithBytes:"nested_octet_string" - length:19]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).e = @"nested_char_string"; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).f = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).g = [NSNumber numberWithFloat:0.0f]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).h = [NSNumber numberWithDouble:0]; + [cluster readAttributeNullableInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT16U Min Value Error: %@", err); - temp_2[1] = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).a = [NSNumber numberWithUnsignedChar:2]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).b = [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).c = [NSNumber numberWithUnsignedChar:3]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).d = [[NSData alloc] initWithBytes:"nested_octet_string" - length:19]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).e = @"nested_char_string"; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).f = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).g = [NSNumber numberWithFloat:0.0f]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).h = [NSNumber numberWithDouble:0]; + VerifyOrReturn(CheckValue("status", err, 0)); - ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).d = temp_2; - } - { - NSMutableArray * temp_2 = [[NSMutableArray alloc] init]; - temp_2[0] = [NSNumber numberWithUnsignedInt:1UL]; - temp_2[1] = [NSNumber numberWithUnsignedInt:2UL]; - temp_2[2] = [NSNumber numberWithUnsignedInt:3UL]; - ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).e = temp_2; - } - { - NSMutableArray * temp_2 = [[NSMutableArray alloc] init]; - temp_2[0] = [[NSData alloc] initWithBytes:"octet_string_1" length:14]; - temp_2[1] = [[NSData alloc] initWithBytes:"octect_string_2" length:15]; - temp_2[2] = [[NSData alloc] initWithBytes:"octet_string_3" length:14]; - ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).f = temp_2; - } { - NSMutableArray * temp_2 = [[NSMutableArray alloc] init]; - temp_2[0] = [NSNumber numberWithUnsignedChar:0]; - temp_2[1] = [NSNumber numberWithUnsignedChar:255]; - ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).g = temp_2; + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_int16u", actualValue)); + VerifyOrReturn(CheckValue("nullable_int16u", actualValue, 0U)); } - params.arg1 = temp_0; - } - [cluster testListNestedStructListArgumentRequestWithParams:params - completionHandler:^(CHIPTestClusterClusterBooleanResponseParams * _Nullable values, - NSError * _Nullable err) { - NSLog(@"Send Test Command With List of Nested Struct List Argument and all " - @"fields b of elements of arg1.d are true Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = values.value; - VerifyOrReturn(CheckValue("value", actualValue, true)); - } - - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendTestCommandWithNestedStructListArgumentAndSomeFieldsBOfElementsOfArg1dAreFalse_167() + CHIP_ERROR TestWriteAttributeNullableInt16uMaxValue_223() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPTestClusterClusterTestListNestedStructListArgumentRequestParams alloc] init]; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [[CHIPTestClusterClusterNestedStructList alloc] init]; - ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).a = [NSNumber numberWithUnsignedChar:0]; - ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).b = [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).a = - [NSNumber numberWithUnsignedChar:0]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).b = - [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).c = - [NSNumber numberWithUnsignedChar:2]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).d = - [[NSData alloc] initWithBytes:"octet_string" length:12]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).e = @"char_string"; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).f = - [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).g = - [NSNumber numberWithFloat:0.0f]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).h = - [NSNumber numberWithDouble:0]; - - { - NSMutableArray * temp_2 = [[NSMutableArray alloc] init]; - temp_2[0] = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).a = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).b = [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).c = [NSNumber numberWithUnsignedChar:3]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).d = [[NSData alloc] initWithBytes:"nested_octet_string" - length:19]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).e = @"nested_char_string"; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).f = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).g = [NSNumber numberWithFloat:0.0f]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).h = [NSNumber numberWithDouble:0]; - - temp_2[1] = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).a = [NSNumber numberWithUnsignedChar:2]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).b = [NSNumber numberWithBool:false]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).c = [NSNumber numberWithUnsignedChar:3]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).d = [[NSData alloc] initWithBytes:"nested_octet_string" - length:19]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).e = @"nested_char_string"; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).f = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).g = [NSNumber numberWithFloat:0.0f]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).h = [NSNumber numberWithDouble:0]; - - ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).d = temp_2; - } - { - NSMutableArray * temp_2 = [[NSMutableArray alloc] init]; - temp_2[0] = [NSNumber numberWithUnsignedInt:1UL]; - temp_2[1] = [NSNumber numberWithUnsignedInt:2UL]; - temp_2[2] = [NSNumber numberWithUnsignedInt:3UL]; - ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).e = temp_2; - } - { - NSMutableArray * temp_2 = [[NSMutableArray alloc] init]; - temp_2[0] = [[NSData alloc] initWithBytes:"octet_string_1" length:14]; - temp_2[1] = [[NSData alloc] initWithBytes:"octect_string_2" length:15]; - temp_2[2] = [[NSData alloc] initWithBytes:"octet_string_3" length:14]; - ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).f = temp_2; - } - { - NSMutableArray * temp_2 = [[NSMutableArray alloc] init]; - temp_2[0] = [NSNumber numberWithUnsignedChar:0]; - temp_2[1] = [NSNumber numberWithUnsignedChar:255]; - ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).g = temp_2; - } - - params.arg1 = temp_0; - } - [cluster testListNestedStructListArgumentRequestWithParams:params - completionHandler:^(CHIPTestClusterClusterBooleanResponseParams * _Nullable values, - NSError * _Nullable err) { - NSLog(@"Send Test Command With Nested Struct List Argument and some fields b " - @"of elements of arg1.d are false Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id nullableInt16uArgument; + nullableInt16uArgument = [NSNumber numberWithUnsignedShort:65534U]; + [cluster writeAttributeNullableInt16uWithValue:nullableInt16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT16U Max Value Error: %@", err); - { - id actualValue = values.value; - VerifyOrReturn(CheckValue("value", actualValue, false)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeListWithListOfInt8uAndNoneOfThemIsSetTo0_168() + CHIP_ERROR TestReadAttributeNullableInt16uMaxValue_224() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id listInt8uArgument; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [NSNumber numberWithUnsignedChar:1]; - temp_0[1] = [NSNumber numberWithUnsignedChar:2]; - temp_0[2] = [NSNumber numberWithUnsignedChar:3]; - temp_0[3] = [NSNumber numberWithUnsignedChar:4]; - listInt8uArgument = temp_0; - } - [cluster writeAttributeListInt8uWithValue:listInt8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute LIST With List of INT8U and none of them is set to 0 Error: %@", err); + [cluster readAttributeNullableInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT16U Max Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_int16u", actualValue)); + VerifyOrReturn(CheckValue("nullable_int16u", actualValue, 65534U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } - VerifyOrReturn(CheckValue("status", err, 0)); + CHIP_ERROR TestWriteAttributeNullableInt16uInvalidValue_225() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - NextTest(); - }]; + id nullableInt16uArgument; + nullableInt16uArgument = [NSNumber numberWithUnsignedShort:65535U]; + [cluster writeAttributeNullableInt16uWithValue:nullableInt16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT16U Invalid Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeListWithListOfInt8u_169() + CHIP_ERROR TestReadAttributeNullableInt16uUnchangedValue_226() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeListInt8uWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute LIST With List of INT8U Error: %@", err); + [cluster readAttributeNullableInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT16U unchanged Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("list_int8u", [actualValue count], static_cast(4))); - VerifyOrReturn(CheckValue("", actualValue[0], 1)); - VerifyOrReturn(CheckValue("", actualValue[1], 2)); - VerifyOrReturn(CheckValue("", actualValue[2], 3)); - VerifyOrReturn(CheckValue("", actualValue[3], 4)); + VerifyOrReturn(CheckValueNonNull("nullable_int16u", actualValue)); + VerifyOrReturn(CheckValue("nullable_int16u", actualValue, 65534U)); } NextTest(); @@ -53920,51 +61639,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeListWithListOfOctetString_170() + CHIP_ERROR TestWriteAttributeNullableInt16uNullValue_227() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id listOctetStringArgument; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [[NSData alloc] initWithBytes:"Test0" length:5]; - temp_0[1] = [[NSData alloc] initWithBytes:"Test1" length:5]; - temp_0[2] = [[NSData alloc] initWithBytes:"Test2" length:5]; - temp_0[3] = [[NSData alloc] initWithBytes:"Test3" length:5]; - listOctetStringArgument = temp_0; - } - [cluster writeAttributeListOctetStringWithValue:listOctetStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute LIST With List of OCTET_STRING Error: %@", err); + id nullableInt16uArgument; + nullableInt16uArgument = nil; + [cluster writeAttributeNullableInt16uWithValue:nullableInt16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT16U null Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeListWithListOfOctetString_171() + CHIP_ERROR TestReadAttributeNullableInt16uNullValue_228() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeListOctetStringWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute LIST With List of OCTET_STRING Error: %@", err); + [cluster readAttributeNullableInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT16U null Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("list_octet_string", [actualValue count], static_cast(4))); - VerifyOrReturn(CheckValueAsString("", actualValue[0], [[NSData alloc] initWithBytes:"Test0" length:5])); - VerifyOrReturn(CheckValueAsString("", actualValue[1], [[NSData alloc] initWithBytes:"Test1" length:5])); - VerifyOrReturn(CheckValueAsString("", actualValue[2], [[NSData alloc] initWithBytes:"Test2" length:5])); - VerifyOrReturn(CheckValueAsString("", actualValue[3], [[NSData alloc] initWithBytes:"Test3" length:5])); + VerifyOrReturn(CheckValueNull("nullable_int16u", actualValue)); } NextTest(); @@ -53973,83 +61681,43 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeListWithListOfListStructOctetString_172() + CHIP_ERROR TestReadAttributeNullableInt16uNullValueRange_229() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id listStructOctetStringArgument; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [[CHIPTestClusterClusterTestListStructOctet alloc] init]; - ((CHIPTestClusterClusterTestListStructOctet *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedLongLong:0ULL]; - ((CHIPTestClusterClusterTestListStructOctet *) temp_0[0]).operationalCert = [[NSData alloc] initWithBytes:"Test0" - length:5]; - - temp_0[1] = [[CHIPTestClusterClusterTestListStructOctet alloc] init]; - ((CHIPTestClusterClusterTestListStructOctet *) temp_0[1]).fabricIndex = [NSNumber numberWithUnsignedLongLong:1ULL]; - ((CHIPTestClusterClusterTestListStructOctet *) temp_0[1]).operationalCert = [[NSData alloc] initWithBytes:"Test1" - length:5]; - - temp_0[2] = [[CHIPTestClusterClusterTestListStructOctet alloc] init]; - ((CHIPTestClusterClusterTestListStructOctet *) temp_0[2]).fabricIndex = [NSNumber numberWithUnsignedLongLong:2ULL]; - ((CHIPTestClusterClusterTestListStructOctet *) temp_0[2]).operationalCert = [[NSData alloc] initWithBytes:"Test2" - length:5]; - - temp_0[3] = [[CHIPTestClusterClusterTestListStructOctet alloc] init]; - ((CHIPTestClusterClusterTestListStructOctet *) temp_0[3]).fabricIndex = [NSNumber numberWithUnsignedLongLong:3ULL]; - ((CHIPTestClusterClusterTestListStructOctet *) temp_0[3]).operationalCert = [[NSData alloc] initWithBytes:"Test3" - length:5]; + [cluster readAttributeNullableInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT16U null Value & range Error: %@", err); - listStructOctetStringArgument = temp_0; - } - [cluster writeAttributeListStructOctetStringWithValue:listStructOctetStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute LIST With List of LIST_STRUCT_OCTET_STRING Error: %@", err); + VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckValue("status", err, 0)); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("nullableInt16u", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("nullableInt16u", [value unsignedShortValue], 65534U)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeListWithListOfListStructOctetString_173() + CHIP_ERROR TestReadAttributeNullableInt16uNullValueNot_230() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeListStructOctetStringWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute LIST With List of LIST_STRUCT_OCTET_STRING Error: %@", err); + [cluster readAttributeNullableInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT16U null Value & not Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("list_struct_octet_string", [actualValue count], static_cast(4))); - VerifyOrReturn( - CheckValue("fabricIndex", ((CHIPTestClusterClusterTestListStructOctet *) actualValue[0]).fabricIndex, 0ULL)); - VerifyOrReturn(CheckValueAsString("operationalCert", - ((CHIPTestClusterClusterTestListStructOctet *) actualValue[0]).operationalCert, - [[NSData alloc] initWithBytes:"Test0" length:5])); - VerifyOrReturn( - CheckValue("fabricIndex", ((CHIPTestClusterClusterTestListStructOctet *) actualValue[1]).fabricIndex, 1ULL)); - VerifyOrReturn(CheckValueAsString("operationalCert", - ((CHIPTestClusterClusterTestListStructOctet *) actualValue[1]).operationalCert, - [[NSData alloc] initWithBytes:"Test1" length:5])); - VerifyOrReturn( - CheckValue("fabricIndex", ((CHIPTestClusterClusterTestListStructOctet *) actualValue[2]).fabricIndex, 2ULL)); - VerifyOrReturn(CheckValueAsString("operationalCert", - ((CHIPTestClusterClusterTestListStructOctet *) actualValue[2]).operationalCert, - [[NSData alloc] initWithBytes:"Test2" length:5])); - VerifyOrReturn( - CheckValue("fabricIndex", ((CHIPTestClusterClusterTestListStructOctet *) actualValue[3]).fabricIndex, 3ULL)); - VerifyOrReturn(CheckValueAsString("operationalCert", - ((CHIPTestClusterClusterTestListStructOctet *) actualValue[3]).operationalCert, - [[NSData alloc] initWithBytes:"Test3" length:5])); + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("nullableInt16u", value, 65534U)); } NextTest(); @@ -54058,98 +61726,63 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestSendTestCommandWithOptionalArgSet_174() + CHIP_ERROR TestWriteAttributeNullableInt16uValue_231() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPTestClusterClusterTestNullableOptionalRequestParams alloc] init]; - params.arg1 = [NSNumber numberWithUnsignedChar:5]; - [cluster - testNullableOptionalRequestWithParams:params - completionHandler:^(CHIPTestClusterClusterTestNullableOptionalResponseParams * _Nullable values, - NSError * _Nullable err) { - NSLog(@"Send Test Command with optional arg set. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = values.wasPresent; - VerifyOrReturn(CheckValue("wasPresent", actualValue, true)); - } - - { - id actualValue = values.wasNull; - VerifyOrReturn(CheckValue("wasNull", actualValue, false)); - } - - { - id actualValue = values.value; - VerifyOrReturn(CheckValue("value", actualValue, 5)); - } + id nullableInt16uArgument; + nullableInt16uArgument = [NSNumber numberWithUnsignedShort:32000U]; + [cluster writeAttributeNullableInt16uWithValue:nullableInt16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT16U Value Error: %@", err); - { - id actualValue = values.originalValue; - VerifyOrReturn(CheckValueNonNull("originalValue", actualValue)); - VerifyOrReturn(CheckValue("originalValue", actualValue, 5)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendTestCommandWithoutItsOptionalArg_175() + CHIP_ERROR TestReadAttributeNullableInt16uValueInRange_232() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPTestClusterClusterTestNullableOptionalRequestParams alloc] init]; - [cluster - testNullableOptionalRequestWithParams:params - completionHandler:^(CHIPTestClusterClusterTestNullableOptionalResponseParams * _Nullable values, - NSError * _Nullable err) { - NSLog(@"Send Test Command without its optional arg. Error: %@", err); + [cluster readAttributeNullableInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT16U Value in range Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = values.wasPresent; - VerifyOrReturn(CheckValue("wasPresent", actualValue, false)); - } + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("nullableInt16u", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("nullableInt16u", [value unsignedShortValue], 65534U)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadListOfStructsContainingNullablesAndOptionals_176() + CHIP_ERROR TestReadAttributeNullableInt16uNotValueOk_233() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeListNullablesAndOptionalsStructWithCompletionHandler:^( - NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read list of structs containing nullables and optionals Error: %@", err); + [cluster readAttributeNullableInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT16U notValue OK Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("list_nullables_and_optionals_struct", [actualValue count], static_cast(1))); - VerifyOrReturn(CheckValueNull( - "NullableInt", ((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableInt)); - VerifyOrReturn(CheckValueNull( - "NullableString", ((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableString)); - VerifyOrReturn(CheckValueNull( - "NullableStruct", ((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableStruct)); - VerifyOrReturn(CheckValueNull( - "NullableList", ((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableList)); + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("nullableInt16u", value, 32001U)); } NextTest(); @@ -54158,72 +61791,41 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteListOfStructsContainingNullablesAndOptionals_177() + CHIP_ERROR TestWriteAttributeNullableInt32uMinValue_234() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id listNullablesAndOptionalsStructArgument; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [[CHIPTestClusterClusterNullablesAndOptionalsStruct alloc] init]; - ((CHIPTestClusterClusterNullablesAndOptionalsStruct *) temp_0[0]).nullableInt = nil; - ((CHIPTestClusterClusterNullablesAndOptionalsStruct *) temp_0[0]).nullableString = nil; - ((CHIPTestClusterClusterNullablesAndOptionalsStruct *) temp_0[0]).nullableStruct = nil; - { - NSMutableArray * temp_3 = [[NSMutableArray alloc] init]; - temp_3[0] = [NSNumber numberWithUnsignedChar:1]; - temp_3[1] = [NSNumber numberWithUnsignedChar:2]; - ((CHIPTestClusterClusterNullablesAndOptionalsStruct *) temp_0[0]).nullableList = temp_3; - } - - listNullablesAndOptionalsStructArgument = temp_0; - } - [cluster - writeAttributeListNullablesAndOptionalsStructWithValue:listNullablesAndOptionalsStructArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write list of structs containing nullables and optionals Error: %@", - err); + id nullableInt32uArgument; + nullableInt32uArgument = [NSNumber numberWithUnsignedInt:0UL]; + [cluster writeAttributeNullableInt32uWithValue:nullableInt32uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT32U Min Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadListOfStructsContainingNullablesAndOptionalsAfterWriting_178() + CHIP_ERROR TestReadAttributeNullableInt32uMinValue_235() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeListNullablesAndOptionalsStructWithCompletionHandler:^( - NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read list of structs containing nullables and optionals after writing Error: %@", err); + [cluster readAttributeNullableInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT32U Min Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("list_nullables_and_optionals_struct", [actualValue count], static_cast(1))); - VerifyOrReturn(CheckValueNull( - "NullableInt", ((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableInt)); - VerifyOrReturn(CheckValueNull( - "NullableString", ((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableString)); - VerifyOrReturn(CheckValueNull( - "NullableStruct", ((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableStruct)); - VerifyOrReturn(CheckValueNonNull( - "NullableList", ((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableList)); - VerifyOrReturn(CheckValue("NullableList", - [((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableList count], - static_cast(2))); - VerifyOrReturn( - CheckValue("", ((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableList[0], 1)); - VerifyOrReturn( - CheckValue("", ((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableList[1], 2)); + VerifyOrReturn(CheckValueNonNull("nullable_int32u", actualValue)); + VerifyOrReturn(CheckValue("nullable_int32u", actualValue, 0UL)); } NextTest(); @@ -54232,40 +61834,41 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableBooleanNull_179() + CHIP_ERROR TestWriteAttributeNullableInt32uMaxValue_236() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableBooleanArgument; - nullableBooleanArgument = nil; - [cluster writeAttributeNullableBooleanWithValue:nullableBooleanArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_BOOLEAN null Error: %@", err); + id nullableInt32uArgument; + nullableInt32uArgument = [NSNumber numberWithUnsignedInt:4294967294UL]; + [cluster writeAttributeNullableInt32uWithValue:nullableInt32uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT32U Max Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableBooleanNull_180() + CHIP_ERROR TestReadAttributeNullableInt32uMaxValue_237() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_BOOLEAN null Error: %@", err); + [cluster readAttributeNullableInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT32U Max Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNull("nullable_boolean", actualValue)); + VerifyOrReturn(CheckValueNonNull("nullable_int32u", actualValue)); + VerifyOrReturn(CheckValue("nullable_int32u", actualValue, 4294967294UL)); } NextTest(); @@ -54274,41 +61877,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableBooleanTrue_181() + CHIP_ERROR TestWriteAttributeNullableInt32uInvalidValue_238() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableBooleanArgument; - nullableBooleanArgument = [NSNumber numberWithBool:true]; - [cluster writeAttributeNullableBooleanWithValue:nullableBooleanArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_BOOLEAN True Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id nullableInt32uArgument; + nullableInt32uArgument = [NSNumber numberWithUnsignedInt:4294967295UL]; + [cluster writeAttributeNullableInt32uWithValue:nullableInt32uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT32U Invalid Value Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableBooleanTrue_182() + CHIP_ERROR TestReadAttributeNullableInt32uUnchangedValue_239() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_BOOLEAN True Error: %@", err); + [cluster readAttributeNullableInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT32U unchanged Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_boolean", actualValue)); - VerifyOrReturn(CheckValue("nullable_boolean", actualValue, true)); + VerifyOrReturn(CheckValueNonNull("nullable_int32u", actualValue)); + VerifyOrReturn(CheckValue("nullable_int32u", actualValue, 4294967294UL)); } NextTest(); @@ -54317,41 +61919,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableBitmap8MaxValue_183() + CHIP_ERROR TestWriteAttributeNullableInt32uNullValue_240() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableBitmap8Argument; - nullableBitmap8Argument = [NSNumber numberWithUnsignedChar:254]; - [cluster writeAttributeNullableBitmap8WithValue:nullableBitmap8Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_BITMAP8 Max Value Error: %@", err); + id nullableInt32uArgument; + nullableInt32uArgument = nil; + [cluster writeAttributeNullableInt32uWithValue:nullableInt32uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT32U null Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableBitmap8MaxValue_184() + CHIP_ERROR TestReadAttributeNullableInt32uNullValue_241() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableBitmap8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_BITMAP8 Max Value Error: %@", err); + [cluster readAttributeNullableInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT32U null Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_bitmap8", actualValue)); - VerifyOrReturn(CheckValue("nullable_bitmap8", actualValue, 254)); + VerifyOrReturn(CheckValueNull("nullable_int32u", actualValue)); } NextTest(); @@ -54360,40 +61961,43 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableBitmap8InvalidValue_185() + CHIP_ERROR TestReadAttributeNullableInt32uNullValueRange_242() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableBitmap8Argument; - nullableBitmap8Argument = [NSNumber numberWithUnsignedChar:255]; - [cluster writeAttributeNullableBitmap8WithValue:nullableBitmap8Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_BITMAP8 Invalid Value Error: %@", err); + [cluster readAttributeNullableInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT32U null Value & range Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("nullableInt32u", [value unsignedIntValue], 0UL)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("nullableInt32u", [value unsignedIntValue], 4294967294UL)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableBitmap8UnchangedValue_186() + CHIP_ERROR TestReadAttributeNullableInt32uNullValueNot_243() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableBitmap8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_BITMAP8 unchanged Value Error: %@", err); + [cluster readAttributeNullableInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT32U null Value & not Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_bitmap8", actualValue)); - VerifyOrReturn(CheckValue("nullable_bitmap8", actualValue, 254)); + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("nullableInt32u", value, 4294967294UL)); } NextTest(); @@ -54402,40 +62006,42 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableBitmap8NullValue_187() + CHIP_ERROR TestWriteAttributeNullableInt32uValue_244() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableBitmap8Argument; - nullableBitmap8Argument = nil; - [cluster writeAttributeNullableBitmap8WithValue:nullableBitmap8Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_BITMAP8 null Value Error: %@", err); + id nullableInt32uArgument; + nullableInt32uArgument = [NSNumber numberWithUnsignedInt:2147483647UL]; + [cluster writeAttributeNullableInt32uWithValue:nullableInt32uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT32U Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableBitmap8NullValue_188() + CHIP_ERROR TestReadAttributeNullableInt32uValueInRange_245() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableBitmap8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_BITMAP8 null Value Error: %@", err); + [cluster readAttributeNullableInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT32U Value in range Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNull("nullable_bitmap8", actualValue)); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("nullableInt32u", [value unsignedIntValue], 0UL)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("nullableInt32u", [value unsignedIntValue], 4294967294UL)); } NextTest(); @@ -54444,41 +62050,62 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableBitmap16MaxValue_189() + CHIP_ERROR TestReadAttributeNullableInt32uNotValueOk_246() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableBitmap16Argument; - nullableBitmap16Argument = [NSNumber numberWithUnsignedShort:65534U]; - [cluster writeAttributeNullableBitmap16WithValue:nullableBitmap16Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_BITMAP16 Max Value Error: %@", err); + [cluster readAttributeNullableInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT32U notValue OK Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("nullableInt32u", value, 2147483648UL)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableBitmap16MaxValue_190() + CHIP_ERROR TestWriteAttributeNullableInt64uMinValue_247() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableBitmap16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_BITMAP16 Max Value Error: %@", err); + id nullableInt64uArgument; + nullableInt64uArgument = [NSNumber numberWithUnsignedLongLong:0ULL]; + [cluster writeAttributeNullableInt64uWithValue:nullableInt64uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT64U Min Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeNullableInt64uMinValue_248() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeNullableInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT64U Min Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_bitmap16", actualValue)); - VerifyOrReturn(CheckValue("nullable_bitmap16", actualValue, 65534U)); + VerifyOrReturn(CheckValueNonNull("nullable_int64u", actualValue)); + VerifyOrReturn(CheckValue("nullable_int64u", actualValue, 0ULL)); } NextTest(); @@ -54487,40 +62114,41 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableBitmap16InvalidValue_191() + CHIP_ERROR TestWriteAttributeNullableInt64uMaxValue_249() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableBitmap16Argument; - nullableBitmap16Argument = [NSNumber numberWithUnsignedShort:65535U]; - [cluster writeAttributeNullableBitmap16WithValue:nullableBitmap16Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_BITMAP16 Invalid Value Error: %@", err); + id nullableInt64uArgument; + nullableInt64uArgument = [NSNumber numberWithUnsignedLongLong:18446744073709551614ULL]; + [cluster writeAttributeNullableInt64uWithValue:nullableInt64uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT64U Max Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableBitmap16UnchangedValue_192() + CHIP_ERROR TestReadAttributeNullableInt64uMaxValue_250() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableBitmap16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_BITMAP16 unchanged Value Error: %@", err); + [cluster readAttributeNullableInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT64U Max Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_bitmap16", actualValue)); - VerifyOrReturn(CheckValue("nullable_bitmap16", actualValue, 65534U)); + VerifyOrReturn(CheckValueNonNull("nullable_int64u", actualValue)); + VerifyOrReturn(CheckValue("nullable_int64u", actualValue, 18446744073709551614ULL)); } NextTest(); @@ -54529,40 +62157,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableBitmap16NullValue_193() + CHIP_ERROR TestWriteAttributeNullableInt64uInvalidValue_251() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableBitmap16Argument; - nullableBitmap16Argument = nil; - [cluster writeAttributeNullableBitmap16WithValue:nullableBitmap16Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_BITMAP16 null Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id nullableInt64uArgument; + nullableInt64uArgument = [NSNumber numberWithUnsignedLongLong:18446744073709551615ULL]; + [cluster writeAttributeNullableInt64uWithValue:nullableInt64uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT64U Invalid Value Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableBitmap16NullValue_194() + CHIP_ERROR TestReadAttributeNullableInt64uUnchangedValue_252() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableBitmap16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_BITMAP16 null Value Error: %@", err); + [cluster readAttributeNullableInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT64U unchanged Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNull("nullable_bitmap16", actualValue)); + VerifyOrReturn(CheckValueNonNull("nullable_int64u", actualValue)); + VerifyOrReturn(CheckValue("nullable_int64u", actualValue, 18446744073709551614ULL)); } NextTest(); @@ -54571,41 +62199,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableBitmap32MaxValue_195() + CHIP_ERROR TestWriteAttributeNullableInt64uNullValue_253() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableBitmap32Argument; - nullableBitmap32Argument = [NSNumber numberWithUnsignedInt:4294967294UL]; - [cluster writeAttributeNullableBitmap32WithValue:nullableBitmap32Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_BITMAP32 Max Value Error: %@", err); + id nullableInt64uArgument; + nullableInt64uArgument = nil; + [cluster writeAttributeNullableInt64uWithValue:nullableInt64uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT64U null Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableBitmap32MaxValue_196() + CHIP_ERROR TestReadAttributeNullableInt64uNullValue_254() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableBitmap32WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_BITMAP32 Max Value Error: %@", err); + [cluster readAttributeNullableInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT64U null Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_bitmap32", actualValue)); - VerifyOrReturn(CheckValue("nullable_bitmap32", actualValue, 4294967294UL)); + VerifyOrReturn(CheckValueNull("nullable_int64u", actualValue)); } NextTest(); @@ -54614,40 +62241,44 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableBitmap32InvalidValue_197() + CHIP_ERROR TestReadAttributeNullableInt64uNullValueRange_255() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableBitmap32Argument; - nullableBitmap32Argument = [NSNumber numberWithUnsignedInt:4294967295UL]; - [cluster writeAttributeNullableBitmap32WithValue:nullableBitmap32Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_BITMAP32 Invalid Value Error: %@", err); + [cluster readAttributeNullableInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT64U null Value & range Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("nullableInt64u", [value unsignedLongLongValue], 0ULL)); + } + if (value != nil) { + VerifyOrReturn( + CheckConstraintMaxValue("nullableInt64u", [value unsignedLongLongValue], 18446744073709551614ULL)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableBitmap32UnchangedValue_198() + CHIP_ERROR TestReadAttributeNullableInt64uNullValueNot_256() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableBitmap32WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_BITMAP32 unchanged Value Error: %@", err); + [cluster readAttributeNullableInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT64U null Value & not Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_bitmap32", actualValue)); - VerifyOrReturn(CheckValue("nullable_bitmap32", actualValue, 4294967294UL)); + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("nullableInt64u", value, 18446744073709551614ULL)); } NextTest(); @@ -54656,40 +62287,43 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableBitmap32NullValue_199() + CHIP_ERROR TestWriteAttributeNullableInt64uValue_257() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableBitmap32Argument; - nullableBitmap32Argument = nil; - [cluster writeAttributeNullableBitmap32WithValue:nullableBitmap32Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_BITMAP32 null Value Error: %@", err); + id nullableInt64uArgument; + nullableInt64uArgument = [NSNumber numberWithUnsignedLongLong:18000000000000000000ULL]; + [cluster writeAttributeNullableInt64uWithValue:nullableInt64uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT64U Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableBitmap32NullValue_200() + CHIP_ERROR TestReadAttributeNullableInt64uValueInRange_258() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableBitmap32WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_BITMAP32 null Value Error: %@", err); + [cluster readAttributeNullableInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT64U Value in range Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNull("nullable_bitmap32", actualValue)); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("nullableInt64u", [value unsignedLongLongValue], 0ULL)); + } + if (value != nil) { + VerifyOrReturn( + CheckConstraintMaxValue("nullableInt64u", [value unsignedLongLongValue], 18446744073709551614ULL)); } NextTest(); @@ -54698,41 +62332,19 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableBitmap64MaxValue_201() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id nullableBitmap64Argument; - nullableBitmap64Argument = [NSNumber numberWithUnsignedLongLong:18446744073709551614ULL]; - [cluster writeAttributeNullableBitmap64WithValue:nullableBitmap64Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_BITMAP64 Max Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadAttributeNullableBitmap64MaxValue_202() + CHIP_ERROR TestReadAttributeNullableInt64uNotValueOk_259() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableBitmap64WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_BITMAP64 Max Value Error: %@", err); + [cluster readAttributeNullableInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT64U notValue OK Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_bitmap64", actualValue)); - VerifyOrReturn(CheckValue("nullable_bitmap64", actualValue, 18446744073709551614ULL)); + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("nullableInt64u", value, 18000000000000000001ULL)); } NextTest(); @@ -54741,40 +62353,41 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableBitmap64InvalidValue_203() + CHIP_ERROR TestWriteAttributeNullableInt8sMinValue_260() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableBitmap64Argument; - nullableBitmap64Argument = [NSNumber numberWithUnsignedLongLong:18446744073709551615ULL]; - [cluster writeAttributeNullableBitmap64WithValue:nullableBitmap64Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_BITMAP64 Invalid Value Error: %@", err); + id nullableInt8sArgument; + nullableInt8sArgument = [NSNumber numberWithChar:-127]; + [cluster writeAttributeNullableInt8sWithValue:nullableInt8sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT8S Min Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableBitmap64UnchangedValue_204() + CHIP_ERROR TestReadAttributeNullableInt8sMinValue_261() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableBitmap64WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_BITMAP64 unchanged Value Error: %@", err); + [cluster readAttributeNullableInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT8S Min Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_bitmap64", actualValue)); - VerifyOrReturn(CheckValue("nullable_bitmap64", actualValue, 18446744073709551614ULL)); + VerifyOrReturn(CheckValueNonNull("nullable_int8s", actualValue)); + VerifyOrReturn(CheckValue("nullable_int8s", actualValue, -127)); } NextTest(); @@ -54783,40 +62396,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableBitmap64NullValue_205() + CHIP_ERROR TestWriteAttributeNullableInt8sInvalidValue_262() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableBitmap64Argument; - nullableBitmap64Argument = nil; - [cluster writeAttributeNullableBitmap64WithValue:nullableBitmap64Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_BITMAP64 null Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id nullableInt8sArgument; + nullableInt8sArgument = [NSNumber numberWithChar:-128]; + [cluster writeAttributeNullableInt8sWithValue:nullableInt8sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT8S Invalid Value Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableBitmap64NullValue_206() + CHIP_ERROR TestReadAttributeNullableInt8sUnchangedValue_263() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableBitmap64WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_BITMAP64 null Value Error: %@", err); + [cluster readAttributeNullableInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT8S unchanged Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNull("nullable_bitmap64", actualValue)); + VerifyOrReturn(CheckValueNonNull("nullable_int8s", actualValue)); + VerifyOrReturn(CheckValue("nullable_int8s", actualValue, -127)); } NextTest(); @@ -54825,17 +62438,17 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt8uMinValue_207() + CHIP_ERROR TestWriteAttributeNullableInt8sNullValue_264() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt8uArgument; - nullableInt8uArgument = [NSNumber numberWithUnsignedChar:0]; - [cluster writeAttributeNullableInt8uWithValue:nullableInt8uArgument + id nullableInt8sArgument; + nullableInt8sArgument = nil; + [cluster writeAttributeNullableInt8sWithValue:nullableInt8sArgument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT8U Min Value Error: %@", err); + NSLog(@"Write attribute NULLABLE_INT8S null Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -54845,21 +62458,20 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt8uMinValue_208() + CHIP_ERROR TestReadAttributeNullableInt8sNullValue_265() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT8U Min Value Error: %@", err); + [cluster readAttributeNullableInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT8S null Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_int8u", actualValue)); - VerifyOrReturn(CheckValue("nullable_int8u", actualValue, 0)); + VerifyOrReturn(CheckValueNull("nullable_int8s", actualValue)); } NextTest(); @@ -54868,41 +62480,43 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt8uMaxValue_209() + CHIP_ERROR TestReadAttributeNullableInt8sNullValueRange_266() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt8uArgument; - nullableInt8uArgument = [NSNumber numberWithUnsignedChar:254]; - [cluster writeAttributeNullableInt8uWithValue:nullableInt8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT8U Max Value Error: %@", err); + [cluster readAttributeNullableInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT8S null Value & range Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("nullableInt8s", [value charValue], -127)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("nullableInt8s", [value charValue], 127)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt8uMaxValue_210() + CHIP_ERROR TestReadAttributeNullableInt8sNullValueNot_267() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT8U Max Value Error: %@", err); + [cluster readAttributeNullableInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT8S null Value & not Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_int8u", actualValue)); - VerifyOrReturn(CheckValue("nullable_int8u", actualValue, 254)); + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("nullableInt8s", value, -127)); } NextTest(); @@ -54911,40 +62525,42 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt8uInvalidValue_211() + CHIP_ERROR TestWriteAttributeNullableInt8sValue_268() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt8uArgument; - nullableInt8uArgument = [NSNumber numberWithUnsignedChar:255]; - [cluster writeAttributeNullableInt8uWithValue:nullableInt8uArgument + id nullableInt8sArgument; + nullableInt8sArgument = [NSNumber numberWithChar:-127]; + [cluster writeAttributeNullableInt8sWithValue:nullableInt8sArgument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT8U Invalid Value Error: %@", err); + NSLog(@"Write attribute NULLABLE_INT8S Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt8uUnchangedValue_212() + CHIP_ERROR TestReadAttributeNullableInt8sValueInRange_269() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT8U unchanged Value Error: %@", err); + [cluster readAttributeNullableInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT8S Value in range Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_int8u", actualValue)); - VerifyOrReturn(CheckValue("nullable_int8u", actualValue, 254)); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("nullableInt8s", [value charValue], -127)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("nullableInt8s", [value charValue], 127)); } NextTest(); @@ -54953,18 +62569,20 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt8uUnchangedValueWithConstraint_213() + CHIP_ERROR TestReadAttributeNullableInt8sNotValueOk_270() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT8U unchanged Value with constraint Error: %@", err); + [cluster readAttributeNullableInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT8S notValue OK Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckValueNonNull("nullableInt8u", value)); + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("nullableInt8s", value, -126)); + } NextTest(); }]; @@ -54972,40 +62590,41 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt8uNullValue_214() + CHIP_ERROR TestWriteAttributeNullableInt16sMinValue_271() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt8uArgument; - nullableInt8uArgument = nil; - [cluster writeAttributeNullableInt8uWithValue:nullableInt8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT8U null Value Error: %@", err); + id nullableInt16sArgument; + nullableInt16sArgument = [NSNumber numberWithShort:-32767]; + [cluster writeAttributeNullableInt16sWithValue:nullableInt16sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT16S Min Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt8uNullValue_215() + CHIP_ERROR TestReadAttributeNullableInt16sMinValue_272() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT8U null Value Error: %@", err); + [cluster readAttributeNullableInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT16S Min Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNull("nullable_int8u", actualValue)); + VerifyOrReturn(CheckValueNonNull("nullable_int16s", actualValue)); + VerifyOrReturn(CheckValue("nullable_int16s", actualValue, -32767)); } NextTest(); @@ -55014,22 +62633,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt8uNullValueRange_216() + CHIP_ERROR TestWriteAttributeNullableInt16sInvalidValue_273() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT8U null Value & range Error: %@", err); + id nullableInt16sArgument; + nullableInt16sArgument = [NSNumber numberWithShort:-32768]; + [cluster writeAttributeNullableInt16sWithValue:nullableInt16sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT16S Invalid Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeNullableInt16sUnchangedValue_274() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeNullableInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT16S unchanged Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("nullableInt8u", [value unsignedCharValue], 0)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("nullableInt8u", [value unsignedCharValue], 254)); + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_int16s", actualValue)); + VerifyOrReturn(CheckValue("nullable_int16s", actualValue, -32767)); } NextTest(); @@ -55038,63 +62675,64 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt8uNullValueNot_217() + CHIP_ERROR TestWriteAttributeNullableInt16sNullValue_275() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT8U null Value & not Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id nullableInt16sArgument; + nullableInt16sArgument = nil; + [cluster writeAttributeNullableInt16sWithValue:nullableInt16sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT16S null Value Error: %@", err); - if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("nullableInt8u", value, 254)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt8uValue_218() + CHIP_ERROR TestReadAttributeNullableInt16sNullValue_276() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt8uArgument; - nullableInt8uArgument = [NSNumber numberWithUnsignedChar:128]; - [cluster writeAttributeNullableInt8uWithValue:nullableInt8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT8U Value Error: %@", err); + [cluster readAttributeNullableInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT16S null Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValueNull("nullable_int16s", actualValue)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt8uValueInRange_219() + CHIP_ERROR TestReadAttributeNullableInt16sNullValueRange_277() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT8U Value in range Error: %@", err); + [cluster readAttributeNullableInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT16S null Value & range Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("nullableInt8u", [value unsignedCharValue], 0)); + VerifyOrReturn(CheckConstraintMinValue("nullableInt16s", [value shortValue], -32767)); } if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("nullableInt8u", [value unsignedCharValue], 254)); + VerifyOrReturn(CheckConstraintMaxValue("nullableInt16s", [value shortValue], 32767)); } NextTest(); @@ -55103,19 +62741,19 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt8uNotValueOk_220() + CHIP_ERROR TestReadAttributeNullableInt16sNullValueNot_278() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT8U notValue OK Error: %@", err); + [cluster readAttributeNullableInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT16S null Value & not Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("nullableInt8u", value, 129)); + VerifyOrReturn(CheckConstraintNotValue("nullableInt16s", value, -32767)); } NextTest(); @@ -55124,17 +62762,17 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt16uMinValue_221() + CHIP_ERROR TestWriteAttributeNullableInt16sValue_279() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt16uArgument; - nullableInt16uArgument = [NSNumber numberWithUnsignedShort:0U]; - [cluster writeAttributeNullableInt16uWithValue:nullableInt16uArgument + id nullableInt16sArgument; + nullableInt16sArgument = [NSNumber numberWithShort:-32767]; + [cluster writeAttributeNullableInt16sWithValue:nullableInt16sArgument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT16U Min Value Error: %@", err); + NSLog(@"Write attribute NULLABLE_INT16S Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -55144,21 +62782,22 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt16uMinValue_222() + CHIP_ERROR TestReadAttributeNullableInt16sValueInRange_280() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT16U Min Value Error: %@", err); + [cluster readAttributeNullableInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT16S Value in range Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_int16u", actualValue)); - VerifyOrReturn(CheckValue("nullable_int16u", actualValue, 0U)); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("nullableInt16s", [value shortValue], -32767)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("nullableInt16s", [value shortValue], 32767)); } NextTest(); @@ -55167,17 +62806,38 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt16uMaxValue_223() + CHIP_ERROR TestReadAttributeNullableInt16sNotValueOk_281() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt16uArgument; - nullableInt16uArgument = [NSNumber numberWithUnsignedShort:65534U]; - [cluster writeAttributeNullableInt16uWithValue:nullableInt16uArgument + [cluster readAttributeNullableInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT16S notValue OK Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("nullableInt16s", value, -32766)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeNullableInt32sMinValue_282() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id nullableInt32sArgument; + nullableInt32sArgument = [NSNumber numberWithInt:-2147483647L]; + [cluster writeAttributeNullableInt32sWithValue:nullableInt32sArgument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT16U Max Value Error: %@", err); + NSLog(@"Write attribute NULLABLE_INT32S Min Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -55187,21 +62847,21 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt16uMaxValue_224() + CHIP_ERROR TestReadAttributeNullableInt32sMinValue_283() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT16U Max Value Error: %@", err); + [cluster readAttributeNullableInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT32S Min Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_int16u", actualValue)); - VerifyOrReturn(CheckValue("nullable_int16u", actualValue, 65534U)); + VerifyOrReturn(CheckValueNonNull("nullable_int32s", actualValue)); + VerifyOrReturn(CheckValue("nullable_int32s", actualValue, -2147483647L)); } NextTest(); @@ -55210,17 +62870,17 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt16uInvalidValue_225() + CHIP_ERROR TestWriteAttributeNullableInt32sInvalidValue_284() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt16uArgument; - nullableInt16uArgument = [NSNumber numberWithUnsignedShort:65535U]; - [cluster writeAttributeNullableInt16uWithValue:nullableInt16uArgument + id nullableInt32sArgument; + nullableInt32sArgument = [NSNumber numberWithInt:-2147483648L]; + [cluster writeAttributeNullableInt32sWithValue:nullableInt32sArgument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT16U Invalid Value Error: %@", err); + NSLog(@"Write attribute NULLABLE_INT32S Invalid Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); NextTest(); @@ -55229,21 +62889,21 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt16uUnchangedValue_226() + CHIP_ERROR TestReadAttributeNullableInt32sUnchangedValue_285() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT16U unchanged Value Error: %@", err); + [cluster readAttributeNullableInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT32S unchanged Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_int16u", actualValue)); - VerifyOrReturn(CheckValue("nullable_int16u", actualValue, 65534U)); + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_int32s", actualValue)); + VerifyOrReturn(CheckValue("nullable_int32s", actualValue, -2147483647L)); } NextTest(); @@ -55252,17 +62912,17 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt16uNullValue_227() + CHIP_ERROR TestWriteAttributeNullableInt32sNullValue_286() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt16uArgument; - nullableInt16uArgument = nil; - [cluster writeAttributeNullableInt16uWithValue:nullableInt16uArgument + id nullableInt32sArgument; + nullableInt32sArgument = nil; + [cluster writeAttributeNullableInt32sWithValue:nullableInt32sArgument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT16U null Value Error: %@", err); + NSLog(@"Write attribute NULLABLE_INT32S null Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -55272,20 +62932,20 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt16uNullValue_228() + CHIP_ERROR TestReadAttributeNullableInt32sNullValue_287() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT16U null Value Error: %@", err); + [cluster readAttributeNullableInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT32S null Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNull("nullable_int16u", actualValue)); + VerifyOrReturn(CheckValueNull("nullable_int32s", actualValue)); } NextTest(); @@ -55294,22 +62954,22 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt16uNullValueRange_229() + CHIP_ERROR TestReadAttributeNullableInt32sNullValueRange_288() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT16U null Value & range Error: %@", err); + [cluster readAttributeNullableInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT32S null Value & range Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("nullableInt16u", [value unsignedShortValue], 0U)); + VerifyOrReturn(CheckConstraintMinValue("nullableInt32s", [value intValue], -2147483647L)); } if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("nullableInt16u", [value unsignedShortValue], 65534U)); + VerifyOrReturn(CheckConstraintMaxValue("nullableInt32s", [value intValue], 2147483647L)); } NextTest(); @@ -55318,19 +62978,19 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt16uNullValueNot_230() + CHIP_ERROR TestReadAttributeNullableInt32sNullValueNot_289() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT16U null Value & not Error: %@", err); + [cluster readAttributeNullableInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT32S null Value & not Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("nullableInt16u", value, 65534U)); + VerifyOrReturn(CheckConstraintNotValue("nullableInt32s", value, -2147483647L)); } NextTest(); @@ -55339,17 +62999,17 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt16uValue_231() + CHIP_ERROR TestWriteAttributeNullableInt32sValue_290() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt16uArgument; - nullableInt16uArgument = [NSNumber numberWithUnsignedShort:32000U]; - [cluster writeAttributeNullableInt16uWithValue:nullableInt16uArgument + id nullableInt32sArgument; + nullableInt32sArgument = [NSNumber numberWithInt:-2147483647L]; + [cluster writeAttributeNullableInt32sWithValue:nullableInt32sArgument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT16U Value Error: %@", err); + NSLog(@"Write attribute NULLABLE_INT32S Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -55359,22 +63019,22 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt16uValueInRange_232() + CHIP_ERROR TestReadAttributeNullableInt32sValueInRange_291() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT16U Value in range Error: %@", err); + [cluster readAttributeNullableInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT32S Value in range Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("nullableInt16u", [value unsignedShortValue], 0U)); + VerifyOrReturn(CheckConstraintMinValue("nullableInt32s", [value intValue], -2147483647L)); } if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("nullableInt16u", [value unsignedShortValue], 65534U)); + VerifyOrReturn(CheckConstraintMaxValue("nullableInt32s", [value intValue], 2147483647L)); } NextTest(); @@ -55383,19 +63043,19 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt16uNotValueOk_233() + CHIP_ERROR TestReadAttributeNullableInt32sNotValueOk_292() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT16U notValue OK Error: %@", err); + [cluster readAttributeNullableInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT32S notValue OK Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("nullableInt16u", value, 32001U)); + VerifyOrReturn(CheckConstraintNotValue("nullableInt32s", value, -2147483646L)); } NextTest(); @@ -55404,17 +63064,17 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt32uMinValue_234() + CHIP_ERROR TestWriteAttributeNullableInt64sMinValue_293() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt32uArgument; - nullableInt32uArgument = [NSNumber numberWithUnsignedInt:0UL]; - [cluster writeAttributeNullableInt32uWithValue:nullableInt32uArgument + id nullableInt64sArgument; + nullableInt64sArgument = [NSNumber numberWithLongLong:-9223372036854775807LL]; + [cluster writeAttributeNullableInt64sWithValue:nullableInt64sArgument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT32U Min Value Error: %@", err); + NSLog(@"Write attribute NULLABLE_INT64S Min Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -55424,21 +63084,21 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt32uMinValue_235() + CHIP_ERROR TestReadAttributeNullableInt64sMinValue_294() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT32U Min Value Error: %@", err); + [cluster readAttributeNullableInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT64S Min Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_int32u", actualValue)); - VerifyOrReturn(CheckValue("nullable_int32u", actualValue, 0UL)); + VerifyOrReturn(CheckValueNonNull("nullable_int64s", actualValue)); + VerifyOrReturn(CheckValue("nullable_int64s", actualValue, -9223372036854775807LL)); } NextTest(); @@ -55447,41 +63107,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt32uMaxValue_236() + CHIP_ERROR TestWriteAttributeNullableInt64sInvalidValue_295() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt32uArgument; - nullableInt32uArgument = [NSNumber numberWithUnsignedInt:4294967294UL]; - [cluster writeAttributeNullableInt32uWithValue:nullableInt32uArgument + id nullableInt64sArgument; + nullableInt64sArgument = [NSNumber numberWithLongLong:-9223372036854775807LL - 1]; + [cluster writeAttributeNullableInt64sWithValue:nullableInt64sArgument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT32U Max Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + NSLog(@"Write attribute NULLABLE_INT64S Invalid Value Error: %@", err); + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt32uMaxValue_237() + CHIP_ERROR TestReadAttributeNullableInt64sUnchangedValue_296() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT32U Max Value Error: %@", err); + [cluster readAttributeNullableInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT64S unchanged Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_int32u", actualValue)); - VerifyOrReturn(CheckValue("nullable_int32u", actualValue, 4294967294UL)); + VerifyOrReturn(CheckValueNonNull("nullable_int64s", actualValue)); + VerifyOrReturn(CheckValue("nullable_int64s", actualValue, -9223372036854775807LL)); } NextTest(); @@ -55490,40 +63149,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt32uInvalidValue_238() + CHIP_ERROR TestWriteAttributeNullableInt64sNullValue_297() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt32uArgument; - nullableInt32uArgument = [NSNumber numberWithUnsignedInt:4294967295UL]; - [cluster writeAttributeNullableInt32uWithValue:nullableInt32uArgument + id nullableInt64sArgument; + nullableInt64sArgument = nil; + [cluster writeAttributeNullableInt64sWithValue:nullableInt64sArgument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT32U Invalid Value Error: %@", err); + NSLog(@"Write attribute NULLABLE_INT64S null Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt32uUnchangedValue_239() + CHIP_ERROR TestReadAttributeNullableInt64sNullValue_298() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT32U unchanged Value Error: %@", err); + [cluster readAttributeNullableInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT64S null Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_int32u", actualValue)); - VerifyOrReturn(CheckValue("nullable_int32u", actualValue, 4294967294UL)); + VerifyOrReturn(CheckValueNull("nullable_int64s", actualValue)); } NextTest(); @@ -55532,40 +63191,43 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt32uNullValue_240() + CHIP_ERROR TestReadAttributeNullableInt64sNullValueRange_299() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt32uArgument; - nullableInt32uArgument = nil; - [cluster writeAttributeNullableInt32uWithValue:nullableInt32uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT32U null Value Error: %@", err); + [cluster readAttributeNullableInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT64S null Value & range Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("nullableInt64s", [value longLongValue], -9223372036854775807LL)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("nullableInt64s", [value longLongValue], 9223372036854775807LL)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt32uNullValue_241() + CHIP_ERROR TestReadAttributeNullableInt64sNullValueNot_300() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT32U null Value Error: %@", err); + [cluster readAttributeNullableInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT64S null Value & not Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNull("nullable_int32u", actualValue)); + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("nullableInt64s", value, -9223372036854775807LL)); } NextTest(); @@ -55574,22 +63236,42 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt32uNullValueRange_242() + CHIP_ERROR TestWriteAttributeNullableInt64sValue_301() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT32U null Value & range Error: %@", err); + id nullableInt64sArgument; + nullableInt64sArgument = [NSNumber numberWithLongLong:-9223372036854775807LL]; + [cluster writeAttributeNullableInt64sWithValue:nullableInt64sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT64S Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeNullableInt64sValueInRange_302() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeNullableInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT64S Value in range Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("nullableInt32u", [value unsignedIntValue], 0UL)); + VerifyOrReturn(CheckConstraintMinValue("nullableInt64s", [value longLongValue], -9223372036854775807LL)); } if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("nullableInt32u", [value unsignedIntValue], 4294967294UL)); + VerifyOrReturn(CheckConstraintMaxValue("nullableInt64s", [value longLongValue], 9223372036854775807LL)); } NextTest(); @@ -55598,19 +63280,19 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt32uNullValueNot_243() + CHIP_ERROR TestReadAttributeNullableInt64sNotValueOk_303() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT32U null Value & not Error: %@", err); + [cluster readAttributeNullableInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT64S notValue OK Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("nullableInt32u", value, 4294967294UL)); + VerifyOrReturn(CheckConstraintNotValue("nullableInt64s", value, -9223372036854775806LL)); } NextTest(); @@ -55619,42 +63301,41 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt32uValue_244() + CHIP_ERROR TestWriteAttributeNullableSingleMediumValue_304() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt32uArgument; - nullableInt32uArgument = [NSNumber numberWithUnsignedInt:2147483647UL]; - [cluster writeAttributeNullableInt32uWithValue:nullableInt32uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT32U Value Error: %@", err); + id nullableFloatSingleArgument; + nullableFloatSingleArgument = [NSNumber numberWithFloat:0.1f]; + [cluster writeAttributeNullableFloatSingleWithValue:nullableFloatSingleArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_SINGLE medium Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt32uValueInRange_245() + CHIP_ERROR TestReadAttributeNullableSingleMediumValue_305() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT32U Value in range Error: %@", err); + [cluster readAttributeNullableFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_SINGLE medium Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("nullableInt32u", [value unsignedIntValue], 0UL)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("nullableInt32u", [value unsignedIntValue], 4294967294UL)); + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_float_single", actualValue)); + VerifyOrReturn(CheckValue("nullable_float_single", actualValue, 0.1f)); } NextTest(); @@ -55663,19 +63344,41 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt32uNotValueOk_246() + CHIP_ERROR TestWriteAttributeNullableSingleLargestValue_306() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT32U notValue OK Error: %@", err); + id nullableFloatSingleArgument; + nullableFloatSingleArgument = [NSNumber numberWithFloat:INFINITY]; + [cluster writeAttributeNullableFloatSingleWithValue:nullableFloatSingleArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_SINGLE largest Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeNullableSingleLargestValue_307() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeNullableFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_SINGLE largest Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("nullableInt32u", value, 2147483648UL)); + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_float_single", actualValue)); + VerifyOrReturn(CheckValue("nullable_float_single", actualValue, INFINITY)); } NextTest(); @@ -55684,41 +63387,41 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt64uMinValue_247() + CHIP_ERROR TestWriteAttributeNullableSingleSmallestValue_308() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt64uArgument; - nullableInt64uArgument = [NSNumber numberWithUnsignedLongLong:0ULL]; - [cluster writeAttributeNullableInt64uWithValue:nullableInt64uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT64U Min Value Error: %@", err); + id nullableFloatSingleArgument; + nullableFloatSingleArgument = [NSNumber numberWithFloat:-INFINITY]; + [cluster writeAttributeNullableFloatSingleWithValue:nullableFloatSingleArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_SINGLE smallest Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt64uMinValue_248() + CHIP_ERROR TestReadAttributeNullableSingleSmallestValue_309() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT64U Min Value Error: %@", err); + [cluster readAttributeNullableFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_SINGLE smallest Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_int64u", actualValue)); - VerifyOrReturn(CheckValue("nullable_int64u", actualValue, 0ULL)); + VerifyOrReturn(CheckValueNonNull("nullable_float_single", actualValue)); + VerifyOrReturn(CheckValue("nullable_float_single", actualValue, -INFINITY)); } NextTest(); @@ -55727,41 +63430,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt64uMaxValue_249() + CHIP_ERROR TestWriteAttributeNullableSingleNullValue_310() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt64uArgument; - nullableInt64uArgument = [NSNumber numberWithUnsignedLongLong:18446744073709551614ULL]; - [cluster writeAttributeNullableInt64uWithValue:nullableInt64uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT64U Max Value Error: %@", err); + id nullableFloatSingleArgument; + nullableFloatSingleArgument = nil; + [cluster writeAttributeNullableFloatSingleWithValue:nullableFloatSingleArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_SINGLE null Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt64uMaxValue_250() + CHIP_ERROR TestReadAttributeNullableSingleNullValue_311() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT64U Max Value Error: %@", err); + [cluster readAttributeNullableFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_SINGLE null Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_int64u", actualValue)); - VerifyOrReturn(CheckValue("nullable_int64u", actualValue, 18446744073709551614ULL)); + VerifyOrReturn(CheckValueNull("nullable_float_single", actualValue)); } NextTest(); @@ -55770,40 +63472,41 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt64uInvalidValue_251() + CHIP_ERROR TestWriteAttributeNullableSingle0Value_312() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt64uArgument; - nullableInt64uArgument = [NSNumber numberWithUnsignedLongLong:18446744073709551615ULL]; - [cluster writeAttributeNullableInt64uWithValue:nullableInt64uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT64U Invalid Value Error: %@", err); + id nullableFloatSingleArgument; + nullableFloatSingleArgument = [NSNumber numberWithFloat:0.0f]; + [cluster writeAttributeNullableFloatSingleWithValue:nullableFloatSingleArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_SINGLE 0 Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt64uUnchangedValue_252() + CHIP_ERROR TestReadAttributeNullableSingle0Value_313() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT64U unchanged Value Error: %@", err); + [cluster readAttributeNullableFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_SINGLE 0 Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_int64u", actualValue)); - VerifyOrReturn(CheckValue("nullable_int64u", actualValue, 18446744073709551614ULL)); + VerifyOrReturn(CheckValueNonNull("nullable_float_single", actualValue)); + VerifyOrReturn(CheckValue("nullable_float_single", actualValue, 0.0f)); } NextTest(); @@ -55812,40 +63515,41 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt64uNullValue_253() + CHIP_ERROR TestWriteAttributeNullableDoubleMediumValue_314() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt64uArgument; - nullableInt64uArgument = nil; - [cluster writeAttributeNullableInt64uWithValue:nullableInt64uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT64U null Value Error: %@", err); + id nullableFloatDoubleArgument; + nullableFloatDoubleArgument = [NSNumber numberWithDouble:0.1234567890123]; + [cluster writeAttributeNullableFloatDoubleWithValue:nullableFloatDoubleArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_DOUBLE medium Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt64uNullValue_254() + CHIP_ERROR TestReadAttributeNullableDoubleMediumValue_315() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT64U null Value Error: %@", err); + [cluster readAttributeNullableFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_DOUBLE medium Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNull("nullable_int64u", actualValue)); + VerifyOrReturn(CheckValueNonNull("nullable_float_double", actualValue)); + VerifyOrReturn(CheckValue("nullable_float_double", actualValue, 0.1234567890123)); } NextTest(); @@ -55854,44 +63558,41 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt64uNullValueRange_255() + CHIP_ERROR TestWriteAttributeNullableDoubleLargestValue_316() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT64U null Value & range Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id nullableFloatDoubleArgument; + nullableFloatDoubleArgument = [NSNumber numberWithDouble:INFINITY]; + [cluster writeAttributeNullableFloatDoubleWithValue:nullableFloatDoubleArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_DOUBLE largest Value Error: %@", err); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("nullableInt64u", [value unsignedLongLongValue], 0ULL)); - } - if (value != nil) { - VerifyOrReturn( - CheckConstraintMaxValue("nullableInt64u", [value unsignedLongLongValue], 18446744073709551614ULL)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt64uNullValueNot_256() + CHIP_ERROR TestReadAttributeNullableDoubleLargestValue_317() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT64U null Value & not Error: %@", err); + [cluster readAttributeNullableFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_DOUBLE largest Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("nullableInt64u", value, 18446744073709551614ULL)); + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_float_double", actualValue)); + VerifyOrReturn(CheckValue("nullable_float_double", actualValue, INFINITY)); } NextTest(); @@ -55900,43 +63601,41 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt64uValue_257() + CHIP_ERROR TestWriteAttributeNullableDoubleSmallestValue_318() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt64uArgument; - nullableInt64uArgument = [NSNumber numberWithUnsignedLongLong:18000000000000000000ULL]; - [cluster writeAttributeNullableInt64uWithValue:nullableInt64uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT64U Value Error: %@", err); + id nullableFloatDoubleArgument; + nullableFloatDoubleArgument = [NSNumber numberWithDouble:-INFINITY]; + [cluster writeAttributeNullableFloatDoubleWithValue:nullableFloatDoubleArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_DOUBLE smallest Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt64uValueInRange_258() + CHIP_ERROR TestReadAttributeNullableDoubleSmallestValue_319() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT64U Value in range Error: %@", err); + [cluster readAttributeNullableFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_DOUBLE smallest Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("nullableInt64u", [value unsignedLongLongValue], 0ULL)); - } - if (value != nil) { - VerifyOrReturn( - CheckConstraintMaxValue("nullableInt64u", [value unsignedLongLongValue], 18446744073709551614ULL)); + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_float_double", actualValue)); + VerifyOrReturn(CheckValue("nullable_float_double", actualValue, -INFINITY)); } NextTest(); @@ -55945,19 +63644,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt64uNotValueOk_259() + CHIP_ERROR TestWriteAttributeNullableDoubleNullValue_320() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT64U notValue OK Error: %@", err); + id nullableFloatDoubleArgument; + nullableFloatDoubleArgument = nil; + [cluster writeAttributeNullableFloatDoubleWithValue:nullableFloatDoubleArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_DOUBLE null Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeNullableDoubleNullValue_321() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeNullableFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_DOUBLE null Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("nullableInt64u", value, 18000000000000000001ULL)); + { + id actualValue = value; + VerifyOrReturn(CheckValueNull("nullable_float_double", actualValue)); } NextTest(); @@ -55966,41 +63686,41 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt8sMinValue_260() + CHIP_ERROR TestWriteAttributeNullableDouble0Value_322() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt8sArgument; - nullableInt8sArgument = [NSNumber numberWithChar:-127]; - [cluster writeAttributeNullableInt8sWithValue:nullableInt8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT8S Min Value Error: %@", err); + id nullableFloatDoubleArgument; + nullableFloatDoubleArgument = [NSNumber numberWithDouble:0]; + [cluster writeAttributeNullableFloatDoubleWithValue:nullableFloatDoubleArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_DOUBLE 0 Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt8sMinValue_261() + CHIP_ERROR TestReadAttributeNullableDouble0Value_323() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT8S Min Value Error: %@", err); + [cluster readAttributeNullableFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_DOUBLE 0 Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_int8s", actualValue)); - VerifyOrReturn(CheckValue("nullable_int8s", actualValue, -127)); + VerifyOrReturn(CheckValueNonNull("nullable_float_double", actualValue)); + VerifyOrReturn(CheckValue("nullable_float_double", actualValue, 0)); } NextTest(); @@ -56009,40 +63729,41 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt8sInvalidValue_262() + CHIP_ERROR TestWriteAttributeNullableEnum8MinValue_324() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt8sArgument; - nullableInt8sArgument = [NSNumber numberWithChar:-128]; - [cluster writeAttributeNullableInt8sWithValue:nullableInt8sArgument + id nullableEnum8Argument; + nullableEnum8Argument = [NSNumber numberWithUnsignedChar:0]; + [cluster writeAttributeNullableEnum8WithValue:nullableEnum8Argument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT8S Invalid Value Error: %@", err); + NSLog(@"Write attribute NULLABLE_ENUM8 Min Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt8sUnchangedValue_263() + CHIP_ERROR TestReadAttributeNullableEnum8MinValue_325() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT8S unchanged Value Error: %@", err); + [cluster readAttributeNullableEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_ENUM8 Min Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_int8s", actualValue)); - VerifyOrReturn(CheckValue("nullable_int8s", actualValue, -127)); + VerifyOrReturn(CheckValueNonNull("nullable_enum8", actualValue)); + VerifyOrReturn(CheckValue("nullable_enum8", actualValue, 0)); } NextTest(); @@ -56051,17 +63772,17 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt8sNullValue_264() + CHIP_ERROR TestWriteAttributeNullableEnum8MaxValue_326() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt8sArgument; - nullableInt8sArgument = nil; - [cluster writeAttributeNullableInt8sWithValue:nullableInt8sArgument + id nullableEnum8Argument; + nullableEnum8Argument = [NSNumber numberWithUnsignedChar:254]; + [cluster writeAttributeNullableEnum8WithValue:nullableEnum8Argument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT8S null Value Error: %@", err); + NSLog(@"Write attribute NULLABLE_ENUM8 Max Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -56071,20 +63792,21 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt8sNullValue_265() + CHIP_ERROR TestReadAttributeNullableEnum8MaxValue_327() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT8S null Value Error: %@", err); + [cluster readAttributeNullableEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_ENUM8 Max Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNull("nullable_int8s", actualValue)); + VerifyOrReturn(CheckValueNonNull("nullable_enum8", actualValue)); + VerifyOrReturn(CheckValue("nullable_enum8", actualValue, 254)); } NextTest(); @@ -56093,43 +63815,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt8sNullValueRange_266() + CHIP_ERROR TestWriteAttributeNullableEnum8InvalidValue_328() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT8S null Value & range Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("nullableInt8s", [value charValue], -127)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("nullableInt8s", [value charValue], 127)); - } + id nullableEnum8Argument; + nullableEnum8Argument = [NSNumber numberWithUnsignedChar:255]; + [cluster writeAttributeNullableEnum8WithValue:nullableEnum8Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_ENUM8 Invalid Value Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt8sNullValueNot_267() + CHIP_ERROR TestReadAttributeNullableEnum8UnchangedValue_329() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT8S null Value & not Error: %@", err); + [cluster readAttributeNullableEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_ENUM8 unchanged Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("nullableInt8s", value, -127)); + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_enum8", actualValue)); + VerifyOrReturn(CheckValue("nullable_enum8", actualValue, 254)); } NextTest(); @@ -56138,17 +63857,17 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt8sValue_268() + CHIP_ERROR TestWriteAttributeNullableEnum8NullValue_330() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt8sArgument; - nullableInt8sArgument = [NSNumber numberWithChar:-127]; - [cluster writeAttributeNullableInt8sWithValue:nullableInt8sArgument + id nullableEnum8Argument; + nullableEnum8Argument = nil; + [cluster writeAttributeNullableEnum8WithValue:nullableEnum8Argument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT8S Value Error: %@", err); + NSLog(@"Write attribute NULLABLE_ENUM8 null Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -56158,22 +63877,20 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt8sValueInRange_269() + CHIP_ERROR TestReadAttributeNullableEnum8NullValue_331() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT8S Value in range Error: %@", err); + [cluster readAttributeNullableEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_ENUM8 null Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("nullableInt8s", [value charValue], -127)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("nullableInt8s", [value charValue], 127)); + { + id actualValue = value; + VerifyOrReturn(CheckValueNull("nullable_enum8", actualValue)); } NextTest(); @@ -56182,19 +63899,41 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt8sNotValueOk_270() + CHIP_ERROR TestWriteAttributeNullableEnum16MinValue_332() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT8S notValue OK Error: %@", err); + id nullableEnum16Argument; + nullableEnum16Argument = [NSNumber numberWithUnsignedShort:0U]; + [cluster writeAttributeNullableEnum16WithValue:nullableEnum16Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_ENUM16 Min Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeNullableEnum16MinValue_333() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeNullableEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_ENUM16 Min Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("nullableInt8s", value, -126)); + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_enum16", actualValue)); + VerifyOrReturn(CheckValue("nullable_enum16", actualValue, 0U)); } NextTest(); @@ -56203,17 +63942,17 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt16sMinValue_271() + CHIP_ERROR TestWriteAttributeNullableEnum16MaxValue_334() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt16sArgument; - nullableInt16sArgument = [NSNumber numberWithShort:-32767]; - [cluster writeAttributeNullableInt16sWithValue:nullableInt16sArgument + id nullableEnum16Argument; + nullableEnum16Argument = [NSNumber numberWithUnsignedShort:65534U]; + [cluster writeAttributeNullableEnum16WithValue:nullableEnum16Argument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT16S Min Value Error: %@", err); + NSLog(@"Write attribute NULLABLE_ENUM16 Max Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -56223,21 +63962,21 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt16sMinValue_272() + CHIP_ERROR TestReadAttributeNullableEnum16MaxValue_335() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT16S Min Value Error: %@", err); + [cluster readAttributeNullableEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_ENUM16 Max Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_int16s", actualValue)); - VerifyOrReturn(CheckValue("nullable_int16s", actualValue, -32767)); + VerifyOrReturn(CheckValueNonNull("nullable_enum16", actualValue)); + VerifyOrReturn(CheckValue("nullable_enum16", actualValue, 65534U)); } NextTest(); @@ -56246,17 +63985,17 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt16sInvalidValue_273() + CHIP_ERROR TestWriteAttributeNullableEnum16InvalidValue_336() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt16sArgument; - nullableInt16sArgument = [NSNumber numberWithShort:-32768]; - [cluster writeAttributeNullableInt16sWithValue:nullableInt16sArgument + id nullableEnum16Argument; + nullableEnum16Argument = [NSNumber numberWithUnsignedShort:65535U]; + [cluster writeAttributeNullableEnum16WithValue:nullableEnum16Argument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT16S Invalid Value Error: %@", err); + NSLog(@"Write attribute NULLABLE_ENUM16 Invalid Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); NextTest(); @@ -56265,21 +64004,21 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt16sUnchangedValue_274() + CHIP_ERROR TestReadAttributeNullableEnum16UnchangedValue_337() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT16S unchanged Value Error: %@", err); + [cluster readAttributeNullableEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_ENUM16 unchanged Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_int16s", actualValue)); - VerifyOrReturn(CheckValue("nullable_int16s", actualValue, -32767)); + VerifyOrReturn(CheckValueNonNull("nullable_enum16", actualValue)); + VerifyOrReturn(CheckValue("nullable_enum16", actualValue, 65534U)); } NextTest(); @@ -56288,17 +64027,17 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt16sNullValue_275() + CHIP_ERROR TestWriteAttributeNullableEnum16NullValue_338() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt16sArgument; - nullableInt16sArgument = nil; - [cluster writeAttributeNullableInt16sWithValue:nullableInt16sArgument + id nullableEnum16Argument; + nullableEnum16Argument = nil; + [cluster writeAttributeNullableEnum16WithValue:nullableEnum16Argument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT16S null Value Error: %@", err); + NSLog(@"Write attribute NULLABLE_ENUM16 null Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -56308,20 +64047,20 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt16sNullValue_276() + CHIP_ERROR TestReadAttributeNullableEnum16NullValue_339() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT16S null Value Error: %@", err); + [cluster readAttributeNullableEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_ENUM16 null Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNull("nullable_int16s", actualValue)); + VerifyOrReturn(CheckValueNull("nullable_enum16", actualValue)); } NextTest(); @@ -56330,43 +64069,41 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt16sNullValueRange_277() + CHIP_ERROR TestWriteAttributeNullableSimpleEnumMinValue_340() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT16S null Value & range Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id nullableEnumAttrArgument; + nullableEnumAttrArgument = [NSNumber numberWithUnsignedChar:0]; + [cluster writeAttributeNullableEnumAttrWithValue:nullableEnumAttrArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_SIMPLE_ENUM Min Value Error: %@", err); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("nullableInt16s", [value shortValue], -32767)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("nullableInt16s", [value shortValue], 32767)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt16sNullValueNot_278() + CHIP_ERROR TestReadAttributeNullableSimpleEnumMinValue_341() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT16S null Value & not Error: %@", err); + [cluster readAttributeNullableEnumAttrWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_SIMPLE_ENUM Min Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("nullableInt16s", value, -32767)); + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_enum_attr", actualValue)); + VerifyOrReturn(CheckValue("nullable_enum_attr", actualValue, 0)); } NextTest(); @@ -56375,42 +64112,41 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt16sValue_279() + CHIP_ERROR TestWriteAttributeNullableSimpleEnumMaxValue_342() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt16sArgument; - nullableInt16sArgument = [NSNumber numberWithShort:-32767]; - [cluster writeAttributeNullableInt16sWithValue:nullableInt16sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT16S Value Error: %@", err); + id nullableEnumAttrArgument; + nullableEnumAttrArgument = [NSNumber numberWithUnsignedChar:254]; + [cluster writeAttributeNullableEnumAttrWithValue:nullableEnumAttrArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_SIMPLE_ENUM Max Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt16sValueInRange_280() + CHIP_ERROR TestReadAttributeNullableSimpleEnumMaxValue_343() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT16S Value in range Error: %@", err); + [cluster readAttributeNullableEnumAttrWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_SIMPLE_ENUM Max Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("nullableInt16s", [value shortValue], -32767)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("nullableInt16s", [value shortValue], 32767)); + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_enum_attr", actualValue)); + VerifyOrReturn(CheckValue("nullable_enum_attr", actualValue, 254)); } NextTest(); @@ -56419,19 +64155,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt16sNotValueOk_281() + CHIP_ERROR TestWriteAttributeNullableSimpleEnumInvalidValue_344() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT16S notValue OK Error: %@", err); + id nullableEnumAttrArgument; + nullableEnumAttrArgument = [NSNumber numberWithUnsignedChar:255]; + [cluster writeAttributeNullableEnumAttrWithValue:nullableEnumAttrArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_SIMPLE_ENUM Invalid Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeNullableSimpleEnumUnchangedValue_345() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeNullableEnumAttrWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_SIMPLE_ENUM unchanged Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("nullableInt16s", value, -32766)); + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_enum_attr", actualValue)); + VerifyOrReturn(CheckValue("nullable_enum_attr", actualValue, 254)); } NextTest(); @@ -56440,41 +64197,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt32sMinValue_282() + CHIP_ERROR TestWriteAttributeNullableSimpleEnumNullValue_346() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt32sArgument; - nullableInt32sArgument = [NSNumber numberWithInt:-2147483647L]; - [cluster writeAttributeNullableInt32sWithValue:nullableInt32sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT32S Min Value Error: %@", err); + id nullableEnumAttrArgument; + nullableEnumAttrArgument = nil; + [cluster writeAttributeNullableEnumAttrWithValue:nullableEnumAttrArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_SIMPLE_ENUM null Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt32sMinValue_283() + CHIP_ERROR TestReadAttributeNullableSimpleEnumNullValue_347() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT32S Min Value Error: %@", err); + [cluster readAttributeNullableEnumAttrWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_SIMPLE_ENUM null Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_int32s", actualValue)); - VerifyOrReturn(CheckValue("nullable_int32s", actualValue, -2147483647L)); + VerifyOrReturn(CheckValueNull("nullable_enum_attr", actualValue)); } NextTest(); @@ -56483,40 +64239,22 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt32sInvalidValue_284() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id nullableInt32sArgument; - nullableInt32sArgument = [NSNumber numberWithInt:-2147483648L]; - [cluster writeAttributeNullableInt32sWithValue:nullableInt32sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT32S Invalid Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadAttributeNullableInt32sUnchangedValue_285() + CHIP_ERROR TestReadAttributeNullableOctetStringDefaultValue_348() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT32S unchanged Value Error: %@", err); + [cluster readAttributeNullableOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_OCTET_STRING Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_int32s", actualValue)); - VerifyOrReturn(CheckValue("nullable_int32s", actualValue, -2147483647L)); + VerifyOrReturn(CheckValueNonNull("nullable_octet_string", actualValue)); + VerifyOrReturn( + CheckValueAsString("nullable_octet_string", actualValue, [[NSData alloc] initWithBytes:"" length:0])); } NextTest(); @@ -56525,40 +64263,42 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt32sNullValue_286() + CHIP_ERROR TestWriteAttributeNullableOctetString_349() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt32sArgument; - nullableInt32sArgument = nil; - [cluster writeAttributeNullableInt32sWithValue:nullableInt32sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT32S null Value Error: %@", err); + id nullableOctetStringArgument; + nullableOctetStringArgument = [[NSData alloc] initWithBytes:"TestValue" length:9]; + [cluster writeAttributeNullableOctetStringWithValue:nullableOctetStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_OCTET_STRING Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt32sNullValue_287() + CHIP_ERROR TestReadAttributeNullableOctetString_350() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT32S null Value Error: %@", err); + [cluster readAttributeNullableOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_OCTET_STRING Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNull("nullable_int32s", actualValue)); + VerifyOrReturn(CheckValueNonNull("nullable_octet_string", actualValue)); + VerifyOrReturn( + CheckValueAsString("nullable_octet_string", actualValue, [[NSData alloc] initWithBytes:"TestValue" length:9])); } NextTest(); @@ -56567,43 +64307,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt32sNullValueRange_288() + CHIP_ERROR TestWriteAttributeNullableOctetString_351() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT32S null Value & range Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id nullableOctetStringArgument; + nullableOctetStringArgument = nil; + [cluster writeAttributeNullableOctetStringWithValue:nullableOctetStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_OCTET_STRING Error: %@", err); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("nullableInt32s", [value intValue], -2147483647L)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("nullableInt32s", [value intValue], 2147483647L)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt32sNullValueNot_289() + CHIP_ERROR TestReadAttributeNullableOctetString_352() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT32S null Value & not Error: %@", err); + [cluster readAttributeNullableOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_OCTET_STRING Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("nullableInt32s", value, -2147483647L)); + { + id actualValue = value; + VerifyOrReturn(CheckValueNull("nullable_octet_string", actualValue)); } NextTest(); @@ -56612,42 +64349,42 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt32sValue_290() + CHIP_ERROR TestWriteAttributeNullableOctetString_353() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt32sArgument; - nullableInt32sArgument = [NSNumber numberWithInt:-2147483647L]; - [cluster writeAttributeNullableInt32sWithValue:nullableInt32sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT32S Value Error: %@", err); + id nullableOctetStringArgument; + nullableOctetStringArgument = [[NSData alloc] initWithBytes:"" length:0]; + [cluster writeAttributeNullableOctetStringWithValue:nullableOctetStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_OCTET_STRING Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt32sValueInRange_291() + CHIP_ERROR TestReadAttributeNullableOctetString_354() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT32S Value in range Error: %@", err); + [cluster readAttributeNullableOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_OCTET_STRING Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("nullableInt32s", [value intValue], -2147483647L)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("nullableInt32s", [value intValue], 2147483647L)); + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_octet_string", actualValue)); + VerifyOrReturn( + CheckValueAsString("nullable_octet_string", actualValue, [[NSData alloc] initWithBytes:"" length:0])); } NextTest(); @@ -56656,19 +64393,21 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt32sNotValueOk_292() + CHIP_ERROR TestReadAttributeNullableCharStringDefaultValue_355() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT32S notValue OK Error: %@", err); + [cluster readAttributeNullableCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_CHAR_STRING Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("nullableInt32s", value, -2147483646L)); + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_char_string", actualValue)); + VerifyOrReturn(CheckValueAsString("nullable_char_string", actualValue, @"")); } NextTest(); @@ -56677,41 +64416,41 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt64sMinValue_293() + CHIP_ERROR TestWriteAttributeNullableCharString_356() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt64sArgument; - nullableInt64sArgument = [NSNumber numberWithLongLong:-9223372036854775807LL]; - [cluster writeAttributeNullableInt64sWithValue:nullableInt64sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT64S Min Value Error: %@", err); + id nullableCharStringArgument; + nullableCharStringArgument = @"☉T☉"; + [cluster writeAttributeNullableCharStringWithValue:nullableCharStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_CHAR_STRING Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt64sMinValue_294() + CHIP_ERROR TestReadAttributeNullableCharString_357() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT64S Min Value Error: %@", err); + [cluster readAttributeNullableCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_CHAR_STRING Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_int64s", actualValue)); - VerifyOrReturn(CheckValue("nullable_int64s", actualValue, -9223372036854775807LL)); + VerifyOrReturn(CheckValueNonNull("nullable_char_string", actualValue)); + VerifyOrReturn(CheckValueAsString("nullable_char_string", actualValue, @"☉T☉")); } NextTest(); @@ -56720,40 +64459,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt64sInvalidValue_295() + CHIP_ERROR TestWriteAttributeNullableCharStringValueTooLong_358() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt64sArgument; - nullableInt64sArgument = [NSNumber numberWithLongLong:-9223372036854775807LL - 1]; - [cluster writeAttributeNullableInt64sWithValue:nullableInt64sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT64S Invalid Value Error: %@", err); + id nullableCharStringArgument; + nullableCharStringArgument = nil; + [cluster writeAttributeNullableCharStringWithValue:nullableCharStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_CHAR_STRING - Value too long Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt64sUnchangedValue_296() + CHIP_ERROR TestReadAttributeNullableCharString_359() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT64S unchanged Value Error: %@", err); + [cluster readAttributeNullableCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_CHAR_STRING Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_int64s", actualValue)); - VerifyOrReturn(CheckValue("nullable_int64s", actualValue, -9223372036854775807LL)); + VerifyOrReturn(CheckValueNull("nullable_char_string", actualValue)); } NextTest(); @@ -56762,40 +64501,41 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt64sNullValue_297() + CHIP_ERROR TestWriteAttributeNullableCharStringEmpty_360() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt64sArgument; - nullableInt64sArgument = nil; - [cluster writeAttributeNullableInt64sWithValue:nullableInt64sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT64S null Value Error: %@", err); + id nullableCharStringArgument; + nullableCharStringArgument = @""; + [cluster writeAttributeNullableCharStringWithValue:nullableCharStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_CHAR_STRING - Empty Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt64sNullValue_298() + CHIP_ERROR TestReadAttributeNullableCharString_361() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT64S null Value Error: %@", err); + [cluster readAttributeNullableCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_CHAR_STRING Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNull("nullable_int64s", actualValue)); + VerifyOrReturn(CheckValueNonNull("nullable_char_string", actualValue)); + VerifyOrReturn(CheckValueAsString("nullable_char_string", actualValue, @"")); } NextTest(); @@ -56804,194 +64544,207 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt64sNullValueRange_299() + CHIP_ERROR TestReadAttributeFromNonexistentEndpoint_362() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:200 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT64S null Value & range Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("nullableInt64s", [value longLongValue], -9223372036854775807LL)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("nullableInt64s", [value longLongValue], 9223372036854775807LL)); - } + [cluster readAttributeListInt8uWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute from nonexistent endpoint. Error: %@", err); + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_ENDPOINT)); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt64sNullValueNot_300() + CHIP_ERROR TestReadAttributeFromNonexistentCluster_363() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT64S null Value & not Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("nullableInt64s", value, -9223372036854775807LL)); - } + [cluster readAttributeListInt8uWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute from nonexistent cluster. Error: %@", err); + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_CLUSTER)); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt64sValue_301() + CHIP_ERROR TestSendACommandThatTakesAnOptionalParameterButDoNotSetIt_364() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt64sArgument; - nullableInt64sArgument = [NSNumber numberWithLongLong:-9223372036854775807LL]; - [cluster writeAttributeNullableInt64sWithValue:nullableInt64sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT64S Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + __auto_type * params = [[CHIPTestClusterClusterTestSimpleOptionalArgumentRequestParams alloc] init]; + [cluster + testSimpleOptionalArgumentRequestWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog( + @"Send a command that takes an optional parameter but do not set it. Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_INVALID_VALUE)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt64sValueInRange_302() + CHIP_ERROR TestSendACommandThatTakesAnOptionalParameterButDoNotSetIt_365() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT64S Value in range Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + __auto_type * params = [[CHIPTestClusterClusterTestSimpleOptionalArgumentRequestParams alloc] init]; + params.arg1 = [NSNumber numberWithBool:1]; + [cluster + testSimpleOptionalArgumentRequestWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog( + @"Send a command that takes an optional parameter but do not set it. Error: %@", err); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("nullableInt64s", [value longLongValue], -9223372036854775807LL)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("nullableInt64s", [value longLongValue], 9223372036854775807LL)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } + bool testSendClusterTestCluster_000366_WaitForReport_Fulfilled = false; + ResponseHandler _Nullable test_TestCluster_list_int8u_Reported = nil; - CHIP_ERROR TestReadAttributeNullableInt64sNotValueOk_303() + CHIP_ERROR TestReportSubscribeToListAttribute_366() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT64S notValue OK Error: %@", err); + test_TestCluster_list_int8u_Reported = ^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Report: Subscribe to list attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("nullableInt64s", value, -9223372036854775806LL)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("list_int8u", [actualValue count], static_cast(4))); + VerifyOrReturn(CheckValue("", actualValue[0], 1)); + VerifyOrReturn(CheckValue("", actualValue[1], 2)); + VerifyOrReturn(CheckValue("", actualValue[2], 3)); + VerifyOrReturn(CheckValue("", actualValue[3], 4)); } - NextTest(); - }]; + testSendClusterTestCluster_000366_WaitForReport_Fulfilled = true; + }; + NextTest(); return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableSingleMediumValue_304() + CHIP_ERROR TestSubscribeToListAttribute_367() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableFloatSingleArgument; - nullableFloatSingleArgument = [NSNumber numberWithFloat:0.1f]; - [cluster writeAttributeNullableFloatSingleWithValue:nullableFloatSingleArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_SINGLE medium Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + uint16_t minIntervalArgument = 2U; + uint16_t maxIntervalArgument = 5U; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + [cluster subscribeAttributeListInt8uWithMinInterval:[NSNumber numberWithUnsignedInt:minIntervalArgument] + maxInterval:[NSNumber numberWithUnsignedInt:maxIntervalArgument] + params:params + subscriptionEstablished:^{ + VerifyOrReturn( + testSendClusterTestCluster_000366_WaitForReport_Fulfilled, SetCommandExitStatus(CHIP_ERROR_INCORRECT_STATE)); + NextTest(); + } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Subscribe to list attribute Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + if (test_TestCluster_list_int8u_Reported != nil) { + ResponseHandler callback = test_TestCluster_list_int8u_Reported; + test_TestCluster_list_int8u_Reported = nil; + callback(value, err); + } + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableSingleMediumValue_305() + CHIP_ERROR TestWriteSubscribedToListAttribute_368() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_SINGLE medium Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id listInt8uArgument; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [NSNumber numberWithUnsignedChar:5]; + temp_0[1] = [NSNumber numberWithUnsignedChar:6]; + temp_0[2] = [NSNumber numberWithUnsignedChar:7]; + temp_0[3] = [NSNumber numberWithUnsignedChar:8]; + listInt8uArgument = temp_0; + } + [cluster writeAttributeListInt8uWithValue:listInt8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write subscribed-to list attribute Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_float_single", actualValue)); - VerifyOrReturn(CheckValue("nullable_float_single", actualValue, 0.1f)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableSingleLargestValue_306() + CHIP_ERROR TestCheckForListAttributeReport_369() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableFloatSingleArgument; - nullableFloatSingleArgument = [NSNumber numberWithFloat:INFINITY]; - [cluster writeAttributeNullableFloatSingleWithValue:nullableFloatSingleArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_SINGLE largest Value Error: %@", err); + test_TestCluster_list_int8u_Reported = ^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check for list attribute report Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValue("list_int8u", [actualValue count], static_cast(4))); + VerifyOrReturn(CheckValue("", actualValue[0], 5)); + VerifyOrReturn(CheckValue("", actualValue[1], 6)); + VerifyOrReturn(CheckValue("", actualValue[2], 7)); + VerifyOrReturn(CheckValue("", actualValue[3], 8)); + } + + NextTest(); + }; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableSingleLargestValue_307() + CHIP_ERROR TestReadRangeRestrictedUnsigned8BitInteger_370() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_SINGLE largest Value Error: %@", err); + [cluster readAttributeRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read range-restricted unsigned 8-bit integer Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_float_single", actualValue)); - VerifyOrReturn(CheckValue("nullable_float_single", actualValue, INFINITY)); + VerifyOrReturn(CheckValue("range_restricted_int8u", actualValue, 70)); } NextTest(); @@ -57000,83 +64753,102 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableSingleSmallestValue_308() + CHIP_ERROR TestWriteMinValueToARangeRestrictedUnsigned8BitInteger_371() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableFloatSingleArgument; - nullableFloatSingleArgument = [NSNumber numberWithFloat:-INFINITY]; - [cluster writeAttributeNullableFloatSingleWithValue:nullableFloatSingleArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_SINGLE smallest Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id rangeRestrictedInt8uArgument; + rangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:0]; + [cluster + writeAttributeRangeRestrictedInt8uWithValue:rangeRestrictedInt8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write min value to a range-restricted unsigned 8-bit integer Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableSingleSmallestValue_309() + CHIP_ERROR TestWriteJustBelowRangeValueToARangeRestrictedUnsigned8BitInteger_372() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_SINGLE smallest Value Error: %@", err); + id rangeRestrictedInt8uArgument; + rangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:19]; + [cluster writeAttributeRangeRestrictedInt8uWithValue:rangeRestrictedInt8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write just-below-range value to a range-restricted unsigned 8-bit integer " + @"Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_float_single", actualValue)); - VerifyOrReturn(CheckValue("nullable_float_single", actualValue, -INFINITY)); - } + return CHIP_NO_ERROR; + } - NextTest(); - }]; + CHIP_ERROR TestWriteJustAboveRangeValueToARangeRestrictedUnsigned8BitInteger_373() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id rangeRestrictedInt8uArgument; + rangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:101]; + [cluster writeAttributeRangeRestrictedInt8uWithValue:rangeRestrictedInt8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write just-above-range value to a range-restricted unsigned 8-bit integer " + @"Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableSingleNullValue_310() + CHIP_ERROR TestWriteMaxValueToARangeRestrictedUnsigned8BitInteger_374() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableFloatSingleArgument; - nullableFloatSingleArgument = nil; - [cluster writeAttributeNullableFloatSingleWithValue:nullableFloatSingleArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_SINGLE null Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id rangeRestrictedInt8uArgument; + rangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:255]; + [cluster + writeAttributeRangeRestrictedInt8uWithValue:rangeRestrictedInt8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write max value to a range-restricted unsigned 8-bit integer Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableSingleNullValue_311() + CHIP_ERROR TestVerifyRangeRestrictedUnsigned8BitIntegerValueHasNotChanged_375() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_SINGLE null Value Error: %@", err); + [cluster readAttributeRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify range-restricted unsigned 8-bit integer value has not changed Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNull("nullable_float_single", actualValue)); + VerifyOrReturn(CheckValue("range_restricted_int8u", actualValue, 70)); } NextTest(); @@ -57085,41 +64857,42 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableSingle0Value_312() + CHIP_ERROR TestWriteMinValidValueToARangeRestrictedUnsigned8BitInteger_376() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableFloatSingleArgument; - nullableFloatSingleArgument = [NSNumber numberWithFloat:0.0f]; - [cluster writeAttributeNullableFloatSingleWithValue:nullableFloatSingleArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_SINGLE 0 Value Error: %@", err); + id rangeRestrictedInt8uArgument; + rangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:20]; + [cluster + writeAttributeRangeRestrictedInt8uWithValue:rangeRestrictedInt8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog( + @"Write min valid value to a range-restricted unsigned 8-bit integer Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableSingle0Value_313() + CHIP_ERROR TestVerifyRangeRestrictedUnsigned8BitIntegerValueIsAtMinValid_377() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_SINGLE 0 Value Error: %@", err); + [cluster readAttributeRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify range-restricted unsigned 8-bit integer value is at min valid Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_float_single", actualValue)); - VerifyOrReturn(CheckValue("nullable_float_single", actualValue, 0.0f)); + VerifyOrReturn(CheckValue("range_restricted_int8u", actualValue, 20)); } NextTest(); @@ -57128,41 +64901,42 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableDoubleMediumValue_314() + CHIP_ERROR TestWriteMaxValidValueToARangeRestrictedUnsigned8BitInteger_378() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableFloatDoubleArgument; - nullableFloatDoubleArgument = [NSNumber numberWithDouble:0.1234567890123]; - [cluster writeAttributeNullableFloatDoubleWithValue:nullableFloatDoubleArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_DOUBLE medium Value Error: %@", err); + id rangeRestrictedInt8uArgument; + rangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:100]; + [cluster + writeAttributeRangeRestrictedInt8uWithValue:rangeRestrictedInt8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog( + @"Write max valid value to a range-restricted unsigned 8-bit integer Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableDoubleMediumValue_315() + CHIP_ERROR TestVerifyRangeRestrictedUnsigned8BitIntegerValueIsAtMaxValid_379() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_DOUBLE medium Value Error: %@", err); + [cluster readAttributeRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify range-restricted unsigned 8-bit integer value is at max valid Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_float_double", actualValue)); - VerifyOrReturn(CheckValue("nullable_float_double", actualValue, 0.1234567890123)); + VerifyOrReturn(CheckValue("range_restricted_int8u", actualValue, 100)); } NextTest(); @@ -57171,41 +64945,42 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableDoubleLargestValue_316() + CHIP_ERROR TestWriteMiddleValidValueToARangeRestrictedUnsigned8BitInteger_380() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableFloatDoubleArgument; - nullableFloatDoubleArgument = [NSNumber numberWithDouble:INFINITY]; - [cluster writeAttributeNullableFloatDoubleWithValue:nullableFloatDoubleArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_DOUBLE largest Value Error: %@", err); + id rangeRestrictedInt8uArgument; + rangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:50]; + [cluster + writeAttributeRangeRestrictedInt8uWithValue:rangeRestrictedInt8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write middle valid value to a range-restricted unsigned 8-bit integer Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableDoubleLargestValue_317() + CHIP_ERROR TestVerifyRangeRestrictedUnsigned8BitIntegerValueIsAtMidValid_381() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_DOUBLE largest Value Error: %@", err); + [cluster readAttributeRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify range-restricted unsigned 8-bit integer value is at mid valid Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_float_double", actualValue)); - VerifyOrReturn(CheckValue("nullable_float_double", actualValue, INFINITY)); + VerifyOrReturn(CheckValue("range_restricted_int8u", actualValue, 50)); } NextTest(); @@ -57214,83 +64989,124 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableDoubleSmallestValue_318() + CHIP_ERROR TestReadRangeRestrictedUnsigned16BitInteger_382() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableFloatDoubleArgument; - nullableFloatDoubleArgument = [NSNumber numberWithDouble:-INFINITY]; - [cluster writeAttributeNullableFloatDoubleWithValue:nullableFloatDoubleArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_DOUBLE smallest Value Error: %@", err); + [cluster readAttributeRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read range-restricted unsigned 16-bit integer Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValue("range_restricted_int16u", actualValue, 200U)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableDoubleSmallestValue_319() + CHIP_ERROR TestWriteMinValueToARangeRestrictedUnsigned16BitInteger_383() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_DOUBLE smallest Value Error: %@", err); + id rangeRestrictedInt16uArgument; + rangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:0U]; + [cluster + writeAttributeRangeRestrictedInt16uWithValue:rangeRestrictedInt16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write min value to a range-restricted unsigned 16-bit integer Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_float_double", actualValue)); - VerifyOrReturn(CheckValue("nullable_float_double", actualValue, -INFINITY)); - } + return CHIP_NO_ERROR; + } - NextTest(); - }]; + CHIP_ERROR TestWriteJustBelowRangeValueToARangeRestrictedUnsigned16BitInteger_384() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id rangeRestrictedInt16uArgument; + rangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:99U]; + [cluster writeAttributeRangeRestrictedInt16uWithValue:rangeRestrictedInt16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write just-below-range value to a range-restricted unsigned 16-bit integer " + @"Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableDoubleNullValue_320() + CHIP_ERROR TestWriteJustAboveRangeValueToARangeRestrictedUnsigned16BitInteger_385() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableFloatDoubleArgument; - nullableFloatDoubleArgument = nil; - [cluster writeAttributeNullableFloatDoubleWithValue:nullableFloatDoubleArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_DOUBLE null Value Error: %@", err); + id rangeRestrictedInt16uArgument; + rangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:1001U]; + [cluster writeAttributeRangeRestrictedInt16uWithValue:rangeRestrictedInt16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write just-above-range value to a range-restricted unsigned 16-bit integer " + @"Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; - NextTest(); - }]; + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteMaxValueToARangeRestrictedUnsigned16BitInteger_386() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id rangeRestrictedInt16uArgument; + rangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:65535U]; + [cluster + writeAttributeRangeRestrictedInt16uWithValue:rangeRestrictedInt16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write max value to a range-restricted unsigned 16-bit integer Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableDoubleNullValue_321() + CHIP_ERROR TestVerifyRangeRestrictedUnsigned16BitIntegerValueHasNotChanged_387() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_DOUBLE null Value Error: %@", err); + [cluster readAttributeRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify range-restricted unsigned 16-bit integer value has not changed Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNull("nullable_float_double", actualValue)); + VerifyOrReturn(CheckValue("range_restricted_int16u", actualValue, 200U)); } NextTest(); @@ -57299,41 +65115,42 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableDouble0Value_322() + CHIP_ERROR TestWriteMinValidValueToARangeRestrictedUnsigned16BitInteger_388() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableFloatDoubleArgument; - nullableFloatDoubleArgument = [NSNumber numberWithDouble:0]; - [cluster writeAttributeNullableFloatDoubleWithValue:nullableFloatDoubleArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_DOUBLE 0 Value Error: %@", err); + id rangeRestrictedInt16uArgument; + rangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:100U]; + [cluster + writeAttributeRangeRestrictedInt16uWithValue:rangeRestrictedInt16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write min valid value to a range-restricted unsigned 16-bit integer Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableDouble0Value_323() + CHIP_ERROR TestVerifyRangeRestrictedUnsigned16BitIntegerValueIsAtMinValid_389() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_DOUBLE 0 Value Error: %@", err); + [cluster readAttributeRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify range-restricted unsigned 16-bit integer value is at min valid Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_float_double", actualValue)); - VerifyOrReturn(CheckValue("nullable_float_double", actualValue, 0)); + VerifyOrReturn(CheckValue("range_restricted_int16u", actualValue, 100U)); } NextTest(); @@ -57342,41 +65159,42 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableEnum8MinValue_324() + CHIP_ERROR TestWriteMaxValidValueToARangeRestrictedUnsigned16BitInteger_390() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableEnum8Argument; - nullableEnum8Argument = [NSNumber numberWithUnsignedChar:0]; - [cluster writeAttributeNullableEnum8WithValue:nullableEnum8Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_ENUM8 Min Value Error: %@", err); + id rangeRestrictedInt16uArgument; + rangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:1000U]; + [cluster + writeAttributeRangeRestrictedInt16uWithValue:rangeRestrictedInt16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write max valid value to a range-restricted unsigned 16-bit integer Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableEnum8MinValue_325() + CHIP_ERROR TestVerifyRangeRestrictedUnsigned16BitIntegerValueIsAtMaxValid_391() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_ENUM8 Min Value Error: %@", err); + [cluster readAttributeRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify range-restricted unsigned 16-bit integer value is at max valid Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_enum8", actualValue)); - VerifyOrReturn(CheckValue("nullable_enum8", actualValue, 0)); + VerifyOrReturn(CheckValue("range_restricted_int16u", actualValue, 1000U)); } NextTest(); @@ -57385,41 +65203,43 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableEnum8MaxValue_326() + CHIP_ERROR TestWriteMiddleValidValueToARangeRestrictedUnsigned16BitInteger_392() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableEnum8Argument; - nullableEnum8Argument = [NSNumber numberWithUnsignedChar:254]; - [cluster writeAttributeNullableEnum8WithValue:nullableEnum8Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_ENUM8 Max Value Error: %@", err); + id rangeRestrictedInt16uArgument; + rangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:500U]; + [cluster + writeAttributeRangeRestrictedInt16uWithValue:rangeRestrictedInt16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog( + @"Write middle valid value to a range-restricted unsigned 16-bit integer Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableEnum8MaxValue_327() + CHIP_ERROR TestVerifyRangeRestrictedUnsigned16BitIntegerValueIsAtMidValid_393() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_ENUM8 Max Value Error: %@", err); + [cluster readAttributeRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify range-restricted unsigned 16-bit integer value is at mid valid Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_enum8", actualValue)); - VerifyOrReturn(CheckValue("nullable_enum8", actualValue, 254)); + VerifyOrReturn(CheckValue("range_restricted_int16u", actualValue, 500U)); } NextTest(); @@ -57428,40 +65248,20 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableEnum8InvalidValue_328() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id nullableEnum8Argument; - nullableEnum8Argument = [NSNumber numberWithUnsignedChar:255]; - [cluster writeAttributeNullableEnum8WithValue:nullableEnum8Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_ENUM8 Invalid Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadAttributeNullableEnum8UnchangedValue_329() + CHIP_ERROR TestReadRangeRestrictedSigned8BitInteger_394() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_ENUM8 unchanged Value Error: %@", err); + [cluster readAttributeRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read range-restricted signed 8-bit integer Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_enum8", actualValue)); - VerifyOrReturn(CheckValue("nullable_enum8", actualValue, 254)); + VerifyOrReturn(CheckValue("range_restricted_int8s", actualValue, -20)); } NextTest(); @@ -57470,83 +65270,102 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableEnum8NullValue_330() + CHIP_ERROR TestWriteMinValueToARangeRestrictedSigned8BitInteger_395() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableEnum8Argument; - nullableEnum8Argument = nil; - [cluster writeAttributeNullableEnum8WithValue:nullableEnum8Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_ENUM8 null Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id rangeRestrictedInt8sArgument; + rangeRestrictedInt8sArgument = [NSNumber numberWithChar:-128]; + [cluster writeAttributeRangeRestrictedInt8sWithValue:rangeRestrictedInt8sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write min value to a range-restricted signed 8-bit integer Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableEnum8NullValue_331() + CHIP_ERROR TestWriteJustBelowRangeValueToARangeRestrictedSigned8BitInteger_396() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_ENUM8 null Value Error: %@", err); + id rangeRestrictedInt8sArgument; + rangeRestrictedInt8sArgument = [NSNumber numberWithChar:-41]; + [cluster + writeAttributeRangeRestrictedInt8sWithValue:rangeRestrictedInt8sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog( + @"Write just-below-range value to a range-restricted signed 8-bit integer Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; - { - id actualValue = value; - VerifyOrReturn(CheckValueNull("nullable_enum8", actualValue)); - } + return CHIP_NO_ERROR; + } - NextTest(); - }]; + CHIP_ERROR TestWriteJustAboveRangeValueToARangeRestrictedSigned8BitInteger_397() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id rangeRestrictedInt8sArgument; + rangeRestrictedInt8sArgument = [NSNumber numberWithChar:51]; + [cluster + writeAttributeRangeRestrictedInt8sWithValue:rangeRestrictedInt8sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog( + @"Write just-above-range value to a range-restricted signed 8-bit integer Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableEnum16MinValue_332() + CHIP_ERROR TestWriteMaxValueToARangeRestrictedSigned8BitInteger_398() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableEnum16Argument; - nullableEnum16Argument = [NSNumber numberWithUnsignedShort:0U]; - [cluster writeAttributeNullableEnum16WithValue:nullableEnum16Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_ENUM16 Min Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id rangeRestrictedInt8sArgument; + rangeRestrictedInt8sArgument = [NSNumber numberWithChar:127]; + [cluster writeAttributeRangeRestrictedInt8sWithValue:rangeRestrictedInt8sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write max value to a range-restricted signed 8-bit integer Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableEnum16MinValue_333() + CHIP_ERROR TestVerifyRangeRestrictedSigned8BitIntegerValueHasNotChanged_399() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_ENUM16 Min Value Error: %@", err); + [cluster readAttributeRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify range-restricted signed 8-bit integer value has not changed Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_enum16", actualValue)); - VerifyOrReturn(CheckValue("nullable_enum16", actualValue, 0U)); + VerifyOrReturn(CheckValue("range_restricted_int8s", actualValue, -20)); } NextTest(); @@ -57555,41 +65374,41 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableEnum16MaxValue_334() + CHIP_ERROR TestWriteMinValidValueToARangeRestrictedSigned8BitInteger_400() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableEnum16Argument; - nullableEnum16Argument = [NSNumber numberWithUnsignedShort:65534U]; - [cluster writeAttributeNullableEnum16WithValue:nullableEnum16Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_ENUM16 Max Value Error: %@", err); + id rangeRestrictedInt8sArgument; + rangeRestrictedInt8sArgument = [NSNumber numberWithChar:-40]; + [cluster + writeAttributeRangeRestrictedInt8sWithValue:rangeRestrictedInt8sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write min valid value to a range-restricted signed 8-bit integer Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableEnum16MaxValue_335() + CHIP_ERROR TestVerifyRangeRestrictedSigned8BitIntegerValueIsAtMinValid_401() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_ENUM16 Max Value Error: %@", err); + [cluster readAttributeRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify range-restricted signed 8-bit integer value is at min valid Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_enum16", actualValue)); - VerifyOrReturn(CheckValue("nullable_enum16", actualValue, 65534U)); + VerifyOrReturn(CheckValue("range_restricted_int8s", actualValue, -40)); } NextTest(); @@ -57598,40 +65417,41 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableEnum16InvalidValue_336() + CHIP_ERROR TestWriteMaxValidValueToARangeRestrictedSigned8BitInteger_402() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableEnum16Argument; - nullableEnum16Argument = [NSNumber numberWithUnsignedShort:65535U]; - [cluster writeAttributeNullableEnum16WithValue:nullableEnum16Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_ENUM16 Invalid Value Error: %@", err); + id rangeRestrictedInt8sArgument; + rangeRestrictedInt8sArgument = [NSNumber numberWithChar:50]; + [cluster + writeAttributeRangeRestrictedInt8sWithValue:rangeRestrictedInt8sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write max valid value to a range-restricted signed 8-bit integer Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableEnum16UnchangedValue_337() + CHIP_ERROR TestVerifyRangeRestrictedSigned8BitIntegerValueIsAtMaxValid_403() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_ENUM16 unchanged Value Error: %@", err); + [cluster readAttributeRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify range-restricted signed 8-bit integer value is at max valid Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_enum16", actualValue)); - VerifyOrReturn(CheckValue("nullable_enum16", actualValue, 65534U)); + VerifyOrReturn(CheckValue("range_restricted_int8s", actualValue, 50)); } NextTest(); @@ -57640,40 +65460,42 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableEnum16NullValue_338() + CHIP_ERROR TestWriteMiddleValidValueToARangeRestrictedSigned8BitInteger_404() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableEnum16Argument; - nullableEnum16Argument = nil; - [cluster writeAttributeNullableEnum16WithValue:nullableEnum16Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_ENUM16 null Value Error: %@", err); + id rangeRestrictedInt8sArgument; + rangeRestrictedInt8sArgument = [NSNumber numberWithChar:6]; + [cluster + writeAttributeRangeRestrictedInt8sWithValue:rangeRestrictedInt8sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write middle valid value to a range-restricted signed 8-bit integer Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableEnum16NullValue_339() + CHIP_ERROR TestVerifyRangeRestrictedSigned8BitIntegerValueIsAtMidValid_405() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_ENUM16 null Value Error: %@", err); + [cluster readAttributeRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify range-restricted signed 8-bit integer value is at mid valid Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNull("nullable_enum16", actualValue)); + VerifyOrReturn(CheckValue("range_restricted_int8s", actualValue, 6)); } NextTest(); @@ -57682,41 +65504,20 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableSimpleEnumMinValue_340() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id nullableEnumAttrArgument; - nullableEnumAttrArgument = [NSNumber numberWithUnsignedChar:0]; - [cluster writeAttributeNullableEnumAttrWithValue:nullableEnumAttrArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_SIMPLE_ENUM Min Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadAttributeNullableSimpleEnumMinValue_341() + CHIP_ERROR TestReadRangeRestrictedSigned16BitInteger_406() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableEnumAttrWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_SIMPLE_ENUM Min Value Error: %@", err); + [cluster readAttributeRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read range-restricted signed 16-bit integer Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_enum_attr", actualValue)); - VerifyOrReturn(CheckValue("nullable_enum_attr", actualValue, 0)); + VerifyOrReturn(CheckValue("range_restricted_int16s", actualValue, -100)); } NextTest(); @@ -57725,60 +65526,80 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableSimpleEnumMaxValue_342() + CHIP_ERROR TestWriteMinValueToARangeRestrictedSigned16BitInteger_407() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableEnumAttrArgument; - nullableEnumAttrArgument = [NSNumber numberWithUnsignedChar:254]; - [cluster writeAttributeNullableEnumAttrWithValue:nullableEnumAttrArgument + id rangeRestrictedInt16sArgument; + rangeRestrictedInt16sArgument = [NSNumber numberWithShort:-32768]; + [cluster + writeAttributeRangeRestrictedInt16sWithValue:rangeRestrictedInt16sArgument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_SIMPLE_ENUM Max Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + NSLog(@"Write min value to a range-restricted signed 16-bit integer Error: %@", err); + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableSimpleEnumMaxValue_343() + CHIP_ERROR TestWriteJustBelowRangeValueToARangeRestrictedSigned16BitInteger_408() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableEnumAttrWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_SIMPLE_ENUM Max Value Error: %@", err); + id rangeRestrictedInt16sArgument; + rangeRestrictedInt16sArgument = [NSNumber numberWithShort:-151]; + [cluster writeAttributeRangeRestrictedInt16sWithValue:rangeRestrictedInt16sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write just-below-range value to a range-restricted signed 16-bit integer " + @"Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_enum_attr", actualValue)); - VerifyOrReturn(CheckValue("nullable_enum_attr", actualValue, 254)); - } + return CHIP_NO_ERROR; + } - NextTest(); - }]; + CHIP_ERROR TestWriteJustAboveRangeValueToARangeRestrictedSigned16BitInteger_409() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id rangeRestrictedInt16sArgument; + rangeRestrictedInt16sArgument = [NSNumber numberWithShort:201]; + [cluster writeAttributeRangeRestrictedInt16sWithValue:rangeRestrictedInt16sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write just-above-range value to a range-restricted signed 16-bit integer " + @"Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableSimpleEnumInvalidValue_344() + CHIP_ERROR TestWriteMaxValueToARangeRestrictedSigned16BitInteger_410() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableEnumAttrArgument; - nullableEnumAttrArgument = [NSNumber numberWithUnsignedChar:255]; - [cluster writeAttributeNullableEnumAttrWithValue:nullableEnumAttrArgument + id rangeRestrictedInt16sArgument; + rangeRestrictedInt16sArgument = [NSNumber numberWithShort:32767]; + [cluster + writeAttributeRangeRestrictedInt16sWithValue:rangeRestrictedInt16sArgument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_SIMPLE_ENUM Invalid Value Error: %@", err); + NSLog(@"Write max value to a range-restricted signed 16-bit integer Error: %@", err); VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); NextTest(); @@ -57787,21 +65608,20 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableSimpleEnumUnchangedValue_345() + CHIP_ERROR TestVerifyRangeRestrictedSigned16BitIntegerValueHasNotChanged_411() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableEnumAttrWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_SIMPLE_ENUM unchanged Value Error: %@", err); + [cluster readAttributeRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify range-restricted signed 16-bit integer value has not changed Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_enum_attr", actualValue)); - VerifyOrReturn(CheckValue("nullable_enum_attr", actualValue, 254)); + VerifyOrReturn(CheckValue("range_restricted_int16s", actualValue, -100)); } NextTest(); @@ -57810,17 +65630,19 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableSimpleEnumNullValue_346() + CHIP_ERROR TestWriteMinValidValueToARangeRestrictedSigned16BitInteger_412() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableEnumAttrArgument; - nullableEnumAttrArgument = nil; - [cluster writeAttributeNullableEnumAttrWithValue:nullableEnumAttrArgument + id rangeRestrictedInt16sArgument; + rangeRestrictedInt16sArgument = [NSNumber numberWithShort:-150]; + [cluster + writeAttributeRangeRestrictedInt16sWithValue:rangeRestrictedInt16sArgument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_SIMPLE_ENUM null Value Error: %@", err); + NSLog( + @"Write min valid value to a range-restricted signed 16-bit integer Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -57830,20 +65652,20 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableSimpleEnumNullValue_347() + CHIP_ERROR TestVerifyRangeRestrictedSigned16BitIntegerValueIsAtMinValid_413() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableEnumAttrWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_SIMPLE_ENUM null Value Error: %@", err); + [cluster readAttributeRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify range-restricted signed 16-bit integer value is at min valid Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNull("nullable_enum_attr", actualValue)); + VerifyOrReturn(CheckValue("range_restricted_int16s", actualValue, -150)); } NextTest(); @@ -57852,22 +65674,42 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableOctetStringDefaultValue_348() + CHIP_ERROR TestWriteMaxValidValueToARangeRestrictedSigned16BitInteger_414() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_OCTET_STRING Default Value Error: %@", err); + id rangeRestrictedInt16sArgument; + rangeRestrictedInt16sArgument = [NSNumber numberWithShort:200]; + [cluster + writeAttributeRangeRestrictedInt16sWithValue:rangeRestrictedInt16sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog( + @"Write max valid value to a range-restricted signed 16-bit integer Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestVerifyRangeRestrictedSigned16BitIntegerValueIsAtMaxValid_415() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify range-restricted signed 16-bit integer value is at max valid Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_octet_string", actualValue)); - VerifyOrReturn( - CheckValueAsString("nullable_octet_string", actualValue, [[NSData alloc] initWithBytes:"" length:0])); + VerifyOrReturn(CheckValue("range_restricted_int16s", actualValue, 200)); } NextTest(); @@ -57876,42 +65718,42 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableOctetString_349() + CHIP_ERROR TestWriteMiddleValidValueToARangeRestrictedSigned16BitInteger_416() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableOctetStringArgument; - nullableOctetStringArgument = [[NSData alloc] initWithBytes:"TestValue" length:9]; - [cluster writeAttributeNullableOctetStringWithValue:nullableOctetStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_OCTET_STRING Error: %@", err); + id rangeRestrictedInt16sArgument; + rangeRestrictedInt16sArgument = [NSNumber numberWithShort:7]; + [cluster + writeAttributeRangeRestrictedInt16sWithValue:rangeRestrictedInt16sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write middle valid value to a range-restricted signed 16-bit integer Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableOctetString_350() + CHIP_ERROR TestVerifyRangeRestrictedSigned16BitIntegerValueIsAtMidValid_417() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_OCTET_STRING Error: %@", err); + [cluster readAttributeRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify range-restricted signed 16-bit integer value is at mid valid Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_octet_string", actualValue)); - VerifyOrReturn( - CheckValueAsString("nullable_octet_string", actualValue, [[NSData alloc] initWithBytes:"TestValue" length:9])); + VerifyOrReturn(CheckValue("range_restricted_int16s", actualValue, 7)); } NextTest(); @@ -57920,1321 +65762,1377 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableOctetString_351() + CHIP_ERROR TestReadNullableRangeRestrictedUnsigned8BitInteger_418() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableOctetStringArgument; - nullableOctetStringArgument = nil; - [cluster writeAttributeNullableOctetStringWithValue:nullableOctetStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_OCTET_STRING Error: %@", err); + [cluster + readAttributeNullableRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read nullable range-restricted unsigned 8-bit integer Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int8u", actualValue)); + VerifyOrReturn(CheckValue("nullable_range_restricted_int8u", actualValue, 70)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableOctetString_352() + CHIP_ERROR TestWriteMinValueToANullableRangeRestrictedUnsigned8BitInteger_419() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_OCTET_STRING Error: %@", err); + id nullableRangeRestrictedInt8uArgument; + nullableRangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:0]; + [cluster writeAttributeNullableRangeRestrictedInt8uWithValue:nullableRangeRestrictedInt8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write min value to a nullable range-restricted unsigned 8-bit " + @"integer Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; - { - id actualValue = value; - VerifyOrReturn(CheckValueNull("nullable_octet_string", actualValue)); - } + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteJustBelowRangeValueToANullableRangeRestrictedUnsigned8BitInteger_420() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id nullableRangeRestrictedInt8uArgument; + nullableRangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:19]; + [cluster writeAttributeNullableRangeRestrictedInt8uWithValue:nullableRangeRestrictedInt8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write just-below-range value to a nullable range-restricted " + @"unsigned 8-bit integer Error: %@", + err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableOctetString_353() + CHIP_ERROR TestWriteJustAboveRangeValueToANullableRangeRestrictedUnsigned8BitInteger_421() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableOctetStringArgument; - nullableOctetStringArgument = [[NSData alloc] initWithBytes:"" length:0]; - [cluster writeAttributeNullableOctetStringWithValue:nullableOctetStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_OCTET_STRING Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id nullableRangeRestrictedInt8uArgument; + nullableRangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:101]; + [cluster writeAttributeNullableRangeRestrictedInt8uWithValue:nullableRangeRestrictedInt8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write just-above-range value to a nullable range-restricted " + @"unsigned 8-bit integer Error: %@", + err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableOctetString_354() + CHIP_ERROR TestWriteMaxValueToANullableRangeRestrictedUnsigned8BitInteger_422() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_OCTET_STRING Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_octet_string", actualValue)); - VerifyOrReturn( - CheckValueAsString("nullable_octet_string", actualValue, [[NSData alloc] initWithBytes:"" length:0])); - } + id nullableRangeRestrictedInt8uArgument; + nullableRangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:254]; + [cluster writeAttributeNullableRangeRestrictedInt8uWithValue:nullableRangeRestrictedInt8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write max value to a nullable range-restricted unsigned 8-bit " + @"integer Error: %@", + err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableCharStringDefaultValue_355() + CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueHasNotChanged_423() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_CHAR_STRING Default Value Error: %@", err); + [cluster + readAttributeNullableRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify nullable range-restricted unsigned 8-bit integer value has not changed Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_char_string", actualValue)); - VerifyOrReturn(CheckValueAsString("nullable_char_string", actualValue, @"")); - } + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int8u", actualValue)); + VerifyOrReturn(CheckValue("nullable_range_restricted_int8u", actualValue, 70)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableCharString_356() + CHIP_ERROR TestWriteMinValidValueToANullableRangeRestrictedUnsigned8BitInteger_424() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableCharStringArgument; - nullableCharStringArgument = @"☉T☉"; - [cluster writeAttributeNullableCharStringWithValue:nullableCharStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_CHAR_STRING Error: %@", err); + id nullableRangeRestrictedInt8uArgument; + nullableRangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:20]; + [cluster writeAttributeNullableRangeRestrictedInt8uWithValue:nullableRangeRestrictedInt8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write min valid value to a nullable range-restricted unsigned 8-bit " + @"integer Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableCharString_357() + CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueIsAtMinValid_425() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_CHAR_STRING Error: %@", err); + [cluster + readAttributeNullableRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify nullable range-restricted unsigned 8-bit integer value is at min valid Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_char_string", actualValue)); - VerifyOrReturn(CheckValueAsString("nullable_char_string", actualValue, @"☉T☉")); - } + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int8u", actualValue)); + VerifyOrReturn(CheckValue("nullable_range_restricted_int8u", actualValue, 20)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableCharStringValueTooLong_358() + CHIP_ERROR TestWriteMaxValidValueToANullableRangeRestrictedUnsigned8BitInteger_426() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableCharStringArgument; - nullableCharStringArgument = nil; - [cluster writeAttributeNullableCharStringWithValue:nullableCharStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_CHAR_STRING - Value too long Error: %@", err); + id nullableRangeRestrictedInt8uArgument; + nullableRangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:100]; + [cluster writeAttributeNullableRangeRestrictedInt8uWithValue:nullableRangeRestrictedInt8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write max valid value to a nullable range-restricted unsigned 8-bit " + @"integer Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableCharString_359() + CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueIsAtMaxValid_427() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_CHAR_STRING Error: %@", err); + [cluster + readAttributeNullableRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify nullable range-restricted unsigned 8-bit integer value is at max valid Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNull("nullable_char_string", actualValue)); - } + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int8u", actualValue)); + VerifyOrReturn(CheckValue("nullable_range_restricted_int8u", actualValue, 100)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableCharStringEmpty_360() + CHIP_ERROR TestWriteMiddleValidValueToANullableRangeRestrictedUnsigned8BitInteger_428() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableCharStringArgument; - nullableCharStringArgument = @""; - [cluster writeAttributeNullableCharStringWithValue:nullableCharStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_CHAR_STRING - Empty Error: %@", err); + id nullableRangeRestrictedInt8uArgument; + nullableRangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:50]; + [cluster writeAttributeNullableRangeRestrictedInt8uWithValue:nullableRangeRestrictedInt8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write middle valid value to a nullable range-restricted unsigned " + @"8-bit integer Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableCharString_361() + CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueIsAtMidValid_429() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_CHAR_STRING Error: %@", err); + [cluster + readAttributeNullableRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify nullable range-restricted unsigned 8-bit integer value is at mid valid Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_char_string", actualValue)); - VerifyOrReturn(CheckValueAsString("nullable_char_string", actualValue, @"")); - } + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int8u", actualValue)); + VerifyOrReturn(CheckValue("nullable_range_restricted_int8u", actualValue, 50)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeFromNonexistentEndpoint_362() + CHIP_ERROR TestWriteNullValueToANullableRangeRestrictedUnsigned8BitInteger_430() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:200 queue:mCallbackQueue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeListInt8uWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute from nonexistent endpoint. Error: %@", err); + id nullableRangeRestrictedInt8uArgument; + nullableRangeRestrictedInt8uArgument = nil; + [cluster writeAttributeNullableRangeRestrictedInt8uWithValue:nullableRangeRestrictedInt8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write null value to a nullable range-restricted unsigned 8-bit " + @"integer Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_ENDPOINT)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeFromNonexistentCluster_363() + CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueIsNull_431() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeListInt8uWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute from nonexistent cluster. Error: %@", err); + [cluster + readAttributeNullableRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify nullable range-restricted unsigned 8-bit integer value is null Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_CLUSTER)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNull("nullable_range_restricted_int8u", actualValue)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendACommandThatTakesAnOptionalParameterButDoNotSetIt_364() + CHIP_ERROR TestReadNullableRangeRestrictedUnsigned16BitInteger_432() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPTestClusterClusterTestSimpleOptionalArgumentRequestParams alloc] init]; [cluster - testSimpleOptionalArgumentRequestWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog( - @"Send a command that takes an optional parameter but do not set it. Error: %@", err); + readAttributeNullableRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read nullable range-restricted unsigned 16-bit integer Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_INVALID_VALUE)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int16u", actualValue)); + VerifyOrReturn(CheckValue("nullable_range_restricted_int16u", actualValue, 200U)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendACommandThatTakesAnOptionalParameterButDoNotSetIt_365() + CHIP_ERROR TestWriteMinValueToANullableRangeRestrictedUnsigned16BitInteger_433() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPTestClusterClusterTestSimpleOptionalArgumentRequestParams alloc] init]; - params.arg1 = [NSNumber numberWithBool:1]; + id nullableRangeRestrictedInt16uArgument; + nullableRangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:0U]; [cluster - testSimpleOptionalArgumentRequestWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog( - @"Send a command that takes an optional parameter but do not set it. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + writeAttributeNullableRangeRestrictedInt16uWithValue:nullableRangeRestrictedInt16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write min value to a nullable range-restricted unsigned 16-bit integer " + @"Error: %@", + err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - bool testSendClusterTestCluster_000366_WaitForReport_Fulfilled = false; - ResponseHandler _Nullable test_TestCluster_list_int8u_Reported = nil; - CHIP_ERROR TestReportSubscribeToListAttribute_366() + CHIP_ERROR TestWriteJustBelowRangeValueToANullableRangeRestrictedUnsigned16BitInteger_434() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - test_TestCluster_list_int8u_Reported = ^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Report: Subscribe to list attribute Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("list_int8u", [actualValue count], static_cast(4))); - VerifyOrReturn(CheckValue("", actualValue[0], 1)); - VerifyOrReturn(CheckValue("", actualValue[1], 2)); - VerifyOrReturn(CheckValue("", actualValue[2], 3)); - VerifyOrReturn(CheckValue("", actualValue[3], 4)); - } + id nullableRangeRestrictedInt16uArgument; + nullableRangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:99U]; + [cluster + writeAttributeNullableRangeRestrictedInt16uWithValue:nullableRangeRestrictedInt16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write just-below-range value to a nullable range-restricted unsigned " + @"16-bit integer Error: %@", + err); - testSendClusterTestCluster_000366_WaitForReport_Fulfilled = true; - }; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; - NextTest(); return CHIP_NO_ERROR; } - CHIP_ERROR TestSubscribeToListAttribute_367() + CHIP_ERROR TestWriteJustAboveRangeValueToANullableRangeRestrictedUnsigned16BitInteger_435() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - uint16_t minIntervalArgument = 2U; - uint16_t maxIntervalArgument = 5U; - CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; - [cluster subscribeAttributeListInt8uWithMinInterval:[NSNumber numberWithUnsignedInt:minIntervalArgument] - maxInterval:[NSNumber numberWithUnsignedInt:maxIntervalArgument] - params:params - subscriptionEstablished:^{ - VerifyOrReturn( - testSendClusterTestCluster_000366_WaitForReport_Fulfilled, SetCommandExitStatus(CHIP_ERROR_INCORRECT_STATE)); - NextTest(); - } - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Subscribe to list attribute Error: %@", err); + id nullableRangeRestrictedInt16uArgument; + nullableRangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:1001U]; + [cluster + writeAttributeNullableRangeRestrictedInt16uWithValue:nullableRangeRestrictedInt16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write just-above-range value to a nullable range-restricted unsigned " + @"16-bit integer Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, 0)); - if (test_TestCluster_list_int8u_Reported != nil) { - ResponseHandler callback = test_TestCluster_list_int8u_Reported; - test_TestCluster_list_int8u_Reported = nil; - callback(value, err); - } - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteSubscribedToListAttribute_368() + CHIP_ERROR TestWriteMaxValueToANullableRangeRestrictedUnsigned16BitInteger_436() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id listInt8uArgument; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [NSNumber numberWithUnsignedChar:5]; - temp_0[1] = [NSNumber numberWithUnsignedChar:6]; - temp_0[2] = [NSNumber numberWithUnsignedChar:7]; - temp_0[3] = [NSNumber numberWithUnsignedChar:8]; - listInt8uArgument = temp_0; - } - [cluster writeAttributeListInt8uWithValue:listInt8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write subscribed-to list attribute Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id nullableRangeRestrictedInt16uArgument; + nullableRangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:65534U]; + [cluster + writeAttributeNullableRangeRestrictedInt16uWithValue:nullableRangeRestrictedInt16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write max value to a nullable range-restricted unsigned 16-bit integer " + @"Error: %@", + err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckForListAttributeReport_369() + CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueHasNotChanged_437() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - test_TestCluster_list_int8u_Reported = ^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check for list attribute report Error: %@", err); + [cluster + readAttributeNullableRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify nullable range-restricted unsigned 16-bit integer value has not changed Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("list_int8u", [actualValue count], static_cast(4))); - VerifyOrReturn(CheckValue("", actualValue[0], 5)); - VerifyOrReturn(CheckValue("", actualValue[1], 6)); - VerifyOrReturn(CheckValue("", actualValue[2], 7)); - VerifyOrReturn(CheckValue("", actualValue[3], 8)); - } + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int16u", actualValue)); + VerifyOrReturn(CheckValue("nullable_range_restricted_int16u", actualValue, 200U)); + } - NextTest(); - }; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadRangeRestrictedUnsigned8BitInteger_370() + CHIP_ERROR TestWriteMinValidValueToANullableRangeRestrictedUnsigned16BitInteger_438() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read range-restricted unsigned 8-bit integer Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id nullableRangeRestrictedInt16uArgument; + nullableRangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:100U]; + [cluster writeAttributeNullableRangeRestrictedInt16uWithValue:nullableRangeRestrictedInt16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write min valid value to a nullable range-restricted unsigned " + @"16-bit integer Error: %@", + err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("range_restricted_int8u", actualValue, 70)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteMinValueToARangeRestrictedUnsigned8BitInteger_371() + CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueIsAtMinValid_439() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id rangeRestrictedInt8uArgument; - rangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:0]; [cluster - writeAttributeRangeRestrictedInt8uWithValue:rangeRestrictedInt8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write min value to a range-restricted unsigned 8-bit integer Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } + readAttributeNullableRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify nullable range-restricted unsigned 16-bit integer value is at min valid Error: %@", err); - CHIP_ERROR TestWriteJustBelowRangeValueToARangeRestrictedUnsigned8BitInteger_372() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(CheckValue("status", err, 0)); - id rangeRestrictedInt8uArgument; - rangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:19]; - [cluster writeAttributeRangeRestrictedInt8uWithValue:rangeRestrictedInt8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write just-below-range value to a range-restricted unsigned 8-bit integer " - @"Error: %@", - err); + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int16u", actualValue)); + VerifyOrReturn(CheckValue("nullable_range_restricted_int16u", actualValue, 100U)); + } - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteJustAboveRangeValueToARangeRestrictedUnsigned8BitInteger_373() + CHIP_ERROR TestWriteMaxValidValueToANullableRangeRestrictedUnsigned16BitInteger_440() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id rangeRestrictedInt8uArgument; - rangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:101]; - [cluster writeAttributeRangeRestrictedInt8uWithValue:rangeRestrictedInt8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write just-above-range value to a range-restricted unsigned 8-bit integer " - @"Error: %@", - err); + id nullableRangeRestrictedInt16uArgument; + nullableRangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:1000U]; + [cluster writeAttributeNullableRangeRestrictedInt16uWithValue:nullableRangeRestrictedInt16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write max valid value to a nullable range-restricted unsigned " + @"16-bit integer Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteMaxValueToARangeRestrictedUnsigned8BitInteger_374() + CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueIsAtMaxValid_441() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id rangeRestrictedInt8uArgument; - rangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:255]; [cluster - writeAttributeRangeRestrictedInt8uWithValue:rangeRestrictedInt8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write max value to a range-restricted unsigned 8-bit integer Error: %@", err); + readAttributeNullableRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify nullable range-restricted unsigned 16-bit integer value is at max valid Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int16u", actualValue)); + VerifyOrReturn(CheckValue("nullable_range_restricted_int16u", actualValue, 1000U)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyRangeRestrictedUnsigned8BitIntegerValueHasNotChanged_375() + CHIP_ERROR TestWriteMiddleValidValueToANullableRangeRestrictedUnsigned16BitInteger_442() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify range-restricted unsigned 8-bit integer value has not changed Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id nullableRangeRestrictedInt16uArgument; + nullableRangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:500U]; + [cluster writeAttributeNullableRangeRestrictedInt16uWithValue:nullableRangeRestrictedInt16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write middle valid value to a nullable range-restricted unsigned " + @"16-bit integer Error: %@", + err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("range_restricted_int8u", actualValue, 70)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteMinValidValueToARangeRestrictedUnsigned8BitInteger_376() + CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueIsAtMidValid_443() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id rangeRestrictedInt8uArgument; - rangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:20]; [cluster - writeAttributeRangeRestrictedInt8uWithValue:rangeRestrictedInt8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog( - @"Write min valid value to a range-restricted unsigned 8-bit integer Error: %@", err); + readAttributeNullableRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify nullable range-restricted unsigned 16-bit integer value is at mid valid Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int16u", actualValue)); + VerifyOrReturn(CheckValue("nullable_range_restricted_int16u", actualValue, 500U)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyRangeRestrictedUnsigned8BitIntegerValueIsAtMinValid_377() + CHIP_ERROR TestWriteNullValueToANullableRangeRestrictedUnsigned16BitInteger_444() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify range-restricted unsigned 8-bit integer value is at min valid Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id nullableRangeRestrictedInt16uArgument; + nullableRangeRestrictedInt16uArgument = nil; + [cluster writeAttributeNullableRangeRestrictedInt16uWithValue:nullableRangeRestrictedInt16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write null value to a nullable range-restricted unsigned 16-bit " + @"integer Error: %@", + err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("range_restricted_int8u", actualValue, 20)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteMaxValidValueToARangeRestrictedUnsigned8BitInteger_378() + CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueIsNull_445() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id rangeRestrictedInt8uArgument; - rangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:100]; [cluster - writeAttributeRangeRestrictedInt8uWithValue:rangeRestrictedInt8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog( - @"Write max valid value to a range-restricted unsigned 8-bit integer Error: %@", err); + readAttributeNullableRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify nullable range-restricted unsigned 16-bit integer value is null Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValueNull("nullable_range_restricted_int16u", actualValue)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyRangeRestrictedUnsigned8BitIntegerValueIsAtMaxValid_379() + CHIP_ERROR TestReadNullableRangeRestrictedSigned8BitInteger_446() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify range-restricted unsigned 8-bit integer value is at max valid Error: %@", err); + [cluster + readAttributeNullableRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read nullable range-restricted signed 8-bit integer Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("range_restricted_int8u", actualValue, 100)); - } + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int8s", actualValue)); + VerifyOrReturn(CheckValue("nullable_range_restricted_int8s", actualValue, -20)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteMiddleValidValueToARangeRestrictedUnsigned8BitInteger_380() + CHIP_ERROR TestWriteMinValueToANullableRangeRestrictedSigned8BitInteger_447() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id rangeRestrictedInt8uArgument; - rangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:50]; - [cluster - writeAttributeRangeRestrictedInt8uWithValue:rangeRestrictedInt8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write middle valid value to a range-restricted unsigned 8-bit integer Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id nullableRangeRestrictedInt8sArgument; + nullableRangeRestrictedInt8sArgument = [NSNumber numberWithChar:-127]; + [cluster writeAttributeNullableRangeRestrictedInt8sWithValue:nullableRangeRestrictedInt8sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write min value to a nullable range-restricted signed 8-bit integer " + @"Error: %@", + err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyRangeRestrictedUnsigned8BitIntegerValueIsAtMidValid_381() + CHIP_ERROR TestWriteJustBelowRangeValueToANullableRangeRestrictedSigned8BitInteger_448() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify range-restricted unsigned 8-bit integer value is at mid valid Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("range_restricted_int8u", actualValue, 50)); - } + id nullableRangeRestrictedInt8sArgument; + nullableRangeRestrictedInt8sArgument = [NSNumber numberWithChar:-41]; + [cluster writeAttributeNullableRangeRestrictedInt8sWithValue:nullableRangeRestrictedInt8sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write just-below-range value to a nullable range-restricted signed " + @"8-bit integer Error: %@", + err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadRangeRestrictedUnsigned16BitInteger_382() + CHIP_ERROR TestWriteJustAboveRangeValueToANullableRangeRestrictedSigned8BitInteger_449() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read range-restricted unsigned 16-bit integer Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("range_restricted_int16u", actualValue, 200U)); - } + id nullableRangeRestrictedInt8sArgument; + nullableRangeRestrictedInt8sArgument = [NSNumber numberWithChar:51]; + [cluster writeAttributeNullableRangeRestrictedInt8sWithValue:nullableRangeRestrictedInt8sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write just-above-range value to a nullable range-restricted signed " + @"8-bit integer Error: %@", + err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteMinValueToARangeRestrictedUnsigned16BitInteger_383() + CHIP_ERROR TestWriteMaxValueToANullableRangeRestrictedSigned8BitInteger_450() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id rangeRestrictedInt16uArgument; - rangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:0U]; - [cluster - writeAttributeRangeRestrictedInt16uWithValue:rangeRestrictedInt16uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write min value to a range-restricted unsigned 16-bit integer Error: %@", err); + id nullableRangeRestrictedInt8sArgument; + nullableRangeRestrictedInt8sArgument = [NSNumber numberWithChar:127]; + [cluster writeAttributeNullableRangeRestrictedInt8sWithValue:nullableRangeRestrictedInt8sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write max value to a nullable range-restricted signed 8-bit integer " + @"Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteJustBelowRangeValueToARangeRestrictedUnsigned16BitInteger_384() + CHIP_ERROR TestVerifyNullableRangeRestrictedSigned8BitIntegerValueHasNotChanged_451() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id rangeRestrictedInt16uArgument; - rangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:99U]; - [cluster writeAttributeRangeRestrictedInt16uWithValue:rangeRestrictedInt16uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write just-below-range value to a range-restricted unsigned 16-bit integer " - @"Error: %@", - err); + [cluster + readAttributeNullableRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify nullable range-restricted signed 8-bit integer value has not changed Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int8s", actualValue)); + VerifyOrReturn(CheckValue("nullable_range_restricted_int8s", actualValue, -20)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteJustAboveRangeValueToARangeRestrictedUnsigned16BitInteger_385() + CHIP_ERROR TestWriteMinValidValueToANullableRangeRestrictedSigned8BitInteger_452() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id rangeRestrictedInt16uArgument; - rangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:1001U]; - [cluster writeAttributeRangeRestrictedInt16uWithValue:rangeRestrictedInt16uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write just-above-range value to a range-restricted unsigned 16-bit integer " - @"Error: %@", - err); + id nullableRangeRestrictedInt8sArgument; + nullableRangeRestrictedInt8sArgument = [NSNumber numberWithChar:-40]; + [cluster writeAttributeNullableRangeRestrictedInt8sWithValue:nullableRangeRestrictedInt8sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write min valid value to a nullable range-restricted signed 8-bit " + @"integer Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteMaxValueToARangeRestrictedUnsigned16BitInteger_386() + CHIP_ERROR TestVerifyNullableRangeRestrictedSigned8BitIntegerValueIsAtMinValid_453() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id rangeRestrictedInt16uArgument; - rangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:65535U]; [cluster - writeAttributeRangeRestrictedInt16uWithValue:rangeRestrictedInt16uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write max value to a range-restricted unsigned 16-bit integer Error: %@", err); + readAttributeNullableRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify nullable range-restricted signed 8-bit integer value is at min valid Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int8s", actualValue)); + VerifyOrReturn(CheckValue("nullable_range_restricted_int8s", actualValue, -40)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyRangeRestrictedUnsigned16BitIntegerValueHasNotChanged_387() + CHIP_ERROR TestWriteMaxValidValueToANullableRangeRestrictedSigned8BitInteger_454() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify range-restricted unsigned 16-bit integer value has not changed Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id nullableRangeRestrictedInt8sArgument; + nullableRangeRestrictedInt8sArgument = [NSNumber numberWithChar:50]; + [cluster writeAttributeNullableRangeRestrictedInt8sWithValue:nullableRangeRestrictedInt8sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write max valid value to a nullable range-restricted signed 8-bit " + @"integer Error: %@", + err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("range_restricted_int16u", actualValue, 200U)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteMinValidValueToARangeRestrictedUnsigned16BitInteger_388() + CHIP_ERROR TestVerifyNullableRangeRestrictedSigned8BitIntegerValueIsAtMaxValid_455() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id rangeRestrictedInt16uArgument; - rangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:100U]; [cluster - writeAttributeRangeRestrictedInt16uWithValue:rangeRestrictedInt16uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write min valid value to a range-restricted unsigned 16-bit integer Error: %@", - err); + readAttributeNullableRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify nullable range-restricted signed 8-bit integer value is at max valid Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int8s", actualValue)); + VerifyOrReturn(CheckValue("nullable_range_restricted_int8s", actualValue, 50)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyRangeRestrictedUnsigned16BitIntegerValueIsAtMinValid_389() + CHIP_ERROR TestWriteMiddleValidValueToANullableRangeRestrictedSigned8BitInteger_456() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify range-restricted unsigned 16-bit integer value is at min valid Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id nullableRangeRestrictedInt8sArgument; + nullableRangeRestrictedInt8sArgument = [NSNumber numberWithChar:6]; + [cluster writeAttributeNullableRangeRestrictedInt8sWithValue:nullableRangeRestrictedInt8sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write middle valid value to a nullable range-restricted signed " + @"8-bit integer Error: %@", + err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("range_restricted_int16u", actualValue, 100U)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteMaxValidValueToARangeRestrictedUnsigned16BitInteger_390() + CHIP_ERROR TestVerifyNullableRangeRestrictedSigned8BitIntegerValueIsAtMidValid_457() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id rangeRestrictedInt16uArgument; - rangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:1000U]; [cluster - writeAttributeRangeRestrictedInt16uWithValue:rangeRestrictedInt16uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write max valid value to a range-restricted unsigned 16-bit integer Error: %@", - err); + readAttributeNullableRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify nullable range-restricted signed 8-bit integer value is at mid valid Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int8s", actualValue)); + VerifyOrReturn(CheckValue("nullable_range_restricted_int8s", actualValue, 6)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyRangeRestrictedUnsigned16BitIntegerValueIsAtMaxValid_391() + CHIP_ERROR TestWriteNullValueToANullableRangeRestrictedSigned8BitInteger_458() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify range-restricted unsigned 16-bit integer value is at max valid Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id nullableRangeRestrictedInt8sArgument; + nullableRangeRestrictedInt8sArgument = nil; + [cluster writeAttributeNullableRangeRestrictedInt8sWithValue:nullableRangeRestrictedInt8sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write null value to a nullable range-restricted signed 8-bit " + @"integer Error: %@", + err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("range_restricted_int16u", actualValue, 1000U)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteMiddleValidValueToARangeRestrictedUnsigned16BitInteger_392() + CHIP_ERROR TestVerifyNullableRangeRestrictedSigned8BitIntegerValueIsAtNull_459() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id rangeRestrictedInt16uArgument; - rangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:500U]; [cluster - writeAttributeRangeRestrictedInt16uWithValue:rangeRestrictedInt16uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog( - @"Write middle valid value to a range-restricted unsigned 16-bit integer Error: %@", - err); + readAttributeNullableRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify nullable range-restricted signed 8-bit integer value is at null Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValueNull("nullable_range_restricted_int8s", actualValue)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyRangeRestrictedUnsigned16BitIntegerValueIsAtMidValid_393() + CHIP_ERROR TestReadNullableRangeRestrictedSigned16BitInteger_460() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify range-restricted unsigned 16-bit integer value is at mid valid Error: %@", err); + [cluster + readAttributeNullableRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read nullable range-restricted signed 16-bit integer Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("range_restricted_int16u", actualValue, 500U)); - } + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int16s", actualValue)); + VerifyOrReturn(CheckValue("nullable_range_restricted_int16s", actualValue, -100)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadRangeRestrictedSigned8BitInteger_394() + CHIP_ERROR TestWriteMinValueToANullableRangeRestrictedSigned16BitInteger_461() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read range-restricted signed 8-bit integer Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("range_restricted_int8s", actualValue, -20)); - } + id nullableRangeRestrictedInt16sArgument; + nullableRangeRestrictedInt16sArgument = [NSNumber numberWithShort:-32767]; + [cluster + writeAttributeNullableRangeRestrictedInt16sWithValue:nullableRangeRestrictedInt16sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write min value to a nullable range-restricted signed 16-bit integer " + @"Error: %@", + err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteMinValueToARangeRestrictedSigned8BitInteger_395() + CHIP_ERROR TestWriteJustBelowRangeValueToANullableRangeRestrictedSigned16BitInteger_462() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id rangeRestrictedInt8sArgument; - rangeRestrictedInt8sArgument = [NSNumber numberWithChar:-128]; - [cluster writeAttributeRangeRestrictedInt8sWithValue:rangeRestrictedInt8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write min value to a range-restricted signed 8-bit integer Error: %@", err); + id nullableRangeRestrictedInt16sArgument; + nullableRangeRestrictedInt16sArgument = [NSNumber numberWithShort:-151]; + [cluster + writeAttributeNullableRangeRestrictedInt16sWithValue:nullableRangeRestrictedInt16sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write just-below-range value to a nullable range-restricted signed " + @"16-bit integer Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteJustBelowRangeValueToARangeRestrictedSigned8BitInteger_396() + CHIP_ERROR TestWriteJustAboveRangeValueToANullableRangeRestrictedSigned16BitInteger_463() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id rangeRestrictedInt8sArgument; - rangeRestrictedInt8sArgument = [NSNumber numberWithChar:-41]; + id nullableRangeRestrictedInt16sArgument; + nullableRangeRestrictedInt16sArgument = [NSNumber numberWithShort:201]; [cluster - writeAttributeRangeRestrictedInt8sWithValue:rangeRestrictedInt8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog( - @"Write just-below-range value to a range-restricted signed 8-bit integer Error: %@", - err); + writeAttributeNullableRangeRestrictedInt16sWithValue:nullableRangeRestrictedInt16sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write just-above-range value to a nullable range-restricted signed " + @"16-bit integer Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteJustAboveRangeValueToARangeRestrictedSigned8BitInteger_397() + CHIP_ERROR TestWriteMaxValueToANullableRangeRestrictedSigned16BitInteger_464() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id rangeRestrictedInt8sArgument; - rangeRestrictedInt8sArgument = [NSNumber numberWithChar:51]; + id nullableRangeRestrictedInt16sArgument; + nullableRangeRestrictedInt16sArgument = [NSNumber numberWithShort:32767]; [cluster - writeAttributeRangeRestrictedInt8sWithValue:rangeRestrictedInt8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog( - @"Write just-above-range value to a range-restricted signed 8-bit integer Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + writeAttributeNullableRangeRestrictedInt16sWithValue:nullableRangeRestrictedInt16sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write max value to a nullable range-restricted signed 16-bit integer " + @"Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteMaxValueToARangeRestrictedSigned8BitInteger_398() + CHIP_ERROR TestVerifyNullableRangeRestrictedSigned16BitIntegerValueHasNotChanged_465() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id rangeRestrictedInt8sArgument; - rangeRestrictedInt8sArgument = [NSNumber numberWithChar:127]; - [cluster writeAttributeRangeRestrictedInt8sWithValue:rangeRestrictedInt8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write max value to a range-restricted signed 8-bit integer Error: %@", err); + [cluster + readAttributeNullableRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify nullable range-restricted signed 16-bit integer value has not changed Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int16s", actualValue)); + VerifyOrReturn(CheckValue("nullable_range_restricted_int16s", actualValue, -100)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyRangeRestrictedSigned8BitIntegerValueHasNotChanged_399() + CHIP_ERROR TestWriteMinValidValueToANullableRangeRestrictedSigned16BitInteger_466() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify range-restricted signed 8-bit integer value has not changed Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id nullableRangeRestrictedInt16sArgument; + nullableRangeRestrictedInt16sArgument = [NSNumber numberWithShort:-150]; + [cluster writeAttributeNullableRangeRestrictedInt16sWithValue:nullableRangeRestrictedInt16sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write min valid value to a nullable range-restricted signed 16-bit " + @"integer Error: %@", + err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("range_restricted_int8s", actualValue, -20)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteMinValidValueToARangeRestrictedSigned8BitInteger_400() + CHIP_ERROR TestVerifyNullableRangeRestrictedSigned16BitIntegerValueIsAtMinValid_467() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id rangeRestrictedInt8sArgument; - rangeRestrictedInt8sArgument = [NSNumber numberWithChar:-40]; [cluster - writeAttributeRangeRestrictedInt8sWithValue:rangeRestrictedInt8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write min valid value to a range-restricted signed 8-bit integer Error: %@", err); + readAttributeNullableRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify nullable range-restricted signed 16-bit integer value is at min valid Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int16s", actualValue)); + VerifyOrReturn(CheckValue("nullable_range_restricted_int16s", actualValue, -150)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyRangeRestrictedSigned8BitIntegerValueIsAtMinValid_401() + CHIP_ERROR TestWriteMaxValidValueToANullableRangeRestrictedSigned16BitInteger_468() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify range-restricted signed 8-bit integer value is at min valid Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id nullableRangeRestrictedInt16sArgument; + nullableRangeRestrictedInt16sArgument = [NSNumber numberWithShort:200]; + [cluster writeAttributeNullableRangeRestrictedInt16sWithValue:nullableRangeRestrictedInt16sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write max valid value to a nullable range-restricted signed 16-bit " + @"integer Error: %@", + err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("range_restricted_int8s", actualValue, -40)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteMaxValidValueToARangeRestrictedSigned8BitInteger_402() + CHIP_ERROR TestVerifyNullableRangeRestrictedSigned16BitIntegerValueIsAtMaxValid_469() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id rangeRestrictedInt8sArgument; - rangeRestrictedInt8sArgument = [NSNumber numberWithChar:50]; [cluster - writeAttributeRangeRestrictedInt8sWithValue:rangeRestrictedInt8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write max valid value to a range-restricted signed 8-bit integer Error: %@", err); + readAttributeNullableRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify nullable range-restricted signed 16-bit integer value is at max valid Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int16s", actualValue)); + VerifyOrReturn(CheckValue("nullable_range_restricted_int16s", actualValue, 200)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyRangeRestrictedSigned8BitIntegerValueIsAtMaxValid_403() + CHIP_ERROR TestWriteMiddleValidValueToANullableRangeRestrictedSigned16BitInteger_470() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify range-restricted signed 8-bit integer value is at max valid Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id nullableRangeRestrictedInt16sArgument; + nullableRangeRestrictedInt16sArgument = [NSNumber numberWithShort:7]; + [cluster writeAttributeNullableRangeRestrictedInt16sWithValue:nullableRangeRestrictedInt16sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write middle valid value to a nullable range-restricted signed " + @"16-bit integer Error: %@", + err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("range_restricted_int8s", actualValue, 50)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteMiddleValidValueToARangeRestrictedSigned8BitInteger_404() + CHIP_ERROR TestVerifyNullableRangeRestrictedSigned16BitIntegerValueIsAtMidValid_471() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id rangeRestrictedInt8sArgument; - rangeRestrictedInt8sArgument = [NSNumber numberWithChar:6]; [cluster - writeAttributeRangeRestrictedInt8sWithValue:rangeRestrictedInt8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write middle valid value to a range-restricted signed 8-bit integer Error: %@", - err); + readAttributeNullableRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify nullable range-restricted signed 16-bit integer value is at mid valid Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int16s", actualValue)); + VerifyOrReturn(CheckValue("nullable_range_restricted_int16s", actualValue, 7)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyRangeRestrictedSigned8BitIntegerValueIsAtMidValid_405() + CHIP_ERROR TestWriteNullValueToANullableRangeRestrictedSigned16BitInteger_472() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify range-restricted signed 8-bit integer value is at mid valid Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id nullableRangeRestrictedInt16sArgument; + nullableRangeRestrictedInt16sArgument = nil; + [cluster writeAttributeNullableRangeRestrictedInt16sWithValue:nullableRangeRestrictedInt16sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write null value to a nullable range-restricted signed 16-bit " + @"integer Error: %@", + err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("range_restricted_int8s", actualValue, 6)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadRangeRestrictedSigned16BitInteger_406() + CHIP_ERROR TestVerifyNullableRangeRestrictedSigned16BitIntegerValueIsNull_473() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read range-restricted signed 16-bit integer Error: %@", err); + [cluster + readAttributeNullableRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify nullable range-restricted signed 16-bit integer value is null Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("range_restricted_int16s", actualValue, -100)); - } + { + id actualValue = value; + VerifyOrReturn(CheckValueNull("nullable_range_restricted_int16s", actualValue)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteMinValueToARangeRestrictedSigned16BitInteger_407() + CHIP_ERROR TestWriteAttributeThatReturnsGeneralStatusOnWrite_474() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id rangeRestrictedInt16sArgument; - rangeRestrictedInt16sArgument = [NSNumber numberWithShort:-32768]; - [cluster - writeAttributeRangeRestrictedInt16sWithValue:rangeRestrictedInt16sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write min value to a range-restricted signed 16-bit integer Error: %@", err); + id generalErrorBooleanArgument; + generalErrorBooleanArgument = [NSNumber numberWithBool:false]; + [cluster writeAttributeGeneralErrorBooleanWithValue:generalErrorBooleanArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute that returns general status on write Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_INVALID_DATA_TYPE)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteJustBelowRangeValueToARangeRestrictedSigned16BitInteger_408() + CHIP_ERROR TestWriteAttributeThatReturnsClusterSpecificStatusOnWrite_475() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id rangeRestrictedInt16sArgument; - rangeRestrictedInt16sArgument = [NSNumber numberWithShort:-151]; - [cluster writeAttributeRangeRestrictedInt16sWithValue:rangeRestrictedInt16sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write just-below-range value to a range-restricted signed 16-bit integer " - @"Error: %@", - err); + id clusterErrorBooleanArgument; + clusterErrorBooleanArgument = [NSNumber numberWithBool:false]; + [cluster + writeAttributeClusterErrorBooleanWithValue:clusterErrorBooleanArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute that returns cluster-specific status on write Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_FAILURE)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteJustAboveRangeValueToARangeRestrictedSigned16BitInteger_409() + CHIP_ERROR TestReadAttributeThatReturnsGeneralStatusOnRead_476() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id rangeRestrictedInt16sArgument; - rangeRestrictedInt16sArgument = [NSNumber numberWithShort:201]; - [cluster writeAttributeRangeRestrictedInt16sWithValue:rangeRestrictedInt16sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write just-above-range value to a range-restricted signed 16-bit integer " - @"Error: %@", - err); + [cluster readAttributeGeneralErrorBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute that returns general status on read Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_INVALID_DATA_TYPE)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteMaxValueToARangeRestrictedSigned16BitInteger_410() + CHIP_ERROR TestReadAttributeThatReturnsClusterSpecificStatusOnRead_477() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id rangeRestrictedInt16sArgument; - rangeRestrictedInt16sArgument = [NSNumber numberWithShort:32767]; - [cluster - writeAttributeRangeRestrictedInt16sWithValue:rangeRestrictedInt16sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write max value to a range-restricted signed 16-bit integer Error: %@", err); + [cluster readAttributeClusterErrorBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read attribute that returns cluster-specific status on read Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_FAILURE)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyRangeRestrictedSigned16BitIntegerValueHasNotChanged_411() + CHIP_ERROR TestReadAcceptedCommandListAttribute_478() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify range-restricted signed 16-bit integer value has not changed Error: %@", err); + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"read AcceptedCommandList attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("range_restricted_int16s", actualValue, -100)); + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(18))); + VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); + VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); + VerifyOrReturn(CheckValue("", actualValue[2], 2UL)); + VerifyOrReturn(CheckValue("", actualValue[3], 4UL)); + VerifyOrReturn(CheckValue("", actualValue[4], 7UL)); + VerifyOrReturn(CheckValue("", actualValue[5], 8UL)); + VerifyOrReturn(CheckValue("", actualValue[6], 9UL)); + VerifyOrReturn(CheckValue("", actualValue[7], 10UL)); + VerifyOrReturn(CheckValue("", actualValue[8], 11UL)); + VerifyOrReturn(CheckValue("", actualValue[9], 12UL)); + VerifyOrReturn(CheckValue("", actualValue[10], 13UL)); + VerifyOrReturn(CheckValue("", actualValue[11], 14UL)); + VerifyOrReturn(CheckValue("", actualValue[12], 15UL)); + VerifyOrReturn(CheckValue("", actualValue[13], 17UL)); + VerifyOrReturn(CheckValue("", actualValue[14], 18UL)); + VerifyOrReturn(CheckValue("", actualValue[15], 19UL)); + VerifyOrReturn(CheckValue("", actualValue[16], 20UL)); + VerifyOrReturn(CheckValue("", actualValue[17], 21UL)); } NextTest(); @@ -59243,42 +67141,28 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteMinValidValueToARangeRestrictedSigned16BitInteger_412() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id rangeRestrictedInt16sArgument; - rangeRestrictedInt16sArgument = [NSNumber numberWithShort:-150]; - [cluster - writeAttributeRangeRestrictedInt16sWithValue:rangeRestrictedInt16sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog( - @"Write min valid value to a range-restricted signed 16-bit integer Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestVerifyRangeRestrictedSigned16BitIntegerValueIsAtMinValid_413() + CHIP_ERROR TestReadGeneratedCommandListAttribute_479() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify range-restricted signed 16-bit integer value is at min valid Error: %@", err); + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"read GeneratedCommandList attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("range_restricted_int16s", actualValue, -150)); + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(8))); + VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); + VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); + VerifyOrReturn(CheckValue("", actualValue[2], 4UL)); + VerifyOrReturn(CheckValue("", actualValue[3], 5UL)); + VerifyOrReturn(CheckValue("", actualValue[4], 6UL)); + VerifyOrReturn(CheckValue("", actualValue[5], 9UL)); + VerifyOrReturn(CheckValue("", actualValue[6], 10UL)); + VerifyOrReturn(CheckValue("", actualValue[7], 11UL)); } NextTest(); @@ -59287,42 +67171,58 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteMaxValidValueToARangeRestrictedSigned16BitInteger_414() + CHIP_ERROR TestWriteStructTypedAttribute_480() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id rangeRestrictedInt16sArgument; - rangeRestrictedInt16sArgument = [NSNumber numberWithShort:200]; - [cluster - writeAttributeRangeRestrictedInt16sWithValue:rangeRestrictedInt16sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog( - @"Write max valid value to a range-restricted signed 16-bit integer Error: %@", err); + id structAttrArgument; + structAttrArgument = [[CHIPTestClusterClusterSimpleStruct alloc] init]; + ((CHIPTestClusterClusterSimpleStruct *) structAttrArgument).a = [NSNumber numberWithUnsignedChar:5]; + ((CHIPTestClusterClusterSimpleStruct *) structAttrArgument).b = [NSNumber numberWithBool:true]; + ((CHIPTestClusterClusterSimpleStruct *) structAttrArgument).c = [NSNumber numberWithUnsignedChar:2]; + ((CHIPTestClusterClusterSimpleStruct *) structAttrArgument).d = [[NSData alloc] initWithBytes:"abc" length:3]; + ((CHIPTestClusterClusterSimpleStruct *) structAttrArgument).e = @""; + ((CHIPTestClusterClusterSimpleStruct *) structAttrArgument).f = [NSNumber numberWithUnsignedChar:17]; + ((CHIPTestClusterClusterSimpleStruct *) structAttrArgument).g = [NSNumber numberWithFloat:1.5f]; + ((CHIPTestClusterClusterSimpleStruct *) structAttrArgument).h = [NSNumber numberWithDouble:3.14159265358979]; - VerifyOrReturn(CheckValue("status", err, 0)); + [cluster writeAttributeStructAttrWithValue:structAttrArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write struct-typed attribute Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyRangeRestrictedSigned16BitIntegerValueIsAtMaxValid_415() + CHIP_ERROR TestReadStructTypedAttribute_481() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify range-restricted signed 16-bit integer value is at max valid Error: %@", err); + [cluster readAttributeStructAttrWithCompletionHandler:^( + CHIPTestClusterClusterSimpleStruct * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read struct-typed attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("range_restricted_int16s", actualValue, 200)); + VerifyOrReturn(CheckValue("a", ((CHIPTestClusterClusterSimpleStruct *) actualValue).a, 5)); + VerifyOrReturn(CheckValue("b", ((CHIPTestClusterClusterSimpleStruct *) actualValue).b, true)); + VerifyOrReturn(CheckValue("c", ((CHIPTestClusterClusterSimpleStruct *) actualValue).c, 2)); + VerifyOrReturn(CheckValueAsString( + "d", ((CHIPTestClusterClusterSimpleStruct *) actualValue).d, [[NSData alloc] initWithBytes:"abc" length:3])); + VerifyOrReturn(CheckValueAsString("e", ((CHIPTestClusterClusterSimpleStruct *) actualValue).e, @"")); + VerifyOrReturn(CheckValue("f", ((CHIPTestClusterClusterSimpleStruct *) actualValue).f, 17)); + VerifyOrReturn(CheckValue("g", ((CHIPTestClusterClusterSimpleStruct *) actualValue).g, 1.5f)); + VerifyOrReturn(CheckValue("h", ((CHIPTestClusterClusterSimpleStruct *) actualValue).h, 3.14159265358979)); } NextTest(); @@ -59330,1422 +67230,1771 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } +}; + +class TestConstraints : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + TestConstraints() + : TestCommandBridge("TestConstraints") + , 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) - CHIP_ERROR TestWriteMiddleValidValueToARangeRestrictedSigned16BitInteger_416() + ~TestConstraints() {} + + /////////// TestCommand Interface ///////// + void NextTest() override { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + CHIP_ERROR err = CHIP_NO_ERROR; - id rangeRestrictedInt16sArgument; - rangeRestrictedInt16sArgument = [NSNumber numberWithShort:7]; - [cluster - writeAttributeRangeRestrictedInt16sWithValue:rangeRestrictedInt16sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write middle valid value to a range-restricted signed 16-bit integer Error: %@", - err); + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: TestConstraints\n"); + } - VerifyOrReturn(CheckValue("status", err, 0)); + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: TestConstraints\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } - NextTest(); - }]; + 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 : Write attribute INT32U Value\n"); + err = TestWriteAttributeInt32uValue_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read attribute INT32U Value MinValue Constraints\n"); + err = TestReadAttributeInt32uValueMinValueConstraints_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Read attribute INT32U Value MaxValue Constraints\n"); + err = TestReadAttributeInt32uValueMaxValueConstraints_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Read attribute INT32U Value NotValue Constraints\n"); + err = TestReadAttributeInt32uValueNotValueConstraints_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Write attribute INT32U Value Back to Default Value\n"); + err = TestWriteAttributeInt32uValueBackToDefaultValue_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Write attribute CHAR_STRING Value\n"); + err = TestWriteAttributeCharStringValue_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Read attribute CHAR_STRING Value MinLength Constraints\n"); + err = TestReadAttributeCharStringValueMinLengthConstraints_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Read attribute CHAR_STRING Value MaxLength Constraints\n"); + err = TestReadAttributeCharStringValueMaxLengthConstraints_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Read attribute CHAR_STRING Value StartsWith Constraints\n"); + err = TestReadAttributeCharStringValueStartsWithConstraints_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Read attribute CHAR_STRING Value EndsWith Constraints\n"); + err = TestReadAttributeCharStringValueEndsWithConstraints_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Write attribute CHAR_STRING Value\n"); + err = TestWriteAttributeCharStringValue_11(); + break; + case 12: + ChipLogProgress( + chipTool, " ***** Test Step 12 : Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints\n"); + err = TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : Write attribute CHAR_STRING Value\n"); + err = TestWriteAttributeCharStringValue_13(); + break; + case 14: + ChipLogProgress( + chipTool, " ***** Test Step 14 : Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints\n"); + err = TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Write attribute CHAR_STRING Value\n"); + err = TestWriteAttributeCharStringValue_15(); + break; + case 16: + ChipLogProgress( + chipTool, " ***** Test Step 16 : Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints\n"); + err = TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : Write attribute CHAR_STRING Value\n"); + err = TestWriteAttributeCharStringValue_17(); + break; + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : Read attribute CHAR_STRING Value isHexString Constraints\n"); + err = TestReadAttributeCharStringValueIsHexStringConstraints_18(); + break; + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : Write attribute CHAR_STRING Value\n"); + err = TestWriteAttributeCharStringValue_19(); + break; + case 20: + ChipLogProgress(chipTool, " ***** Test Step 20 : Read attribute CHAR_STRING Value isHexString Constraints\n"); + err = TestReadAttributeCharStringValueIsHexStringConstraints_20(); + break; + case 21: + ChipLogProgress(chipTool, " ***** Test Step 21 : Write attribute CHAR_STRING Value Back to Default Value\n"); + err = TestWriteAttributeCharStringValueBackToDefaultValue_21(); + break; + } - return CHIP_NO_ERROR; + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - CHIP_ERROR TestVerifyRangeRestrictedSigned16BitIntegerValueIsAtMidValid_417() + chip::System::Clock::Timeout GetWaitDuration() const override { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify range-restricted signed 16-bit integer value is at mid valid Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } - { - id actualValue = value; - VerifyOrReturn(CheckValue("range_restricted_int16s", actualValue, 7)); - } +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 22; - NextTest(); - }]; + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestReadNullableRangeRestrictedUnsigned8BitInteger_418() + CHIP_ERROR TestWriteAttributeInt32uValue_1() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeNullableRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read nullable range-restricted unsigned 8-bit integer Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id int32uArgument; + int32uArgument = [NSNumber numberWithUnsignedInt:5UL]; + [cluster writeAttributeInt32uWithValue:int32uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT32U Value Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int8u", actualValue)); - VerifyOrReturn(CheckValue("nullable_range_restricted_int8u", actualValue, 70)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteMinValueToANullableRangeRestrictedUnsigned8BitInteger_419() + CHIP_ERROR TestReadAttributeInt32uValueMinValueConstraints_2() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableRangeRestrictedInt8uArgument; - nullableRangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:0]; - [cluster writeAttributeNullableRangeRestrictedInt8uWithValue:nullableRangeRestrictedInt8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write min value to a nullable range-restricted unsigned 8-bit " - @"integer Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } + [cluster readAttributeInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT32U Value MinValue Constraints Error: %@", err); - CHIP_ERROR TestWriteJustBelowRangeValueToANullableRangeRestrictedUnsigned8BitInteger_420() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(CheckValue("status", err, 0)); - id nullableRangeRestrictedInt8uArgument; - nullableRangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:19]; - [cluster writeAttributeNullableRangeRestrictedInt8uWithValue:nullableRangeRestrictedInt8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write just-below-range value to a nullable range-restricted " - @"unsigned 8-bit integer Error: %@", - err); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("int32u", [value unsignedIntValue], 5UL)); + } - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteJustAboveRangeValueToANullableRangeRestrictedUnsigned8BitInteger_421() + CHIP_ERROR TestReadAttributeInt32uValueMaxValueConstraints_3() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableRangeRestrictedInt8uArgument; - nullableRangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:101]; - [cluster writeAttributeNullableRangeRestrictedInt8uWithValue:nullableRangeRestrictedInt8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write just-above-range value to a nullable range-restricted " - @"unsigned 8-bit integer Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } + [cluster readAttributeInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT32U Value MaxValue Constraints Error: %@", err); - CHIP_ERROR TestWriteMaxValueToANullableRangeRestrictedUnsigned8BitInteger_422() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(CheckValue("status", err, 0)); - id nullableRangeRestrictedInt8uArgument; - nullableRangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:254]; - [cluster writeAttributeNullableRangeRestrictedInt8uWithValue:nullableRangeRestrictedInt8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write max value to a nullable range-restricted unsigned 8-bit " - @"integer Error: %@", - err); + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("int32u", [value unsignedIntValue], 5UL)); + } - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueHasNotChanged_423() + CHIP_ERROR TestReadAttributeInt32uValueNotValueConstraints_4() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeNullableRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify nullable range-restricted unsigned 8-bit integer value has not changed Error: %@", err); + [cluster readAttributeInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT32U Value NotValue Constraints Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int8u", actualValue)); - VerifyOrReturn(CheckValue("nullable_range_restricted_int8u", actualValue, 70)); - } + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("int32u", value, 6UL)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteMinValidValueToANullableRangeRestrictedUnsigned8BitInteger_424() + CHIP_ERROR TestWriteAttributeInt32uValueBackToDefaultValue_5() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableRangeRestrictedInt8uArgument; - nullableRangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:20]; - [cluster writeAttributeNullableRangeRestrictedInt8uWithValue:nullableRangeRestrictedInt8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write min valid value to a nullable range-restricted unsigned 8-bit " - @"integer Error: %@", - err); + id int32uArgument; + int32uArgument = [NSNumber numberWithUnsignedInt:0UL]; + [cluster writeAttributeInt32uWithValue:int32uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT32U Value Back to Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueIsAtMinValid_425() + CHIP_ERROR TestWriteAttributeCharStringValue_6() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeNullableRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify nullable range-restricted unsigned 8-bit integer value is at min valid Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id charStringArgument; + charStringArgument = @"** Test **"; + [cluster writeAttributeCharStringWithValue:charStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute CHAR_STRING Value Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int8u", actualValue)); - VerifyOrReturn(CheckValue("nullable_range_restricted_int8u", actualValue, 20)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteMaxValidValueToANullableRangeRestrictedUnsigned8BitInteger_426() + CHIP_ERROR TestReadAttributeCharStringValueMinLengthConstraints_7() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableRangeRestrictedInt8uArgument; - nullableRangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:100]; - [cluster writeAttributeNullableRangeRestrictedInt8uWithValue:nullableRangeRestrictedInt8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write max valid value to a nullable range-restricted unsigned 8-bit " - @"integer Error: %@", - err); + [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute CHAR_STRING Value MinLength Constraints Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintMinLength("charString", [value length], 5)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueIsAtMaxValid_427() + CHIP_ERROR TestReadAttributeCharStringValueMaxLengthConstraints_8() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeNullableRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify nullable range-restricted unsigned 8-bit integer value is at max valid Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute CHAR_STRING Value MaxLength Constraints Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int8u", actualValue)); - VerifyOrReturn(CheckValue("nullable_range_restricted_int8u", actualValue, 100)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintMaxLength("charString", [value length], 20)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteMiddleValidValueToANullableRangeRestrictedUnsigned8BitInteger_428() + CHIP_ERROR TestReadAttributeCharStringValueStartsWithConstraints_9() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableRangeRestrictedInt8uArgument; - nullableRangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:50]; - [cluster writeAttributeNullableRangeRestrictedInt8uWithValue:nullableRangeRestrictedInt8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write middle valid value to a nullable range-restricted unsigned " - @"8-bit integer Error: %@", - err); + [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute CHAR_STRING Value StartsWith Constraints Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintStartsWith("charString", value, "**")); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueIsAtMidValid_429() + CHIP_ERROR TestReadAttributeCharStringValueEndsWithConstraints_10() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeNullableRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify nullable range-restricted unsigned 8-bit integer value is at mid valid Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute CHAR_STRING Value EndsWith Constraints Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int8u", actualValue)); - VerifyOrReturn(CheckValue("nullable_range_restricted_int8u", actualValue, 50)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintEndsWith("charString", value, "**")); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteNullValueToANullableRangeRestrictedUnsigned8BitInteger_430() + CHIP_ERROR TestWriteAttributeCharStringValue_11() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableRangeRestrictedInt8uArgument; - nullableRangeRestrictedInt8uArgument = nil; - [cluster writeAttributeNullableRangeRestrictedInt8uWithValue:nullableRangeRestrictedInt8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write null value to a nullable range-restricted unsigned 8-bit " - @"integer Error: %@", - err); + id charStringArgument; + charStringArgument = @"lowercase"; + [cluster writeAttributeCharStringWithValue:charStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute CHAR_STRING Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueIsNull_431() + CHIP_ERROR TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_12() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeNullableRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify nullable range-restricted unsigned 8-bit integer value is null Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValueNull("nullable_range_restricted_int8u", actualValue)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintIsUpperCase("charString", value, false)); + VerifyOrReturn(CheckConstraintIsLowerCase("charString", value, true)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadNullableRangeRestrictedUnsigned16BitInteger_432() + CHIP_ERROR TestWriteAttributeCharStringValue_13() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeNullableRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read nullable range-restricted unsigned 16-bit integer Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id charStringArgument; + charStringArgument = @"UPPERCASE"; + [cluster writeAttributeCharStringWithValue:charStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute CHAR_STRING Value Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int16u", actualValue)); - VerifyOrReturn(CheckValue("nullable_range_restricted_int16u", actualValue, 200U)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteMinValueToANullableRangeRestrictedUnsigned16BitInteger_433() + CHIP_ERROR TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_14() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableRangeRestrictedInt16uArgument; - nullableRangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:0U]; - [cluster - writeAttributeNullableRangeRestrictedInt16uWithValue:nullableRangeRestrictedInt16uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write min value to a nullable range-restricted unsigned 16-bit integer " - @"Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestWriteJustBelowRangeValueToANullableRangeRestrictedUnsigned16BitInteger_434() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints Error: %@", err); - id nullableRangeRestrictedInt16uArgument; - nullableRangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:99U]; - [cluster - writeAttributeNullableRangeRestrictedInt16uWithValue:nullableRangeRestrictedInt16uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write just-below-range value to a nullable range-restricted unsigned " - @"16-bit integer Error: %@", - err); + VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintIsUpperCase("charString", value, true)); + VerifyOrReturn(CheckConstraintIsLowerCase("charString", value, false)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteJustAboveRangeValueToANullableRangeRestrictedUnsigned16BitInteger_435() + CHIP_ERROR TestWriteAttributeCharStringValue_15() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableRangeRestrictedInt16uArgument; - nullableRangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:1001U]; - [cluster - writeAttributeNullableRangeRestrictedInt16uWithValue:nullableRangeRestrictedInt16uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write just-above-range value to a nullable range-restricted unsigned " - @"16-bit integer Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestWriteMaxValueToANullableRangeRestrictedUnsigned16BitInteger_436() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + id charStringArgument; + charStringArgument = @"lowUPPER"; + [cluster writeAttributeCharStringWithValue:charStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute CHAR_STRING Value Error: %@", err); - id nullableRangeRestrictedInt16uArgument; - nullableRangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:65534U]; - [cluster - writeAttributeNullableRangeRestrictedInt16uWithValue:nullableRangeRestrictedInt16uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write max value to a nullable range-restricted unsigned 16-bit integer " - @"Error: %@", - err); + VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueHasNotChanged_437() + CHIP_ERROR TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_16() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeNullableRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify nullable range-restricted unsigned 16-bit integer value has not changed Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int16u", actualValue)); - VerifyOrReturn(CheckValue("nullable_range_restricted_int16u", actualValue, 200U)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintIsUpperCase("charString", value, false)); + VerifyOrReturn(CheckConstraintIsLowerCase("charString", value, false)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteMinValidValueToANullableRangeRestrictedUnsigned16BitInteger_438() + CHIP_ERROR TestWriteAttributeCharStringValue_17() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableRangeRestrictedInt16uArgument; - nullableRangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:100U]; - [cluster writeAttributeNullableRangeRestrictedInt16uWithValue:nullableRangeRestrictedInt16uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write min valid value to a nullable range-restricted unsigned " - @"16-bit integer Error: %@", - err); + id charStringArgument; + charStringArgument = @"ABCDEF012V"; + [cluster writeAttributeCharStringWithValue:charStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute CHAR_STRING Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueIsAtMinValid_439() + CHIP_ERROR TestReadAttributeCharStringValueIsHexStringConstraints_18() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeNullableRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify nullable range-restricted unsigned 16-bit integer value is at min valid Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute CHAR_STRING Value isHexString Constraints Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int16u", actualValue)); - VerifyOrReturn(CheckValue("nullable_range_restricted_int16u", actualValue, 100U)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintIsHexString("charString", value, false)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteMaxValidValueToANullableRangeRestrictedUnsigned16BitInteger_440() + CHIP_ERROR TestWriteAttributeCharStringValue_19() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableRangeRestrictedInt16uArgument; - nullableRangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:1000U]; - [cluster writeAttributeNullableRangeRestrictedInt16uWithValue:nullableRangeRestrictedInt16uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write max valid value to a nullable range-restricted unsigned " - @"16-bit integer Error: %@", - err); + id charStringArgument; + charStringArgument = @"ABCDEF0123"; + [cluster writeAttributeCharStringWithValue:charStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute CHAR_STRING Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueIsAtMaxValid_441() + CHIP_ERROR TestReadAttributeCharStringValueIsHexStringConstraints_20() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeNullableRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify nullable range-restricted unsigned 16-bit integer value is at max valid Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute CHAR_STRING Value isHexString Constraints Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int16u", actualValue)); - VerifyOrReturn(CheckValue("nullable_range_restricted_int16u", actualValue, 1000U)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintIsHexString("charString", value, true)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteMiddleValidValueToANullableRangeRestrictedUnsigned16BitInteger_442() + CHIP_ERROR TestWriteAttributeCharStringValueBackToDefaultValue_21() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableRangeRestrictedInt16uArgument; - nullableRangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:500U]; - [cluster writeAttributeNullableRangeRestrictedInt16uWithValue:nullableRangeRestrictedInt16uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write middle valid value to a nullable range-restricted unsigned " - @"16-bit integer Error: %@", - err); + id charStringArgument; + charStringArgument = @""; + [cluster writeAttributeCharStringWithValue:charStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute CHAR_STRING Value Back to Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } +}; - CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueIsAtMidValid_443() +class TestDelayCommands : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + TestDelayCommands() + : TestCommandBridge("TestDelayCommands") + , mTestIndex(0) { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + 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) - [cluster - readAttributeNullableRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify nullable range-restricted unsigned 16-bit integer value is at mid valid Error: %@", err); + ~TestDelayCommands() {} - VerifyOrReturn(CheckValue("status", err, 0)); + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int16u", actualValue)); - VerifyOrReturn(CheckValue("nullable_range_restricted_int16u", actualValue, 500U)); - } + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: TestDelayCommands\n"); + } - NextTest(); - }]; + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: TestDelayCommands\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } - return 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++) { + 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 : Wait 100ms\n"); + err = TestWait100ms_1(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - CHIP_ERROR TestWriteNullValueToANullableRangeRestrictedUnsigned16BitInteger_444() + chip::System::Clock::Timeout GetWaitDuration() const override { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } - id nullableRangeRestrictedInt16uArgument; - nullableRangeRestrictedInt16uArgument = nil; - [cluster writeAttributeNullableRangeRestrictedInt16uWithValue:nullableRangeRestrictedInt16uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write null value to a nullable range-restricted unsigned 16-bit " - @"integer Error: %@", - err); +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 2; - VerifyOrReturn(CheckValue("status", err, 0)); + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; - NextTest(); - }]; + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + CHIP_ERROR TestWait100ms_1() + { + WaitForMs(100); return CHIP_NO_ERROR; } +}; - CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueIsNull_445() +class TestLogCommands : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + TestLogCommands() + : TestCommandBridge("TestLogCommands") + , mTestIndex(0) { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + 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) - [cluster - readAttributeNullableRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify nullable range-restricted unsigned 16-bit integer value is null Error: %@", err); + ~TestLogCommands() {} - VerifyOrReturn(CheckValue("status", err, 0)); + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; - { - id actualValue = value; - VerifyOrReturn(CheckValueNull("nullable_range_restricted_int16u", actualValue)); - } + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: TestLogCommands\n"); + } - NextTest(); - }]; + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: TestLogCommands\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } - return 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++) { + 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 simple message\n"); + err = TestLogASimpleMessage_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Do a simple user prompt message\n"); + err = TestDoASimpleUserPromptMessage_2(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - CHIP_ERROR TestReadNullableRangeRestrictedSigned8BitInteger_446() + chip::System::Clock::Timeout GetWaitDuration() const override { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } - [cluster - readAttributeNullableRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read nullable range-restricted signed 8-bit integer Error: %@", err); +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 3; - VerifyOrReturn(CheckValue("status", err, 0)); + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int8s", actualValue)); - VerifyOrReturn(CheckValue("nullable_range_restricted_int8s", actualValue, -20)); - } + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } - NextTest(); - }]; + CHIP_ERROR TestLogASimpleMessage_1() + { + Log(@"This is a simple message"); + return CHIP_NO_ERROR; + } + CHIP_ERROR TestDoASimpleUserPromptMessage_2() + { + UserPrompt(@"This is a simple message"); return CHIP_NO_ERROR; } +}; - CHIP_ERROR TestWriteMinValueToANullableRangeRestrictedSigned8BitInteger_447() +class TestSaveAs : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + TestSaveAs() + : TestCommandBridge("TestSaveAs") + , mTestIndex(0) { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + 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) - id nullableRangeRestrictedInt8sArgument; - nullableRangeRestrictedInt8sArgument = [NSNumber numberWithChar:-127]; - [cluster writeAttributeNullableRangeRestrictedInt8sWithValue:nullableRangeRestrictedInt8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write min value to a nullable range-restricted signed 8-bit integer " - @"Error: %@", - err); + ~TestSaveAs() {} - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: TestSaveAs\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: TestSaveAs\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 : Send Test Add Arguments Command\n"); + err = TestSendTestAddArgumentsCommand_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Send Test Add Arguments Command\n"); + err = TestSendTestAddArgumentsCommand_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Send Test Add Arguments Command\n"); + err = TestSendTestAddArgumentsCommand_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Read attribute BOOLEAN Default Value\n"); + err = TestReadAttributeBooleanDefaultValue_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Write attribute BOOLEAN Not Default Value\n"); + err = TestWriteAttributeBooleanNotDefaultValue_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Read attribute BOOLEAN Not Default Value\n"); + err = TestReadAttributeBooleanNotDefaultValue_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Write attribute BOOLEAN DefaultValue\n"); + err = TestWriteAttributeBooleanDefaultValue_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Read attribute BOOLEAN False\n"); + err = TestReadAttributeBooleanFalse_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Read attribute BITMAP8 Default Value\n"); + err = TestReadAttributeBitmap8DefaultValue_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Write attribute BITMAP8 Not Default Value\n"); + err = TestWriteAttributeBitmap8NotDefaultValue_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Read attribute BITMAP8 Not Default Value\n"); + err = TestReadAttributeBitmap8NotDefaultValue_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Write attribute BITMAP8 Default Value\n"); + err = TestWriteAttributeBitmap8DefaultValue_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : Read attribute BITMAP8 Default Value\n"); + err = TestReadAttributeBitmap8DefaultValue_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Read attribute BITMAP16 Default Value\n"); + err = TestReadAttributeBitmap16DefaultValue_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Write attribute BITMAP16 Not Default Value\n"); + err = TestWriteAttributeBitmap16NotDefaultValue_15(); + break; + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : Read attribute BITMAP16 Not Default Value\n"); + err = TestReadAttributeBitmap16NotDefaultValue_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : Write attribute BITMAP16 Default Value\n"); + err = TestWriteAttributeBitmap16DefaultValue_17(); + break; + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : Read attribute BITMAP16 Default Value\n"); + err = TestReadAttributeBitmap16DefaultValue_18(); + break; + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : Read attribute BITMAP32 Default Value\n"); + err = TestReadAttributeBitmap32DefaultValue_19(); + break; + case 20: + ChipLogProgress(chipTool, " ***** Test Step 20 : Write attribute BITMAP32 Not Default Value\n"); + err = TestWriteAttributeBitmap32NotDefaultValue_20(); + break; + case 21: + ChipLogProgress(chipTool, " ***** Test Step 21 : Read attribute BITMAP32 Not Default Value\n"); + err = TestReadAttributeBitmap32NotDefaultValue_21(); + break; + case 22: + ChipLogProgress(chipTool, " ***** Test Step 22 : Write attribute BITMAP32 Default Value\n"); + err = TestWriteAttributeBitmap32DefaultValue_22(); + break; + case 23: + ChipLogProgress(chipTool, " ***** Test Step 23 : Read attribute BITMAP32 Default Value\n"); + err = TestReadAttributeBitmap32DefaultValue_23(); + break; + case 24: + ChipLogProgress(chipTool, " ***** Test Step 24 : Read attribute BITMAP64 Default Value\n"); + err = TestReadAttributeBitmap64DefaultValue_24(); + break; + case 25: + ChipLogProgress(chipTool, " ***** Test Step 25 : Write attribute BITMAP64 Not Default Value\n"); + err = TestWriteAttributeBitmap64NotDefaultValue_25(); + break; + case 26: + ChipLogProgress(chipTool, " ***** Test Step 26 : Read attribute BITMAP64 Default Value\n"); + err = TestReadAttributeBitmap64DefaultValue_26(); + break; + case 27: + ChipLogProgress(chipTool, " ***** Test Step 27 : Write attribute BITMAP64 Default Value\n"); + err = TestWriteAttributeBitmap64DefaultValue_27(); + break; + case 28: + ChipLogProgress(chipTool, " ***** Test Step 28 : Read attribute BITMAP64 Default Value\n"); + err = TestReadAttributeBitmap64DefaultValue_28(); + break; + case 29: + ChipLogProgress(chipTool, " ***** Test Step 29 : Read attribute INT8U Default Value\n"); + err = TestReadAttributeInt8uDefaultValue_29(); + break; + case 30: + ChipLogProgress(chipTool, " ***** Test Step 30 : Write attribute INT8U Not Default Value\n"); + err = TestWriteAttributeInt8uNotDefaultValue_30(); + break; + case 31: + ChipLogProgress(chipTool, " ***** Test Step 31 : Read attribute INT8U Not Default Value\n"); + err = TestReadAttributeInt8uNotDefaultValue_31(); + break; + case 32: + ChipLogProgress(chipTool, " ***** Test Step 32 : Write attribute INT8U Default Value\n"); + err = TestWriteAttributeInt8uDefaultValue_32(); + break; + case 33: + ChipLogProgress(chipTool, " ***** Test Step 33 : Read attribute INT8U Default Value\n"); + err = TestReadAttributeInt8uDefaultValue_33(); + break; + case 34: + ChipLogProgress(chipTool, " ***** Test Step 34 : Read attribute INT16U Default Value\n"); + err = TestReadAttributeInt16uDefaultValue_34(); + break; + case 35: + ChipLogProgress(chipTool, " ***** Test Step 35 : Write attribute INT16U Not Default Value\n"); + err = TestWriteAttributeInt16uNotDefaultValue_35(); + break; + case 36: + ChipLogProgress(chipTool, " ***** Test Step 36 : Read attribute INT16U Not Default Value\n"); + err = TestReadAttributeInt16uNotDefaultValue_36(); + break; + case 37: + ChipLogProgress(chipTool, " ***** Test Step 37 : Write attribute INT16U Default Value\n"); + err = TestWriteAttributeInt16uDefaultValue_37(); + break; + case 38: + ChipLogProgress(chipTool, " ***** Test Step 38 : Read attribute INT16U Default Value\n"); + err = TestReadAttributeInt16uDefaultValue_38(); + break; + case 39: + ChipLogProgress(chipTool, " ***** Test Step 39 : Read attribute INT32U Default Value\n"); + err = TestReadAttributeInt32uDefaultValue_39(); + break; + case 40: + ChipLogProgress(chipTool, " ***** Test Step 40 : Write attribute INT32U Not Default Value\n"); + err = TestWriteAttributeInt32uNotDefaultValue_40(); + break; + case 41: + ChipLogProgress(chipTool, " ***** Test Step 41 : Read attribute INT32U Not Default Value\n"); + err = TestReadAttributeInt32uNotDefaultValue_41(); + break; + case 42: + ChipLogProgress(chipTool, " ***** Test Step 42 : Write attribute INT32U Default Value\n"); + err = TestWriteAttributeInt32uDefaultValue_42(); + break; + case 43: + ChipLogProgress(chipTool, " ***** Test Step 43 : Read attribute INT32U Default Value\n"); + err = TestReadAttributeInt32uDefaultValue_43(); + break; + case 44: + ChipLogProgress(chipTool, " ***** Test Step 44 : Read attribute INT64U Default Value\n"); + err = TestReadAttributeInt64uDefaultValue_44(); + break; + case 45: + ChipLogProgress(chipTool, " ***** Test Step 45 : Write attribute INT64U Not Default Value\n"); + err = TestWriteAttributeInt64uNotDefaultValue_45(); + break; + case 46: + ChipLogProgress(chipTool, " ***** Test Step 46 : Read attribute INT64U Not Default Value\n"); + err = TestReadAttributeInt64uNotDefaultValue_46(); + break; + case 47: + ChipLogProgress(chipTool, " ***** Test Step 47 : Write attribute INT64U Default Value\n"); + err = TestWriteAttributeInt64uDefaultValue_47(); + break; + case 48: + ChipLogProgress(chipTool, " ***** Test Step 48 : Read attribute INT64U Default Value\n"); + err = TestReadAttributeInt64uDefaultValue_48(); + break; + case 49: + ChipLogProgress(chipTool, " ***** Test Step 49 : Read attribute INT8S Default Value\n"); + err = TestReadAttributeInt8sDefaultValue_49(); + break; + case 50: + ChipLogProgress(chipTool, " ***** Test Step 50 : Write attribute INT8S Not Default Value\n"); + err = TestWriteAttributeInt8sNotDefaultValue_50(); + break; + case 51: + ChipLogProgress(chipTool, " ***** Test Step 51 : Read attribute INT8S Not Default Value\n"); + err = TestReadAttributeInt8sNotDefaultValue_51(); + break; + case 52: + ChipLogProgress(chipTool, " ***** Test Step 52 : Write attribute INT8S Default Value\n"); + err = TestWriteAttributeInt8sDefaultValue_52(); + break; + case 53: + ChipLogProgress(chipTool, " ***** Test Step 53 : Read attribute INT8S Default Value\n"); + err = TestReadAttributeInt8sDefaultValue_53(); + break; + case 54: + ChipLogProgress(chipTool, " ***** Test Step 54 : Read attribute INT16S Default Value\n"); + err = TestReadAttributeInt16sDefaultValue_54(); + break; + case 55: + ChipLogProgress(chipTool, " ***** Test Step 55 : Write attribute INT16S Not Default Value\n"); + err = TestWriteAttributeInt16sNotDefaultValue_55(); + break; + case 56: + ChipLogProgress(chipTool, " ***** Test Step 56 : Read attribute INT16S Not Default Value\n"); + err = TestReadAttributeInt16sNotDefaultValue_56(); + break; + case 57: + ChipLogProgress(chipTool, " ***** Test Step 57 : Write attribute INT16S Default Value\n"); + err = TestWriteAttributeInt16sDefaultValue_57(); + break; + case 58: + ChipLogProgress(chipTool, " ***** Test Step 58 : Read attribute INT16S Default Value\n"); + err = TestReadAttributeInt16sDefaultValue_58(); + break; + case 59: + ChipLogProgress(chipTool, " ***** Test Step 59 : Read attribute INT32S Default Value\n"); + err = TestReadAttributeInt32sDefaultValue_59(); + break; + case 60: + ChipLogProgress(chipTool, " ***** Test Step 60 : Write attribute INT32S Not Default Value\n"); + err = TestWriteAttributeInt32sNotDefaultValue_60(); + break; + case 61: + ChipLogProgress(chipTool, " ***** Test Step 61 : Read attribute INT32S Not Default Value\n"); + err = TestReadAttributeInt32sNotDefaultValue_61(); + break; + case 62: + ChipLogProgress(chipTool, " ***** Test Step 62 : Write attribute INT32S Default Value\n"); + err = TestWriteAttributeInt32sDefaultValue_62(); + break; + case 63: + ChipLogProgress(chipTool, " ***** Test Step 63 : Read attribute INT32S Default Value\n"); + err = TestReadAttributeInt32sDefaultValue_63(); + break; + case 64: + ChipLogProgress(chipTool, " ***** Test Step 64 : Read attribute INT64S Default Value\n"); + err = TestReadAttributeInt64sDefaultValue_64(); + break; + case 65: + ChipLogProgress(chipTool, " ***** Test Step 65 : Write attribute INTS Not Default Value\n"); + err = TestWriteAttributeIntsNotDefaultValue_65(); + break; + case 66: + ChipLogProgress(chipTool, " ***** Test Step 66 : Read attribute INT64S Not Default Value\n"); + err = TestReadAttributeInt64sNotDefaultValue_66(); + break; + case 67: + ChipLogProgress(chipTool, " ***** Test Step 67 : Write attribute INT64S Default Value\n"); + err = TestWriteAttributeInt64sDefaultValue_67(); + break; + case 68: + ChipLogProgress(chipTool, " ***** Test Step 68 : Read attribute INT64S Default Value\n"); + err = TestReadAttributeInt64sDefaultValue_68(); + break; + case 69: + ChipLogProgress(chipTool, " ***** Test Step 69 : Read attribute ENUM8 Default Value\n"); + err = TestReadAttributeEnum8DefaultValue_69(); + break; + case 70: + ChipLogProgress(chipTool, " ***** Test Step 70 : Write attribute ENUM8 Not Default Value\n"); + err = TestWriteAttributeEnum8NotDefaultValue_70(); + break; + case 71: + ChipLogProgress(chipTool, " ***** Test Step 71 : Read attribute ENUM8 Not Default Value\n"); + err = TestReadAttributeEnum8NotDefaultValue_71(); + break; + case 72: + ChipLogProgress(chipTool, " ***** Test Step 72 : Write attribute ENUM8 Default Value\n"); + err = TestWriteAttributeEnum8DefaultValue_72(); + break; + case 73: + ChipLogProgress(chipTool, " ***** Test Step 73 : Read attribute ENUM8 Default Value\n"); + err = TestReadAttributeEnum8DefaultValue_73(); + break; + case 74: + ChipLogProgress(chipTool, " ***** Test Step 74 : Read attribute ENUM16 Default Value\n"); + err = TestReadAttributeEnum16DefaultValue_74(); + break; + case 75: + ChipLogProgress(chipTool, " ***** Test Step 75 : Write attribute ENUM16 Not Default Value\n"); + err = TestWriteAttributeEnum16NotDefaultValue_75(); + break; + case 76: + ChipLogProgress(chipTool, " ***** Test Step 76 : Read attribute ENUM16 Not Default Value\n"); + err = TestReadAttributeEnum16NotDefaultValue_76(); + break; + case 77: + ChipLogProgress(chipTool, " ***** Test Step 77 : Write attribute ENUM16 Default Value\n"); + err = TestWriteAttributeEnum16DefaultValue_77(); + break; + case 78: + ChipLogProgress(chipTool, " ***** Test Step 78 : Read attribute ENUM16 Default Value\n"); + err = TestReadAttributeEnum16DefaultValue_78(); + break; + case 79: + ChipLogProgress(chipTool, " ***** Test Step 79 : Read attribute EPOCH_US Default Value\n"); + err = TestReadAttributeEpochUsDefaultValue_79(); + break; + case 80: + ChipLogProgress(chipTool, " ***** Test Step 80 : Write attribute EPOCH_US Not Default Value\n"); + err = TestWriteAttributeEpochUsNotDefaultValue_80(); + break; + case 81: + ChipLogProgress(chipTool, " ***** Test Step 81 : Read attribute EPOCH_US Not Default Value\n"); + err = TestReadAttributeEpochUsNotDefaultValue_81(); + break; + case 82: + ChipLogProgress(chipTool, " ***** Test Step 82 : Write attribute EPOCH_US Default Value\n"); + err = TestWriteAttributeEpochUsDefaultValue_82(); + break; + case 83: + ChipLogProgress(chipTool, " ***** Test Step 83 : Read attribute EPOCH_US Default Value\n"); + err = TestReadAttributeEpochUsDefaultValue_83(); + break; + case 84: + ChipLogProgress(chipTool, " ***** Test Step 84 : Read attribute EPOCH_S Default Value\n"); + err = TestReadAttributeEpochSDefaultValue_84(); + break; + case 85: + ChipLogProgress(chipTool, " ***** Test Step 85 : Write attribute EPOCH_S Not Default Value\n"); + err = TestWriteAttributeEpochSNotDefaultValue_85(); + break; + case 86: + ChipLogProgress(chipTool, " ***** Test Step 86 : Read attribute EPOCH_S Not Default Value\n"); + err = TestReadAttributeEpochSNotDefaultValue_86(); + break; + case 87: + ChipLogProgress(chipTool, " ***** Test Step 87 : Write attribute EPOCH_S Default Value\n"); + err = TestWriteAttributeEpochSDefaultValue_87(); + break; + case 88: + ChipLogProgress(chipTool, " ***** Test Step 88 : Read attribute EPOCH_S Default Value\n"); + err = TestReadAttributeEpochSDefaultValue_88(); + break; + case 89: + ChipLogProgress(chipTool, " ***** Test Step 89 : Read attribute vendor_id Default Value\n"); + err = TestReadAttributeVendorIdDefaultValue_89(); + break; + case 90: + ChipLogProgress(chipTool, " ***** Test Step 90 : Write attribute vendor_id Not Default Value\n"); + err = TestWriteAttributeVendorIdNotDefaultValue_90(); + break; + case 91: + ChipLogProgress(chipTool, " ***** Test Step 91 : Read attribute vendor_id Not Default Value\n"); + err = TestReadAttributeVendorIdNotDefaultValue_91(); + break; + case 92: + ChipLogProgress(chipTool, " ***** Test Step 92 : Write attribute vendor_id Default Value\n"); + err = TestWriteAttributeVendorIdDefaultValue_92(); + break; + case 93: + ChipLogProgress(chipTool, " ***** Test Step 93 : Read attribute vendor_id Default Value\n"); + err = TestReadAttributeVendorIdDefaultValue_93(); + break; + case 94: + ChipLogProgress(chipTool, " ***** Test Step 94 : Read attribute char_string Default Value\n"); + err = TestReadAttributeCharStringDefaultValue_94(); + break; + case 95: + ChipLogProgress( + chipTool, " ***** Test Step 95 : Read attribute char_string Default Value and compare to saved value\n"); + err = TestReadAttributeCharStringDefaultValueAndCompareToSavedValue_95(); + break; + case 96: + ChipLogProgress(chipTool, " ***** Test Step 96 : Write attribute char_string Not Default Value\n"); + err = TestWriteAttributeCharStringNotDefaultValue_96(); + break; + case 97: + ChipLogProgress(chipTool, " ***** Test Step 97 : Read attribute char_string Not Default Value\n"); + err = TestReadAttributeCharStringNotDefaultValue_97(); + break; + case 98: + ChipLogProgress( + chipTool, " ***** Test Step 98 : Read attribute char_string Not Default Value and compare to saved value\n"); + err = TestReadAttributeCharStringNotDefaultValueAndCompareToSavedValue_98(); + break; + case 99: + ChipLogProgress(chipTool, " ***** Test Step 99 : Write attribute char_string Not Default Value from saved value\n"); + err = TestWriteAttributeCharStringNotDefaultValueFromSavedValue_99(); + break; + case 100: + ChipLogProgress( + chipTool, " ***** Test Step 100 : Read attribute char_string Not Default Value and compare to expected value\n"); + err = TestReadAttributeCharStringNotDefaultValueAndCompareToExpectedValue_100(); + break; + case 101: + ChipLogProgress(chipTool, " ***** Test Step 101 : Write attribute char_string Default Value\n"); + err = TestWriteAttributeCharStringDefaultValue_101(); + break; + case 102: + ChipLogProgress(chipTool, " ***** Test Step 102 : Read attribute octet_string Default Value\n"); + err = TestReadAttributeOctetStringDefaultValue_102(); + break; + case 103: + ChipLogProgress( + chipTool, " ***** Test Step 103 : Read attribute octet_string Default Value and compare to saved value\n"); + err = TestReadAttributeOctetStringDefaultValueAndCompareToSavedValue_103(); + break; + case 104: + ChipLogProgress(chipTool, " ***** Test Step 104 : Write attribute octet_string Not Default Value\n"); + err = TestWriteAttributeOctetStringNotDefaultValue_104(); + break; + case 105: + ChipLogProgress(chipTool, " ***** Test Step 105 : Read attribute octet_string Not Default Value\n"); + err = TestReadAttributeOctetStringNotDefaultValue_105(); + break; + case 106: + ChipLogProgress( + chipTool, " ***** Test Step 106 : Read attribute octet_string Not Default Value and compare to saved value\n"); + err = TestReadAttributeOctetStringNotDefaultValueAndCompareToSavedValue_106(); + break; + case 107: + ChipLogProgress(chipTool, " ***** Test Step 107 : Write attribute octet_string Not Default Value from saved value\n"); + err = TestWriteAttributeOctetStringNotDefaultValueFromSavedValue_107(); + break; + case 108: + ChipLogProgress( + chipTool, " ***** Test Step 108 : Read attribute octet_string Not Default Value and compare to expected value\n"); + err = TestReadAttributeOctetStringNotDefaultValueAndCompareToExpectedValue_108(); + break; + case 109: + ChipLogProgress(chipTool, " ***** Test Step 109 : Write attribute octet_string Default Value\n"); + err = TestWriteAttributeOctetStringDefaultValue_109(); + break; + } - return CHIP_NO_ERROR; + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - CHIP_ERROR TestWriteJustBelowRangeValueToANullableRangeRestrictedSigned8BitInteger_448() + chip::System::Clock::Timeout GetWaitDuration() const override { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id nullableRangeRestrictedInt8sArgument; - nullableRangeRestrictedInt8sArgument = [NSNumber numberWithChar:-41]; - [cluster writeAttributeNullableRangeRestrictedInt8sWithValue:nullableRangeRestrictedInt8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write just-below-range value to a nullable range-restricted signed " - @"8-bit integer Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; - - return CHIP_NO_ERROR; + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); } - CHIP_ERROR TestWriteJustAboveRangeValueToANullableRangeRestrictedSigned8BitInteger_449() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id nullableRangeRestrictedInt8sArgument; - nullableRangeRestrictedInt8sArgument = [NSNumber numberWithChar:51]; - [cluster writeAttributeNullableRangeRestrictedInt8sWithValue:nullableRangeRestrictedInt8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write just-above-range value to a nullable range-restricted signed " - @"8-bit integer Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 110; - return CHIP_NO_ERROR; - } + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; - CHIP_ERROR TestWriteMaxValueToANullableRangeRestrictedSigned8BitInteger_450() + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id nullableRangeRestrictedInt8sArgument; - nullableRangeRestrictedInt8sArgument = [NSNumber numberWithChar:127]; - [cluster writeAttributeNullableRangeRestrictedInt8sWithValue:nullableRangeRestrictedInt8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write max value to a nullable range-restricted signed 8-bit integer " - @"Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; - + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } + NSNumber * _Nonnull TestAddArgumentDefaultValue; - CHIP_ERROR TestVerifyNullableRangeRestrictedSigned8BitIntegerValueHasNotChanged_451() + CHIP_ERROR TestSendTestAddArgumentsCommand_1() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeNullableRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify nullable range-restricted signed 8-bit integer value has not changed Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int8s", actualValue)); - VerifyOrReturn(CheckValue("nullable_range_restricted_int8s", actualValue, -20)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestWriteMinValidValueToANullableRangeRestrictedSigned8BitInteger_452() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + __auto_type * params = [[CHIPTestClusterClusterTestAddArgumentsParams alloc] init]; + params.arg1 = [NSNumber numberWithUnsignedChar:3]; + params.arg2 = [NSNumber numberWithUnsignedChar:17]; + [cluster testAddArgumentsWithParams:params + completionHandler:^( + CHIPTestClusterClusterTestAddArgumentsResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send Test Add Arguments Command Error: %@", err); - id nullableRangeRestrictedInt8sArgument; - nullableRangeRestrictedInt8sArgument = [NSNumber numberWithChar:-40]; - [cluster writeAttributeNullableRangeRestrictedInt8sWithValue:nullableRangeRestrictedInt8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write min valid value to a nullable range-restricted signed 8-bit " - @"integer Error: %@", - err); + VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = values.returnValue; + VerifyOrReturn(CheckValue("returnValue", actualValue, 20)); + } + { + TestAddArgumentDefaultValue = values.returnValue; + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyNullableRangeRestrictedSigned8BitIntegerValueIsAtMinValid_453() + CHIP_ERROR TestSendTestAddArgumentsCommand_2() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeNullableRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify nullable range-restricted signed 8-bit integer value is at min valid Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int8s", actualValue)); - VerifyOrReturn(CheckValue("nullable_range_restricted_int8s", actualValue, -40)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestWriteMaxValidValueToANullableRangeRestrictedSigned8BitInteger_454() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + __auto_type * params = [[CHIPTestClusterClusterTestAddArgumentsParams alloc] init]; + params.arg1 = [NSNumber numberWithUnsignedChar:3]; + params.arg2 = [NSNumber numberWithUnsignedChar:17]; + [cluster testAddArgumentsWithParams:params + completionHandler:^( + CHIPTestClusterClusterTestAddArgumentsResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send Test Add Arguments Command Error: %@", err); - id nullableRangeRestrictedInt8sArgument; - nullableRangeRestrictedInt8sArgument = [NSNumber numberWithChar:50]; - [cluster writeAttributeNullableRangeRestrictedInt8sWithValue:nullableRangeRestrictedInt8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write max valid value to a nullable range-restricted signed 8-bit " - @"integer Error: %@", - err); + VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = values.returnValue; + VerifyOrReturn(CheckValue("returnValue", actualValue, TestAddArgumentDefaultValue)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyNullableRangeRestrictedSigned8BitIntegerValueIsAtMaxValid_455() + CHIP_ERROR TestSendTestAddArgumentsCommand_3() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeNullableRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify nullable range-restricted signed 8-bit integer value is at max valid Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int8s", actualValue)); - VerifyOrReturn(CheckValue("nullable_range_restricted_int8s", actualValue, 50)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestWriteMiddleValidValueToANullableRangeRestrictedSigned8BitInteger_456() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + __auto_type * params = [[CHIPTestClusterClusterTestAddArgumentsParams alloc] init]; + params.arg1 = [NSNumber numberWithUnsignedChar:3]; + params.arg2 = [TestAddArgumentDefaultValue copy]; + [cluster testAddArgumentsWithParams:params + completionHandler:^( + CHIPTestClusterClusterTestAddArgumentsResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send Test Add Arguments Command Error: %@", err); - id nullableRangeRestrictedInt8sArgument; - nullableRangeRestrictedInt8sArgument = [NSNumber numberWithChar:6]; - [cluster writeAttributeNullableRangeRestrictedInt8sWithValue:nullableRangeRestrictedInt8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write middle valid value to a nullable range-restricted signed " - @"8-bit integer Error: %@", - err); + VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckValue("status", err, 0)); + if (values.returnValue != nil) { + VerifyOrReturn( + CheckConstraintNotValue("returnValue", values.returnValue, TestAddArgumentDefaultValue)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } + NSNumber * _Nonnull readAttributeBooleanDefaultValue; - CHIP_ERROR TestVerifyNullableRangeRestrictedSigned8BitIntegerValueIsAtMidValid_457() + CHIP_ERROR TestReadAttributeBooleanDefaultValue_4() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeNullableRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify nullable range-restricted signed 8-bit integer value is at mid valid Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int8s", actualValue)); - VerifyOrReturn(CheckValue("nullable_range_restricted_int8s", actualValue, 6)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestWriteNullValueToANullableRangeRestrictedSigned8BitInteger_458() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + [cluster readAttributeBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BOOLEAN Default Value Error: %@", err); - id nullableRangeRestrictedInt8sArgument; - nullableRangeRestrictedInt8sArgument = nil; - [cluster writeAttributeNullableRangeRestrictedInt8sWithValue:nullableRangeRestrictedInt8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write null value to a nullable range-restricted signed 8-bit " - @"integer Error: %@", - err); + VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("boolean", actualValue, 0)); + } + { + readAttributeBooleanDefaultValue = value; + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyNullableRangeRestrictedSigned8BitIntegerValueIsAtNull_459() + CHIP_ERROR TestWriteAttributeBooleanNotDefaultValue_5() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeNullableRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify nullable range-restricted signed 8-bit integer value is at null Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id booleanArgument; + booleanArgument = [NSNumber numberWithBool:1]; + [cluster writeAttributeBooleanWithValue:booleanArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute BOOLEAN Not Default Value Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValueNull("nullable_range_restricted_int8s", actualValue)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadNullableRangeRestrictedSigned16BitInteger_460() + CHIP_ERROR TestReadAttributeBooleanNotDefaultValue_6() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeNullableRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read nullable range-restricted signed 16-bit integer Error: %@", err); + [cluster readAttributeBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BOOLEAN Not Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int16s", actualValue)); - VerifyOrReturn(CheckValue("nullable_range_restricted_int16s", actualValue, -100)); - } + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("boolean", value, readAttributeBooleanDefaultValue)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteMinValueToANullableRangeRestrictedSigned16BitInteger_461() + CHIP_ERROR TestWriteAttributeBooleanDefaultValue_7() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableRangeRestrictedInt16sArgument; - nullableRangeRestrictedInt16sArgument = [NSNumber numberWithShort:-32767]; - [cluster - writeAttributeNullableRangeRestrictedInt16sWithValue:nullableRangeRestrictedInt16sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write min value to a nullable range-restricted signed 16-bit integer " - @"Error: %@", - err); + id booleanArgument; + booleanArgument = [readAttributeBooleanDefaultValue copy]; + [cluster writeAttributeBooleanWithValue:booleanArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute BOOLEAN DefaultValue Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteJustBelowRangeValueToANullableRangeRestrictedSigned16BitInteger_462() + CHIP_ERROR TestReadAttributeBooleanFalse_8() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableRangeRestrictedInt16sArgument; - nullableRangeRestrictedInt16sArgument = [NSNumber numberWithShort:-151]; - [cluster - writeAttributeNullableRangeRestrictedInt16sWithValue:nullableRangeRestrictedInt16sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write just-below-range value to a nullable range-restricted signed " - @"16-bit integer Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } + [cluster readAttributeBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BOOLEAN False Error: %@", err); - CHIP_ERROR TestWriteJustAboveRangeValueToANullableRangeRestrictedSigned16BitInteger_463() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(CheckValue("status", err, 0)); - id nullableRangeRestrictedInt16sArgument; - nullableRangeRestrictedInt16sArgument = [NSNumber numberWithShort:201]; - [cluster - writeAttributeNullableRangeRestrictedInt16sWithValue:nullableRangeRestrictedInt16sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write just-above-range value to a nullable range-restricted signed " - @"16-bit integer Error: %@", - err); + { + id actualValue = value; + VerifyOrReturn(CheckValue("boolean", actualValue, readAttributeBooleanDefaultValue)); + } - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } + NSNumber * _Nonnull readAttributeBitmap8DefaultValue; - CHIP_ERROR TestWriteMaxValueToANullableRangeRestrictedSigned16BitInteger_464() + CHIP_ERROR TestReadAttributeBitmap8DefaultValue_9() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableRangeRestrictedInt16sArgument; - nullableRangeRestrictedInt16sArgument = [NSNumber numberWithShort:32767]; - [cluster - writeAttributeNullableRangeRestrictedInt16sWithValue:nullableRangeRestrictedInt16sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write max value to a nullable range-restricted signed 16-bit integer " - @"Error: %@", - err); + [cluster readAttributeBitmap8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BITMAP8 Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("bitmap8", actualValue, 0)); + } + { + readAttributeBitmap8DefaultValue = value; + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyNullableRangeRestrictedSigned16BitIntegerValueHasNotChanged_465() + CHIP_ERROR TestWriteAttributeBitmap8NotDefaultValue_10() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeNullableRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify nullable range-restricted signed 16-bit integer value has not changed Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id bitmap8Argument; + bitmap8Argument = [NSNumber numberWithUnsignedChar:1]; + [cluster writeAttributeBitmap8WithValue:bitmap8Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute BITMAP8 Not Default Value Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int16s", actualValue)); - VerifyOrReturn(CheckValue("nullable_range_restricted_int16s", actualValue, -100)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteMinValidValueToANullableRangeRestrictedSigned16BitInteger_466() + CHIP_ERROR TestReadAttributeBitmap8NotDefaultValue_11() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableRangeRestrictedInt16sArgument; - nullableRangeRestrictedInt16sArgument = [NSNumber numberWithShort:-150]; - [cluster writeAttributeNullableRangeRestrictedInt16sWithValue:nullableRangeRestrictedInt16sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write min valid value to a nullable range-restricted signed 16-bit " - @"integer Error: %@", - err); + [cluster readAttributeBitmap8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BITMAP8 Not Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("bitmap8", value, readAttributeBitmap8DefaultValue)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyNullableRangeRestrictedSigned16BitIntegerValueIsAtMinValid_467() + CHIP_ERROR TestWriteAttributeBitmap8DefaultValue_12() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeNullableRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify nullable range-restricted signed 16-bit integer value is at min valid Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id bitmap8Argument; + bitmap8Argument = [readAttributeBitmap8DefaultValue copy]; + [cluster writeAttributeBitmap8WithValue:bitmap8Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute BITMAP8 Default Value Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int16s", actualValue)); - VerifyOrReturn(CheckValue("nullable_range_restricted_int16s", actualValue, -150)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteMaxValidValueToANullableRangeRestrictedSigned16BitInteger_468() + CHIP_ERROR TestReadAttributeBitmap8DefaultValue_13() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableRangeRestrictedInt16sArgument; - nullableRangeRestrictedInt16sArgument = [NSNumber numberWithShort:200]; - [cluster writeAttributeNullableRangeRestrictedInt16sWithValue:nullableRangeRestrictedInt16sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write max valid value to a nullable range-restricted signed 16-bit " - @"integer Error: %@", - err); + [cluster readAttributeBitmap8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BITMAP8 Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValue("bitmap8", actualValue, readAttributeBitmap8DefaultValue)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } + NSNumber * _Nonnull readAttributeBitmap16DefaultValue; - CHIP_ERROR TestVerifyNullableRangeRestrictedSigned16BitIntegerValueIsAtMaxValid_469() + CHIP_ERROR TestReadAttributeBitmap16DefaultValue_14() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeNullableRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify nullable range-restricted signed 16-bit integer value is at max valid Error: %@", err); + [cluster readAttributeBitmap16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BITMAP16 Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int16s", actualValue)); - VerifyOrReturn(CheckValue("nullable_range_restricted_int16s", actualValue, 200)); - } + { + id actualValue = value; + VerifyOrReturn(CheckValue("bitmap16", actualValue, 0U)); + } + { + readAttributeBitmap16DefaultValue = value; + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteMiddleValidValueToANullableRangeRestrictedSigned16BitInteger_470() + CHIP_ERROR TestWriteAttributeBitmap16NotDefaultValue_15() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableRangeRestrictedInt16sArgument; - nullableRangeRestrictedInt16sArgument = [NSNumber numberWithShort:7]; - [cluster writeAttributeNullableRangeRestrictedInt16sWithValue:nullableRangeRestrictedInt16sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write middle valid value to a nullable range-restricted signed " - @"16-bit integer Error: %@", - err); + id bitmap16Argument; + bitmap16Argument = [NSNumber numberWithUnsignedShort:1U]; + [cluster writeAttributeBitmap16WithValue:bitmap16Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute BITMAP16 Not Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyNullableRangeRestrictedSigned16BitIntegerValueIsAtMidValid_471() + CHIP_ERROR TestReadAttributeBitmap16NotDefaultValue_16() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeNullableRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify nullable range-restricted signed 16-bit integer value is at mid valid Error: %@", err); + [cluster readAttributeBitmap16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BITMAP16 Not Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int16s", actualValue)); - VerifyOrReturn(CheckValue("nullable_range_restricted_int16s", actualValue, 7)); - } + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("bitmap16", value, readAttributeBitmap16DefaultValue)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteNullValueToANullableRangeRestrictedSigned16BitInteger_472() + CHIP_ERROR TestWriteAttributeBitmap16DefaultValue_17() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableRangeRestrictedInt16sArgument; - nullableRangeRestrictedInt16sArgument = nil; - [cluster writeAttributeNullableRangeRestrictedInt16sWithValue:nullableRangeRestrictedInt16sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write null value to a nullable range-restricted signed 16-bit " - @"integer Error: %@", - err); + id bitmap16Argument; + bitmap16Argument = [readAttributeBitmap16DefaultValue copy]; + [cluster writeAttributeBitmap16WithValue:bitmap16Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute BITMAP16 Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyNullableRangeRestrictedSigned16BitIntegerValueIsNull_473() + CHIP_ERROR TestReadAttributeBitmap16DefaultValue_18() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeNullableRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify nullable range-restricted signed 16-bit integer value is null Error: %@", err); + [cluster readAttributeBitmap16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BITMAP16 Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNull("nullable_range_restricted_int16s", actualValue)); - } + { + id actualValue = value; + VerifyOrReturn(CheckValue("bitmap16", actualValue, readAttributeBitmap16DefaultValue)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } + NSNumber * _Nonnull readAttributeBitmap32DefaultValue; - CHIP_ERROR TestWriteAttributeThatReturnsGeneralStatusOnWrite_474() + CHIP_ERROR TestReadAttributeBitmap32DefaultValue_19() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id generalErrorBooleanArgument; - generalErrorBooleanArgument = [NSNumber numberWithBool:false]; - [cluster writeAttributeGeneralErrorBooleanWithValue:generalErrorBooleanArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute that returns general status on write Error: %@", err); + [cluster readAttributeBitmap32WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BITMAP32 Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_INVALID_DATA_TYPE)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("bitmap32", actualValue, 0UL)); + } + { + readAttributeBitmap32DefaultValue = value; + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeThatReturnsClusterSpecificStatusOnWrite_475() + CHIP_ERROR TestWriteAttributeBitmap32NotDefaultValue_20() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id clusterErrorBooleanArgument; - clusterErrorBooleanArgument = [NSNumber numberWithBool:false]; - [cluster - writeAttributeClusterErrorBooleanWithValue:clusterErrorBooleanArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute that returns cluster-specific status on write Error: %@", err); + id bitmap32Argument; + bitmap32Argument = [NSNumber numberWithUnsignedInt:1UL]; + [cluster writeAttributeBitmap32WithValue:bitmap32Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute BITMAP32 Not Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_FAILURE)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeThatReturnsGeneralStatusOnRead_476() + CHIP_ERROR TestReadAttributeBitmap32NotDefaultValue_21() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeGeneralErrorBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute that returns general status on read Error: %@", err); + [cluster readAttributeBitmap32WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BITMAP32 Not Default Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("bitmap32", value, readAttributeBitmap32DefaultValue)); + } - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_INVALID_DATA_TYPE)); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeThatReturnsClusterSpecificStatusOnRead_477() + CHIP_ERROR TestWriteAttributeBitmap32DefaultValue_22() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeClusterErrorBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read attribute that returns cluster-specific status on read Error: %@", err); + id bitmap32Argument; + bitmap32Argument = [readAttributeBitmap32DefaultValue copy]; + [cluster writeAttributeBitmap32WithValue:bitmap32Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute BITMAP32 Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_FAILURE)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAcceptedCommandListAttribute_478() + CHIP_ERROR TestReadAttributeBitmap32DefaultValue_23() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"read AcceptedCommandList attribute Error: %@", err); + [cluster readAttributeBitmap32WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BITMAP32 Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(18))); - VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); - VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); - VerifyOrReturn(CheckValue("", actualValue[2], 2UL)); - VerifyOrReturn(CheckValue("", actualValue[3], 4UL)); - VerifyOrReturn(CheckValue("", actualValue[4], 7UL)); - VerifyOrReturn(CheckValue("", actualValue[5], 8UL)); - VerifyOrReturn(CheckValue("", actualValue[6], 9UL)); - VerifyOrReturn(CheckValue("", actualValue[7], 10UL)); - VerifyOrReturn(CheckValue("", actualValue[8], 11UL)); - VerifyOrReturn(CheckValue("", actualValue[9], 12UL)); - VerifyOrReturn(CheckValue("", actualValue[10], 13UL)); - VerifyOrReturn(CheckValue("", actualValue[11], 14UL)); - VerifyOrReturn(CheckValue("", actualValue[12], 15UL)); - VerifyOrReturn(CheckValue("", actualValue[13], 17UL)); - VerifyOrReturn(CheckValue("", actualValue[14], 18UL)); - VerifyOrReturn(CheckValue("", actualValue[15], 19UL)); - VerifyOrReturn(CheckValue("", actualValue[16], 20UL)); - VerifyOrReturn(CheckValue("", actualValue[17], 21UL)); + VerifyOrReturn(CheckValue("bitmap32", actualValue, readAttributeBitmap32DefaultValue)); } NextTest(); @@ -60753,29 +69002,25 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } + NSNumber * _Nonnull readAttributeBitmap64DefaultValue; - CHIP_ERROR TestReadGeneratedCommandListAttribute_479() + CHIP_ERROR TestReadAttributeBitmap64DefaultValue_24() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"read GeneratedCommandList attribute Error: %@", err); + [cluster readAttributeBitmap64WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BITMAP64 Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(8))); - VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); - VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); - VerifyOrReturn(CheckValue("", actualValue[2], 4UL)); - VerifyOrReturn(CheckValue("", actualValue[3], 5UL)); - VerifyOrReturn(CheckValue("", actualValue[4], 6UL)); - VerifyOrReturn(CheckValue("", actualValue[5], 9UL)); - VerifyOrReturn(CheckValue("", actualValue[6], 10UL)); - VerifyOrReturn(CheckValue("", actualValue[7], 11UL)); + VerifyOrReturn(CheckValue("bitmap64", actualValue, 0ULL)); + } + { + readAttributeBitmap64DefaultValue = value; } NextTest(); @@ -60784,58 +69029,39 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteStructTypedAttribute_480() + CHIP_ERROR TestWriteAttributeBitmap64NotDefaultValue_25() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id structAttrArgument; - structAttrArgument = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) structAttrArgument).a = [NSNumber numberWithUnsignedChar:5]; - ((CHIPTestClusterClusterSimpleStruct *) structAttrArgument).b = [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterSimpleStruct *) structAttrArgument).c = [NSNumber numberWithUnsignedChar:2]; - ((CHIPTestClusterClusterSimpleStruct *) structAttrArgument).d = [[NSData alloc] initWithBytes:"abc" length:3]; - ((CHIPTestClusterClusterSimpleStruct *) structAttrArgument).e = @""; - ((CHIPTestClusterClusterSimpleStruct *) structAttrArgument).f = [NSNumber numberWithUnsignedChar:17]; - ((CHIPTestClusterClusterSimpleStruct *) structAttrArgument).g = [NSNumber numberWithFloat:1.5f]; - ((CHIPTestClusterClusterSimpleStruct *) structAttrArgument).h = [NSNumber numberWithDouble:3.14159265358979]; - - [cluster writeAttributeStructAttrWithValue:structAttrArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write struct-typed attribute Error: %@", err); + id bitmap64Argument; + bitmap64Argument = [NSNumber numberWithUnsignedLongLong:1ULL]; + [cluster writeAttributeBitmap64WithValue:bitmap64Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute BITMAP64 Not Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadStructTypedAttribute_481() + CHIP_ERROR TestReadAttributeBitmap64DefaultValue_26() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeStructAttrWithCompletionHandler:^( - CHIPTestClusterClusterSimpleStruct * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read struct-typed attribute Error: %@", err); + [cluster readAttributeBitmap64WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BITMAP64 Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("a", ((CHIPTestClusterClusterSimpleStruct *) actualValue).a, 5)); - VerifyOrReturn(CheckValue("b", ((CHIPTestClusterClusterSimpleStruct *) actualValue).b, true)); - VerifyOrReturn(CheckValue("c", ((CHIPTestClusterClusterSimpleStruct *) actualValue).c, 2)); - VerifyOrReturn(CheckValueAsString( - "d", ((CHIPTestClusterClusterSimpleStruct *) actualValue).d, [[NSData alloc] initWithBytes:"abc" length:3])); - VerifyOrReturn(CheckValueAsString("e", ((CHIPTestClusterClusterSimpleStruct *) actualValue).e, @"")); - VerifyOrReturn(CheckValue("f", ((CHIPTestClusterClusterSimpleStruct *) actualValue).f, 17)); - VerifyOrReturn(CheckValue("g", ((CHIPTestClusterClusterSimpleStruct *) actualValue).g, 1.5f)); - VerifyOrReturn(CheckValue("h", ((CHIPTestClusterClusterSimpleStruct *) actualValue).h, 3.14159265358979)); + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("bitmap64", value, readAttributeBitmap64DefaultValue)); } NextTest(); @@ -60843,623 +69069,176 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } -}; -class TestSaveAs : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - TestSaveAs() - : TestCommandBridge("TestSaveAs") - , mTestIndex(0) + CHIP_ERROR TestWriteAttributeBitmap64DefaultValue_27() { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id bitmap64Argument; + bitmap64Argument = [readAttributeBitmap64DefaultValue copy]; + [cluster writeAttributeBitmap64WithValue:bitmap64Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute BITMAP64 Default Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~TestSaveAs() {} + CHIP_ERROR TestReadAttributeBitmap64DefaultValue_28() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeBitmap64WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BITMAP64 Default Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); - /////////// TestCommand Interface ///////// - void NextTest() override + { + id actualValue = value; + VerifyOrReturn(CheckValue("bitmap64", actualValue, readAttributeBitmap64DefaultValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nonnull readAttributeInt8uDefaultValue; + + CHIP_ERROR TestReadAttributeInt8uDefaultValue_29() { - CHIP_ERROR err = CHIP_NO_ERROR; + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: TestSaveAs\n"); - } + [cluster readAttributeInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT8U Default Value Error: %@", err); - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: TestSaveAs\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + VerifyOrReturn(CheckValue("status", err, 0)); - Wait(); + { + id actualValue = value; + VerifyOrReturn(CheckValue("int8u", actualValue, 0)); + } + { + readAttributeInt8uDefaultValue = value; + } - // 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 : Send Test Add Arguments Command\n"); - err = TestSendTestAddArgumentsCommand_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Send Test Add Arguments Command\n"); - err = TestSendTestAddArgumentsCommand_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Send Test Add Arguments Command\n"); - err = TestSendTestAddArgumentsCommand_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read attribute BOOLEAN Default Value\n"); - err = TestReadAttributeBooleanDefaultValue_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Write attribute BOOLEAN Not Default Value\n"); - err = TestWriteAttributeBooleanNotDefaultValue_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Read attribute BOOLEAN Not Default Value\n"); - err = TestReadAttributeBooleanNotDefaultValue_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Write attribute BOOLEAN DefaultValue\n"); - err = TestWriteAttributeBooleanDefaultValue_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Read attribute BOOLEAN False\n"); - err = TestReadAttributeBooleanFalse_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Read attribute BITMAP8 Default Value\n"); - err = TestReadAttributeBitmap8DefaultValue_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Write attribute BITMAP8 Not Default Value\n"); - err = TestWriteAttributeBitmap8NotDefaultValue_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Read attribute BITMAP8 Not Default Value\n"); - err = TestReadAttributeBitmap8NotDefaultValue_11(); - break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Write attribute BITMAP8 Default Value\n"); - err = TestWriteAttributeBitmap8DefaultValue_12(); - break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Read attribute BITMAP8 Default Value\n"); - err = TestReadAttributeBitmap8DefaultValue_13(); - break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Read attribute BITMAP16 Default Value\n"); - err = TestReadAttributeBitmap16DefaultValue_14(); - break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Write attribute BITMAP16 Not Default Value\n"); - err = TestWriteAttributeBitmap16NotDefaultValue_15(); - break; - case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : Read attribute BITMAP16 Not Default Value\n"); - err = TestReadAttributeBitmap16NotDefaultValue_16(); - break; - case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : Write attribute BITMAP16 Default Value\n"); - err = TestWriteAttributeBitmap16DefaultValue_17(); - break; - case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : Read attribute BITMAP16 Default Value\n"); - err = TestReadAttributeBitmap16DefaultValue_18(); - break; - case 19: - ChipLogProgress(chipTool, " ***** Test Step 19 : Read attribute BITMAP32 Default Value\n"); - err = TestReadAttributeBitmap32DefaultValue_19(); - break; - case 20: - ChipLogProgress(chipTool, " ***** Test Step 20 : Write attribute BITMAP32 Not Default Value\n"); - err = TestWriteAttributeBitmap32NotDefaultValue_20(); - break; - case 21: - ChipLogProgress(chipTool, " ***** Test Step 21 : Read attribute BITMAP32 Not Default Value\n"); - err = TestReadAttributeBitmap32NotDefaultValue_21(); - break; - case 22: - ChipLogProgress(chipTool, " ***** Test Step 22 : Write attribute BITMAP32 Default Value\n"); - err = TestWriteAttributeBitmap32DefaultValue_22(); - break; - case 23: - ChipLogProgress(chipTool, " ***** Test Step 23 : Read attribute BITMAP32 Default Value\n"); - err = TestReadAttributeBitmap32DefaultValue_23(); - break; - case 24: - ChipLogProgress(chipTool, " ***** Test Step 24 : Read attribute BITMAP64 Default Value\n"); - err = TestReadAttributeBitmap64DefaultValue_24(); - break; - case 25: - ChipLogProgress(chipTool, " ***** Test Step 25 : Write attribute BITMAP64 Not Default Value\n"); - err = TestWriteAttributeBitmap64NotDefaultValue_25(); - break; - case 26: - ChipLogProgress(chipTool, " ***** Test Step 26 : Read attribute BITMAP64 Default Value\n"); - err = TestReadAttributeBitmap64DefaultValue_26(); - break; - case 27: - ChipLogProgress(chipTool, " ***** Test Step 27 : Write attribute BITMAP64 Default Value\n"); - err = TestWriteAttributeBitmap64DefaultValue_27(); - break; - case 28: - ChipLogProgress(chipTool, " ***** Test Step 28 : Read attribute BITMAP64 Default Value\n"); - err = TestReadAttributeBitmap64DefaultValue_28(); - break; - case 29: - ChipLogProgress(chipTool, " ***** Test Step 29 : Read attribute INT8U Default Value\n"); - err = TestReadAttributeInt8uDefaultValue_29(); - break; - case 30: - ChipLogProgress(chipTool, " ***** Test Step 30 : Write attribute INT8U Not Default Value\n"); - err = TestWriteAttributeInt8uNotDefaultValue_30(); - break; - case 31: - ChipLogProgress(chipTool, " ***** Test Step 31 : Read attribute INT8U Not Default Value\n"); - err = TestReadAttributeInt8uNotDefaultValue_31(); - break; - case 32: - ChipLogProgress(chipTool, " ***** Test Step 32 : Write attribute INT8U Default Value\n"); - err = TestWriteAttributeInt8uDefaultValue_32(); - break; - case 33: - ChipLogProgress(chipTool, " ***** Test Step 33 : Read attribute INT8U Default Value\n"); - err = TestReadAttributeInt8uDefaultValue_33(); - break; - case 34: - ChipLogProgress(chipTool, " ***** Test Step 34 : Read attribute INT16U Default Value\n"); - err = TestReadAttributeInt16uDefaultValue_34(); - break; - case 35: - ChipLogProgress(chipTool, " ***** Test Step 35 : Write attribute INT16U Not Default Value\n"); - err = TestWriteAttributeInt16uNotDefaultValue_35(); - break; - case 36: - ChipLogProgress(chipTool, " ***** Test Step 36 : Read attribute INT16U Not Default Value\n"); - err = TestReadAttributeInt16uNotDefaultValue_36(); - break; - case 37: - ChipLogProgress(chipTool, " ***** Test Step 37 : Write attribute INT16U Default Value\n"); - err = TestWriteAttributeInt16uDefaultValue_37(); - break; - case 38: - ChipLogProgress(chipTool, " ***** Test Step 38 : Read attribute INT16U Default Value\n"); - err = TestReadAttributeInt16uDefaultValue_38(); - break; - case 39: - ChipLogProgress(chipTool, " ***** Test Step 39 : Read attribute INT32U Default Value\n"); - err = TestReadAttributeInt32uDefaultValue_39(); - break; - case 40: - ChipLogProgress(chipTool, " ***** Test Step 40 : Write attribute INT32U Not Default Value\n"); - err = TestWriteAttributeInt32uNotDefaultValue_40(); - break; - case 41: - ChipLogProgress(chipTool, " ***** Test Step 41 : Read attribute INT32U Not Default Value\n"); - err = TestReadAttributeInt32uNotDefaultValue_41(); - break; - case 42: - ChipLogProgress(chipTool, " ***** Test Step 42 : Write attribute INT32U Default Value\n"); - err = TestWriteAttributeInt32uDefaultValue_42(); - break; - case 43: - ChipLogProgress(chipTool, " ***** Test Step 43 : Read attribute INT32U Default Value\n"); - err = TestReadAttributeInt32uDefaultValue_43(); - break; - case 44: - ChipLogProgress(chipTool, " ***** Test Step 44 : Read attribute INT64U Default Value\n"); - err = TestReadAttributeInt64uDefaultValue_44(); - break; - case 45: - ChipLogProgress(chipTool, " ***** Test Step 45 : Write attribute INT64U Not Default Value\n"); - err = TestWriteAttributeInt64uNotDefaultValue_45(); - break; - case 46: - ChipLogProgress(chipTool, " ***** Test Step 46 : Read attribute INT64U Not Default Value\n"); - err = TestReadAttributeInt64uNotDefaultValue_46(); - break; - case 47: - ChipLogProgress(chipTool, " ***** Test Step 47 : Write attribute INT64U Default Value\n"); - err = TestWriteAttributeInt64uDefaultValue_47(); - break; - case 48: - ChipLogProgress(chipTool, " ***** Test Step 48 : Read attribute INT64U Default Value\n"); - err = TestReadAttributeInt64uDefaultValue_48(); - break; - case 49: - ChipLogProgress(chipTool, " ***** Test Step 49 : Read attribute INT8S Default Value\n"); - err = TestReadAttributeInt8sDefaultValue_49(); - break; - case 50: - ChipLogProgress(chipTool, " ***** Test Step 50 : Write attribute INT8S Not Default Value\n"); - err = TestWriteAttributeInt8sNotDefaultValue_50(); - break; - case 51: - ChipLogProgress(chipTool, " ***** Test Step 51 : Read attribute INT8S Not Default Value\n"); - err = TestReadAttributeInt8sNotDefaultValue_51(); - break; - case 52: - ChipLogProgress(chipTool, " ***** Test Step 52 : Write attribute INT8S Default Value\n"); - err = TestWriteAttributeInt8sDefaultValue_52(); - break; - case 53: - ChipLogProgress(chipTool, " ***** Test Step 53 : Read attribute INT8S Default Value\n"); - err = TestReadAttributeInt8sDefaultValue_53(); - break; - case 54: - ChipLogProgress(chipTool, " ***** Test Step 54 : Read attribute INT16S Default Value\n"); - err = TestReadAttributeInt16sDefaultValue_54(); - break; - case 55: - ChipLogProgress(chipTool, " ***** Test Step 55 : Write attribute INT16S Not Default Value\n"); - err = TestWriteAttributeInt16sNotDefaultValue_55(); - break; - case 56: - ChipLogProgress(chipTool, " ***** Test Step 56 : Read attribute INT16S Not Default Value\n"); - err = TestReadAttributeInt16sNotDefaultValue_56(); - break; - case 57: - ChipLogProgress(chipTool, " ***** Test Step 57 : Write attribute INT16S Default Value\n"); - err = TestWriteAttributeInt16sDefaultValue_57(); - break; - case 58: - ChipLogProgress(chipTool, " ***** Test Step 58 : Read attribute INT16S Default Value\n"); - err = TestReadAttributeInt16sDefaultValue_58(); - break; - case 59: - ChipLogProgress(chipTool, " ***** Test Step 59 : Read attribute INT32S Default Value\n"); - err = TestReadAttributeInt32sDefaultValue_59(); - break; - case 60: - ChipLogProgress(chipTool, " ***** Test Step 60 : Write attribute INT32S Not Default Value\n"); - err = TestWriteAttributeInt32sNotDefaultValue_60(); - break; - case 61: - ChipLogProgress(chipTool, " ***** Test Step 61 : Read attribute INT32S Not Default Value\n"); - err = TestReadAttributeInt32sNotDefaultValue_61(); - break; - case 62: - ChipLogProgress(chipTool, " ***** Test Step 62 : Write attribute INT32S Default Value\n"); - err = TestWriteAttributeInt32sDefaultValue_62(); - break; - case 63: - ChipLogProgress(chipTool, " ***** Test Step 63 : Read attribute INT32S Default Value\n"); - err = TestReadAttributeInt32sDefaultValue_63(); - break; - case 64: - ChipLogProgress(chipTool, " ***** Test Step 64 : Read attribute INT64S Default Value\n"); - err = TestReadAttributeInt64sDefaultValue_64(); - break; - case 65: - ChipLogProgress(chipTool, " ***** Test Step 65 : Write attribute INTS Not Default Value\n"); - err = TestWriteAttributeIntsNotDefaultValue_65(); - break; - case 66: - ChipLogProgress(chipTool, " ***** Test Step 66 : Read attribute INT64S Not Default Value\n"); - err = TestReadAttributeInt64sNotDefaultValue_66(); - break; - case 67: - ChipLogProgress(chipTool, " ***** Test Step 67 : Write attribute INT64S Default Value\n"); - err = TestWriteAttributeInt64sDefaultValue_67(); - break; - case 68: - ChipLogProgress(chipTool, " ***** Test Step 68 : Read attribute INT64S Default Value\n"); - err = TestReadAttributeInt64sDefaultValue_68(); - break; - case 69: - ChipLogProgress(chipTool, " ***** Test Step 69 : Read attribute ENUM8 Default Value\n"); - err = TestReadAttributeEnum8DefaultValue_69(); - break; - case 70: - ChipLogProgress(chipTool, " ***** Test Step 70 : Write attribute ENUM8 Not Default Value\n"); - err = TestWriteAttributeEnum8NotDefaultValue_70(); - break; - case 71: - ChipLogProgress(chipTool, " ***** Test Step 71 : Read attribute ENUM8 Not Default Value\n"); - err = TestReadAttributeEnum8NotDefaultValue_71(); - break; - case 72: - ChipLogProgress(chipTool, " ***** Test Step 72 : Write attribute ENUM8 Default Value\n"); - err = TestWriteAttributeEnum8DefaultValue_72(); - break; - case 73: - ChipLogProgress(chipTool, " ***** Test Step 73 : Read attribute ENUM8 Default Value\n"); - err = TestReadAttributeEnum8DefaultValue_73(); - break; - case 74: - ChipLogProgress(chipTool, " ***** Test Step 74 : Read attribute ENUM16 Default Value\n"); - err = TestReadAttributeEnum16DefaultValue_74(); - break; - case 75: - ChipLogProgress(chipTool, " ***** Test Step 75 : Write attribute ENUM16 Not Default Value\n"); - err = TestWriteAttributeEnum16NotDefaultValue_75(); - break; - case 76: - ChipLogProgress(chipTool, " ***** Test Step 76 : Read attribute ENUM16 Not Default Value\n"); - err = TestReadAttributeEnum16NotDefaultValue_76(); - break; - case 77: - ChipLogProgress(chipTool, " ***** Test Step 77 : Write attribute ENUM16 Default Value\n"); - err = TestWriteAttributeEnum16DefaultValue_77(); - break; - case 78: - ChipLogProgress(chipTool, " ***** Test Step 78 : Read attribute ENUM16 Default Value\n"); - err = TestReadAttributeEnum16DefaultValue_78(); - break; - case 79: - ChipLogProgress(chipTool, " ***** Test Step 79 : Read attribute EPOCH_US Default Value\n"); - err = TestReadAttributeEpochUsDefaultValue_79(); - break; - case 80: - ChipLogProgress(chipTool, " ***** Test Step 80 : Write attribute EPOCH_US Not Default Value\n"); - err = TestWriteAttributeEpochUsNotDefaultValue_80(); - break; - case 81: - ChipLogProgress(chipTool, " ***** Test Step 81 : Read attribute EPOCH_US Not Default Value\n"); - err = TestReadAttributeEpochUsNotDefaultValue_81(); - break; - case 82: - ChipLogProgress(chipTool, " ***** Test Step 82 : Write attribute EPOCH_US Default Value\n"); - err = TestWriteAttributeEpochUsDefaultValue_82(); - break; - case 83: - ChipLogProgress(chipTool, " ***** Test Step 83 : Read attribute EPOCH_US Default Value\n"); - err = TestReadAttributeEpochUsDefaultValue_83(); - break; - case 84: - ChipLogProgress(chipTool, " ***** Test Step 84 : Read attribute EPOCH_S Default Value\n"); - err = TestReadAttributeEpochSDefaultValue_84(); - break; - case 85: - ChipLogProgress(chipTool, " ***** Test Step 85 : Write attribute EPOCH_S Not Default Value\n"); - err = TestWriteAttributeEpochSNotDefaultValue_85(); - break; - case 86: - ChipLogProgress(chipTool, " ***** Test Step 86 : Read attribute EPOCH_S Not Default Value\n"); - err = TestReadAttributeEpochSNotDefaultValue_86(); - break; - case 87: - ChipLogProgress(chipTool, " ***** Test Step 87 : Write attribute EPOCH_S Default Value\n"); - err = TestWriteAttributeEpochSDefaultValue_87(); - break; - case 88: - ChipLogProgress(chipTool, " ***** Test Step 88 : Read attribute EPOCH_S Default Value\n"); - err = TestReadAttributeEpochSDefaultValue_88(); - break; - case 89: - ChipLogProgress(chipTool, " ***** Test Step 89 : Read attribute vendor_id Default Value\n"); - err = TestReadAttributeVendorIdDefaultValue_89(); - break; - case 90: - ChipLogProgress(chipTool, " ***** Test Step 90 : Write attribute vendor_id Not Default Value\n"); - err = TestWriteAttributeVendorIdNotDefaultValue_90(); - break; - case 91: - ChipLogProgress(chipTool, " ***** Test Step 91 : Read attribute vendor_id Not Default Value\n"); - err = TestReadAttributeVendorIdNotDefaultValue_91(); - break; - case 92: - ChipLogProgress(chipTool, " ***** Test Step 92 : Write attribute vendor_id Default Value\n"); - err = TestWriteAttributeVendorIdDefaultValue_92(); - break; - case 93: - ChipLogProgress(chipTool, " ***** Test Step 93 : Read attribute vendor_id Default Value\n"); - err = TestReadAttributeVendorIdDefaultValue_93(); - break; - case 94: - ChipLogProgress(chipTool, " ***** Test Step 94 : Read attribute char_string Default Value\n"); - err = TestReadAttributeCharStringDefaultValue_94(); - break; - case 95: - ChipLogProgress( - chipTool, " ***** Test Step 95 : Read attribute char_string Default Value and compare to saved value\n"); - err = TestReadAttributeCharStringDefaultValueAndCompareToSavedValue_95(); - break; - case 96: - ChipLogProgress(chipTool, " ***** Test Step 96 : Write attribute char_string Not Default Value\n"); - err = TestWriteAttributeCharStringNotDefaultValue_96(); - break; - case 97: - ChipLogProgress(chipTool, " ***** Test Step 97 : Read attribute char_string Not Default Value\n"); - err = TestReadAttributeCharStringNotDefaultValue_97(); - break; - case 98: - ChipLogProgress( - chipTool, " ***** Test Step 98 : Read attribute char_string Not Default Value and compare to saved value\n"); - err = TestReadAttributeCharStringNotDefaultValueAndCompareToSavedValue_98(); - break; - case 99: - ChipLogProgress(chipTool, " ***** Test Step 99 : Write attribute char_string Not Default Value from saved value\n"); - err = TestWriteAttributeCharStringNotDefaultValueFromSavedValue_99(); - break; - case 100: - ChipLogProgress( - chipTool, " ***** Test Step 100 : Read attribute char_string Not Default Value and compare to expected value\n"); - err = TestReadAttributeCharStringNotDefaultValueAndCompareToExpectedValue_100(); - break; - case 101: - ChipLogProgress(chipTool, " ***** Test Step 101 : Write attribute char_string Default Value\n"); - err = TestWriteAttributeCharStringDefaultValue_101(); - break; - case 102: - ChipLogProgress(chipTool, " ***** Test Step 102 : Read attribute octet_string Default Value\n"); - err = TestReadAttributeOctetStringDefaultValue_102(); - break; - case 103: - ChipLogProgress( - chipTool, " ***** Test Step 103 : Read attribute octet_string Default Value and compare to saved value\n"); - err = TestReadAttributeOctetStringDefaultValueAndCompareToSavedValue_103(); - break; - case 104: - ChipLogProgress(chipTool, " ***** Test Step 104 : Write attribute octet_string Not Default Value\n"); - err = TestWriteAttributeOctetStringNotDefaultValue_104(); - break; - case 105: - ChipLogProgress(chipTool, " ***** Test Step 105 : Read attribute octet_string Not Default Value\n"); - err = TestReadAttributeOctetStringNotDefaultValue_105(); - break; - case 106: - ChipLogProgress( - chipTool, " ***** Test Step 106 : Read attribute octet_string Not Default Value and compare to saved value\n"); - err = TestReadAttributeOctetStringNotDefaultValueAndCompareToSavedValue_106(); - break; - case 107: - ChipLogProgress(chipTool, " ***** Test Step 107 : Write attribute octet_string Not Default Value from saved value\n"); - err = TestWriteAttributeOctetStringNotDefaultValueFromSavedValue_107(); - break; - case 108: - ChipLogProgress( - chipTool, " ***** Test Step 108 : Read attribute octet_string Not Default Value and compare to expected value\n"); - err = TestReadAttributeOctetStringNotDefaultValueAndCompareToExpectedValue_108(); - break; - case 109: - ChipLogProgress(chipTool, " ***** Test Step 109 : Write attribute octet_string Default Value\n"); - err = TestWriteAttributeOctetStringDefaultValue_109(); - break; - } + NextTest(); + }]; - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + return CHIP_NO_ERROR; } - chip::System::Clock::Timeout GetWaitDuration() const override + CHIP_ERROR TestWriteAttributeInt8uNotDefaultValue_30() { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id int8uArgument; + int8uArgument = [NSNumber numberWithUnsignedChar:1]; + [cluster writeAttributeInt8uWithValue:int8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT8U Not Default Value Error: %@", err); -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 110; + VerifyOrReturn(CheckValue("status", err, 0)); - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; + NextTest(); + }]; - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - NSNumber * _Nonnull TestAddArgumentDefaultValue; - CHIP_ERROR TestSendTestAddArgumentsCommand_1() + CHIP_ERROR TestReadAttributeInt8uNotDefaultValue_31() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPTestClusterClusterTestAddArgumentsParams alloc] init]; - params.arg1 = [NSNumber numberWithUnsignedChar:3]; - params.arg2 = [NSNumber numberWithUnsignedChar:17]; - [cluster testAddArgumentsWithParams:params - completionHandler:^( - CHIPTestClusterClusterTestAddArgumentsResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Send Test Add Arguments Command Error: %@", err); + [cluster readAttributeInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT8U Not Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = values.returnValue; - VerifyOrReturn(CheckValue("returnValue", actualValue, 20)); - } - { - TestAddArgumentDefaultValue = values.returnValue; - } + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("int8u", value, readAttributeInt8uDefaultValue)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendTestAddArgumentsCommand_2() + CHIP_ERROR TestWriteAttributeInt8uDefaultValue_32() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPTestClusterClusterTestAddArgumentsParams alloc] init]; - params.arg1 = [NSNumber numberWithUnsignedChar:3]; - params.arg2 = [NSNumber numberWithUnsignedChar:17]; - [cluster testAddArgumentsWithParams:params - completionHandler:^( - CHIPTestClusterClusterTestAddArgumentsResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Send Test Add Arguments Command Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id int8uArgument; + int8uArgument = [readAttributeInt8uDefaultValue copy]; + [cluster writeAttributeInt8uWithValue:int8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT8U Default Value Error: %@", err); - { - id actualValue = values.returnValue; - VerifyOrReturn(CheckValue("returnValue", actualValue, TestAddArgumentDefaultValue)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendTestAddArgumentsCommand_3() + CHIP_ERROR TestReadAttributeInt8uDefaultValue_33() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPTestClusterClusterTestAddArgumentsParams alloc] init]; - params.arg1 = [NSNumber numberWithUnsignedChar:3]; - params.arg2 = [TestAddArgumentDefaultValue copy]; - [cluster testAddArgumentsWithParams:params - completionHandler:^( - CHIPTestClusterClusterTestAddArgumentsResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Send Test Add Arguments Command Error: %@", err); + [cluster readAttributeInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT8U Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - if (values.returnValue != nil) { - VerifyOrReturn( - CheckConstraintNotValue("returnValue", values.returnValue, TestAddArgumentDefaultValue)); - } + { + id actualValue = value; + VerifyOrReturn(CheckValue("int8u", actualValue, readAttributeInt8uDefaultValue)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - NSNumber * _Nonnull readAttributeBooleanDefaultValue; + NSNumber * _Nonnull readAttributeInt16uDefaultValue; - CHIP_ERROR TestReadAttributeBooleanDefaultValue_4() + CHIP_ERROR TestReadAttributeInt16uDefaultValue_34() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BOOLEAN Default Value Error: %@", err); + [cluster readAttributeInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT16U Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("boolean", actualValue, 0)); + VerifyOrReturn(CheckValue("int16u", actualValue, 0U)); } { - readAttributeBooleanDefaultValue = value; + readAttributeInt16uDefaultValue = value; } NextTest(); @@ -61468,39 +69247,39 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeBooleanNotDefaultValue_5() + CHIP_ERROR TestWriteAttributeInt16uNotDefaultValue_35() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id booleanArgument; - booleanArgument = [NSNumber numberWithBool:1]; - [cluster writeAttributeBooleanWithValue:booleanArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute BOOLEAN Not Default Value Error: %@", err); + id int16uArgument; + int16uArgument = [NSNumber numberWithUnsignedShort:1U]; + [cluster writeAttributeInt16uWithValue:int16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT16U Not Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeBooleanNotDefaultValue_6() + CHIP_ERROR TestReadAttributeInt16uNotDefaultValue_36() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BOOLEAN Not Default Value Error: %@", err); + [cluster readAttributeInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT16U Not Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("boolean", value, readAttributeBooleanDefaultValue)); + VerifyOrReturn(CheckConstraintNotValue("int16u", value, readAttributeInt16uDefaultValue)); } NextTest(); @@ -61509,40 +69288,40 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeBooleanDefaultValue_7() + CHIP_ERROR TestWriteAttributeInt16uDefaultValue_37() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id booleanArgument; - booleanArgument = [readAttributeBooleanDefaultValue copy]; - [cluster writeAttributeBooleanWithValue:booleanArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute BOOLEAN DefaultValue Error: %@", err); + id int16uArgument; + int16uArgument = [readAttributeInt16uDefaultValue copy]; + [cluster writeAttributeInt16uWithValue:int16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT16U Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeBooleanFalse_8() + CHIP_ERROR TestReadAttributeInt16uDefaultValue_38() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BOOLEAN False Error: %@", err); + [cluster readAttributeInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT16U Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("boolean", actualValue, readAttributeBooleanDefaultValue)); + VerifyOrReturn(CheckValue("int16u", actualValue, readAttributeInt16uDefaultValue)); } NextTest(); @@ -61550,25 +69329,25 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull readAttributeBitmap8DefaultValue; + NSNumber * _Nonnull readAttributeInt32uDefaultValue; - CHIP_ERROR TestReadAttributeBitmap8DefaultValue_9() + CHIP_ERROR TestReadAttributeInt32uDefaultValue_39() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBitmap8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP8 Default Value Error: %@", err); + [cluster readAttributeInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT32U Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("bitmap8", actualValue, 0)); + VerifyOrReturn(CheckValue("int32u", actualValue, 0UL)); } { - readAttributeBitmap8DefaultValue = value; + readAttributeInt32uDefaultValue = value; } NextTest(); @@ -61577,39 +69356,39 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeBitmap8NotDefaultValue_10() + CHIP_ERROR TestWriteAttributeInt32uNotDefaultValue_40() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id bitmap8Argument; - bitmap8Argument = [NSNumber numberWithUnsignedChar:1]; - [cluster writeAttributeBitmap8WithValue:bitmap8Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute BITMAP8 Not Default Value Error: %@", err); + id int32uArgument; + int32uArgument = [NSNumber numberWithUnsignedInt:1UL]; + [cluster writeAttributeInt32uWithValue:int32uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT32U Not Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeBitmap8NotDefaultValue_11() + CHIP_ERROR TestReadAttributeInt32uNotDefaultValue_41() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBitmap8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP8 Not Default Value Error: %@", err); + [cluster readAttributeInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT32U Not Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("bitmap8", value, readAttributeBitmap8DefaultValue)); + VerifyOrReturn(CheckConstraintNotValue("int32u", value, readAttributeInt32uDefaultValue)); } NextTest(); @@ -61618,40 +69397,40 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeBitmap8DefaultValue_12() + CHIP_ERROR TestWriteAttributeInt32uDefaultValue_42() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id bitmap8Argument; - bitmap8Argument = [readAttributeBitmap8DefaultValue copy]; - [cluster writeAttributeBitmap8WithValue:bitmap8Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute BITMAP8 Default Value Error: %@", err); + id int32uArgument; + int32uArgument = [readAttributeInt32uDefaultValue copy]; + [cluster writeAttributeInt32uWithValue:int32uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT32U Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeBitmap8DefaultValue_13() + CHIP_ERROR TestReadAttributeInt32uDefaultValue_43() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBitmap8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP8 Default Value Error: %@", err); + [cluster readAttributeInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT32U Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("bitmap8", actualValue, readAttributeBitmap8DefaultValue)); + VerifyOrReturn(CheckValue("int32u", actualValue, readAttributeInt32uDefaultValue)); } NextTest(); @@ -61659,25 +69438,25 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull readAttributeBitmap16DefaultValue; + NSNumber * _Nonnull readAttributeInt64uDefaultValue; - CHIP_ERROR TestReadAttributeBitmap16DefaultValue_14() + CHIP_ERROR TestReadAttributeInt64uDefaultValue_44() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBitmap16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP16 Default Value Error: %@", err); + [cluster readAttributeInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT64U Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("bitmap16", actualValue, 0U)); + VerifyOrReturn(CheckValue("int64u", actualValue, 0ULL)); } { - readAttributeBitmap16DefaultValue = value; + readAttributeInt64uDefaultValue = value; } NextTest(); @@ -61686,39 +69465,39 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeBitmap16NotDefaultValue_15() + CHIP_ERROR TestWriteAttributeInt64uNotDefaultValue_45() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id bitmap16Argument; - bitmap16Argument = [NSNumber numberWithUnsignedShort:1U]; - [cluster writeAttributeBitmap16WithValue:bitmap16Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute BITMAP16 Not Default Value Error: %@", err); + id int64uArgument; + int64uArgument = [NSNumber numberWithUnsignedLongLong:1ULL]; + [cluster writeAttributeInt64uWithValue:int64uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT64U Not Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeBitmap16NotDefaultValue_16() + CHIP_ERROR TestReadAttributeInt64uNotDefaultValue_46() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBitmap16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP16 Not Default Value Error: %@", err); + [cluster readAttributeInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT64U Not Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("bitmap16", value, readAttributeBitmap16DefaultValue)); + VerifyOrReturn(CheckConstraintNotValue("int64u", value, readAttributeInt64uDefaultValue)); } NextTest(); @@ -61727,40 +69506,40 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeBitmap16DefaultValue_17() + CHIP_ERROR TestWriteAttributeInt64uDefaultValue_47() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id bitmap16Argument; - bitmap16Argument = [readAttributeBitmap16DefaultValue copy]; - [cluster writeAttributeBitmap16WithValue:bitmap16Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute BITMAP16 Default Value Error: %@", err); + id int64uArgument; + int64uArgument = [readAttributeInt64uDefaultValue copy]; + [cluster writeAttributeInt64uWithValue:int64uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT64U Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeBitmap16DefaultValue_18() + CHIP_ERROR TestReadAttributeInt64uDefaultValue_48() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBitmap16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP16 Default Value Error: %@", err); + [cluster readAttributeInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT64U Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("bitmap16", actualValue, readAttributeBitmap16DefaultValue)); + VerifyOrReturn(CheckValue("int64u", actualValue, readAttributeInt64uDefaultValue)); } NextTest(); @@ -61768,25 +69547,25 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull readAttributeBitmap32DefaultValue; + NSNumber * _Nonnull readAttributeInt8sDefaultValue; - CHIP_ERROR TestReadAttributeBitmap32DefaultValue_19() + CHIP_ERROR TestReadAttributeInt8sDefaultValue_49() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBitmap32WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP32 Default Value Error: %@", err); + [cluster readAttributeInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT8S Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("bitmap32", actualValue, 0UL)); + VerifyOrReturn(CheckValue("int8s", actualValue, 0)); } { - readAttributeBitmap32DefaultValue = value; + readAttributeInt8sDefaultValue = value; } NextTest(); @@ -61795,39 +69574,39 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeBitmap32NotDefaultValue_20() + CHIP_ERROR TestWriteAttributeInt8sNotDefaultValue_50() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id bitmap32Argument; - bitmap32Argument = [NSNumber numberWithUnsignedInt:1UL]; - [cluster writeAttributeBitmap32WithValue:bitmap32Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute BITMAP32 Not Default Value Error: %@", err); + id int8sArgument; + int8sArgument = [NSNumber numberWithChar:1]; + [cluster writeAttributeInt8sWithValue:int8sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT8S Not Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeBitmap32NotDefaultValue_21() + CHIP_ERROR TestReadAttributeInt8sNotDefaultValue_51() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBitmap32WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP32 Not Default Value Error: %@", err); + [cluster readAttributeInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT8S Not Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("bitmap32", value, readAttributeBitmap32DefaultValue)); + VerifyOrReturn(CheckConstraintNotValue("int8s", value, readAttributeInt8sDefaultValue)); } NextTest(); @@ -61836,40 +69615,40 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeBitmap32DefaultValue_22() + CHIP_ERROR TestWriteAttributeInt8sDefaultValue_52() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id bitmap32Argument; - bitmap32Argument = [readAttributeBitmap32DefaultValue copy]; - [cluster writeAttributeBitmap32WithValue:bitmap32Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute BITMAP32 Default Value Error: %@", err); + id int8sArgument; + int8sArgument = [readAttributeInt8sDefaultValue copy]; + [cluster writeAttributeInt8sWithValue:int8sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT8S Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeBitmap32DefaultValue_23() + CHIP_ERROR TestReadAttributeInt8sDefaultValue_53() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBitmap32WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP32 Default Value Error: %@", err); + [cluster readAttributeInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT8S Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("bitmap32", actualValue, readAttributeBitmap32DefaultValue)); + VerifyOrReturn(CheckValue("int8s", actualValue, readAttributeInt8sDefaultValue)); } NextTest(); @@ -61877,25 +69656,25 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull readAttributeBitmap64DefaultValue; + NSNumber * _Nonnull readAttributeInt16sDefaultValue; - CHIP_ERROR TestReadAttributeBitmap64DefaultValue_24() + CHIP_ERROR TestReadAttributeInt16sDefaultValue_54() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBitmap64WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP64 Default Value Error: %@", err); + [cluster readAttributeInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT16S Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("bitmap64", actualValue, 0ULL)); + VerifyOrReturn(CheckValue("int16s", actualValue, 0)); } { - readAttributeBitmap64DefaultValue = value; + readAttributeInt16sDefaultValue = value; } NextTest(); @@ -61904,39 +69683,39 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeBitmap64NotDefaultValue_25() + CHIP_ERROR TestWriteAttributeInt16sNotDefaultValue_55() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id bitmap64Argument; - bitmap64Argument = [NSNumber numberWithUnsignedLongLong:1ULL]; - [cluster writeAttributeBitmap64WithValue:bitmap64Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute BITMAP64 Not Default Value Error: %@", err); + id int16sArgument; + int16sArgument = [NSNumber numberWithShort:1]; + [cluster writeAttributeInt16sWithValue:int16sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT16S Not Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeBitmap64DefaultValue_26() + CHIP_ERROR TestReadAttributeInt16sNotDefaultValue_56() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBitmap64WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP64 Default Value Error: %@", err); + [cluster readAttributeInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT16S Not Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("bitmap64", value, readAttributeBitmap64DefaultValue)); + VerifyOrReturn(CheckConstraintNotValue("int16s", value, readAttributeInt16sDefaultValue)); } NextTest(); @@ -61945,40 +69724,40 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeBitmap64DefaultValue_27() + CHIP_ERROR TestWriteAttributeInt16sDefaultValue_57() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id bitmap64Argument; - bitmap64Argument = [readAttributeBitmap64DefaultValue copy]; - [cluster writeAttributeBitmap64WithValue:bitmap64Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute BITMAP64 Default Value Error: %@", err); + id int16sArgument; + int16sArgument = [readAttributeInt16sDefaultValue copy]; + [cluster writeAttributeInt16sWithValue:int16sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT16S Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeBitmap64DefaultValue_28() + CHIP_ERROR TestReadAttributeInt16sDefaultValue_58() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBitmap64WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP64 Default Value Error: %@", err); + [cluster readAttributeInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT16S Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("bitmap64", actualValue, readAttributeBitmap64DefaultValue)); + VerifyOrReturn(CheckValue("int16s", actualValue, readAttributeInt16sDefaultValue)); } NextTest(); @@ -61986,25 +69765,25 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull readAttributeInt8uDefaultValue; + NSNumber * _Nonnull readAttributeInt32sDefaultValue; - CHIP_ERROR TestReadAttributeInt8uDefaultValue_29() + CHIP_ERROR TestReadAttributeInt32sDefaultValue_59() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT8U Default Value Error: %@", err); + [cluster readAttributeInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT32S Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int8u", actualValue, 0)); + VerifyOrReturn(CheckValue("int32s", actualValue, 0L)); } { - readAttributeInt8uDefaultValue = value; + readAttributeInt32sDefaultValue = value; } NextTest(); @@ -62013,39 +69792,39 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt8uNotDefaultValue_30() + CHIP_ERROR TestWriteAttributeInt32sNotDefaultValue_60() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int8uArgument; - int8uArgument = [NSNumber numberWithUnsignedChar:1]; - [cluster writeAttributeInt8uWithValue:int8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT8U Not Default Value Error: %@", err); + id int32sArgument; + int32sArgument = [NSNumber numberWithInt:1L]; + [cluster writeAttributeInt32sWithValue:int32sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT32S Not Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt8uNotDefaultValue_31() + CHIP_ERROR TestReadAttributeInt32sNotDefaultValue_61() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT8U Not Default Value Error: %@", err); + [cluster readAttributeInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT32S Not Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("int8u", value, readAttributeInt8uDefaultValue)); + VerifyOrReturn(CheckConstraintNotValue("int32s", value, readAttributeInt32sDefaultValue)); } NextTest(); @@ -62054,40 +69833,40 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt8uDefaultValue_32() + CHIP_ERROR TestWriteAttributeInt32sDefaultValue_62() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int8uArgument; - int8uArgument = [readAttributeInt8uDefaultValue copy]; - [cluster writeAttributeInt8uWithValue:int8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT8U Default Value Error: %@", err); + id int32sArgument; + int32sArgument = [readAttributeInt32sDefaultValue copy]; + [cluster writeAttributeInt32sWithValue:int32sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT32S Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt8uDefaultValue_33() + CHIP_ERROR TestReadAttributeInt32sDefaultValue_63() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT8U Default Value Error: %@", err); + [cluster readAttributeInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT32S Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int8u", actualValue, readAttributeInt8uDefaultValue)); + VerifyOrReturn(CheckValue("int32s", actualValue, readAttributeInt32sDefaultValue)); } NextTest(); @@ -62095,25 +69874,25 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull readAttributeInt16uDefaultValue; + NSNumber * _Nonnull readAttributeInt64sDefaultValue; - CHIP_ERROR TestReadAttributeInt16uDefaultValue_34() + CHIP_ERROR TestReadAttributeInt64sDefaultValue_64() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT16U Default Value Error: %@", err); + [cluster readAttributeInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT64S Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int16u", actualValue, 0U)); + VerifyOrReturn(CheckValue("int64s", actualValue, 0LL)); } { - readAttributeInt16uDefaultValue = value; + readAttributeInt64sDefaultValue = value; } NextTest(); @@ -62122,17 +69901,17 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt16uNotDefaultValue_35() + CHIP_ERROR TestWriteAttributeIntsNotDefaultValue_65() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int16uArgument; - int16uArgument = [NSNumber numberWithUnsignedShort:1U]; - [cluster writeAttributeInt16uWithValue:int16uArgument + id int64sArgument; + int64sArgument = [NSNumber numberWithLongLong:1LL]; + [cluster writeAttributeInt64sWithValue:int64sArgument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT16U Not Default Value Error: %@", err); + NSLog(@"Write attribute INTS Not Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -62142,19 +69921,19 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt16uNotDefaultValue_36() + CHIP_ERROR TestReadAttributeInt64sNotDefaultValue_66() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT16U Not Default Value Error: %@", err); + [cluster readAttributeInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT64S Not Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("int16u", value, readAttributeInt16uDefaultValue)); + VerifyOrReturn(CheckConstraintNotValue("int64s", value, readAttributeInt64sDefaultValue)); } NextTest(); @@ -62163,17 +69942,17 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt16uDefaultValue_37() + CHIP_ERROR TestWriteAttributeInt64sDefaultValue_67() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int16uArgument; - int16uArgument = [readAttributeInt16uDefaultValue copy]; - [cluster writeAttributeInt16uWithValue:int16uArgument + id int64sArgument; + int64sArgument = [readAttributeInt64sDefaultValue copy]; + [cluster writeAttributeInt64sWithValue:int64sArgument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT16U Default Value Error: %@", err); + NSLog(@"Write attribute INT64S Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -62183,20 +69962,20 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt16uDefaultValue_38() + CHIP_ERROR TestReadAttributeInt64sDefaultValue_68() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT16U Default Value Error: %@", err); + [cluster readAttributeInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT64S Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int16u", actualValue, readAttributeInt16uDefaultValue)); + VerifyOrReturn(CheckValue("int64s", actualValue, readAttributeInt64sDefaultValue)); } NextTest(); @@ -62204,25 +69983,25 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull readAttributeInt32uDefaultValue; + NSNumber * _Nonnull readAttributeEnum8DefaultValue; - CHIP_ERROR TestReadAttributeInt32uDefaultValue_39() + CHIP_ERROR TestReadAttributeEnum8DefaultValue_69() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT32U Default Value Error: %@", err); + [cluster readAttributeEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute ENUM8 Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int32u", actualValue, 0UL)); + VerifyOrReturn(CheckValue("enum8", actualValue, 0)); } { - readAttributeInt32uDefaultValue = value; + readAttributeEnum8DefaultValue = value; } NextTest(); @@ -62231,39 +70010,39 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt32uNotDefaultValue_40() + CHIP_ERROR TestWriteAttributeEnum8NotDefaultValue_70() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int32uArgument; - int32uArgument = [NSNumber numberWithUnsignedInt:1UL]; - [cluster writeAttributeInt32uWithValue:int32uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT32U Not Default Value Error: %@", err); + id enum8Argument; + enum8Argument = [NSNumber numberWithUnsignedChar:1]; + [cluster writeAttributeEnum8WithValue:enum8Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute ENUM8 Not Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt32uNotDefaultValue_41() + CHIP_ERROR TestReadAttributeEnum8NotDefaultValue_71() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT32U Not Default Value Error: %@", err); + [cluster readAttributeEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute ENUM8 Not Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("int32u", value, readAttributeInt32uDefaultValue)); + VerifyOrReturn(CheckConstraintNotValue("enum8", value, readAttributeEnum8DefaultValue)); } NextTest(); @@ -62272,40 +70051,40 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt32uDefaultValue_42() + CHIP_ERROR TestWriteAttributeEnum8DefaultValue_72() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int32uArgument; - int32uArgument = [readAttributeInt32uDefaultValue copy]; - [cluster writeAttributeInt32uWithValue:int32uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT32U Default Value Error: %@", err); + id enum8Argument; + enum8Argument = [readAttributeEnum8DefaultValue copy]; + [cluster writeAttributeEnum8WithValue:enum8Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute ENUM8 Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt32uDefaultValue_43() + CHIP_ERROR TestReadAttributeEnum8DefaultValue_73() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT32U Default Value Error: %@", err); + [cluster readAttributeEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute ENUM8 Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int32u", actualValue, readAttributeInt32uDefaultValue)); + VerifyOrReturn(CheckValue("enum8", actualValue, readAttributeEnum8DefaultValue)); } NextTest(); @@ -62313,25 +70092,25 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull readAttributeInt64uDefaultValue; + NSNumber * _Nonnull readAttributeEnum16DefaultValue; - CHIP_ERROR TestReadAttributeInt64uDefaultValue_44() + CHIP_ERROR TestReadAttributeEnum16DefaultValue_74() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT64U Default Value Error: %@", err); + [cluster readAttributeEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute ENUM16 Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int64u", actualValue, 0ULL)); + VerifyOrReturn(CheckValue("enum16", actualValue, 0U)); } { - readAttributeInt64uDefaultValue = value; + readAttributeEnum16DefaultValue = value; } NextTest(); @@ -62340,17 +70119,17 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt64uNotDefaultValue_45() + CHIP_ERROR TestWriteAttributeEnum16NotDefaultValue_75() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int64uArgument; - int64uArgument = [NSNumber numberWithUnsignedLongLong:1ULL]; - [cluster writeAttributeInt64uWithValue:int64uArgument + id enum16Argument; + enum16Argument = [NSNumber numberWithUnsignedShort:1U]; + [cluster writeAttributeEnum16WithValue:enum16Argument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT64U Not Default Value Error: %@", err); + NSLog(@"Write attribute ENUM16 Not Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -62360,19 +70139,19 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt64uNotDefaultValue_46() + CHIP_ERROR TestReadAttributeEnum16NotDefaultValue_76() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT64U Not Default Value Error: %@", err); + [cluster readAttributeEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute ENUM16 Not Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("int64u", value, readAttributeInt64uDefaultValue)); + VerifyOrReturn(CheckConstraintNotValue("enum16", value, readAttributeEnum16DefaultValue)); } NextTest(); @@ -62381,17 +70160,17 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt64uDefaultValue_47() + CHIP_ERROR TestWriteAttributeEnum16DefaultValue_77() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int64uArgument; - int64uArgument = [readAttributeInt64uDefaultValue copy]; - [cluster writeAttributeInt64uWithValue:int64uArgument + id enum16Argument; + enum16Argument = [readAttributeEnum16DefaultValue copy]; + [cluster writeAttributeEnum16WithValue:enum16Argument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT64U Default Value Error: %@", err); + NSLog(@"Write attribute ENUM16 Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -62401,20 +70180,20 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt64uDefaultValue_48() + CHIP_ERROR TestReadAttributeEnum16DefaultValue_78() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT64U Default Value Error: %@", err); + [cluster readAttributeEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute ENUM16 Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int64u", actualValue, readAttributeInt64uDefaultValue)); + VerifyOrReturn(CheckValue("enum16", actualValue, readAttributeEnum16DefaultValue)); } NextTest(); @@ -62422,25 +70201,25 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull readAttributeInt8sDefaultValue; + NSNumber * _Nonnull readAttributeEpochUSDefaultValue; - CHIP_ERROR TestReadAttributeInt8sDefaultValue_49() + CHIP_ERROR TestReadAttributeEpochUsDefaultValue_79() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT8S Default Value Error: %@", err); + [cluster readAttributeEpochUsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute EPOCH_US Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int8s", actualValue, 0)); + VerifyOrReturn(CheckValue("epoch_us", actualValue, 0ULL)); } { - readAttributeInt8sDefaultValue = value; + readAttributeEpochUSDefaultValue = value; } NextTest(); @@ -62449,39 +70228,39 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt8sNotDefaultValue_50() + CHIP_ERROR TestWriteAttributeEpochUsNotDefaultValue_80() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int8sArgument; - int8sArgument = [NSNumber numberWithChar:1]; - [cluster writeAttributeInt8sWithValue:int8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT8S Not Default Value Error: %@", err); + id epochUsArgument; + epochUsArgument = [NSNumber numberWithUnsignedLongLong:1ULL]; + [cluster writeAttributeEpochUsWithValue:epochUsArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute EPOCH_US Not Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt8sNotDefaultValue_51() + CHIP_ERROR TestReadAttributeEpochUsNotDefaultValue_81() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT8S Not Default Value Error: %@", err); + [cluster readAttributeEpochUsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute EPOCH_US Not Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("int8s", value, readAttributeInt8sDefaultValue)); + VerifyOrReturn(CheckConstraintNotValue("epochUs", value, readAttributeEpochUSDefaultValue)); } NextTest(); @@ -62490,40 +70269,40 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt8sDefaultValue_52() + CHIP_ERROR TestWriteAttributeEpochUsDefaultValue_82() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int8sArgument; - int8sArgument = [readAttributeInt8sDefaultValue copy]; - [cluster writeAttributeInt8sWithValue:int8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT8S Default Value Error: %@", err); + id epochUsArgument; + epochUsArgument = [readAttributeEpochUSDefaultValue copy]; + [cluster writeAttributeEpochUsWithValue:epochUsArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute EPOCH_US Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt8sDefaultValue_53() + CHIP_ERROR TestReadAttributeEpochUsDefaultValue_83() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT8S Default Value Error: %@", err); + [cluster readAttributeEpochUsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute EPOCH_US Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int8s", actualValue, readAttributeInt8sDefaultValue)); + VerifyOrReturn(CheckValue("epoch_us", actualValue, readAttributeEpochUSDefaultValue)); } NextTest(); @@ -62531,25 +70310,25 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull readAttributeInt16sDefaultValue; + NSNumber * _Nonnull readAttributeEpochSDefaultValue; - CHIP_ERROR TestReadAttributeInt16sDefaultValue_54() + CHIP_ERROR TestReadAttributeEpochSDefaultValue_84() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT16S Default Value Error: %@", err); + [cluster readAttributeEpochSWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute EPOCH_S Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int16s", actualValue, 0)); + VerifyOrReturn(CheckValue("epoch_s", actualValue, 0UL)); } { - readAttributeInt16sDefaultValue = value; + readAttributeEpochSDefaultValue = value; } NextTest(); @@ -62558,17 +70337,17 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt16sNotDefaultValue_55() + CHIP_ERROR TestWriteAttributeEpochSNotDefaultValue_85() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int16sArgument; - int16sArgument = [NSNumber numberWithShort:1]; - [cluster writeAttributeInt16sWithValue:int16sArgument + id epochSArgument; + epochSArgument = [NSNumber numberWithUnsignedInt:1UL]; + [cluster writeAttributeEpochSWithValue:epochSArgument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT16S Not Default Value Error: %@", err); + NSLog(@"Write attribute EPOCH_S Not Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -62578,19 +70357,19 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt16sNotDefaultValue_56() + CHIP_ERROR TestReadAttributeEpochSNotDefaultValue_86() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT16S Not Default Value Error: %@", err); + [cluster readAttributeEpochSWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute EPOCH_S Not Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("int16s", value, readAttributeInt16sDefaultValue)); + VerifyOrReturn(CheckConstraintNotValue("epochS", value, readAttributeEpochSDefaultValue)); } NextTest(); @@ -62599,17 +70378,17 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt16sDefaultValue_57() + CHIP_ERROR TestWriteAttributeEpochSDefaultValue_87() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int16sArgument; - int16sArgument = [readAttributeInt16sDefaultValue copy]; - [cluster writeAttributeInt16sWithValue:int16sArgument + id epochSArgument; + epochSArgument = [readAttributeEpochSDefaultValue copy]; + [cluster writeAttributeEpochSWithValue:epochSArgument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT16S Default Value Error: %@", err); + NSLog(@"Write attribute EPOCH_S Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -62619,20 +70398,20 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt16sDefaultValue_58() + CHIP_ERROR TestReadAttributeEpochSDefaultValue_88() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT16S Default Value Error: %@", err); + [cluster readAttributeEpochSWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute EPOCH_S Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int16s", actualValue, readAttributeInt16sDefaultValue)); + VerifyOrReturn(CheckValue("epoch_s", actualValue, readAttributeEpochSDefaultValue)); } NextTest(); @@ -62640,25 +70419,25 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull readAttributeInt32sDefaultValue; + NSNumber * _Nonnull readAttributeVendorIdDefaultValue; - CHIP_ERROR TestReadAttributeInt32sDefaultValue_59() + CHIP_ERROR TestReadAttributeVendorIdDefaultValue_89() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT32S Default Value Error: %@", err); + [cluster readAttributeVendorIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute vendor_id Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int32s", actualValue, 0L)); + VerifyOrReturn(CheckValue("vendor_id", actualValue, 0U)); } { - readAttributeInt32sDefaultValue = value; + readAttributeVendorIdDefaultValue = value; } NextTest(); @@ -62667,39 +70446,39 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt32sNotDefaultValue_60() + CHIP_ERROR TestWriteAttributeVendorIdNotDefaultValue_90() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int32sArgument; - int32sArgument = [NSNumber numberWithInt:1L]; - [cluster writeAttributeInt32sWithValue:int32sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT32S Not Default Value Error: %@", err); + id vendorIdArgument; + vendorIdArgument = [NSNumber numberWithUnsignedShort:1U]; + [cluster writeAttributeVendorIdWithValue:vendorIdArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute vendor_id Not Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt32sNotDefaultValue_61() + CHIP_ERROR TestReadAttributeVendorIdNotDefaultValue_91() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT32S Not Default Value Error: %@", err); + [cluster readAttributeVendorIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute vendor_id Not Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("int32s", value, readAttributeInt32sDefaultValue)); + VerifyOrReturn(CheckConstraintNotValue("vendorId", value, readAttributeVendorIdDefaultValue)); } NextTest(); @@ -62708,40 +70487,40 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt32sDefaultValue_62() + CHIP_ERROR TestWriteAttributeVendorIdDefaultValue_92() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int32sArgument; - int32sArgument = [readAttributeInt32sDefaultValue copy]; - [cluster writeAttributeInt32sWithValue:int32sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT32S Default Value Error: %@", err); + id vendorIdArgument; + vendorIdArgument = [readAttributeVendorIdDefaultValue copy]; + [cluster writeAttributeVendorIdWithValue:vendorIdArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute vendor_id Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt32sDefaultValue_63() + CHIP_ERROR TestReadAttributeVendorIdDefaultValue_93() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT32S Default Value Error: %@", err); + [cluster readAttributeVendorIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute vendor_id Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int32s", actualValue, readAttributeInt32sDefaultValue)); + VerifyOrReturn(CheckValue("vendor_id", actualValue, readAttributeVendorIdDefaultValue)); } NextTest(); @@ -62749,25 +70528,25 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull readAttributeInt64sDefaultValue; + NSString * _Nonnull readAttributeCharStringDefaultValue; - CHIP_ERROR TestReadAttributeInt64sDefaultValue_64() + CHIP_ERROR TestReadAttributeCharStringDefaultValue_94() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT64S Default Value Error: %@", err); + [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute char_string Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int64s", actualValue, 0LL)); + VerifyOrReturn(CheckValueAsString("char_string", actualValue, @"")); } { - readAttributeInt64sDefaultValue = value; + readAttributeCharStringDefaultValue = value; } NextTest(); @@ -62776,39 +70555,20 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeIntsNotDefaultValue_65() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id int64sArgument; - int64sArgument = [NSNumber numberWithLongLong:1LL]; - [cluster writeAttributeInt64sWithValue:int64sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INTS Not Default Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadAttributeInt64sNotDefaultValue_66() + CHIP_ERROR TestReadAttributeCharStringDefaultValueAndCompareToSavedValue_95() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT64S Not Default Value Error: %@", err); + [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute char_string Default Value and compare to saved value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("int64s", value, readAttributeInt64sDefaultValue)); + { + id actualValue = value; + VerifyOrReturn(CheckValueAsString("char_string", actualValue, readAttributeCharStringDefaultValue)); } NextTest(); @@ -62817,40 +70577,48 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt64sDefaultValue_67() + CHIP_ERROR TestWriteAttributeCharStringNotDefaultValue_96() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int64sArgument; - int64sArgument = [readAttributeInt64sDefaultValue copy]; - [cluster writeAttributeInt64sWithValue:int64sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT64S Default Value Error: %@", err); + id charStringArgument; + charStringArgument = @"NotDefault"; + [cluster writeAttributeCharStringWithValue:charStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute char_string Not Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } + NSString * _Nonnull readAttributeCharStringNotDefaultValue; - CHIP_ERROR TestReadAttributeInt64sDefaultValue_68() + CHIP_ERROR TestReadAttributeCharStringNotDefaultValue_97() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT64S Default Value Error: %@", err); + [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute char_string Not Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int64s", actualValue, readAttributeInt64sDefaultValue)); + VerifyOrReturn(CheckValueAsString("char_string", actualValue, @"NotDefault")); + } + + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("charString", value, readAttributeCharStringDefaultValue)); + } + { + readAttributeCharStringNotDefaultValue = value; } NextTest(); @@ -62858,25 +70626,25 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull readAttributeEnum8DefaultValue; - CHIP_ERROR TestReadAttributeEnum8DefaultValue_69() + CHIP_ERROR TestReadAttributeCharStringNotDefaultValueAndCompareToSavedValue_98() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute ENUM8 Default Value Error: %@", err); + [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute char_string Not Default Value and compare to saved value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("enum8", actualValue, 0)); + VerifyOrReturn(CheckValueAsString("char_string", actualValue, readAttributeCharStringNotDefaultValue)); } - { - readAttributeEnum8DefaultValue = value; + + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("charString", value, readAttributeCharStringDefaultValue)); } NextTest(); @@ -62885,39 +70653,40 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeEnum8NotDefaultValue_70() + CHIP_ERROR TestWriteAttributeCharStringNotDefaultValueFromSavedValue_99() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id enum8Argument; - enum8Argument = [NSNumber numberWithUnsignedChar:1]; - [cluster writeAttributeEnum8WithValue:enum8Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute ENUM8 Not Default Value Error: %@", err); + id charStringArgument; + charStringArgument = [readAttributeCharStringNotDefaultValue copy]; + [cluster writeAttributeCharStringWithValue:charStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute char_string Not Default Value from saved value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeEnum8NotDefaultValue_71() + CHIP_ERROR TestReadAttributeCharStringNotDefaultValueAndCompareToExpectedValue_100() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute ENUM8 Not Default Value Error: %@", err); + [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute char_string Not Default Value and compare to expected value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("enum8", value, readAttributeEnum8DefaultValue)); + { + id actualValue = value; + VerifyOrReturn(CheckValueAsString("char_string", actualValue, @"NotDefault")); } NextTest(); @@ -62926,66 +70695,44 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeEnum8DefaultValue_72() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id enum8Argument; - enum8Argument = [readAttributeEnum8DefaultValue copy]; - [cluster writeAttributeEnum8WithValue:enum8Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute ENUM8 Default Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadAttributeEnum8DefaultValue_73() + CHIP_ERROR TestWriteAttributeCharStringDefaultValue_101() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute ENUM8 Default Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id charStringArgument; + charStringArgument = [readAttributeCharStringDefaultValue copy]; + [cluster writeAttributeCharStringWithValue:charStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute char_string Default Value Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("enum8", actualValue, readAttributeEnum8DefaultValue)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - NSNumber * _Nonnull readAttributeEnum16DefaultValue; + NSData * _Nonnull readAttributeOctetStringDefaultValue; - CHIP_ERROR TestReadAttributeEnum16DefaultValue_74() + CHIP_ERROR TestReadAttributeOctetStringDefaultValue_102() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute ENUM16 Default Value Error: %@", err); + [cluster readAttributeOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute octet_string Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("enum16", actualValue, 0U)); + VerifyOrReturn(CheckValueAsString("octet_string", actualValue, [[NSData alloc] initWithBytes:"" length:0])); } { - readAttributeEnum16DefaultValue = value; + readAttributeOctetStringDefaultValue = value; } NextTest(); @@ -62994,39 +70741,20 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeEnum16NotDefaultValue_75() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id enum16Argument; - enum16Argument = [NSNumber numberWithUnsignedShort:1U]; - [cluster writeAttributeEnum16WithValue:enum16Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute ENUM16 Not Default Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadAttributeEnum16NotDefaultValue_76() + CHIP_ERROR TestReadAttributeOctetStringDefaultValueAndCompareToSavedValue_103() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute ENUM16 Not Default Value Error: %@", err); + [cluster readAttributeOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute octet_string Default Value and compare to saved value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("enum16", value, readAttributeEnum16DefaultValue)); + { + id actualValue = value; + VerifyOrReturn(CheckValueAsString("octet_string", actualValue, readAttributeOctetStringDefaultValue)); } NextTest(); @@ -63035,40 +70763,49 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeEnum16DefaultValue_77() + CHIP_ERROR TestWriteAttributeOctetStringNotDefaultValue_104() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id enum16Argument; - enum16Argument = [readAttributeEnum16DefaultValue copy]; - [cluster writeAttributeEnum16WithValue:enum16Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute ENUM16 Default Value Error: %@", err); + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - VerifyOrReturn(CheckValue("status", err, 0)); + id octetStringArgument; + octetStringArgument = [[NSData alloc] initWithBytes:"NotDefault" length:10]; + [cluster writeAttributeOctetStringWithValue:octetStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute octet_string Not Default Value Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } + NSData * _Nonnull readAttributeOctetStringNotDefaultValue; - CHIP_ERROR TestReadAttributeEnum16DefaultValue_78() + CHIP_ERROR TestReadAttributeOctetStringNotDefaultValue_105() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute ENUM16 Default Value Error: %@", err); + [cluster readAttributeOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute octet_string Not Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("enum16", actualValue, readAttributeEnum16DefaultValue)); + VerifyOrReturn( + CheckValueAsString("octet_string", actualValue, [[NSData alloc] initWithBytes:"NotDefault" length:10])); + } + + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("octetString", value, readAttributeOctetStringDefaultValue)); + } + { + readAttributeOctetStringNotDefaultValue = value; } NextTest(); @@ -63076,25 +70813,25 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull readAttributeEpochUSDefaultValue; - CHIP_ERROR TestReadAttributeEpochUsDefaultValue_79() + CHIP_ERROR TestReadAttributeOctetStringNotDefaultValueAndCompareToSavedValue_106() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEpochUsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute EPOCH_US Default Value Error: %@", err); + [cluster readAttributeOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute octet_string Not Default Value and compare to saved value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("epoch_us", actualValue, 0ULL)); + VerifyOrReturn(CheckValueAsString("octet_string", actualValue, readAttributeOctetStringNotDefaultValue)); } - { - readAttributeEpochUSDefaultValue = value; + + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("octetString", value, readAttributeOctetStringDefaultValue)); } NextTest(); @@ -63103,39 +70840,41 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeEpochUsNotDefaultValue_80() + CHIP_ERROR TestWriteAttributeOctetStringNotDefaultValueFromSavedValue_107() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id epochUsArgument; - epochUsArgument = [NSNumber numberWithUnsignedLongLong:1ULL]; - [cluster writeAttributeEpochUsWithValue:epochUsArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute EPOCH_US Not Default Value Error: %@", err); + id octetStringArgument; + octetStringArgument = [readAttributeOctetStringNotDefaultValue copy]; + [cluster writeAttributeOctetStringWithValue:octetStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute octet_string Not Default Value from saved value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeEpochUsNotDefaultValue_81() + CHIP_ERROR TestReadAttributeOctetStringNotDefaultValueAndCompareToExpectedValue_108() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEpochUsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute EPOCH_US Not Default Value Error: %@", err); + [cluster readAttributeOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute octet_string Not Default Value and compare to expected value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("epochUs", value, readAttributeEpochUSDefaultValue)); + { + id actualValue = value; + VerifyOrReturn( + CheckValueAsString("octet_string", actualValue, [[NSData alloc] initWithBytes:"NotDefault" length:10])); } NextTest(); @@ -63144,40 +70883,129 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeEpochUsDefaultValue_82() + CHIP_ERROR TestWriteAttributeOctetStringDefaultValue_109() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id epochUsArgument; - epochUsArgument = [readAttributeEpochUSDefaultValue copy]; - [cluster writeAttributeEpochUsWithValue:epochUsArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute EPOCH_US Default Value Error: %@", err); + id octetStringArgument; + octetStringArgument = [readAttributeOctetStringDefaultValue copy]; + [cluster writeAttributeOctetStringWithValue:octetStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute octet_string Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } +}; - CHIP_ERROR TestReadAttributeEpochUsDefaultValue_83() +class TestDescriptorCluster : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + TestDescriptorCluster() + : TestCommandBridge("TestDescriptorCluster") + , 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) + + ~TestDescriptorCluster() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: TestDescriptorCluster\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: TestDescriptorCluster\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 : Read attribute Device list\n"); + err = TestReadAttributeDeviceList_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read attribute Server list\n"); + err = TestReadAttributeServerList_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Read attribute Client list\n"); + err = TestReadAttributeClientList_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Read attribute Parts list\n"); + err = TestReadAttributePartsList_4(); + 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 = 5; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeDeviceList_1() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestDescriptor * cluster = [[CHIPTestDescriptor alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEpochUsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute EPOCH_US Default Value Error: %@", err); + [cluster readAttributeDeviceListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute Device list Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("epoch_us", actualValue, readAttributeEpochUSDefaultValue)); + VerifyOrReturn(CheckValue("device list", [actualValue count], static_cast(1))); + VerifyOrReturn(CheckValue("type", ((CHIPDescriptorClusterDeviceType *) actualValue[0]).type, 22UL)); + VerifyOrReturn(CheckValue("revision", ((CHIPDescriptorClusterDeviceType *) actualValue[0]).revision, 1U)); } NextTest(); @@ -63185,25 +71013,46 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull readAttributeEpochSDefaultValue; - CHIP_ERROR TestReadAttributeEpochSDefaultValue_84() + CHIP_ERROR TestReadAttributeServerList_2() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestDescriptor * cluster = [[CHIPTestDescriptor alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEpochSWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute EPOCH_S Default Value Error: %@", err); + [cluster readAttributeServerListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute Server list Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("epoch_s", actualValue, 0UL)); - } - { - readAttributeEpochSDefaultValue = value; + VerifyOrReturn(CheckValue("server list", [actualValue count], static_cast(25))); + VerifyOrReturn(CheckValue("", actualValue[0], 3UL)); + VerifyOrReturn(CheckValue("", actualValue[1], 4UL)); + VerifyOrReturn(CheckValue("", actualValue[2], 29UL)); + VerifyOrReturn(CheckValue("", actualValue[3], 30UL)); + VerifyOrReturn(CheckValue("", actualValue[4], 31UL)); + VerifyOrReturn(CheckValue("", actualValue[5], 40UL)); + VerifyOrReturn(CheckValue("", actualValue[6], 42UL)); + VerifyOrReturn(CheckValue("", actualValue[7], 43UL)); + VerifyOrReturn(CheckValue("", actualValue[8], 44UL)); + VerifyOrReturn(CheckValue("", actualValue[9], 45UL)); + VerifyOrReturn(CheckValue("", actualValue[10], 46UL)); + VerifyOrReturn(CheckValue("", actualValue[11], 48UL)); + VerifyOrReturn(CheckValue("", actualValue[12], 49UL)); + VerifyOrReturn(CheckValue("", actualValue[13], 50UL)); + VerifyOrReturn(CheckValue("", actualValue[14], 51UL)); + VerifyOrReturn(CheckValue("", actualValue[15], 52UL)); + VerifyOrReturn(CheckValue("", actualValue[16], 53UL)); + VerifyOrReturn(CheckValue("", actualValue[17], 54UL)); + VerifyOrReturn(CheckValue("", actualValue[18], 55UL)); + VerifyOrReturn(CheckValue("", actualValue[19], 60UL)); + VerifyOrReturn(CheckValue("", actualValue[20], 62UL)); + VerifyOrReturn(CheckValue("", actualValue[21], 63UL)); + VerifyOrReturn(CheckValue("", actualValue[22], 64UL)); + VerifyOrReturn(CheckValue("", actualValue[23], 65UL)); + VerifyOrReturn(CheckValue("", actualValue[24], 1029UL)); } NextTest(); @@ -63212,39 +71061,45 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeEpochSNotDefaultValue_85() + CHIP_ERROR TestReadAttributeClientList_3() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestDescriptor * cluster = [[CHIPTestDescriptor alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id epochSArgument; - epochSArgument = [NSNumber numberWithUnsignedInt:1UL]; - [cluster writeAttributeEpochSWithValue:epochSArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute EPOCH_S Not Default Value Error: %@", err); + [cluster readAttributeClientListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute Client list Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValue("client list", [actualValue count], static_cast(1))); + VerifyOrReturn(CheckValue("", actualValue[0], 41UL)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeEpochSNotDefaultValue_86() + CHIP_ERROR TestReadAttributePartsList_4() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestDescriptor * cluster = [[CHIPTestDescriptor alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEpochSWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute EPOCH_S Not Default Value Error: %@", err); + [cluster readAttributePartsListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute Parts list Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("epochS", value, readAttributeEpochSDefaultValue)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("parts list", [actualValue count], static_cast(2))); + VerifyOrReturn(CheckValue("", actualValue[0], 1U)); + VerifyOrReturn(CheckValue("", actualValue[1], 2U)); } NextTest(); @@ -63252,67 +71107,160 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } +}; - CHIP_ERROR TestWriteAttributeEpochSDefaultValue_87() +class TestBasicInformation : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + TestBasicInformation() + : TestCommandBridge("TestBasicInformation") + , mTestIndex(0) { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + 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) - id epochSArgument; - epochSArgument = [readAttributeEpochSDefaultValue copy]; - [cluster writeAttributeEpochSWithValue:epochSArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute EPOCH_S Default Value Error: %@", err); + ~TestBasicInformation() {} - VerifyOrReturn(CheckValue("status", err, 0)); + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; - NextTest(); - }]; + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: TestBasicInformation\n"); + } - return CHIP_NO_ERROR; - } + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: TestBasicInformation\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } - CHIP_ERROR TestReadAttributeEpochSDefaultValue_88() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + Wait(); - [cluster readAttributeEpochSWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute EPOCH_S Default Value Error: %@", err); + // 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 : Read location\n"); + err = TestReadLocation_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Write location\n"); + err = TestWriteLocation_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Read back location\n"); + err = TestReadBackLocation_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Restore initial location value\n"); + err = TestRestoreInitialLocationValue_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read AttributeList value\n"); + err = TestReadAttributeListValue_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Read NodeLabel\n"); + err = TestReadNodeLabel_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Write NodeLabel\n"); + err = TestWriteNodeLabel_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Read back NodeLabel\n"); + err = TestReadBackNodeLabel_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Read LocalConfigDisabled\n"); + err = TestReadLocalConfigDisabled_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Write LocalConfigDisabled\n"); + err = TestWriteLocalConfigDisabled_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Read back LocalConfigDisabled\n"); + err = TestReadBackLocalConfigDisabled_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Reboot the device\n"); + err = TestRebootTheDevice_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : Connect to the device again\n"); + err = TestConnectToTheDeviceAgain_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Read back NodeLabel after reboot\n"); + err = TestReadBackNodeLabelAfterReboot_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Restore initial NodeLabel value\n"); + err = TestRestoreInitialNodeLabelValue_15(); + break; + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : Read back LocalConfigDisabled after reboot\n"); + err = TestReadBackLocalConfigDisabledAfterReboot_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : Restore initial LocalConfigDisabled value\n"); + err = TestRestoreInitialLocalConfigDisabledValue_17(); + break; + } - VerifyOrReturn(CheckValue("status", err, 0)); + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } - { - id actualValue = value; - VerifyOrReturn(CheckValue("epoch_s", actualValue, readAttributeEpochSDefaultValue)); - } + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } - NextTest(); - }]; +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 18; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - NSNumber * _Nonnull readAttributeVendorIdDefaultValue; - CHIP_ERROR TestReadAttributeVendorIdDefaultValue_89() + CHIP_ERROR TestReadLocation_1() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeVendorIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute vendor_id Default Value Error: %@", err); + [cluster readAttributeLocationWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read location Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("vendor_id", actualValue, 0U)); - } - { - readAttributeVendorIdDefaultValue = value; + VerifyOrReturn(CheckValueAsString("Location", actualValue, @"XX")); } NextTest(); @@ -63321,17 +71269,17 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeVendorIdNotDefaultValue_90() + CHIP_ERROR TestWriteLocation_2() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id vendorIdArgument; - vendorIdArgument = [NSNumber numberWithUnsignedShort:1U]; - [cluster writeAttributeVendorIdWithValue:vendorIdArgument + id locationArgument; + locationArgument = @"US"; + [cluster writeAttributeLocationWithValue:locationArgument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute vendor_id Not Default Value Error: %@", err); + NSLog(@"Write location Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -63341,19 +71289,20 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeVendorIdNotDefaultValue_91() + CHIP_ERROR TestReadBackLocation_3() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeVendorIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute vendor_id Not Default Value Error: %@", err); + [cluster readAttributeLocationWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read back location Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("vendorId", value, readAttributeVendorIdDefaultValue)); + { + id actualValue = value; + VerifyOrReturn(CheckValueAsString("Location", actualValue, @"US")); } NextTest(); @@ -63362,17 +71311,17 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeVendorIdDefaultValue_92() + CHIP_ERROR TestRestoreInitialLocationValue_4() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id vendorIdArgument; - vendorIdArgument = [readAttributeVendorIdDefaultValue copy]; - [cluster writeAttributeVendorIdWithValue:vendorIdArgument + id locationArgument; + locationArgument = @"XX"; + [cluster writeAttributeLocationWithValue:locationArgument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute vendor_id Default Value Error: %@", err); + NSLog(@"Restore initial location value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -63382,20 +71331,44 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeVendorIdDefaultValue_93() + CHIP_ERROR TestReadAttributeListValue_5() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeVendorIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute vendor_id Default Value Error: %@", err); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read AttributeList value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("vendor_id", actualValue, readAttributeVendorIdDefaultValue)); + VerifyOrReturn(CheckValue("AttributeList", [actualValue count], static_cast(24))); + VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); + VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); + VerifyOrReturn(CheckValue("", actualValue[2], 2UL)); + VerifyOrReturn(CheckValue("", actualValue[3], 3UL)); + VerifyOrReturn(CheckValue("", actualValue[4], 4UL)); + VerifyOrReturn(CheckValue("", actualValue[5], 5UL)); + VerifyOrReturn(CheckValue("", actualValue[6], 6UL)); + VerifyOrReturn(CheckValue("", actualValue[7], 7UL)); + VerifyOrReturn(CheckValue("", actualValue[8], 8UL)); + VerifyOrReturn(CheckValue("", actualValue[9], 9UL)); + VerifyOrReturn(CheckValue("", actualValue[10], 10UL)); + VerifyOrReturn(CheckValue("", actualValue[11], 11UL)); + VerifyOrReturn(CheckValue("", actualValue[12], 12UL)); + VerifyOrReturn(CheckValue("", actualValue[13], 13UL)); + VerifyOrReturn(CheckValue("", actualValue[14], 14UL)); + VerifyOrReturn(CheckValue("", actualValue[15], 15UL)); + VerifyOrReturn(CheckValue("", actualValue[16], 16UL)); + VerifyOrReturn(CheckValue("", actualValue[17], 17UL)); + VerifyOrReturn(CheckValue("", actualValue[18], 18UL)); + VerifyOrReturn(CheckValue("", actualValue[19], 19UL)); + VerifyOrReturn(CheckValue("", actualValue[20], 65528UL)); + VerifyOrReturn(CheckValue("", actualValue[21], 65529UL)); + VerifyOrReturn(CheckValue("", actualValue[22], 65531UL)); + VerifyOrReturn(CheckValue("", actualValue[23], 65533UL)); } NextTest(); @@ -63403,25 +71376,63 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - NSString * _Nonnull readAttributeCharStringDefaultValue; - CHIP_ERROR TestReadAttributeCharStringDefaultValue_94() + CHIP_ERROR TestReadNodeLabel_6() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute char_string Default Value Error: %@", err); + [cluster readAttributeNodeLabelWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read NodeLabel Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueAsString("char_string", actualValue, @"")); + VerifyOrReturn(CheckValueAsString("NodeLabel", actualValue, @"")); } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteNodeLabel_7() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id nodeLabelArgument; + nodeLabelArgument = @"My node"; + [cluster writeAttributeNodeLabelWithValue:nodeLabelArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write NodeLabel Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadBackNodeLabel_8() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeNodeLabelWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read back NodeLabel Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + { - readAttributeCharStringDefaultValue = value; + id actualValue = value; + VerifyOrReturn(CheckValueAsString("NodeLabel", actualValue, @"My node")); } NextTest(); @@ -63430,20 +71441,20 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeCharStringDefaultValueAndCompareToSavedValue_95() + CHIP_ERROR TestReadLocalConfigDisabled_9() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute char_string Default Value and compare to saved value Error: %@", err); + [cluster readAttributeLocalConfigDisabledWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read LocalConfigDisabled Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueAsString("char_string", actualValue, readAttributeCharStringDefaultValue)); + VerifyOrReturn(CheckValue("LocalConfigDisabled", actualValue, false)); } NextTest(); @@ -63452,48 +71463,40 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeCharStringNotDefaultValue_96() + CHIP_ERROR TestWriteLocalConfigDisabled_10() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id charStringArgument; - charStringArgument = @"NotDefault"; - [cluster writeAttributeCharStringWithValue:charStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute char_string Not Default Value Error: %@", err); + id localConfigDisabledArgument; + localConfigDisabledArgument = [NSNumber numberWithBool:true]; + [cluster writeAttributeLocalConfigDisabledWithValue:localConfigDisabledArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write LocalConfigDisabled Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - NSString * _Nonnull readAttributeCharStringNotDefaultValue; - CHIP_ERROR TestReadAttributeCharStringNotDefaultValue_97() + CHIP_ERROR TestReadBackLocalConfigDisabled_11() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute char_string Not Default Value Error: %@", err); + [cluster readAttributeLocalConfigDisabledWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read back LocalConfigDisabled Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValueAsString("char_string", actualValue, @"NotDefault")); - } - - if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("charString", value, readAttributeCharStringDefaultValue)); - } + { - readAttributeCharStringNotDefaultValue = value; + id actualValue = value; + VerifyOrReturn(CheckValue("LocalConfigDisabled", actualValue, true)); } NextTest(); @@ -63502,24 +71505,32 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeCharStringNotDefaultValueAndCompareToSavedValue_98() + CHIP_ERROR TestRebootTheDevice_12() + { + Reboot(); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestConnectToTheDeviceAgain_13() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadBackNodeLabelAfterReboot_14() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute char_string Not Default Value and compare to saved value Error: %@", err); + [cluster readAttributeNodeLabelWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read back NodeLabel after reboot Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueAsString("char_string", actualValue, readAttributeCharStringNotDefaultValue)); - } - - if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("charString", value, readAttributeCharStringDefaultValue)); + VerifyOrReturn(CheckValueAsString("NodeLabel", actualValue, @"My node")); } NextTest(); @@ -63528,40 +71539,40 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeCharStringNotDefaultValueFromSavedValue_99() + CHIP_ERROR TestRestoreInitialNodeLabelValue_15() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id charStringArgument; - charStringArgument = [readAttributeCharStringNotDefaultValue copy]; - [cluster writeAttributeCharStringWithValue:charStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute char_string Not Default Value from saved value Error: %@", err); + id nodeLabelArgument; + nodeLabelArgument = @""; + [cluster writeAttributeNodeLabelWithValue:nodeLabelArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Restore initial NodeLabel value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeCharStringNotDefaultValueAndCompareToExpectedValue_100() + CHIP_ERROR TestReadBackLocalConfigDisabledAfterReboot_16() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute char_string Not Default Value and compare to expected value Error: %@", err); + [cluster readAttributeLocalConfigDisabledWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read back LocalConfigDisabled after reboot Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueAsString("char_string", actualValue, @"NotDefault")); + VerifyOrReturn(CheckValue("LocalConfigDisabled", actualValue, true)); } NextTest(); @@ -63570,66 +71581,236 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeCharStringDefaultValue_101() + CHIP_ERROR TestRestoreInitialLocalConfigDisabledValue_17() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id charStringArgument; - charStringArgument = [readAttributeCharStringDefaultValue copy]; - [cluster writeAttributeCharStringWithValue:charStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute char_string Default Value Error: %@", err); + id localConfigDisabledArgument; + localConfigDisabledArgument = [NSNumber numberWithBool:false]; + [cluster writeAttributeLocalConfigDisabledWithValue:localConfigDisabledArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Restore initial LocalConfigDisabled value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - NSData * _Nonnull readAttributeOctetStringDefaultValue; +}; - CHIP_ERROR TestReadAttributeOctetStringDefaultValue_102() +class TestIdentifyCluster : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + TestIdentifyCluster() + : TestCommandBridge("TestIdentifyCluster") + , 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) + + ~TestIdentifyCluster() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: TestIdentifyCluster\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: TestIdentifyCluster\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 : Send Identify command and expect success response\n"); + err = TestSendIdentifyCommandAndExpectSuccessResponse_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; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSendIdentifyCommandAndExpectSuccessResponse_1() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute octet_string Default Value Error: %@", err); + __auto_type * params = [[CHIPIdentifyClusterIdentifyParams alloc] init]; + params.identifyTime = [NSNumber numberWithUnsignedShort:0U]; + [cluster identifyWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Send Identify command and expect success response Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueAsString("octet_string", actualValue, [[NSData alloc] initWithBytes:"" length:0])); - } - { - readAttributeOctetStringDefaultValue = value; - } + NextTest(); + }]; - NextTest(); - }]; + return CHIP_NO_ERROR; + } +}; + +class TestOperationalCredentialsCluster : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + TestOperationalCredentialsCluster() + : TestCommandBridge("TestOperationalCredentialsCluster") + , 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) + + ~TestOperationalCredentialsCluster() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: TestOperationalCredentialsCluster\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: TestOperationalCredentialsCluster\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 : Read number of supported fabrics\n"); + err = TestReadNumberOfSupportedFabrics_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read number of commissioned fabrics\n"); + err = TestReadNumberOfCommissionedFabrics_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Read current fabric index\n"); + err = TestReadCurrentFabricIndex_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Remove nonexistent fabric\n"); + err = TestRemoveNonexistentFabric_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read fabric list before setting label\n"); + err = TestReadFabricListBeforeSettingLabel_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Set the fabric label\n"); + err = TestSetTheFabricLabel_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Read fabric list after setting label\n"); + err = TestReadFabricListAfterSettingLabel_7(); + 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 = 8; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeOctetStringDefaultValueAndCompareToSavedValue_103() + CHIP_ERROR TestReadNumberOfSupportedFabrics_1() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute octet_string Default Value and compare to saved value Error: %@", err); + [cluster readAttributeSupportedFabricsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read number of supported fabrics Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueAsString("octet_string", actualValue, readAttributeOctetStringDefaultValue)); + VerifyOrReturn(CheckConstraintType("supportedFabrics", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("supportedFabrics", [value unsignedCharValue], 4)); } NextTest(); @@ -63638,49 +71819,50 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeOctetStringNotDefaultValue_104() + CHIP_ERROR TestReadNumberOfCommissionedFabrics_2() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id octetStringArgument; - octetStringArgument = [[NSData alloc] initWithBytes:"NotDefault" length:10]; - [cluster writeAttributeOctetStringWithValue:octetStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute octet_string Not Default Value Error: %@", err); + [cluster readAttributeCommissionedFabricsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read number of commissioned fabrics Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("commissionedFabrics", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("commissionedFabrics", [value unsignedCharValue], 1)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - NSData * _Nonnull readAttributeOctetStringNotDefaultValue; + NSNumber * _Nonnull ourFabricIndex; - CHIP_ERROR TestReadAttributeOctetStringNotDefaultValue_105() + CHIP_ERROR TestReadCurrentFabricIndex_3() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute octet_string Not Default Value Error: %@", err); + [cluster readAttributeCurrentFabricIndexWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read current fabric index Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn( - CheckValueAsString("octet_string", actualValue, [[NSData alloc] initWithBytes:"NotDefault" length:10])); - } - + VerifyOrReturn(CheckConstraintType("currentFabricIndex", "", "uint8")); if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("octetString", value, readAttributeOctetStringDefaultValue)); + VerifyOrReturn(CheckConstraintMinValue("currentFabricIndex", [value unsignedCharValue], 1)); } { - readAttributeOctetStringNotDefaultValue = value; + ourFabricIndex = value; } NextTest(); @@ -63689,111 +71871,149 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeOctetStringNotDefaultValueAndCompareToSavedValue_106() + CHIP_ERROR TestRemoveNonexistentFabric_4() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute octet_string Not Default Value and compare to saved value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + __auto_type * params = [[CHIPOperationalCredentialsClusterRemoveFabricParams alloc] init]; + params.fabricIndex = [NSNumber numberWithUnsignedChar:243]; + [cluster removeFabricWithParams:params + completionHandler:^( + CHIPOperationalCredentialsClusterNOCResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Remove nonexistent fabric Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValueAsString("octet_string", actualValue, readAttributeOctetStringNotDefaultValue)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("octetString", value, readAttributeOctetStringDefaultValue)); - } + { + id actualValue = values.statusCode; + VerifyOrReturn(CheckValue("StatusCode", actualValue, 11)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeOctetStringNotDefaultValueFromSavedValue_107() + CHIP_ERROR TestReadFabricListBeforeSettingLabel_5() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id octetStringArgument; - octetStringArgument = [readAttributeOctetStringNotDefaultValue copy]; - [cluster writeAttributeOctetStringWithValue:octetStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute octet_string Not Default Value from saved value Error: %@", err); + CHIPReadParams * params = [[CHIPReadParams alloc] init]; + params.fabricFiltered = [NSNumber numberWithBool:true]; + [cluster readAttributeFabricsWithParams:params + completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read fabric list before setting label Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValue("Fabrics", [actualValue count], static_cast(1))); + VerifyOrReturn(CheckValueAsString("Label", + ((CHIPOperationalCredentialsClusterFabricDescriptor *) actualValue[0]).label, @"")); + VerifyOrReturn(CheckValue("FabricIndex", + ((CHIPOperationalCredentialsClusterFabricDescriptor *) actualValue[0]).fabricIndex, + ourFabricIndex)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeOctetStringNotDefaultValueAndCompareToExpectedValue_108() + CHIP_ERROR TestSetTheFabricLabel_6() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute octet_string Not Default Value and compare to expected value Error: %@", err); + __auto_type * params = [[CHIPOperationalCredentialsClusterUpdateFabricLabelParams alloc] init]; + params.label = @"Batcave"; + [cluster updateFabricLabelWithParams:params + completionHandler:^( + CHIPOperationalCredentialsClusterNOCResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Set the fabric label Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn( - CheckValueAsString("octet_string", actualValue, [[NSData alloc] initWithBytes:"NotDefault" length:10])); - } + { + id actualValue = values.statusCode; + VerifyOrReturn(CheckValue("StatusCode", actualValue, 0)); + } - NextTest(); - }]; + { + id actualValue = values.fabricIndex; + VerifyOrReturn(CheckValue("FabricIndex", actualValue, ourFabricIndex)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeOctetStringDefaultValue_109() + CHIP_ERROR TestReadFabricListAfterSettingLabel_7() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id octetStringArgument; - octetStringArgument = [readAttributeOctetStringDefaultValue copy]; - [cluster writeAttributeOctetStringWithValue:octetStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute octet_string Default Value Error: %@", err); + CHIPReadParams * params = [[CHIPReadParams alloc] init]; + params.fabricFiltered = [NSNumber numberWithBool:true]; + [cluster + readAttributeFabricsWithParams:params + completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read fabric list after setting label Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValue("Fabrics", [actualValue count], static_cast(1))); + VerifyOrReturn(CheckValueAsString("Label", + ((CHIPOperationalCredentialsClusterFabricDescriptor *) actualValue[0]).label, @"Batcave")); + VerifyOrReturn(CheckValue("FabricIndex", + ((CHIPOperationalCredentialsClusterFabricDescriptor *) actualValue[0]).fabricIndex, + ourFabricIndex)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } }; -class TestConstraints : public TestCommandBridge { +class TestModeSelectCluster : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - TestConstraints() - : TestCommandBridge("TestConstraints") + TestModeSelectCluster() + : TestCommandBridge("TestModeSelectCluster") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("discriminator", 0, UINT16_MAX, &mDiscriminator); AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~TestConstraints() {} + ~TestModeSelectCluster() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -63801,11 +72021,11 @@ class TestConstraints : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: TestConstraints\n"); + ChipLogProgress(chipTool, " **** Test Start: TestModeSelectCluster\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: TestConstraints\n"); + ChipLogProgress(chipTool, " **** Test Complete: TestModeSelectCluster\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -63822,91 +72042,129 @@ class TestConstraints : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Write attribute INT32U Value\n"); - err = TestWriteAttributeInt32uValue_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Read Description\n"); + err = TestReadDescription_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read attribute INT32U Value MinValue Constraints\n"); - err = TestReadAttributeInt32uValueMinValueConstraints_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Read StandardNamespace\n"); + err = TestReadStandardNamespace_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read attribute INT32U Value MaxValue Constraints\n"); - err = TestReadAttributeInt32uValueMaxValueConstraints_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Read SupportedModes\n"); + err = TestReadSupportedModes_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read attribute INT32U Value NotValue Constraints\n"); - err = TestReadAttributeInt32uValueNotValueConstraints_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Read CurrentMode\n"); + err = TestReadCurrentMode_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Write attribute INT32U Value Back to Default Value\n"); - err = TestWriteAttributeInt32uValueBackToDefaultValue_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Read StartUpMode\n"); + err = TestReadStartUpMode_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Write attribute CHAR_STRING Value\n"); - err = TestWriteAttributeCharStringValue_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : Read OnMode\n"); + err = TestReadOnMode_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Read attribute CHAR_STRING Value MinLength Constraints\n"); - err = TestReadAttributeCharStringValueMinLengthConstraints_7(); + ChipLogProgress(chipTool, " ***** Test Step 7 : Change to Supported Mode\n"); + err = TestChangeToSupportedMode_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Read attribute CHAR_STRING Value MaxLength Constraints\n"); - err = TestReadAttributeCharStringValueMaxLengthConstraints_8(); + ChipLogProgress(chipTool, " ***** Test Step 8 : Verify Current Mode Change\n"); + err = TestVerifyCurrentModeChange_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Read attribute CHAR_STRING Value StartsWith Constraints\n"); - err = TestReadAttributeCharStringValueStartsWithConstraints_9(); + ChipLogProgress(chipTool, " ***** Test Step 9 : Change to Unsupported Mode\n"); + err = TestChangeToUnsupportedMode_9(); break; case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Read attribute CHAR_STRING Value EndsWith Constraints\n"); - err = TestReadAttributeCharStringValueEndsWithConstraints_10(); + ChipLogProgress(chipTool, " ***** Test Step 10 : Toggle OnOff\n"); + err = TestToggleOnOff_10(); break; case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Write attribute CHAR_STRING Value\n"); - err = TestWriteAttributeCharStringValue_11(); + ChipLogProgress(chipTool, " ***** Test Step 11 : Toggle OnOff\n"); + err = TestToggleOnOff_11(); break; case 12: - ChipLogProgress( - chipTool, " ***** Test Step 12 : Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints\n"); - err = TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_12(); + ChipLogProgress(chipTool, " ***** Test Step 12 : Verify Current Mode does not change when OnMode is null\n"); + err = TestVerifyCurrentModeDoesNotChangeWhenOnModeIsNull_12(); break; case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Write attribute CHAR_STRING Value\n"); - err = TestWriteAttributeCharStringValue_13(); + ChipLogProgress(chipTool, " ***** Test Step 13 : Change to Unsupported OnMode\n"); + err = TestChangeToUnsupportedOnMode_13(); break; case 14: - ChipLogProgress( - chipTool, " ***** Test Step 14 : Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints\n"); - err = TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_14(); + ChipLogProgress(chipTool, " ***** Test Step 14 : Change OnMode\n"); + err = TestChangeOnMode_14(); break; case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Write attribute CHAR_STRING Value\n"); - err = TestWriteAttributeCharStringValue_15(); + ChipLogProgress(chipTool, " ***** Test Step 15 : Verify OnMode\n"); + err = TestVerifyOnMode_15(); + break; + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : Toggle OnOff\n"); + err = TestToggleOnOff_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : Toggle OnOff\n"); + err = TestToggleOnOff_17(); + break; + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : Verify Current Mode Changes if OnMode is not null\n"); + err = TestVerifyCurrentModeChangesIfOnModeIsNotNull_18(); + break; + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : Change to Unsupported StartUp Mode\n"); + err = TestChangeToUnsupportedStartUpMode_19(); + break; + case 20: + ChipLogProgress(chipTool, " ***** Test Step 20 : Change to Supported StartUp Mode\n"); + err = TestChangeToSupportedStartUpMode_20(); + break; + case 21: + ChipLogProgress(chipTool, " ***** Test Step 21 : Verify StartUp Mode Change\n"); + err = TestVerifyStartUpModeChange_21(); + break; + case 22: + ChipLogProgress(chipTool, " ***** Test Step 22 : Change CurrentMode to another value\n"); + err = TestChangeCurrentModeToAnotherValue_22(); + break; + case 23: + ChipLogProgress(chipTool, " ***** Test Step 23 : Change On Mode\n"); + err = TestChangeOnMode_23(); + break; + case 24: + ChipLogProgress(chipTool, " ***** Test Step 24 : Set StartUpOnOff\n"); + err = TestSetStartUpOnOff_24(); + break; + case 25: + ChipLogProgress(chipTool, " ***** Test Step 25 : Reboot target device\n"); + err = TestRebootTargetDevice_25(); + break; + case 26: + ChipLogProgress(chipTool, " ***** Test Step 26 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_26(); break; - case 16: + case 27: ChipLogProgress( - chipTool, " ***** Test Step 16 : Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints\n"); - err = TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_16(); - break; - case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : Write attribute CHAR_STRING Value\n"); - err = TestWriteAttributeCharStringValue_17(); + chipTool, " ***** Test Step 27 : Verify Current Mode Change based on OnMode, as it overwrites StartUpMode\n"); + err = TestVerifyCurrentModeChangeBasedOnOnModeAsItOverwritesStartUpMode_27(); break; - case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : Read attribute CHAR_STRING Value isHexString Constraints\n"); - err = TestReadAttributeCharStringValueIsHexStringConstraints_18(); + case 28: + ChipLogProgress(chipTool, " ***** Test Step 28 : Change On Mode to Null\n"); + err = TestChangeOnModeToNull_28(); break; - case 19: - ChipLogProgress(chipTool, " ***** Test Step 19 : Write attribute CHAR_STRING Value\n"); - err = TestWriteAttributeCharStringValue_19(); + case 29: + ChipLogProgress(chipTool, " ***** Test Step 29 : Reboot target device\n"); + err = TestRebootTargetDevice_29(); break; - case 20: - ChipLogProgress(chipTool, " ***** Test Step 20 : Read attribute CHAR_STRING Value isHexString Constraints\n"); - err = TestReadAttributeCharStringValueIsHexStringConstraints_20(); + case 30: + ChipLogProgress(chipTool, " ***** Test Step 30 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_30(); break; - case 21: - ChipLogProgress(chipTool, " ***** Test Step 21 : Write attribute CHAR_STRING Value Back to Default Value\n"); - err = TestWriteAttributeCharStringValueBackToDefaultValue_21(); + case 31: + ChipLogProgress(chipTool, " ***** Test Step 31 : Verify Current Mode Change based on new StartUp Mode\n"); + err = TestVerifyCurrentModeChangeBasedOnNewStartUpMode_31(); break; } @@ -63923,11 +72181,12 @@ class TestConstraints : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 22; + const uint16_t mTestCount = 32; chip::Optional mNodeId; chip::Optional mCluster; chip::Optional mEndpoint; + chip::Optional mDiscriminator; chip::Optional mTimeout; CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() @@ -63936,39 +72195,43 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt32uValue_1() + CHIP_ERROR TestReadDescription_1() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int32uArgument; - int32uArgument = [NSNumber numberWithUnsignedInt:5UL]; - [cluster writeAttributeInt32uWithValue:int32uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT32U Value Error: %@", err); + [cluster readAttributeDescriptionWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read Description Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValueAsString("Description", actualValue, @"Coffee")); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt32uValueMinValueConstraints_2() + CHIP_ERROR TestReadStandardNamespace_2() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT32U Value MinValue Constraints Error: %@", err); + [cluster readAttributeStandardNamespaceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read StandardNamespace Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("int32u", [value unsignedIntValue], 5UL)); + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("StandardNamespace", actualValue)); + VerifyOrReturn(CheckValue("StandardNamespace", actualValue, 0U)); } NextTest(); @@ -63977,19 +72240,35 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt32uValueMaxValueConstraints_3() + CHIP_ERROR TestReadSupportedModes_3() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT32U Value MaxValue Constraints Error: %@", err); + [cluster readAttributeSupportedModesWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read SupportedModes Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("int32u", [value unsignedIntValue], 5UL)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("SupportedModes", [actualValue count], static_cast(3))); + VerifyOrReturn( + CheckValueAsString("Label", ((CHIPModeSelectClusterModeOptionStruct *) actualValue[0]).label, @"Black")); + VerifyOrReturn(CheckValue("Mode", ((CHIPModeSelectClusterModeOptionStruct *) actualValue[0]).mode, 0)); + VerifyOrReturn( + CheckValue("SemanticTag", ((CHIPModeSelectClusterModeOptionStruct *) actualValue[0]).semanticTag, 0UL)); + VerifyOrReturn( + CheckValueAsString("Label", ((CHIPModeSelectClusterModeOptionStruct *) actualValue[1]).label, @"Cappuccino")); + VerifyOrReturn(CheckValue("Mode", ((CHIPModeSelectClusterModeOptionStruct *) actualValue[1]).mode, 4)); + VerifyOrReturn( + CheckValue("SemanticTag", ((CHIPModeSelectClusterModeOptionStruct *) actualValue[1]).semanticTag, 0UL)); + VerifyOrReturn( + CheckValueAsString("Label", ((CHIPModeSelectClusterModeOptionStruct *) actualValue[2]).label, @"Espresso")); + VerifyOrReturn(CheckValue("Mode", ((CHIPModeSelectClusterModeOptionStruct *) actualValue[2]).mode, 7)); + VerifyOrReturn( + CheckValue("SemanticTag", ((CHIPModeSelectClusterModeOptionStruct *) actualValue[2]).semanticTag, 0UL)); } NextTest(); @@ -63998,19 +72277,20 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt32uValueNotValueConstraints_4() + CHIP_ERROR TestReadCurrentMode_4() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT32U Value NotValue Constraints Error: %@", err); + [cluster readAttributeCurrentModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read CurrentMode Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("int32u", value, 6UL)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("CurrentMode", actualValue, 0)); } NextTest(); @@ -64019,337 +72299,510 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt32uValueBackToDefaultValue_5() + CHIP_ERROR TestReadStartUpMode_5() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int32uArgument; - int32uArgument = [NSNumber numberWithUnsignedInt:0UL]; - [cluster writeAttributeInt32uWithValue:int32uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT32U Value Back to Default Value Error: %@", err); + [cluster readAttributeStartUpModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read StartUpMode Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("StartUpMode", actualValue)); + VerifyOrReturn(CheckValue("StartUpMode", actualValue, 0)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeCharStringValue_6() + CHIP_ERROR TestReadOnMode_6() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id charStringArgument; - charStringArgument = @"** Test **"; - [cluster writeAttributeCharStringWithValue:charStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute CHAR_STRING Value Error: %@", err); + [cluster readAttributeOnModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read OnMode Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValueNull("OnMode", actualValue)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeCharStringValueMinLengthConstraints_7() + CHIP_ERROR TestChangeToSupportedMode_7() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute CHAR_STRING Value MinLength Constraints Error: %@", err); + __auto_type * params = [[CHIPModeSelectClusterChangeToModeParams alloc] init]; + params.newMode = [NSNumber numberWithUnsignedChar:4]; + [cluster changeToModeWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Change to Supported Mode Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nonnull currentModeBeforeToggle; + + CHIP_ERROR TestVerifyCurrentModeChange_8() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify Current Mode Change Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintMinLength("charString", [value length], 5)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("CurrentMode", actualValue, 4)); + } + { + currentModeBeforeToggle = value; + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeCharStringValueMaxLengthConstraints_8() + CHIP_ERROR TestChangeToUnsupportedMode_9() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute CHAR_STRING Value MaxLength Constraints Error: %@", err); + __auto_type * params = [[CHIPModeSelectClusterChangeToModeParams alloc] init]; + params.newMode = [NSNumber numberWithUnsignedChar:2]; + [cluster changeToModeWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Change to Unsupported Mode Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_INVALID_COMMAND)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestToggleOnOff_10() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster offWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Toggle OnOff Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintMaxLength("charString", [value length], 20)); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeCharStringValueStartsWithConstraints_9() + CHIP_ERROR TestToggleOnOff_11() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute CHAR_STRING Value StartsWith Constraints Error: %@", err); + [cluster onWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Toggle OnOff Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintStartsWith("charString", value, "**")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeCharStringValueEndsWithConstraints_10() + CHIP_ERROR TestVerifyCurrentModeDoesNotChangeWhenOnModeIsNull_12() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute CHAR_STRING Value EndsWith Constraints Error: %@", err); + [cluster readAttributeCurrentModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify Current Mode does not change when OnMode is null Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintEndsWith("charString", value, "**")); + { + id actualValue = value; + VerifyOrReturn(CheckValue("CurrentMode", actualValue, currentModeBeforeToggle)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeCharStringValue_11() + CHIP_ERROR TestChangeToUnsupportedOnMode_13() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id charStringArgument; - charStringArgument = @"lowercase"; - [cluster writeAttributeCharStringWithValue:charStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute CHAR_STRING Value Error: %@", err); + id onModeArgument; + onModeArgument = [NSNumber numberWithUnsignedChar:2]; + [cluster writeAttributeOnModeWithValue:onModeArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Change to Unsupported OnMode Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_INVALID_COMMAND)); + NextTest(); + }]; - NextTest(); - }]; + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestChangeOnMode_14() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id onModeArgument; + onModeArgument = [NSNumber numberWithUnsignedChar:7]; + [cluster writeAttributeOnModeWithValue:onModeArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Change OnMode Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } + NSNumber * _Nullable OnModeValue; - CHIP_ERROR TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_12() + CHIP_ERROR TestVerifyOnMode_15() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints Error: %@", err); + [cluster readAttributeOnModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify OnMode Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintIsUpperCase("charString", value, false)); - VerifyOrReturn(CheckConstraintIsLowerCase("charString", value, true)); + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("OnMode", actualValue)); + VerifyOrReturn(CheckValue("OnMode", actualValue, 7)); + } + { + OnModeValue = value; + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeCharStringValue_13() + CHIP_ERROR TestToggleOnOff_16() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id charStringArgument; - charStringArgument = @"UPPERCASE"; - [cluster writeAttributeCharStringWithValue:charStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute CHAR_STRING Value Error: %@", err); + [cluster offWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Toggle OnOff Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_14() + CHIP_ERROR TestToggleOnOff_17() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints Error: %@", err); + [cluster onWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Toggle OnOff Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintIsUpperCase("charString", value, true)); - VerifyOrReturn(CheckConstraintIsLowerCase("charString", value, false)); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeCharStringValue_15() + CHIP_ERROR TestVerifyCurrentModeChangesIfOnModeIsNotNull_18() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id charStringArgument; - charStringArgument = @"lowUPPER"; - [cluster writeAttributeCharStringWithValue:charStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute CHAR_STRING Value Error: %@", err); + [cluster readAttributeCurrentModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify Current Mode Changes if OnMode is not null Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValue("CurrentMode", actualValue, OnModeValue)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_16() + CHIP_ERROR TestChangeToUnsupportedStartUpMode_19() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints Error: %@", err); + id startUpModeArgument; + startUpModeArgument = [NSNumber numberWithUnsignedChar:2]; + [cluster writeAttributeStartUpModeWithValue:startUpModeArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Change to Unsupported StartUp Mode Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_INVALID_COMMAND)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestChangeToSupportedStartUpMode_20() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id startUpModeArgument; + startUpModeArgument = [NSNumber numberWithUnsignedChar:7]; + [cluster writeAttributeStartUpModeWithValue:startUpModeArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Change to Supported StartUp Mode Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestVerifyStartUpModeChange_21() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeStartUpModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify StartUp Mode Change Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintIsUpperCase("charString", value, false)); - VerifyOrReturn(CheckConstraintIsLowerCase("charString", value, false)); + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("StartUpMode", actualValue)); + VerifyOrReturn(CheckValue("StartUpMode", actualValue, 7)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeCharStringValue_17() + CHIP_ERROR TestChangeCurrentModeToAnotherValue_22() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id charStringArgument; - charStringArgument = @"ABCDEF012V"; - [cluster writeAttributeCharStringWithValue:charStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute CHAR_STRING Value Error: %@", err); + __auto_type * params = [[CHIPModeSelectClusterChangeToModeParams alloc] init]; + params.newMode = [NSNumber numberWithUnsignedChar:0]; + [cluster changeToModeWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Change CurrentMode to another value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeCharStringValueIsHexStringConstraints_18() + CHIP_ERROR TestChangeOnMode_23() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute CHAR_STRING Value isHexString Constraints Error: %@", err); + id onModeArgument; + onModeArgument = [NSNumber numberWithUnsignedChar:4]; + [cluster writeAttributeOnModeWithValue:onModeArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Change On Mode Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintIsHexString("charString", value, false)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeCharStringValue_19() + CHIP_ERROR TestSetStartUpOnOff_24() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id charStringArgument; - charStringArgument = @"ABCDEF0123"; - [cluster writeAttributeCharStringWithValue:charStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute CHAR_STRING Value Error: %@", err); + id startUpOnOffArgument; + startUpOnOffArgument = [NSNumber numberWithUnsignedChar:1]; + [cluster writeAttributeStartUpOnOffWithValue:startUpOnOffArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Set StartUpOnOff Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeCharStringValueIsHexStringConstraints_20() + CHIP_ERROR TestRebootTargetDevice_25() + { + Reboot(mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_26() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestVerifyCurrentModeChangeBasedOnOnModeAsItOverwritesStartUpMode_27() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute CHAR_STRING Value isHexString Constraints Error: %@", err); + [cluster readAttributeCurrentModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify Current Mode Change based on OnMode, as it overwrites StartUpMode Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintIsHexString("charString", value, true)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("CurrentMode", actualValue, 4)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeCharStringValueBackToDefaultValue_21() + CHIP_ERROR TestChangeOnModeToNull_28() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id charStringArgument; - charStringArgument = @""; - [cluster writeAttributeCharStringWithValue:charStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute CHAR_STRING Value Back to Default Value Error: %@", err); + id onModeArgument; + onModeArgument = nil; + [cluster writeAttributeOnModeWithValue:onModeArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Change On Mode to Null Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestRebootTargetDevice_29() + { + Reboot(mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_30() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestVerifyCurrentModeChangeBasedOnNewStartUpMode_31() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify Current Mode Change based on new StartUp Mode Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("CurrentMode", actualValue, 7)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } }; -class TestDelayCommands : public TestCommandBridge { +class TestSelfFabricRemoval : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - TestDelayCommands() - : TestCommandBridge("TestDelayCommands") + TestSelfFabricRemoval() + : TestCommandBridge("TestSelfFabricRemoval") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -64359,7 +72812,7 @@ class TestDelayCommands : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~TestDelayCommands() {} + ~TestSelfFabricRemoval() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -64367,11 +72820,11 @@ class TestDelayCommands : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: TestDelayCommands\n"); + ChipLogProgress(chipTool, " **** Test Start: TestSelfFabricRemoval\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: TestDelayCommands\n"); + ChipLogProgress(chipTool, " **** Test Complete: TestSelfFabricRemoval\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -64388,8 +72841,16 @@ class TestDelayCommands : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Wait 100ms\n"); - err = TestWait100ms_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Read number of commissioned fabrics\n"); + err = TestReadNumberOfCommissionedFabrics_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read current fabric index\n"); + err = TestReadCurrentFabricIndex_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Remove single own fabric\n"); + err = TestRemoveSingleOwnFabric_3(); break; } @@ -64406,7 +72867,7 @@ class TestDelayCommands : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 2; + const uint16_t mTestCount = 4; chip::Optional mNodeId; chip::Optional mCluster; @@ -64419,18 +72880,88 @@ class TestDelayCommands : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWait100ms_1() + CHIP_ERROR TestReadNumberOfCommissionedFabrics_1() { - WaitForMs(100); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCommissionedFabricsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read number of commissioned fabrics Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("CommissionedFabrics", actualValue, 1)); + } + + VerifyOrReturn(CheckConstraintType("commissionedFabrics", "", "uint8")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nonnull ourFabricIndex; + + CHIP_ERROR TestReadCurrentFabricIndex_2() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentFabricIndexWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read current fabric index Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentFabricIndex", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentFabricIndex", [value unsignedCharValue], 1)); + } + { + ourFabricIndex = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestRemoveSingleOwnFabric_3() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPOperationalCredentialsClusterRemoveFabricParams alloc] init]; + params.fabricIndex = [ourFabricIndex copy]; + [cluster removeFabricWithParams:params + completionHandler:^( + CHIPOperationalCredentialsClusterNOCResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Remove single own fabric Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + return CHIP_NO_ERROR; } }; -class TestDescriptorCluster : public TestCommandBridge { +class TestBinding : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - TestDescriptorCluster() - : TestCommandBridge("TestDescriptorCluster") + TestBinding() + : TestCommandBridge("TestBinding") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -64440,7 +72971,7 @@ class TestDescriptorCluster : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~TestDescriptorCluster() {} + ~TestBinding() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -64448,11 +72979,11 @@ class TestDescriptorCluster : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: TestDescriptorCluster\n"); + ChipLogProgress(chipTool, " **** Test Start: TestBinding\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: TestDescriptorCluster\n"); + ChipLogProgress(chipTool, " **** Test Complete: TestBinding\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -64469,20 +73000,36 @@ class TestDescriptorCluster : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read attribute Device list\n"); - err = TestReadAttributeDeviceList_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Write empty binding table\n"); + err = TestWriteEmptyBindingTable_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read attribute Server list\n"); - err = TestReadAttributeServerList_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Read empty binding table\n"); + err = TestReadEmptyBindingTable_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read attribute Client list\n"); - err = TestReadAttributeClientList_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Write invalid binding table\n"); + err = TestWriteInvalidBindingTable_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read attribute Parts list\n"); - err = TestReadAttributePartsList_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Write binding table (endpoint 1)\n"); + err = TestWriteBindingTableEndpoint1_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read binding table (endpoint 1)\n"); + err = TestReadBindingTableEndpoint1_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Write binding table (endpoint 0)\n"); + err = TestWriteBindingTableEndpoint0_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Read binding table (endpoint 0)\n"); + err = TestReadBindingTableEndpoint0_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Verify endpoint 1 not changed\n"); + err = TestVerifyEndpoint1NotChanged_8(); break; } @@ -64499,7 +73046,7 @@ class TestDescriptorCluster : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 5; + const uint16_t mTestCount = 9; chip::Optional mNodeId; chip::Optional mCluster; @@ -64512,140 +73059,282 @@ class TestDescriptorCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeDeviceList_1() + CHIP_ERROR TestWriteEmptyBindingTable_1() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestDescriptor * cluster = [[CHIPTestDescriptor alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + CHIPTestBinding * cluster = [[CHIPTestBinding alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeDeviceListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute Device list Error: %@", err); + id bindingArgument; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + bindingArgument = temp_0; + } + [cluster writeAttributeBindingWithValue:bindingArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write empty binding table Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("device list", [actualValue count], static_cast(1))); - VerifyOrReturn(CheckValue("type", ((CHIPDescriptorClusterDeviceType *) actualValue[0]).type, 22UL)); - VerifyOrReturn(CheckValue("revision", ((CHIPDescriptorClusterDeviceType *) actualValue[0]).revision, 1U)); - } + NextTest(); + }]; - NextTest(); - }]; + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadEmptyBindingTable_2() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestBinding * cluster = [[CHIPTestBinding alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + CHIPReadParams * params = [[CHIPReadParams alloc] init]; + params.fabricFiltered = [NSNumber numberWithBool:true]; + [cluster readAttributeBindingWithParams:params + completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read empty binding table Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("Binding", [actualValue count], static_cast(0))); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeServerList_2() + CHIP_ERROR TestWriteInvalidBindingTable_3() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestDescriptor * cluster = [[CHIPTestDescriptor alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + CHIPTestBinding * cluster = [[CHIPTestBinding alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeServerListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute Server list Error: %@", err); + id bindingArgument; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [[CHIPBindingClusterTargetStruct alloc] init]; + ((CHIPBindingClusterTargetStruct *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedChar:0]; - VerifyOrReturn(CheckValue("status", err, 0)); + temp_0[1] = [[CHIPBindingClusterTargetStruct alloc] init]; + ((CHIPBindingClusterTargetStruct *) temp_0[1]).node = [NSNumber numberWithUnsignedLongLong:1ULL]; + ((CHIPBindingClusterTargetStruct *) temp_0[1]).group = [NSNumber numberWithUnsignedShort:1U]; + ((CHIPBindingClusterTargetStruct *) temp_0[1]).endpoint = [NSNumber numberWithUnsignedShort:1U]; + ((CHIPBindingClusterTargetStruct *) temp_0[1]).cluster = [NSNumber numberWithUnsignedInt:6UL]; + ((CHIPBindingClusterTargetStruct *) temp_0[1]).fabricIndex = [NSNumber numberWithUnsignedChar:0]; - { - id actualValue = value; - VerifyOrReturn(CheckValue("server list", [actualValue count], static_cast(25))); - VerifyOrReturn(CheckValue("", actualValue[0], 3UL)); - VerifyOrReturn(CheckValue("", actualValue[1], 4UL)); - VerifyOrReturn(CheckValue("", actualValue[2], 29UL)); - VerifyOrReturn(CheckValue("", actualValue[3], 30UL)); - VerifyOrReturn(CheckValue("", actualValue[4], 31UL)); - VerifyOrReturn(CheckValue("", actualValue[5], 40UL)); - VerifyOrReturn(CheckValue("", actualValue[6], 42UL)); - VerifyOrReturn(CheckValue("", actualValue[7], 43UL)); - VerifyOrReturn(CheckValue("", actualValue[8], 44UL)); - VerifyOrReturn(CheckValue("", actualValue[9], 45UL)); - VerifyOrReturn(CheckValue("", actualValue[10], 46UL)); - VerifyOrReturn(CheckValue("", actualValue[11], 48UL)); - VerifyOrReturn(CheckValue("", actualValue[12], 49UL)); - VerifyOrReturn(CheckValue("", actualValue[13], 50UL)); - VerifyOrReturn(CheckValue("", actualValue[14], 51UL)); - VerifyOrReturn(CheckValue("", actualValue[15], 52UL)); - VerifyOrReturn(CheckValue("", actualValue[16], 53UL)); - VerifyOrReturn(CheckValue("", actualValue[17], 54UL)); - VerifyOrReturn(CheckValue("", actualValue[18], 55UL)); - VerifyOrReturn(CheckValue("", actualValue[19], 60UL)); - VerifyOrReturn(CheckValue("", actualValue[20], 62UL)); - VerifyOrReturn(CheckValue("", actualValue[21], 63UL)); - VerifyOrReturn(CheckValue("", actualValue[22], 64UL)); - VerifyOrReturn(CheckValue("", actualValue[23], 65UL)); - VerifyOrReturn(CheckValue("", actualValue[24], 1029UL)); - } + bindingArgument = temp_0; + } + [cluster writeAttributeBindingWithValue:bindingArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write invalid binding table Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeClientList_3() + CHIP_ERROR TestWriteBindingTableEndpoint1_4() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestDescriptor * cluster = [[CHIPTestDescriptor alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + CHIPTestBinding * cluster = [[CHIPTestBinding alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeClientListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute Client list Error: %@", err); + id bindingArgument; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [[CHIPBindingClusterTargetStruct alloc] init]; + ((CHIPBindingClusterTargetStruct *) temp_0[0]).group = [NSNumber numberWithUnsignedShort:1U]; + ((CHIPBindingClusterTargetStruct *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedChar:0]; - VerifyOrReturn(CheckValue("status", err, 0)); + temp_0[1] = [[CHIPBindingClusterTargetStruct alloc] init]; + ((CHIPBindingClusterTargetStruct *) temp_0[1]).node = [NSNumber numberWithUnsignedLongLong:1ULL]; + ((CHIPBindingClusterTargetStruct *) temp_0[1]).endpoint = [NSNumber numberWithUnsignedShort:1U]; + ((CHIPBindingClusterTargetStruct *) temp_0[1]).cluster = [NSNumber numberWithUnsignedInt:6UL]; + ((CHIPBindingClusterTargetStruct *) temp_0[1]).fabricIndex = [NSNumber numberWithUnsignedChar:0]; - { - id actualValue = value; - VerifyOrReturn(CheckValue("client list", [actualValue count], static_cast(1))); - VerifyOrReturn(CheckValue("", actualValue[0], 41UL)); - } + temp_0[2] = [[CHIPBindingClusterTargetStruct alloc] init]; + ((CHIPBindingClusterTargetStruct *) temp_0[2]).node = [NSNumber numberWithUnsignedLongLong:2ULL]; + ((CHIPBindingClusterTargetStruct *) temp_0[2]).endpoint = [NSNumber numberWithUnsignedShort:1U]; + ((CHIPBindingClusterTargetStruct *) temp_0[2]).fabricIndex = [NSNumber numberWithUnsignedChar:0]; - NextTest(); - }]; + bindingArgument = temp_0; + } + [cluster writeAttributeBindingWithValue:bindingArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write binding table (endpoint 1) Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributePartsList_4() + CHIP_ERROR TestReadBindingTableEndpoint1_5() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestDescriptor * cluster = [[CHIPTestDescriptor alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + CHIPTestBinding * cluster = [[CHIPTestBinding alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributePartsListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute Parts list Error: %@", err); + CHIPReadParams * params = [[CHIPReadParams alloc] init]; + params.fabricFiltered = [NSNumber numberWithBool:true]; + [cluster + readAttributeBindingWithParams:params + completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read binding table (endpoint 1) Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("parts list", [actualValue count], static_cast(2))); - VerifyOrReturn(CheckValue("", actualValue[0], 1U)); - VerifyOrReturn(CheckValue("", actualValue[1], 2U)); - } + { + id actualValue = value; + VerifyOrReturn(CheckValue("Binding", [actualValue count], static_cast(3))); + VerifyOrReturn(CheckValue("Group", ((CHIPBindingClusterTargetStruct *) actualValue[0]).group, 1U)); + VerifyOrReturn( + CheckValue("FabricIndex", ((CHIPBindingClusterTargetStruct *) actualValue[0]).fabricIndex, 1)); + VerifyOrReturn(CheckValue("Node", ((CHIPBindingClusterTargetStruct *) actualValue[1]).node, 1ULL)); + VerifyOrReturn( + CheckValue("Endpoint", ((CHIPBindingClusterTargetStruct *) actualValue[1]).endpoint, 1U)); + VerifyOrReturn( + CheckValue("Cluster", ((CHIPBindingClusterTargetStruct *) actualValue[1]).cluster, 6UL)); + VerifyOrReturn( + CheckValue("FabricIndex", ((CHIPBindingClusterTargetStruct *) actualValue[1]).fabricIndex, 1)); + VerifyOrReturn(CheckValue("Node", ((CHIPBindingClusterTargetStruct *) actualValue[2]).node, 2ULL)); + VerifyOrReturn( + CheckValue("Endpoint", ((CHIPBindingClusterTargetStruct *) actualValue[2]).endpoint, 1U)); + VerifyOrReturn( + CheckValue("FabricIndex", ((CHIPBindingClusterTargetStruct *) actualValue[2]).fabricIndex, 1)); + } - NextTest(); - }]; + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteBindingTableEndpoint0_6() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestBinding * cluster = [[CHIPTestBinding alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id bindingArgument; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [[CHIPBindingClusterTargetStruct alloc] init]; + ((CHIPBindingClusterTargetStruct *) temp_0[0]).node = [NSNumber numberWithUnsignedLongLong:3ULL]; + ((CHIPBindingClusterTargetStruct *) temp_0[0]).endpoint = [NSNumber numberWithUnsignedShort:1U]; + ((CHIPBindingClusterTargetStruct *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedChar:0]; + + bindingArgument = temp_0; + } + [cluster writeAttributeBindingWithValue:bindingArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write binding table (endpoint 0) Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadBindingTableEndpoint0_7() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestBinding * cluster = [[CHIPTestBinding alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + CHIPReadParams * params = [[CHIPReadParams alloc] init]; + params.fabricFiltered = [NSNumber numberWithBool:true]; + [cluster + readAttributeBindingWithParams:params + completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read binding table (endpoint 0) Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("Binding", [actualValue count], static_cast(1))); + VerifyOrReturn(CheckValue("Node", ((CHIPBindingClusterTargetStruct *) actualValue[0]).node, 3ULL)); + VerifyOrReturn( + CheckValue("Endpoint", ((CHIPBindingClusterTargetStruct *) actualValue[0]).endpoint, 1U)); + VerifyOrReturn( + CheckValue("FabricIndex", ((CHIPBindingClusterTargetStruct *) actualValue[0]).fabricIndex, 1)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestVerifyEndpoint1NotChanged_8() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestBinding * cluster = [[CHIPTestBinding alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + CHIPReadParams * params = [[CHIPReadParams alloc] init]; + params.fabricFiltered = [NSNumber numberWithBool:true]; + [cluster + readAttributeBindingWithParams:params + completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify endpoint 1 not changed Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("Binding", [actualValue count], static_cast(3))); + VerifyOrReturn(CheckValue("Group", ((CHIPBindingClusterTargetStruct *) actualValue[0]).group, 1U)); + VerifyOrReturn( + CheckValue("FabricIndex", ((CHIPBindingClusterTargetStruct *) actualValue[0]).fabricIndex, 1)); + VerifyOrReturn(CheckValue("Node", ((CHIPBindingClusterTargetStruct *) actualValue[1]).node, 1ULL)); + VerifyOrReturn( + CheckValue("Endpoint", ((CHIPBindingClusterTargetStruct *) actualValue[1]).endpoint, 1U)); + VerifyOrReturn( + CheckValue("Cluster", ((CHIPBindingClusterTargetStruct *) actualValue[1]).cluster, 6UL)); + VerifyOrReturn( + CheckValue("FabricIndex", ((CHIPBindingClusterTargetStruct *) actualValue[1]).fabricIndex, 1)); + VerifyOrReturn(CheckValue("Node", ((CHIPBindingClusterTargetStruct *) actualValue[2]).node, 2ULL)); + VerifyOrReturn( + CheckValue("Endpoint", ((CHIPBindingClusterTargetStruct *) actualValue[2]).endpoint, 1U)); + VerifyOrReturn( + CheckValue("FabricIndex", ((CHIPBindingClusterTargetStruct *) actualValue[2]).fabricIndex, 1)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } }; -class TestGroupsCluster : public TestCommandBridge { +class TestUserLabelCluster : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - TestGroupsCluster() - : TestCommandBridge("TestGroupsCluster") + TestUserLabelCluster() + : TestCommandBridge("TestUserLabelCluster") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("discriminator", 0, UINT16_MAX, &mDiscriminator); AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~TestGroupsCluster() {} + ~TestUserLabelCluster() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -64653,11 +73342,11 @@ class TestGroupsCluster : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: TestGroupsCluster\n"); + ChipLogProgress(chipTool, " **** Test Start: TestUserLabelCluster\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: TestGroupsCluster\n"); + ChipLogProgress(chipTool, " **** Test Complete: TestUserLabelCluster\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -64674,76 +73363,28 @@ class TestGroupsCluster : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : View Group 0 (invalid)\n"); - err = TestViewGroup0Invalid_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Clear User Label List\n"); + err = TestClearUserLabelList_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : View Group 1 (not found)\n"); - err = TestViewGroup1NotFound_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Read User Label List\n"); + err = TestReadUserLabelList_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Add Group 1 (new)\n"); - err = TestAddGroup1New_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Write User Label List\n"); + err = TestWriteUserLabelList_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : View Group 1 (new)\n"); - err = TestViewGroup1New_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Reboot target device\n"); + err = TestRebootTargetDevice_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : View Group 2 (not found)\n"); - err = TestViewGroup2NotFound_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Get Group Membership 1 (all)\n"); - err = TestGetGroupMembership1All_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : View Group 3 (not found)\n"); - err = TestViewGroup3NotFound_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : View Group 1 (existing)\n"); - err = TestViewGroup1Existing_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Remove Group 0 (invalid)\n"); - err = TestRemoveGroup0Invalid_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Remove Group 4 (not found)\n"); - err = TestRemoveGroup4NotFound_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : View Group 1 (not removed)\n"); - err = TestViewGroup1NotRemoved_11(); - break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : View Group 2 (removed)\n"); - err = TestViewGroup2Removed_12(); - break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Get Group Membership 3\n"); - err = TestGetGroupMembership3_13(); - break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Remove All\n"); - err = TestRemoveAll_14(); - break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : View Group 1 (removed)\n"); - err = TestViewGroup1Removed_15(); - break; - case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : View Group 2 (still removed)\n"); - err = TestViewGroup2StillRemoved_16(); - break; - case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : View Group 3 (removed)\n"); - err = TestViewGroup3Removed_17(); - break; - case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : Get Group Membership 4\n"); - err = TestGetGroupMembership4_18(); + ChipLogProgress(chipTool, " ***** Test Step 6 : Verify\n"); + err = TestVerify_6(); break; } @@ -64760,11 +73401,12 @@ class TestGroupsCluster : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 19; + const uint16_t mTestCount = 7; chip::Optional mNodeId; chip::Optional mCluster; chip::Optional mEndpoint; + chip::Optional mDiscriminator; chip::Optional mTimeout; CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() @@ -64773,314 +73415,281 @@ class TestGroupsCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestViewGroup0Invalid_1() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; - params.groupId = [NSNumber numberWithUnsignedShort:0U]; - [cluster viewGroupWithParams:params - completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"View Group 0 (invalid) Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 135)); - } - - { - id actualValue = values.groupId; - VerifyOrReturn(CheckValue("groupId", actualValue, 0U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestViewGroup1NotFound_2() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; - params.groupId = [NSNumber numberWithUnsignedShort:1U]; - [cluster viewGroupWithParams:params - completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"View Group 1 (not found) Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 139)); - } - - { - id actualValue = values.groupId; - VerifyOrReturn(CheckValue("groupId", actualValue, 1U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestAddGroup1New_3() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[CHIPGroupsClusterAddGroupParams alloc] init]; - params.groupId = [NSNumber numberWithUnsignedShort:1U]; - params.groupName = @"Group #1"; - [cluster addGroupWithParams:params - completionHandler:^(CHIPGroupsClusterAddGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Add Group 1 (new) Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0)); - } - - { - id actualValue = values.groupId; - VerifyOrReturn(CheckValue("groupId", actualValue, 1U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestViewGroup1New_4() + CHIP_ERROR TestClearUserLabelList_1() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestUserLabel * cluster = [[CHIPTestUserLabel alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; - params.groupId = [NSNumber numberWithUnsignedShort:1U]; - [cluster viewGroupWithParams:params - completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"View Group 1 (new) Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0)); - } - - { - id actualValue = values.groupId; - VerifyOrReturn(CheckValue("groupId", actualValue, 1U)); - } - - { - id actualValue = values.groupName; - VerifyOrReturn(CheckValueAsString("groupName", actualValue, @"Group #1")); - } + id labelListArgument; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + labelListArgument = temp_0; + } + [cluster writeAttributeLabelListWithValue:labelListArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Clear User Label List Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestViewGroup2NotFound_5() + CHIP_ERROR TestReadUserLabelList_2() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestUserLabel * cluster = [[CHIPTestUserLabel alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; - params.groupId = [NSNumber numberWithUnsignedShort:4369U]; - [cluster viewGroupWithParams:params - completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"View Group 2 (not found) Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + [cluster readAttributeLabelListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read User Label List Error: %@", err); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 139)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = values.groupId; - VerifyOrReturn(CheckValue("groupId", actualValue, 4369U)); - } + { + id actualValue = value; + VerifyOrReturn(CheckValue("label list", [actualValue count], static_cast(0))); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestGetGroupMembership1All_6() + CHIP_ERROR TestWriteUserLabelList_3() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestUserLabel * cluster = [[CHIPTestUserLabel alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPGroupsClusterGetGroupMembershipParams alloc] init]; + id labelListArgument; { NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - params.groupList = temp_0; + temp_0[0] = [[CHIPUserLabelClusterLabelStruct alloc] init]; + ((CHIPUserLabelClusterLabelStruct *) temp_0[0]).label = @"room"; + ((CHIPUserLabelClusterLabelStruct *) temp_0[0]).value = @"bedroom 2"; + + temp_0[1] = [[CHIPUserLabelClusterLabelStruct alloc] init]; + ((CHIPUserLabelClusterLabelStruct *) temp_0[1]).label = @"orientation"; + ((CHIPUserLabelClusterLabelStruct *) temp_0[1]).value = @"North"; + + temp_0[2] = [[CHIPUserLabelClusterLabelStruct alloc] init]; + ((CHIPUserLabelClusterLabelStruct *) temp_0[2]).label = @"floor"; + ((CHIPUserLabelClusterLabelStruct *) temp_0[2]).value = @"5"; + + temp_0[3] = [[CHIPUserLabelClusterLabelStruct alloc] init]; + ((CHIPUserLabelClusterLabelStruct *) temp_0[3]).label = @"direction"; + ((CHIPUserLabelClusterLabelStruct *) temp_0[3]).value = @"up"; + + labelListArgument = temp_0; } - [cluster getGroupMembershipWithParams:params - completionHandler:^( - CHIPGroupsClusterGetGroupMembershipResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Get Group Membership 1 (all) Error: %@", err); + [cluster writeAttributeLabelListWithValue:labelListArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write User Label List Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = values.capacity; - VerifyOrReturn(CheckValueNull("capacity", actualValue)); - } + NextTest(); + }]; - { - id actualValue = values.groupList; - VerifyOrReturn(CheckValue("groupList", [actualValue count], static_cast(1))); - VerifyOrReturn(CheckValue("", actualValue[0], 1U)); - } + return CHIP_NO_ERROR; + } - NextTest(); - }]; + CHIP_ERROR TestRebootTargetDevice_4() + { + Reboot(mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U); + return CHIP_NO_ERROR; + } + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_5() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestViewGroup3NotFound_7() + CHIP_ERROR TestVerify_6() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestUserLabel * cluster = [[CHIPTestUserLabel alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; - params.groupId = [NSNumber numberWithUnsignedShort:32767U]; - [cluster viewGroupWithParams:params - completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"View Group 3 (not found) Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + [cluster readAttributeLabelListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify Error: %@", err); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 139)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = values.groupId; - VerifyOrReturn(CheckValue("groupId", actualValue, 32767U)); - } + { + id actualValue = value; + VerifyOrReturn(CheckValue("label list", [actualValue count], static_cast(4))); + VerifyOrReturn(CheckValueAsString("label", ((CHIPUserLabelClusterLabelStruct *) actualValue[0]).label, @"room")); + VerifyOrReturn( + CheckValueAsString("value", ((CHIPUserLabelClusterLabelStruct *) actualValue[0]).value, @"bedroom 2")); + VerifyOrReturn( + CheckValueAsString("label", ((CHIPUserLabelClusterLabelStruct *) actualValue[1]).label, @"orientation")); + VerifyOrReturn(CheckValueAsString("value", ((CHIPUserLabelClusterLabelStruct *) actualValue[1]).value, @"North")); + VerifyOrReturn(CheckValueAsString("label", ((CHIPUserLabelClusterLabelStruct *) actualValue[2]).label, @"floor")); + VerifyOrReturn(CheckValueAsString("value", ((CHIPUserLabelClusterLabelStruct *) actualValue[2]).value, @"5")); + VerifyOrReturn( + CheckValueAsString("label", ((CHIPUserLabelClusterLabelStruct *) actualValue[3]).label, @"direction")); + VerifyOrReturn(CheckValueAsString("value", ((CHIPUserLabelClusterLabelStruct *) actualValue[3]).value, @"up")); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } +}; - CHIP_ERROR TestViewGroup1Existing_8() +class TestArmFailSafe : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + TestArmFailSafe() + : TestCommandBridge("TestArmFailSafe") + , mTestIndex(0) { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("discriminator", 0, UINT16_MAX, &mDiscriminator); + AddArgument("payload", &mPayload); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; - params.groupId = [NSNumber numberWithUnsignedShort:1U]; - [cluster viewGroupWithParams:params - completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"View Group 1 (existing) Error: %@", err); + ~TestArmFailSafe() {} - VerifyOrReturn(CheckValue("status", err, 0)); + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0)); - } + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: TestArmFailSafe\n"); + } - { - id actualValue = values.groupId; - VerifyOrReturn(CheckValue("groupId", actualValue, 1U)); - } + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: TestArmFailSafe\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } - { - id actualValue = values.groupName; - VerifyOrReturn(CheckValueAsString("groupName", actualValue, @"Group #1")); - } + Wait(); - NextTest(); - }]; + // 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 : Reboot target device\n"); + err = TestRebootTargetDevice_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Wait for the alpha device to be retrieved \n"); + err = TestWaitForTheAlphaDeviceToBeRetrieved_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Query fabrics list\n"); + err = TestQueryFabricsList_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : ArmFailSafe on target device with timeout 0\n"); + err = TestArmFailSafeOnTargetDeviceWithTimeout0_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Reads NodeLabel mandatory attribute of target device\n"); + err = TestReadsNodeLabelMandatoryAttributeOfTargetDevice_4(); + 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 = 5; + + chip::Optional mNodeId; + chip::Optional mEndpoint; + chip::Optional mDiscriminator; + chip::Optional mPayload; + chip::Optional mTimeout; + CHIP_ERROR TestRebootTargetDevice_0() + { + Reboot(mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U); return CHIP_NO_ERROR; } - CHIP_ERROR TestRemoveGroup0Invalid_9() + CHIP_ERROR TestWaitForTheAlphaDeviceToBeRetrieved_1() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestQueryFabricsList_2() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPGroupsClusterRemoveGroupParams alloc] init]; - params.groupId = [NSNumber numberWithUnsignedShort:0U]; - [cluster removeGroupWithParams:params - completionHandler:^(CHIPGroupsClusterRemoveGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Remove Group 0 (invalid) Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + CHIPReadParams * params = [[CHIPReadParams alloc] init]; + params.fabricFiltered = [NSNumber numberWithBool:true]; + [cluster readAttributeFabricsWithParams:params + completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Query fabrics list Error: %@", err); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 135)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = values.groupId; - VerifyOrReturn(CheckValue("groupId", actualValue, 0U)); - } + { + id actualValue = value; + VerifyOrReturn(CheckValue("Fabrics", [actualValue count], static_cast(1))); + VerifyOrReturn(CheckValueAsString("Label", + ((CHIPOperationalCredentialsClusterFabricDescriptor *) actualValue[0]).label, @"")); + } - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("fabrics", "", "list")); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestRemoveGroup4NotFound_10() + CHIP_ERROR TestArmFailSafeOnTargetDeviceWithTimeout0_3() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestGeneralCommissioning * cluster = [[CHIPTestGeneralCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPGroupsClusterRemoveGroupParams alloc] init]; - params.groupId = [NSNumber numberWithUnsignedShort:4U]; - [cluster removeGroupWithParams:params - completionHandler:^(CHIPGroupsClusterRemoveGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Remove Group 4 (not found) Error: %@", err); + __auto_type * params = [[CHIPGeneralCommissioningClusterArmFailSafeParams alloc] init]; + params.expiryLengthSeconds = [NSNumber numberWithUnsignedShort:0U]; + params.breadcrumb = [NSNumber numberWithUnsignedLongLong:0ULL]; + [cluster armFailSafeWithParams:params + completionHandler:^( + CHIPGeneralCommissioningClusterArmFailSafeResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"ArmFailSafe on target device with timeout 0 Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 139)); - } - - { - id actualValue = values.groupId; - VerifyOrReturn(CheckValue("groupId", actualValue, 4U)); + id actualValue = values.errorCode; + VerifyOrReturn(CheckValue("errorCode", actualValue, 0)); } NextTest(); @@ -65089,262 +73698,289 @@ class TestGroupsCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestViewGroup1NotRemoved_11() + CHIP_ERROR TestReadsNodeLabelMandatoryAttributeOfTargetDevice_4() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; - params.groupId = [NSNumber numberWithUnsignedShort:1U]; - [cluster viewGroupWithParams:params - completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"View Group 1 (not removed) Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0)); - } + [cluster readAttributeNodeLabelWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads NodeLabel mandatory attribute of target device Error: %@", err); - { - id actualValue = values.groupId; - VerifyOrReturn(CheckValue("groupId", actualValue, 1U)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = values.groupName; - VerifyOrReturn(CheckValueAsString("groupName", actualValue, @"Group #1")); - } + { + id actualValue = value; + VerifyOrReturn(CheckValueAsString("NodeLabel", actualValue, @"")); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } +}; - CHIP_ERROR TestViewGroup2Removed_12() +class Test_TC_SWDIAG_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_SWDIAG_1_1() + : TestCommandBridge("Test_TC_SWDIAG_1_1") + , mTestIndex(0) { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; - params.groupId = [NSNumber numberWithUnsignedShort:4369U]; - [cluster viewGroupWithParams:params - completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"View Group 2 (removed) Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 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) - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 139)); - } + ~Test_TC_SWDIAG_1_1() {} - { - id actualValue = values.groupId; - VerifyOrReturn(CheckValue("groupId", actualValue, 4369U)); - } + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; - NextTest(); - }]; + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_SWDIAG_1_1\n"); + } - return CHIP_NO_ERROR; - } + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_SWDIAG_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } - CHIP_ERROR TestGetGroupMembership3_13() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + Wait(); - __auto_type * params = [[CHIPGroupsClusterGetGroupMembershipParams alloc] init]; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [NSNumber numberWithUnsignedShort:1U]; - temp_0[1] = [NSNumber numberWithUnsignedShort:2U]; - temp_0[2] = [NSNumber numberWithUnsignedShort:4369U]; - temp_0[3] = [NSNumber numberWithUnsignedShort:3U]; - params.groupList = temp_0; + // 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 : Reads a list of ThreadMetrics struct non-global attribute from DUT.\n"); + if (ShouldSkip("A_THREADMETRICS")) { + NextTest(); + return; + } + err = TestReadsAListOfThreadMetricsStructNonGlobalAttributeFromDut_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Reads CurrentHeapFree non-global attribute value from DUT\n"); + err = TestReadsCurrentHeapFreeNonGlobalAttributeValueFromDut_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Reads CurrentHeapUsed non-global attribute value from DUT\n"); + if (ShouldSkip("A_CURRENTHEAPUSED")) { + NextTest(); + return; + } + err = TestReadsCurrentHeapUsedNonGlobalAttributeValueFromDut_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Reads CurrentHeapHighWaterMark non-global attribute value from DUT\n"); + if (ShouldSkip("A_CURRENTHEAPHIGHWATERMARK")) { + NextTest(); + return; + } + err = TestReadsCurrentHeapHighWaterMarkNonGlobalAttributeValueFromDut_4(); + break; } - [cluster getGroupMembershipWithParams:params - completionHandler:^( - CHIPGroupsClusterGetGroupMembershipResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Get Group Membership 3 Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } - { - id actualValue = values.capacity; - VerifyOrReturn(CheckValueNull("capacity", actualValue)); - } + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } - { - id actualValue = values.groupList; - VerifyOrReturn(CheckValue("groupList", [actualValue count], static_cast(1))); - VerifyOrReturn(CheckValue("", actualValue[0], 1U)); - } +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 5; - NextTest(); - }]; + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestRemoveAll_14() + CHIP_ERROR TestReadsAListOfThreadMetricsStructNonGlobalAttributeFromDut_1() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestSoftwareDiagnostics * cluster = [[CHIPTestSoftwareDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster removeAllGroupsWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Remove All Error: %@", err); + [cluster readAttributeThreadMetricsWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads a list of ThreadMetrics struct non-global attribute from DUT. Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckConstraintType("threadMetrics", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestViewGroup1Removed_15() + CHIP_ERROR TestReadsCurrentHeapFreeNonGlobalAttributeValueFromDut_2() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestSoftwareDiagnostics * cluster = [[CHIPTestSoftwareDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; - params.groupId = [NSNumber numberWithUnsignedShort:1U]; - [cluster viewGroupWithParams:params - completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"View Group 1 (removed) Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + [cluster readAttributeCurrentHeapFreeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads CurrentHeapFree non-global attribute value from DUT Error: %@", err); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 139)); - } + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } - { - id actualValue = values.groupId; - VerifyOrReturn(CheckValue("groupId", actualValue, 1U)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("currentHeapFree", "", "uint64")); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestViewGroup2StillRemoved_16() + CHIP_ERROR TestReadsCurrentHeapUsedNonGlobalAttributeValueFromDut_3() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestSoftwareDiagnostics * cluster = [[CHIPTestSoftwareDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; - params.groupId = [NSNumber numberWithUnsignedShort:4369U]; - [cluster viewGroupWithParams:params - completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"View Group 2 (still removed) Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + [cluster readAttributeCurrentHeapUsedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads CurrentHeapUsed non-global attribute value from DUT Error: %@", err); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 139)); - } + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } - { - id actualValue = values.groupId; - VerifyOrReturn(CheckValue("groupId", actualValue, 4369U)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("currentHeapUsed", "", "uint64")); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestViewGroup3Removed_17() + CHIP_ERROR TestReadsCurrentHeapHighWaterMarkNonGlobalAttributeValueFromDut_4() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestSoftwareDiagnostics * cluster = [[CHIPTestSoftwareDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; - params.groupId = [NSNumber numberWithUnsignedShort:32767U]; - [cluster viewGroupWithParams:params - completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"View Group 3 (removed) Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + [cluster readAttributeCurrentHeapHighWatermarkWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads CurrentHeapHighWaterMark non-global attribute value from DUT Error: %@", err); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 139)); - } + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } - { - id actualValue = values.groupId; - VerifyOrReturn(CheckValue("groupId", actualValue, 32767U)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("currentHeapHighWatermark", "", "uint64")); + NextTest(); + }]; return CHIP_NO_ERROR; } +}; - CHIP_ERROR TestGetGroupMembership4_18() +class Test_TC_SWDIAG_2_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_SWDIAG_2_1() + : TestCommandBridge("Test_TC_SWDIAG_2_1") + , mTestIndex(0) { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + 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) - __auto_type * params = [[CHIPGroupsClusterGetGroupMembershipParams alloc] init]; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [NSNumber numberWithUnsignedShort:1U]; - temp_0[1] = [NSNumber numberWithUnsignedShort:2U]; - temp_0[2] = [NSNumber numberWithUnsignedShort:4369U]; - temp_0[3] = [NSNumber numberWithUnsignedShort:3U]; - temp_0[4] = [NSNumber numberWithUnsignedShort:32767U]; - params.groupList = temp_0; + ~Test_TC_SWDIAG_2_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_SWDIAG_2_1\n"); } - [cluster getGroupMembershipWithParams:params - completionHandler:^( - CHIPGroupsClusterGetGroupMembershipResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Get Group Membership 4 Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_SWDIAG_2_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } - { - id actualValue = values.capacity; - VerifyOrReturn(CheckValueNull("capacity", actualValue)); - } + Wait(); - { - id actualValue = values.groupList; - VerifyOrReturn(CheckValue("groupList", [actualValue count], static_cast(0))); - } + // 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++) { + } - NextTest(); - }]; + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } - return 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; }; -class TestGroupKeyManagementCluster : public TestCommandBridge { +class Test_TC_SWDIAG_3_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - TestGroupKeyManagementCluster() - : TestCommandBridge("TestGroupKeyManagementCluster") + Test_TC_SWDIAG_3_1() + : TestCommandBridge("Test_TC_SWDIAG_3_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -65354,7 +73990,7 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~TestGroupKeyManagementCluster() {} + ~Test_TC_SWDIAG_3_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -65362,11 +73998,11 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: TestGroupKeyManagementCluster\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_SWDIAG_3_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: TestGroupKeyManagementCluster\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_SWDIAG_3_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -65383,72 +74019,28 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read maxGroupsPerFabric\n"); - err = TestReadMaxGroupsPerFabric_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Sends ResetWatermarks to DUT\n"); + if (ShouldSkip("CR_RESETWATERMARKS")) { + NextTest(); + return; + } + err = TestSendsResetWatermarksToDut_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read maxGroupKeysPerFabric\n"); - err = TestReadMaxGroupKeysPerFabric_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Reads CurrentHeapUsed attribute value from DUT\n"); + if (ShouldSkip("A_CURRENTHEAPUSED")) { + NextTest(); + return; + } + err = TestReadsCurrentHeapUsedAttributeValueFromDut_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Add Group 1\n"); - err = TestAddGroup1_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Add Group 2\n"); - err = TestAddGroup2_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : KeySet Write 1\n"); - err = TestKeySetWrite1_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : KeySet Write 2\n"); - err = TestKeySetWrite2_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : KeySet Read\n"); - err = TestKeySetRead_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Write Group Keys (invalid)\n"); - err = TestWriteGroupKeysInvalid_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Write Group Keys\n"); - err = TestWriteGroupKeys_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Read Group Keys\n"); - err = TestReadGroupKeys_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Read GroupTable\n"); - err = TestReadGroupTable_11(); - break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : KeySet Remove 1\n"); - err = TestKeySetRemove1_12(); - break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : KeySet Read (removed)\n"); - err = TestKeySetReadRemoved_13(); - break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : KeySet Read (not removed)\n"); - err = TestKeySetReadNotRemoved_14(); - break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Remove All\n"); - err = TestRemoveAll_15(); - break; - case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : KeySet Remove 2\n"); - err = TestKeySetRemove2_16(); - break; - case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : KeySet Read (also removed)\n"); - err = TestKeySetReadAlsoRemoved_17(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Reads CurrentHeapHighWaterMark attribute value from DUT\n"); + if (ShouldSkip("A_CURRENTHEAPHIGHWATERMARK")) { + NextTest(); + return; + } + err = TestReadsCurrentHeapHighWaterMarkAttributeValueFromDut_3(); break; } @@ -65465,7 +74057,7 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 18; + const uint16_t mTestCount = 4; chip::Optional mNodeId; chip::Optional mCluster; @@ -65478,490 +74070,294 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadMaxGroupsPerFabric_1() + CHIP_ERROR TestSendsResetWatermarksToDut_1() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestSoftwareDiagnostics * cluster = [[CHIPTestSoftwareDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMaxGroupsPerFabricWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read maxGroupsPerFabric Error: %@", err); + [cluster resetWatermarksWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Sends ResetWatermarks to DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("maxGroupsPerFabric", [value unsignedShortValue], 2U)); - } - NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadMaxGroupKeysPerFabric_2() + CHIP_ERROR TestReadsCurrentHeapUsedAttributeValueFromDut_2() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestSoftwareDiagnostics * cluster = [[CHIPTestSoftwareDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMaxGroupKeysPerFabricWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read maxGroupKeysPerFabric Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + [cluster readAttributeCurrentHeapUsedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads CurrentHeapUsed attribute value from DUT Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("MaxGroupKeysPerFabric", actualValue, 2U)); + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; } + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentHeapUsed", "", "uint64")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestAddGroup1_3() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[CHIPGroupsClusterAddGroupParams alloc] init]; - params.groupId = [NSNumber numberWithUnsignedShort:257U]; - params.groupName = @"Group #1"; - [cluster addGroupWithParams:params - completionHandler:^(CHIPGroupsClusterAddGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Add Group 1 Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0)); - } - - { - id actualValue = values.groupId; - VerifyOrReturn(CheckValue("groupId", actualValue, 257U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestAddGroup2_4() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[CHIPGroupsClusterAddGroupParams alloc] init]; - params.groupId = [NSNumber numberWithUnsignedShort:258U]; - params.groupName = @"Group #2"; - [cluster addGroupWithParams:params - completionHandler:^(CHIPGroupsClusterAddGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Add Group 2 Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0)); - } - - { - id actualValue = values.groupId; - VerifyOrReturn(CheckValue("groupId", actualValue, 258U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestKeySetWrite1_5() + CHIP_ERROR TestReadsCurrentHeapHighWaterMarkAttributeValueFromDut_3() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestSoftwareDiagnostics * cluster = [[CHIPTestSoftwareDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPGroupKeyManagementClusterKeySetWriteParams alloc] init]; - params.groupKeySet = [[CHIPGroupKeyManagementClusterGroupKeySetStruct alloc] init]; - ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySetID = - [NSNumber numberWithUnsignedShort:417U]; - ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySecurityPolicy = - [NSNumber numberWithUnsignedChar:0]; - ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey0 = - [[NSData alloc] initWithBytes:"\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257" length:16]; - ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime0 = - [NSNumber numberWithUnsignedLongLong:1110000ULL]; - ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey1 = - [[NSData alloc] initWithBytes:"\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277" length:16]; - ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime1 = - [NSNumber numberWithUnsignedLongLong:1110001ULL]; - ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey2 = - [[NSData alloc] initWithBytes:"\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317" length:16]; - ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime2 = - [NSNumber numberWithUnsignedLongLong:1110002ULL]; + [cluster readAttributeCurrentHeapHighWatermarkWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads CurrentHeapHighWaterMark attribute value from DUT Error: %@", err); - [cluster keySetWriteWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"KeySet Write 1 Error: %@", err); + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("currentHeapHighWatermark", "", "uint64")); + NextTest(); + }]; return CHIP_NO_ERROR; } +}; - CHIP_ERROR TestKeySetWrite2_6() +class TestSubscribe_OnOff : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + TestSubscribe_OnOff() + : TestCommandBridge("TestSubscribe_OnOff") + , mTestIndex(0) { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[CHIPGroupKeyManagementClusterKeySetWriteParams alloc] init]; - params.groupKeySet = [[CHIPGroupKeyManagementClusterGroupKeySetStruct alloc] init]; - ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySetID = - [NSNumber numberWithUnsignedShort:418U]; - ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySecurityPolicy = - [NSNumber numberWithUnsignedChar:1]; - ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey0 = - [[NSData alloc] initWithBytes:"\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337" length:16]; - ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime0 = - [NSNumber numberWithUnsignedLongLong:2110000ULL]; - ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey1 = - [[NSData alloc] initWithBytes:"\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357" length:16]; - ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime1 = - [NSNumber numberWithUnsignedLongLong:2110001ULL]; - ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey2 = - [[NSData alloc] initWithBytes:"\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377" length:16]; - ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime2 = - [NSNumber numberWithUnsignedLongLong:2110002ULL]; - - [cluster keySetWriteWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"KeySet Write 2 Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; + 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) - CHIP_ERROR TestKeySetRead_7() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[CHIPGroupKeyManagementClusterKeySetReadParams alloc] init]; - params.groupKeySetID = [NSNumber numberWithUnsignedShort:417U]; - [cluster - keySetReadWithParams:params - completionHandler:^( - CHIPGroupKeyManagementClusterKeySetReadResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"KeySet Read Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = values.groupKeySet; - VerifyOrReturn(CheckValue( - "GroupKeySetID", ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).groupKeySetID, 417U)); - VerifyOrReturn(CheckValue("GroupKeySecurityPolicy", - ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).groupKeySecurityPolicy, 0)); - VerifyOrReturn( - CheckValueNull("EpochKey0", ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochKey0)); - VerifyOrReturn(CheckValueNonNull( - "EpochStartTime0", ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime0)); - VerifyOrReturn(CheckValue("EpochStartTime0", - ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime0, 1110000ULL)); - VerifyOrReturn( - CheckValueNull("EpochKey1", ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochKey1)); - VerifyOrReturn(CheckValueNonNull( - "EpochStartTime1", ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime1)); - VerifyOrReturn(CheckValue("EpochStartTime1", - ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime1, 1110001ULL)); - VerifyOrReturn( - CheckValueNull("EpochKey2", ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochKey2)); - VerifyOrReturn(CheckValueNonNull( - "EpochStartTime2", ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime2)); - VerifyOrReturn(CheckValue("EpochStartTime2", - ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime2, 1110002ULL)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } + ~TestSubscribe_OnOff() {} - CHIP_ERROR TestWriteGroupKeysInvalid_8() + /////////// TestCommand Interface ///////// + void NextTest() override { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id groupKeyMapArgument; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [[CHIPGroupKeyManagementClusterGroupKeyMapStruct alloc] init]; - ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[0]).groupId = [NSNumber numberWithUnsignedShort:258U]; - ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[0]).groupKeySetID = [NSNumber numberWithUnsignedShort:0U]; - ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedChar:1]; + CHIP_ERROR err = CHIP_NO_ERROR; - groupKeyMapArgument = temp_0; + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: TestSubscribe_OnOff\n"); } - [cluster writeAttributeGroupKeyMapWithValue:groupKeyMapArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write Group Keys (invalid) Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestWriteGroupKeys_9() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: TestSubscribe_OnOff\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } - id groupKeyMapArgument; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [[CHIPGroupKeyManagementClusterGroupKeyMapStruct alloc] init]; - ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[0]).groupId = [NSNumber numberWithUnsignedShort:257U]; - ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[0]).groupKeySetID = [NSNumber numberWithUnsignedShort:417U]; - ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedChar:1]; + Wait(); - temp_0[1] = [[CHIPGroupKeyManagementClusterGroupKeyMapStruct alloc] init]; - ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[1]).groupId = [NSNumber numberWithUnsignedShort:258U]; - ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[1]).groupKeySetID = [NSNumber numberWithUnsignedShort:418U]; - ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[1]).fabricIndex = [NSNumber numberWithUnsignedChar:1]; + // 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 : Set OnOff Attribute to false\n"); + err = TestSetOnOffAttributeToFalse_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Report: Subscribe OnOff Attribute\n"); + err = TestReportSubscribeOnOffAttribute_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Subscribe OnOff Attribute\n"); + err = TestSubscribeOnOffAttribute_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Turn On the light to see attribute change\n"); + err = TestTurnOnTheLightToSeeAttributeChange_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Check for attribute report\n"); + err = TestCheckForAttributeReport_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Turn Off the light to see attribute change\n"); + err = TestTurnOffTheLightToSeeAttributeChange_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Check for attribute report\n"); + err = TestCheckForAttributeReport_7(); + break; + } - groupKeyMapArgument = temp_0; + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); } - [cluster writeAttributeGroupKeyMapWithValue:groupKeyMapArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write Group Keys Error: %@", err); + } - VerifyOrReturn(CheckValue("status", err, 0)); + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } - NextTest(); - }]; +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 8; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestReadGroupKeys_10() + CHIP_ERROR TestSetOnOffAttributeToFalse_1() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - CHIPReadParams * params = [[CHIPReadParams alloc] init]; - params.fabricFiltered = [NSNumber numberWithBool:true]; - [cluster - readAttributeGroupKeyMapWithParams:params - completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read Group Keys Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + [cluster offWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Set OnOff Attribute to false Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("GroupKeyMap", [actualValue count], static_cast(2))); - VerifyOrReturn(CheckValue("GroupId", - ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[0]).groupId, 257U)); - VerifyOrReturn(CheckValue("GroupKeySetID", - ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[0]).groupKeySetID, 417U)); - VerifyOrReturn(CheckValue("FabricIndex", - ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[0]).fabricIndex, 1)); - VerifyOrReturn(CheckValue("GroupId", - ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[1]).groupId, 258U)); - VerifyOrReturn(CheckValue("GroupKeySetID", - ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[1]).groupKeySetID, 418U)); - VerifyOrReturn(CheckValue("FabricIndex", - ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[1]).fabricIndex, 1)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } + bool testSendClusterTestSubscribe_OnOff_000002_WaitForReport_Fulfilled = false; + ResponseHandler _Nullable test_TestSubscribe_OnOff_OnOff_Reported = nil; - CHIP_ERROR TestReadGroupTable_11() + CHIP_ERROR TestReportSubscribeOnOffAttribute_2() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - CHIPReadParams * params = [[CHIPReadParams alloc] init]; - params.fabricFiltered = [NSNumber numberWithBool:true]; - [cluster readAttributeGroupTableWithParams:params - completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read GroupTable Error: %@", err); + test_TestSubscribe_OnOff_OnOff_Reported = ^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Report: Subscribe OnOff Attribute Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("GroupTable", [actualValue count], static_cast(2))); - VerifyOrReturn(CheckValue("GroupId", - ((CHIPGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[0]).groupId, 257U)); - VerifyOrReturn(CheckValueAsString("GroupName", - ((CHIPGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[0]).groupName, - @"Group #1")); - VerifyOrReturn(CheckValue("FabricIndex", - ((CHIPGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[0]).fabricIndex, 1)); - VerifyOrReturn(CheckValue("GroupId", - ((CHIPGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[1]).groupId, 258U)); - VerifyOrReturn(CheckValueAsString("GroupName", - ((CHIPGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[1]).groupName, - @"Group #2")); - VerifyOrReturn(CheckValue("FabricIndex", - ((CHIPGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[1]).fabricIndex, 1)); - } + { + id actualValue = value; + VerifyOrReturn(CheckValue("OnOff", actualValue, false)); + } - NextTest(); - }]; + testSendClusterTestSubscribe_OnOff_000002_WaitForReport_Fulfilled = true; + }; + NextTest(); return CHIP_NO_ERROR; } - CHIP_ERROR TestKeySetRemove1_12() + CHIP_ERROR TestSubscribeOnOffAttribute_3() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPGroupKeyManagementClusterKeySetRemoveParams alloc] init]; - params.groupKeySetID = [NSNumber numberWithUnsignedShort:417U]; - [cluster keySetRemoveWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"KeySet Remove 1 Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + uint16_t minIntervalArgument = 2U; + uint16_t maxIntervalArgument = 5U; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + [cluster subscribeAttributeOnOffWithMinInterval:[NSNumber numberWithUnsignedInt:minIntervalArgument] + maxInterval:[NSNumber numberWithUnsignedInt:maxIntervalArgument] + params:params + subscriptionEstablished:^{ + VerifyOrReturn(testSendClusterTestSubscribe_OnOff_000002_WaitForReport_Fulfilled, + SetCommandExitStatus(CHIP_ERROR_INCORRECT_STATE)); + NextTest(); + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Subscribe OnOff Attribute Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + if (test_TestSubscribe_OnOff_OnOff_Reported != nil) { + ResponseHandler callback = test_TestSubscribe_OnOff_OnOff_Reported; + test_TestSubscribe_OnOff_OnOff_Reported = nil; + callback(value, err); + } + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestKeySetReadRemoved_13() + CHIP_ERROR TestTurnOnTheLightToSeeAttributeChange_4() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPGroupKeyManagementClusterKeySetReadParams alloc] init]; - params.groupKeySetID = [NSNumber numberWithUnsignedShort:417U]; - [cluster keySetReadWithParams:params - completionHandler:^( - CHIPGroupKeyManagementClusterKeySetReadResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"KeySet Read (removed) Error: %@", err); + [cluster onWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Turn On the light to see attribute change Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_NOT_FOUND)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestKeySetReadNotRemoved_14() + CHIP_ERROR TestCheckForAttributeReport_5() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPGroupKeyManagementClusterKeySetReadParams alloc] init]; - params.groupKeySetID = [NSNumber numberWithUnsignedShort:418U]; - [cluster - keySetReadWithParams:params - completionHandler:^( - CHIPGroupKeyManagementClusterKeySetReadResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"KeySet Read (not removed) Error: %@", err); + test_TestSubscribe_OnOff_OnOff_Reported = ^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check for attribute report Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = values.groupKeySet; - VerifyOrReturn(CheckValue( - "GroupKeySetID", ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).groupKeySetID, 418U)); - VerifyOrReturn(CheckValue("GroupKeySecurityPolicy", - ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).groupKeySecurityPolicy, 1)); - VerifyOrReturn( - CheckValueNull("EpochKey0", ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochKey0)); - VerifyOrReturn(CheckValueNonNull( - "EpochStartTime0", ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime0)); - VerifyOrReturn(CheckValue("EpochStartTime0", - ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime0, 2110000ULL)); - VerifyOrReturn( - CheckValueNull("EpochKey1", ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochKey1)); - VerifyOrReturn(CheckValueNonNull( - "EpochStartTime1", ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime1)); - VerifyOrReturn(CheckValue("EpochStartTime1", - ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime1, 2110001ULL)); - VerifyOrReturn( - CheckValueNull("EpochKey2", ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochKey2)); - VerifyOrReturn(CheckValueNonNull( - "EpochStartTime2", ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime2)); - VerifyOrReturn(CheckValue("EpochStartTime2", - ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime2, 2110002ULL)); - } + { + id actualValue = value; + VerifyOrReturn(CheckValue("OnOff", actualValue, true)); + } - NextTest(); - }]; + NextTest(); + }; return CHIP_NO_ERROR; } - CHIP_ERROR TestRemoveAll_15() + CHIP_ERROR TestTurnOffTheLightToSeeAttributeChange_6() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster removeAllGroupsWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Remove All Error: %@", err); + [cluster offWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Turn Off the light to see attribute change Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -65971,56 +74367,34 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestKeySetRemove2_16() + CHIP_ERROR TestCheckForAttributeReport_7() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPGroupKeyManagementClusterKeySetRemoveParams alloc] init]; - params.groupKeySetID = [NSNumber numberWithUnsignedShort:418U]; - [cluster keySetRemoveWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"KeySet Remove 2 Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } + test_TestSubscribe_OnOff_OnOff_Reported = ^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check for attribute report Error: %@", err); - CHIP_ERROR TestKeySetReadAlsoRemoved_17() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(CheckValue("status", err, 0)); - __auto_type * params = [[CHIPGroupKeyManagementClusterKeySetReadParams alloc] init]; - params.groupKeySetID = [NSNumber numberWithUnsignedShort:418U]; - [cluster keySetReadWithParams:params - completionHandler:^( - CHIPGroupKeyManagementClusterKeySetReadResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"KeySet Read (also removed) Error: %@", err); + { + id actualValue = value; + VerifyOrReturn(CheckValue("OnOff", actualValue, false)); + } - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_NOT_FOUND)); - NextTest(); - }]; + NextTest(); + }; return CHIP_NO_ERROR; } }; -class TestIdentifyCluster : public TestCommandBridge { +class DL_LockUnlock : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - TestIdentifyCluster() - : TestCommandBridge("TestIdentifyCluster") + DL_LockUnlock() + : TestCommandBridge("DL_LockUnlock") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -66030,7 +74404,7 @@ class TestIdentifyCluster : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~TestIdentifyCluster() {} + ~DL_LockUnlock() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -66038,11 +74412,11 @@ class TestIdentifyCluster : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: TestIdentifyCluster\n"); + ChipLogProgress(chipTool, " **** Test Start: DL_LockUnlock\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: TestIdentifyCluster\n"); + ChipLogProgress(chipTool, " **** Test Complete: DL_LockUnlock\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -66059,8 +74433,44 @@ class TestIdentifyCluster : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Send Identify command and expect success response\n"); - err = TestSendIdentifyCommandAndExpectSuccessResponse_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Create new PIN credential and lock/unlock user\n"); + err = TestCreateNewPinCredentialAndLockUnlockUser_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Try to unlock the door with invalid PIN\n"); + err = TestTryToUnlockTheDoorWithInvalidPin_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Verify that lock state attribute value is set to Locked\n"); + err = TestVerifyThatLockStateAttributeValueIsSetToLocked_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Try to unlock the door with valid PIN\n"); + err = TestTryToUnlockTheDoorWithValidPin_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Verify that lock state attribute value is set to Unlocked\n"); + err = TestVerifyThatLockStateAttributeValueIsSetToUnlocked_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Try to lock the door with invalid PIN\n"); + err = TestTryToLockTheDoorWithInvalidPin_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Verify that lock state attribute value is set to Unlocked\n"); + err = TestVerifyThatLockStateAttributeValueIsSetToUnlocked_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Try to unlock the door with valid PIN\n"); + err = TestTryToUnlockTheDoorWithValidPin_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Verify that lock state attribute value is set to Locked\n"); + err = TestVerifyThatLockStateAttributeValueIsSetToLocked_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Clean the created credential\n"); + err = TestCleanTheCreatedCredential_10(); break; } @@ -66077,7 +74487,7 @@ class TestIdentifyCluster : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 2; + const uint16_t mTestCount = 11; chip::Optional mNodeId; chip::Optional mCluster; @@ -66090,123 +74500,251 @@ class TestIdentifyCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestSendIdentifyCommandAndExpectSuccessResponse_1() + CHIP_ERROR TestCreateNewPinCredentialAndLockUnlockUser_1() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPIdentifyClusterIdentifyParams alloc] init]; - params.identifyTime = [NSNumber numberWithUnsignedShort:0U]; - [cluster identifyWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Send Identify command and expect success response Error: %@", err); + __auto_type * params = [[CHIPDoorLockClusterSetCredentialParams alloc] init]; + params.operationType = [NSNumber numberWithUnsignedChar:0]; + params.credential = [[CHIPDoorLockClusterDlCredential alloc] init]; + ((CHIPDoorLockClusterDlCredential *) params.credential).credentialType = [NSNumber numberWithUnsignedChar:1]; + ((CHIPDoorLockClusterDlCredential *) params.credential).credentialIndex = [NSNumber numberWithUnsignedShort:1U]; + + params.credentialData = [[NSData alloc] initWithBytes:"123456" length:6]; + params.userIndex = nil; + params.userStatus = nil; + params.userType = nil; + [cluster + setCredentialWithParams:params + completionHandler:^(CHIPDoorLockClusterSetCredentialResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Create new PIN credential and lock/unlock user Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0)); + } + + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValueNonNull("userIndex", actualValue)); + VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); + } + + { + id actualValue = values.nextCredentialIndex; + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", actualValue)); + VerifyOrReturn(CheckValue("nextCredentialIndex", actualValue, 2U)); + } + NextTest(); }]; return CHIP_NO_ERROR; } -}; -class TestLogCommands : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - TestLogCommands() - : TestCommandBridge("TestLogCommands") - , mTestIndex(0) + CHIP_ERROR TestTryToUnlockTheDoorWithInvalidPin_2() { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPDoorLockClusterUnlockDoorParams alloc] init]; + params.pinCode = [[NSData alloc] initWithBytes:"000000" length:6]; + [cluster unlockDoorWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Try to unlock the door with invalid PIN Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_FAILURE)); + NextTest(); + }]; + + return CHIP_NO_ERROR; } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~TestLogCommands() {} + CHIP_ERROR TestVerifyThatLockStateAttributeValueIsSetToLocked_3() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - /////////// TestCommand Interface ///////// - void NextTest() override + [cluster readAttributeLockStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify that lock state attribute value is set to Locked Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("LockState", actualValue)); + VerifyOrReturn(CheckValue("LockState", actualValue, 1)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTryToUnlockTheDoorWithValidPin_4() { - CHIP_ERROR err = CHIP_NO_ERROR; + CHIPDevice * device = GetConnectedDevice(); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: TestLogCommands\n"); - } + __auto_type * params = [[CHIPDoorLockClusterUnlockDoorParams alloc] init]; + params.pinCode = [[NSData alloc] initWithBytes:"123456" length:6]; + [cluster unlockDoorWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Try to unlock the door with valid PIN Error: %@", err); - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: TestLogCommands\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + VerifyOrReturn(CheckValue("status", err, 0)); - Wait(); + NextTest(); + }]; - // 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 simple message\n"); - err = TestLogASimpleMessage_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Do a simple user prompt message\n"); - err = TestDoASimpleUserPromptMessage_2(); - break; - } + return CHIP_NO_ERROR; + } - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + CHIP_ERROR TestVerifyThatLockStateAttributeValueIsSetToUnlocked_5() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeLockStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify that lock state attribute value is set to Unlocked Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("LockState", actualValue)); + VerifyOrReturn(CheckValue("LockState", actualValue, 2)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; } - chip::System::Clock::Timeout GetWaitDuration() const override + CHIP_ERROR TestTryToLockTheDoorWithInvalidPin_6() { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPDoorLockClusterLockDoorParams alloc] init]; + params.pinCode = [[NSData alloc] initWithBytes:"000000" length:6]; + [cluster lockDoorWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Try to lock the door with invalid PIN Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_FAILURE)); + NextTest(); + }]; + + return CHIP_NO_ERROR; } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 3; + CHIP_ERROR TestVerifyThatLockStateAttributeValueIsSetToUnlocked_7() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; + [cluster readAttributeLockStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify that lock state attribute value is set to Unlocked Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("LockState", actualValue)); + VerifyOrReturn(CheckValue("LockState", actualValue, 2)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTryToUnlockTheDoorWithValidPin_8() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPDoorLockClusterLockDoorParams alloc] init]; + params.pinCode = [[NSData alloc] initWithBytes:"123456" length:6]; + [cluster lockDoorWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Try to unlock the door with valid PIN Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestVerifyThatLockStateAttributeValueIsSetToLocked_9() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeLockStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify that lock state attribute value is set to Locked Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("LockState", actualValue)); + VerifyOrReturn(CheckValue("LockState", actualValue, 1)); + } - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); - return CHIP_NO_ERROR; - } + NextTest(); + }]; - CHIP_ERROR TestLogASimpleMessage_1() - { - Log(@"This is a simple message"); return CHIP_NO_ERROR; } - CHIP_ERROR TestDoASimpleUserPromptMessage_2() + CHIP_ERROR TestCleanTheCreatedCredential_10() { - UserPrompt(@"This is a simple message"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPDoorLockClusterClearCredentialParams alloc] init]; + params.credential = [[CHIPDoorLockClusterDlCredential alloc] init]; + ((CHIPDoorLockClusterDlCredential *) params.credential).credentialType = [NSNumber numberWithUnsignedChar:1]; + ((CHIPDoorLockClusterDlCredential *) params.credential).credentialIndex = [NSNumber numberWithUnsignedShort:1U]; + + [cluster clearCredentialWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Clean the created credential Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + return CHIP_NO_ERROR; } }; -class TestOperationalCredentialsCluster : public TestCommandBridge { +class Test_TC_DL_1_3 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - TestOperationalCredentialsCluster() - : TestCommandBridge("TestOperationalCredentialsCluster") + Test_TC_DL_1_3() + : TestCommandBridge("Test_TC_DL_1_3") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -66216,7 +74754,7 @@ class TestOperationalCredentialsCluster : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~TestOperationalCredentialsCluster() {} + ~Test_TC_DL_1_3() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -66224,11 +74762,11 @@ class TestOperationalCredentialsCluster : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: TestOperationalCredentialsCluster\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_DL_1_3\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: TestOperationalCredentialsCluster\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DL_1_3\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -66245,32 +74783,36 @@ class TestOperationalCredentialsCluster : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read number of supported fabrics\n"); - err = TestReadNumberOfSupportedFabrics_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Create new PIN credential and lock/unlock user\n"); + err = TestCreateNewPinCredentialAndLockUnlockUser_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read number of commissioned fabrics\n"); - err = TestReadNumberOfCommissionedFabrics_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Precondition: Door is in locked state\n"); + err = TestPreconditionDoorIsInLockedState_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read current fabric index\n"); - err = TestReadCurrentFabricIndex_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : TH writes AutoRelockTime attribute value as 10 seconds on the DUT\n"); + err = TestThWritesAutoRelockTimeAttributeValueAs10SecondsOnTheDut_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Remove nonexistent fabric\n"); - err = TestRemoveNonexistentFabric_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : TH sends the unlock Door command to the DUT with valid PINCode\n"); + err = TestThSendsTheUnlockDoorCommandToTheDutWithValidPINCode_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read fabric list before setting label\n"); - err = TestReadFabricListBeforeSettingLabel_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : TH reads AutoRelockTime attribute from DUT\n"); + err = TestThReadsAutoRelockTimeAttributeFromDut_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Set the fabric label\n"); - err = TestSetTheFabricLabel_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : Wait 10000ms\n"); + err = TestWait10000ms_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Read fabric list after setting label\n"); - err = TestReadFabricListAfterSettingLabel_7(); + ChipLogProgress(chipTool, " ***** Test Step 7 : TH reads LockState attriute\n"); + err = TestThReadsLockStateAttriute_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Clean the created credential\n"); + err = TestCleanTheCreatedCredential_8(); break; } @@ -66287,7 +74829,7 @@ class TestOperationalCredentialsCluster : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 8; + const uint16_t mTestCount = 9; chip::Optional mNodeId; chip::Optional mCluster; @@ -66300,201 +74842,179 @@ class TestOperationalCredentialsCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadNumberOfSupportedFabrics_1() + CHIP_ERROR TestCreateNewPinCredentialAndLockUnlockUser_1() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeSupportedFabricsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read number of supported fabrics Error: %@", err); + __auto_type * params = [[CHIPDoorLockClusterSetCredentialParams alloc] init]; + params.operationType = [NSNumber numberWithUnsignedChar:0]; + params.credential = [[CHIPDoorLockClusterDlCredential alloc] init]; + ((CHIPDoorLockClusterDlCredential *) params.credential).credentialType = [NSNumber numberWithUnsignedChar:1]; + ((CHIPDoorLockClusterDlCredential *) params.credential).credentialIndex = [NSNumber numberWithUnsignedShort:1U]; - VerifyOrReturn(CheckValue("status", err, 0)); + params.credentialData = [[NSData alloc] initWithBytes:"123456" length:6]; + params.userIndex = nil; + params.userStatus = nil; + params.userType = nil; + [cluster + setCredentialWithParams:params + completionHandler:^(CHIPDoorLockClusterSetCredentialResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Create new PIN credential and lock/unlock user Error: %@", err); - VerifyOrReturn(CheckConstraintType("supportedFabrics", "", "uint8")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("supportedFabrics", [value unsignedCharValue], 4)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0)); + } + + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValueNonNull("userIndex", actualValue)); + VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); + } + + { + id actualValue = values.nextCredentialIndex; + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", actualValue)); + VerifyOrReturn(CheckValue("nextCredentialIndex", actualValue, 2U)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadNumberOfCommissionedFabrics_2() + CHIP_ERROR TestPreconditionDoorIsInLockedState_2() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCommissionedFabricsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read number of commissioned fabrics Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + __auto_type * params = [[CHIPDoorLockClusterLockDoorParams alloc] init]; + params.pinCode = [[NSData alloc] initWithBytes:"123456" length:6]; + [cluster lockDoorWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Precondition: Door is in locked state Error: %@", err); - VerifyOrReturn(CheckConstraintType("commissionedFabrics", "", "uint8")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("commissionedFabrics", [value unsignedCharValue], 1)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - NSNumber * _Nonnull ourFabricIndex; - CHIP_ERROR TestReadCurrentFabricIndex_3() + CHIP_ERROR TestThWritesAutoRelockTimeAttributeValueAs10SecondsOnTheDut_3() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentFabricIndexWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read current fabric index Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id autoRelockTimeArgument; + autoRelockTimeArgument = [NSNumber numberWithUnsignedInt:10UL]; + [cluster writeAttributeAutoRelockTimeWithValue:autoRelockTimeArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH writes AutoRelockTime attribute value as 10 seconds on the DUT Error: %@", err); - VerifyOrReturn(CheckConstraintType("currentFabricIndex", "", "uint8")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("currentFabricIndex", [value unsignedCharValue], 1)); - } - { - ourFabricIndex = value; - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestRemoveNonexistentFabric_4() + CHIP_ERROR TestThSendsTheUnlockDoorCommandToTheDutWithValidPINCode_4() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPOperationalCredentialsClusterRemoveFabricParams alloc] init]; - params.fabricIndex = [NSNumber numberWithUnsignedChar:243]; - [cluster removeFabricWithParams:params - completionHandler:^( - CHIPOperationalCredentialsClusterNOCResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Remove nonexistent fabric Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + __auto_type * params = [[CHIPDoorLockClusterUnlockDoorParams alloc] init]; + params.pinCode = [[NSData alloc] initWithBytes:"123456" length:6]; + [cluster unlockDoorWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends the unlock Door command to the DUT with valid PINCode Error: %@", err); - { - id actualValue = values.statusCode; - VerifyOrReturn(CheckValue("StatusCode", actualValue, 11)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadFabricListBeforeSettingLabel_5() + CHIP_ERROR TestThReadsAutoRelockTimeAttributeFromDut_5() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - CHIPReadParams * params = [[CHIPReadParams alloc] init]; - params.fabricFiltered = [NSNumber numberWithBool:true]; - [cluster readAttributeFabricsWithParams:params - completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read fabric list before setting label Error: %@", err); + [cluster readAttributeAutoRelockTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads AutoRelockTime attribute from DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("Fabrics", [actualValue count], static_cast(1))); - VerifyOrReturn(CheckValueAsString("Label", - ((CHIPOperationalCredentialsClusterFabricDescriptor *) actualValue[0]).label, @"")); - VerifyOrReturn(CheckValue("FabricIndex", - ((CHIPOperationalCredentialsClusterFabricDescriptor *) actualValue[0]).fabricIndex, - ourFabricIndex)); - } + { + id actualValue = value; + VerifyOrReturn(CheckValue("AutoRelockTime", actualValue, 10UL)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSetTheFabricLabel_6() + CHIP_ERROR TestWait10000ms_6() + { + WaitForMs(10000); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsLockStateAttriute_7() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPOperationalCredentialsClusterUpdateFabricLabelParams alloc] init]; - params.label = @"Batcave"; - [cluster updateFabricLabelWithParams:params - completionHandler:^( - CHIPOperationalCredentialsClusterNOCResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Set the fabric label Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + [cluster readAttributeLockStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads LockState attriute Error: %@", err); - { - id actualValue = values.statusCode; - VerifyOrReturn(CheckValue("StatusCode", actualValue, 0)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = values.fabricIndex; - VerifyOrReturn(CheckValue("FabricIndex", actualValue, ourFabricIndex)); - } + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("LockState", actualValue)); + VerifyOrReturn(CheckValue("LockState", actualValue, 1)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadFabricListAfterSettingLabel_7() + CHIP_ERROR TestCleanTheCreatedCredential_8() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - CHIPReadParams * params = [[CHIPReadParams alloc] init]; - params.fabricFiltered = [NSNumber numberWithBool:true]; - [cluster - readAttributeFabricsWithParams:params - completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read fabric list after setting label Error: %@", err); + __auto_type * params = [[CHIPDoorLockClusterClearCredentialParams alloc] init]; + params.credential = [[CHIPDoorLockClusterDlCredential alloc] init]; + ((CHIPDoorLockClusterDlCredential *) params.credential).credentialType = [NSNumber numberWithUnsignedChar:1]; + ((CHIPDoorLockClusterDlCredential *) params.credential).credentialIndex = [NSNumber numberWithUnsignedShort:1U]; - VerifyOrReturn(CheckValue("status", err, 0)); + [cluster clearCredentialWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Clean the created credential Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("Fabrics", [actualValue count], static_cast(1))); - VerifyOrReturn(CheckValueAsString("Label", - ((CHIPOperationalCredentialsClusterFabricDescriptor *) actualValue[0]).label, @"Batcave")); - VerifyOrReturn(CheckValue("FabricIndex", - ((CHIPOperationalCredentialsClusterFabricDescriptor *) actualValue[0]).fabricIndex, - ourFabricIndex)); - } + VerifyOrReturn(CheckValue("status", err, 0)); NextTest(); }]; @@ -66503,11 +75023,11 @@ class TestOperationalCredentialsCluster : public TestCommandBridge { } }; -class TestSelfFabricRemoval : public TestCommandBridge { +class TestGroupsCluster : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - TestSelfFabricRemoval() - : TestCommandBridge("TestSelfFabricRemoval") + TestGroupsCluster() + : TestCommandBridge("TestGroupsCluster") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -66517,7 +75037,7 @@ class TestSelfFabricRemoval : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~TestSelfFabricRemoval() {} + ~TestGroupsCluster() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -66525,510 +75045,698 @@ class TestSelfFabricRemoval : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: TestSelfFabricRemoval\n"); + ChipLogProgress(chipTool, " **** Test Start: TestGroupsCluster\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: TestSelfFabricRemoval\n"); + ChipLogProgress(chipTool, " **** Test Complete: TestGroupsCluster\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 : Read number of commissioned fabrics\n"); - err = TestReadNumberOfCommissionedFabrics_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read current fabric index\n"); - err = TestReadCurrentFabricIndex_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Remove single own fabric\n"); - err = TestRemoveSingleOwnFabric_3(); - break; - } + // 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 : View Group 0 (invalid)\n"); + err = TestViewGroup0Invalid_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : View Group 1 (not found)\n"); + err = TestViewGroup1NotFound_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Add Group 1 (new)\n"); + err = TestAddGroup1New_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : View Group 1 (new)\n"); + err = TestViewGroup1New_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : View Group 2 (not found)\n"); + err = TestViewGroup2NotFound_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Get Group Membership 1 (all)\n"); + err = TestGetGroupMembership1All_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : View Group 3 (not found)\n"); + err = TestViewGroup3NotFound_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : View Group 1 (existing)\n"); + err = TestViewGroup1Existing_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Remove Group 0 (invalid)\n"); + err = TestRemoveGroup0Invalid_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Remove Group 4 (not found)\n"); + err = TestRemoveGroup4NotFound_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : View Group 1 (not removed)\n"); + err = TestViewGroup1NotRemoved_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : View Group 2 (removed)\n"); + err = TestViewGroup2Removed_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : Get Group Membership 3\n"); + err = TestGetGroupMembership3_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Remove All\n"); + err = TestRemoveAll_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : View Group 1 (removed)\n"); + err = TestViewGroup1Removed_15(); + break; + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : View Group 2 (still removed)\n"); + err = TestViewGroup2StillRemoved_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : View Group 3 (removed)\n"); + err = TestViewGroup3Removed_17(); + break; + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : Get Group Membership 4\n"); + err = TestGetGroupMembership4_18(); + 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 = 19; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestViewGroup0Invalid_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; + params.groupId = [NSNumber numberWithUnsignedShort:0U]; + [cluster viewGroupWithParams:params + completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"View Group 0 (invalid) Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 135)); + } + + { + id actualValue = values.groupId; + VerifyOrReturn(CheckValue("groupId", actualValue, 0U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestViewGroup1NotFound_2() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; + params.groupId = [NSNumber numberWithUnsignedShort:1U]; + [cluster viewGroupWithParams:params + completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"View Group 1 (not found) Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 139)); + } + + { + id actualValue = values.groupId; + VerifyOrReturn(CheckValue("groupId", actualValue, 1U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestAddGroup1New_3() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPGroupsClusterAddGroupParams alloc] init]; + params.groupId = [NSNumber numberWithUnsignedShort:1U]; + params.groupName = @"Group #1"; + [cluster addGroupWithParams:params + completionHandler:^(CHIPGroupsClusterAddGroupResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Add Group 1 (new) Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0)); + } + + { + id actualValue = values.groupId; + VerifyOrReturn(CheckValue("groupId", actualValue, 1U)); + } + + NextTest(); + }]; - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + return CHIP_NO_ERROR; } - chip::System::Clock::Timeout GetWaitDuration() const override + CHIP_ERROR TestViewGroup1New_4() { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } + CHIPDevice * device = GetConnectedDevice(); + CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 4; + __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; + params.groupId = [NSNumber numberWithUnsignedShort:1U]; + [cluster viewGroupWithParams:params + completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"View Group 1 (new) Error: %@", err); - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0)); + } + + { + id actualValue = values.groupId; + VerifyOrReturn(CheckValue("groupId", actualValue, 1U)); + } + + { + id actualValue = values.groupName; + VerifyOrReturn(CheckValueAsString("groupName", actualValue, @"Group #1")); + } + + NextTest(); + }]; - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestReadNumberOfCommissionedFabrics_1() + CHIP_ERROR TestViewGroup2NotFound_5() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCommissionedFabricsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read number of commissioned fabrics Error: %@", err); + __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; + params.groupId = [NSNumber numberWithUnsignedShort:4369U]; + [cluster viewGroupWithParams:params + completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"View Group 2 (not found) Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("CommissionedFabrics", actualValue, 1)); - } + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 139)); + } - VerifyOrReturn(CheckConstraintType("commissionedFabrics", "", "uint8")); - NextTest(); - }]; + { + id actualValue = values.groupId; + VerifyOrReturn(CheckValue("groupId", actualValue, 4369U)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - NSNumber * _Nonnull ourFabricIndex; - CHIP_ERROR TestReadCurrentFabricIndex_2() + CHIP_ERROR TestGetGroupMembership1All_6() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentFabricIndexWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read current fabric index Error: %@", err); + __auto_type * params = [[CHIPGroupsClusterGetGroupMembershipParams alloc] init]; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + params.groupList = temp_0; + } + [cluster getGroupMembershipWithParams:params + completionHandler:^( + CHIPGroupsClusterGetGroupMembershipResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Get Group Membership 1 (all) Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("currentFabricIndex", "", "uint8")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("currentFabricIndex", [value unsignedCharValue], 1)); - } - { - ourFabricIndex = value; - } + { + id actualValue = values.capacity; + VerifyOrReturn(CheckValueNull("capacity", actualValue)); + } - NextTest(); - }]; + { + id actualValue = values.groupList; + VerifyOrReturn(CheckValue("groupList", [actualValue count], static_cast(1))); + VerifyOrReturn(CheckValue("", actualValue[0], 1U)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestRemoveSingleOwnFabric_3() + CHIP_ERROR TestViewGroup3NotFound_7() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPOperationalCredentialsClusterRemoveFabricParams alloc] init]; - params.fabricIndex = [ourFabricIndex copy]; - [cluster removeFabricWithParams:params - completionHandler:^( - CHIPOperationalCredentialsClusterNOCResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Remove single own fabric Error: %@", err); + __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; + params.groupId = [NSNumber numberWithUnsignedShort:32767U]; + [cluster viewGroupWithParams:params + completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"View Group 3 (not found) Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 139)); + } + + { + id actualValue = values.groupId; + VerifyOrReturn(CheckValue("groupId", actualValue, 32767U)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } -}; -class TestBinding : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - TestBinding() - : TestCommandBridge("TestBinding") - , mTestIndex(0) + CHIP_ERROR TestViewGroup1Existing_8() { - 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) + CHIPDevice * device = GetConnectedDevice(); + CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - ~TestBinding() {} + __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; + params.groupId = [NSNumber numberWithUnsignedShort:1U]; + [cluster viewGroupWithParams:params + completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"View Group 1 (existing) Error: %@", err); - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; + VerifyOrReturn(CheckValue("status", err, 0)); - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: TestBinding\n"); - } + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0)); + } - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: TestBinding\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + { + id actualValue = values.groupId; + VerifyOrReturn(CheckValue("groupId", actualValue, 1U)); + } - Wait(); + { + id actualValue = values.groupName; + VerifyOrReturn(CheckValueAsString("groupName", actualValue, @"Group #1")); + } - // 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 : Write empty binding table\n"); - err = TestWriteEmptyBindingTable_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read empty binding table\n"); - err = TestReadEmptyBindingTable_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Write invalid binding table\n"); - err = TestWriteInvalidBindingTable_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Write binding table (endpoint 1)\n"); - err = TestWriteBindingTableEndpoint1_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read binding table (endpoint 1)\n"); - err = TestReadBindingTableEndpoint1_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Write binding table (endpoint 0)\n"); - err = TestWriteBindingTableEndpoint0_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Read binding table (endpoint 0)\n"); - err = TestReadBindingTableEndpoint0_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Verify endpoint 1 not changed\n"); - err = TestVerifyEndpoint1NotChanged_8(); - break; - } + NextTest(); + }]; - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + return CHIP_NO_ERROR; } - chip::System::Clock::Timeout GetWaitDuration() const override + CHIP_ERROR TestRemoveGroup0Invalid_9() { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } + CHIPDevice * device = GetConnectedDevice(); + CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 9; + __auto_type * params = [[CHIPGroupsClusterRemoveGroupParams alloc] init]; + params.groupId = [NSNumber numberWithUnsignedShort:0U]; + [cluster removeGroupWithParams:params + completionHandler:^(CHIPGroupsClusterRemoveGroupResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Remove Group 0 (invalid) Error: %@", err); - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 135)); + } + + { + id actualValue = values.groupId; + VerifyOrReturn(CheckValue("groupId", actualValue, 0U)); + } + + NextTest(); + }]; - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteEmptyBindingTable_1() + CHIP_ERROR TestRemoveGroup4NotFound_10() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestBinding * cluster = [[CHIPTestBinding alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id bindingArgument; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - bindingArgument = temp_0; - } - [cluster writeAttributeBindingWithValue:bindingArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write empty binding table Error: %@", err); + __auto_type * params = [[CHIPGroupsClusterRemoveGroupParams alloc] init]; + params.groupId = [NSNumber numberWithUnsignedShort:4U]; + [cluster removeGroupWithParams:params + completionHandler:^(CHIPGroupsClusterRemoveGroupResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Remove Group 4 (not found) Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 139)); + } + + { + id actualValue = values.groupId; + VerifyOrReturn(CheckValue("groupId", actualValue, 4U)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadEmptyBindingTable_2() + CHIP_ERROR TestViewGroup1NotRemoved_11() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestBinding * cluster = [[CHIPTestBinding alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - CHIPReadParams * params = [[CHIPReadParams alloc] init]; - params.fabricFiltered = [NSNumber numberWithBool:true]; - [cluster readAttributeBindingWithParams:params - completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read empty binding table Error: %@", err); + __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; + params.groupId = [NSNumber numberWithUnsignedShort:1U]; + [cluster viewGroupWithParams:params + completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"View Group 1 (not removed) Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("Binding", [actualValue count], static_cast(0))); - } + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0)); + } - NextTest(); - }]; + { + id actualValue = values.groupId; + VerifyOrReturn(CheckValue("groupId", actualValue, 1U)); + } + + { + id actualValue = values.groupName; + VerifyOrReturn(CheckValueAsString("groupName", actualValue, @"Group #1")); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteInvalidBindingTable_3() + CHIP_ERROR TestViewGroup2Removed_12() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestBinding * cluster = [[CHIPTestBinding alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id bindingArgument; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [[CHIPBindingClusterTargetStruct alloc] init]; - ((CHIPBindingClusterTargetStruct *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedChar:0]; + __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; + params.groupId = [NSNumber numberWithUnsignedShort:4369U]; + [cluster viewGroupWithParams:params + completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"View Group 2 (removed) Error: %@", err); - temp_0[1] = [[CHIPBindingClusterTargetStruct alloc] init]; - ((CHIPBindingClusterTargetStruct *) temp_0[1]).node = [NSNumber numberWithUnsignedLongLong:1ULL]; - ((CHIPBindingClusterTargetStruct *) temp_0[1]).group = [NSNumber numberWithUnsignedShort:1U]; - ((CHIPBindingClusterTargetStruct *) temp_0[1]).endpoint = [NSNumber numberWithUnsignedShort:1U]; - ((CHIPBindingClusterTargetStruct *) temp_0[1]).cluster = [NSNumber numberWithUnsignedInt:6UL]; - ((CHIPBindingClusterTargetStruct *) temp_0[1]).fabricIndex = [NSNumber numberWithUnsignedChar:0]; + VerifyOrReturn(CheckValue("status", err, 0)); - bindingArgument = temp_0; - } - [cluster writeAttributeBindingWithValue:bindingArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write invalid binding table Error: %@", err); + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 139)); + } - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + { + id actualValue = values.groupId; + VerifyOrReturn(CheckValue("groupId", actualValue, 4369U)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteBindingTableEndpoint1_4() + CHIP_ERROR TestGetGroupMembership3_13() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestBinding * cluster = [[CHIPTestBinding alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id bindingArgument; + __auto_type * params = [[CHIPGroupsClusterGetGroupMembershipParams alloc] init]; { NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [[CHIPBindingClusterTargetStruct alloc] init]; - ((CHIPBindingClusterTargetStruct *) temp_0[0]).group = [NSNumber numberWithUnsignedShort:1U]; - ((CHIPBindingClusterTargetStruct *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedChar:0]; - - temp_0[1] = [[CHIPBindingClusterTargetStruct alloc] init]; - ((CHIPBindingClusterTargetStruct *) temp_0[1]).node = [NSNumber numberWithUnsignedLongLong:1ULL]; - ((CHIPBindingClusterTargetStruct *) temp_0[1]).endpoint = [NSNumber numberWithUnsignedShort:1U]; - ((CHIPBindingClusterTargetStruct *) temp_0[1]).cluster = [NSNumber numberWithUnsignedInt:6UL]; - ((CHIPBindingClusterTargetStruct *) temp_0[1]).fabricIndex = [NSNumber numberWithUnsignedChar:0]; + temp_0[0] = [NSNumber numberWithUnsignedShort:1U]; + temp_0[1] = [NSNumber numberWithUnsignedShort:2U]; + temp_0[2] = [NSNumber numberWithUnsignedShort:4369U]; + temp_0[3] = [NSNumber numberWithUnsignedShort:3U]; + params.groupList = temp_0; + } + [cluster getGroupMembershipWithParams:params + completionHandler:^( + CHIPGroupsClusterGetGroupMembershipResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Get Group Membership 3 Error: %@", err); - temp_0[2] = [[CHIPBindingClusterTargetStruct alloc] init]; - ((CHIPBindingClusterTargetStruct *) temp_0[2]).node = [NSNumber numberWithUnsignedLongLong:2ULL]; - ((CHIPBindingClusterTargetStruct *) temp_0[2]).endpoint = [NSNumber numberWithUnsignedShort:1U]; - ((CHIPBindingClusterTargetStruct *) temp_0[2]).fabricIndex = [NSNumber numberWithUnsignedChar:0]; + VerifyOrReturn(CheckValue("status", err, 0)); - bindingArgument = temp_0; - } - [cluster writeAttributeBindingWithValue:bindingArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write binding table (endpoint 1) Error: %@", err); + { + id actualValue = values.capacity; + VerifyOrReturn(CheckValueNull("capacity", actualValue)); + } - VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = values.groupList; + VerifyOrReturn(CheckValue("groupList", [actualValue count], static_cast(1))); + VerifyOrReturn(CheckValue("", actualValue[0], 1U)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadBindingTableEndpoint1_5() + CHIP_ERROR TestRemoveAll_14() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestBinding * cluster = [[CHIPTestBinding alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - CHIPReadParams * params = [[CHIPReadParams alloc] init]; - params.fabricFiltered = [NSNumber numberWithBool:true]; - [cluster - readAttributeBindingWithParams:params - completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read binding table (endpoint 1) Error: %@", err); + [cluster removeAllGroupsWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Remove All Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("Binding", [actualValue count], static_cast(3))); - VerifyOrReturn(CheckValue("Group", ((CHIPBindingClusterTargetStruct *) actualValue[0]).group, 1U)); - VerifyOrReturn( - CheckValue("FabricIndex", ((CHIPBindingClusterTargetStruct *) actualValue[0]).fabricIndex, 1)); - VerifyOrReturn(CheckValue("Node", ((CHIPBindingClusterTargetStruct *) actualValue[1]).node, 1ULL)); - VerifyOrReturn( - CheckValue("Endpoint", ((CHIPBindingClusterTargetStruct *) actualValue[1]).endpoint, 1U)); - VerifyOrReturn( - CheckValue("Cluster", ((CHIPBindingClusterTargetStruct *) actualValue[1]).cluster, 6UL)); - VerifyOrReturn( - CheckValue("FabricIndex", ((CHIPBindingClusterTargetStruct *) actualValue[1]).fabricIndex, 1)); - VerifyOrReturn(CheckValue("Node", ((CHIPBindingClusterTargetStruct *) actualValue[2]).node, 2ULL)); - VerifyOrReturn( - CheckValue("Endpoint", ((CHIPBindingClusterTargetStruct *) actualValue[2]).endpoint, 1U)); - VerifyOrReturn( - CheckValue("FabricIndex", ((CHIPBindingClusterTargetStruct *) actualValue[2]).fabricIndex, 1)); - } + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestViewGroup1Removed_15() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - NextTest(); - }]; + __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; + params.groupId = [NSNumber numberWithUnsignedShort:1U]; + [cluster viewGroupWithParams:params + completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"View Group 1 (removed) Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 139)); + } + + { + id actualValue = values.groupId; + VerifyOrReturn(CheckValue("groupId", actualValue, 1U)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteBindingTableEndpoint0_6() + CHIP_ERROR TestViewGroup2StillRemoved_16() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestBinding * cluster = [[CHIPTestBinding alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id bindingArgument; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [[CHIPBindingClusterTargetStruct alloc] init]; - ((CHIPBindingClusterTargetStruct *) temp_0[0]).node = [NSNumber numberWithUnsignedLongLong:3ULL]; - ((CHIPBindingClusterTargetStruct *) temp_0[0]).endpoint = [NSNumber numberWithUnsignedShort:1U]; - ((CHIPBindingClusterTargetStruct *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedChar:0]; + __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; + params.groupId = [NSNumber numberWithUnsignedShort:4369U]; + [cluster viewGroupWithParams:params + completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"View Group 2 (still removed) Error: %@", err); - bindingArgument = temp_0; - } - [cluster writeAttributeBindingWithValue:bindingArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write binding table (endpoint 0) Error: %@", err); + VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 139)); + } - NextTest(); - }]; + { + id actualValue = values.groupId; + VerifyOrReturn(CheckValue("groupId", actualValue, 4369U)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadBindingTableEndpoint0_7() + CHIP_ERROR TestViewGroup3Removed_17() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestBinding * cluster = [[CHIPTestBinding alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - CHIPReadParams * params = [[CHIPReadParams alloc] init]; - params.fabricFiltered = [NSNumber numberWithBool:true]; - [cluster - readAttributeBindingWithParams:params - completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read binding table (endpoint 0) Error: %@", err); + __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; + params.groupId = [NSNumber numberWithUnsignedShort:32767U]; + [cluster viewGroupWithParams:params + completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"View Group 3 (removed) Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("Binding", [actualValue count], static_cast(1))); - VerifyOrReturn(CheckValue("Node", ((CHIPBindingClusterTargetStruct *) actualValue[0]).node, 3ULL)); - VerifyOrReturn( - CheckValue("Endpoint", ((CHIPBindingClusterTargetStruct *) actualValue[0]).endpoint, 1U)); - VerifyOrReturn( - CheckValue("FabricIndex", ((CHIPBindingClusterTargetStruct *) actualValue[0]).fabricIndex, 1)); - } + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 139)); + } - NextTest(); - }]; + { + id actualValue = values.groupId; + VerifyOrReturn(CheckValue("groupId", actualValue, 32767U)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyEndpoint1NotChanged_8() + CHIP_ERROR TestGetGroupMembership4_18() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestBinding * cluster = [[CHIPTestBinding alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - CHIPReadParams * params = [[CHIPReadParams alloc] init]; - params.fabricFiltered = [NSNumber numberWithBool:true]; - [cluster - readAttributeBindingWithParams:params - completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify endpoint 1 not changed Error: %@", err); + __auto_type * params = [[CHIPGroupsClusterGetGroupMembershipParams alloc] init]; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [NSNumber numberWithUnsignedShort:1U]; + temp_0[1] = [NSNumber numberWithUnsignedShort:2U]; + temp_0[2] = [NSNumber numberWithUnsignedShort:4369U]; + temp_0[3] = [NSNumber numberWithUnsignedShort:3U]; + temp_0[4] = [NSNumber numberWithUnsignedShort:32767U]; + params.groupList = temp_0; + } + [cluster getGroupMembershipWithParams:params + completionHandler:^( + CHIPGroupsClusterGetGroupMembershipResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Get Group Membership 4 Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("Binding", [actualValue count], static_cast(3))); - VerifyOrReturn(CheckValue("Group", ((CHIPBindingClusterTargetStruct *) actualValue[0]).group, 1U)); - VerifyOrReturn( - CheckValue("FabricIndex", ((CHIPBindingClusterTargetStruct *) actualValue[0]).fabricIndex, 1)); - VerifyOrReturn(CheckValue("Node", ((CHIPBindingClusterTargetStruct *) actualValue[1]).node, 1ULL)); - VerifyOrReturn( - CheckValue("Endpoint", ((CHIPBindingClusterTargetStruct *) actualValue[1]).endpoint, 1U)); - VerifyOrReturn( - CheckValue("Cluster", ((CHIPBindingClusterTargetStruct *) actualValue[1]).cluster, 6UL)); - VerifyOrReturn( - CheckValue("FabricIndex", ((CHIPBindingClusterTargetStruct *) actualValue[1]).fabricIndex, 1)); - VerifyOrReturn(CheckValue("Node", ((CHIPBindingClusterTargetStruct *) actualValue[2]).node, 2ULL)); - VerifyOrReturn( - CheckValue("Endpoint", ((CHIPBindingClusterTargetStruct *) actualValue[2]).endpoint, 1U)); - VerifyOrReturn( - CheckValue("FabricIndex", ((CHIPBindingClusterTargetStruct *) actualValue[2]).fabricIndex, 1)); - } + { + id actualValue = values.capacity; + VerifyOrReturn(CheckValueNull("capacity", actualValue)); + } - NextTest(); - }]; + { + id actualValue = values.groupList; + VerifyOrReturn(CheckValue("groupList", [actualValue count], static_cast(0))); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } }; -class Test_TC_SWDIAG_1_1 : public TestCommandBridge { +class TestGroupKeyManagementCluster : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_SWDIAG_1_1() - : TestCommandBridge("Test_TC_SWDIAG_1_1") + TestGroupKeyManagementCluster() + : TestCommandBridge("TestGroupKeyManagementCluster") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -67038,7 +75746,7 @@ class Test_TC_SWDIAG_1_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_SWDIAG_1_1() {} + ~TestGroupKeyManagementCluster() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -67046,11 +75754,11 @@ class Test_TC_SWDIAG_1_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_SWDIAG_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: TestGroupKeyManagementCluster\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_SWDIAG_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: TestGroupKeyManagementCluster\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -67067,32 +75775,72 @@ class Test_TC_SWDIAG_1_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Reads a list of ThreadMetrics struct non-global attribute from DUT.\n"); - if (ShouldSkip("A_THREADMETRICS")) { - NextTest(); - return; - } - err = TestReadsAListOfThreadMetricsStructNonGlobalAttributeFromDut_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Read maxGroupsPerFabric\n"); + err = TestReadMaxGroupsPerFabric_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Reads CurrentHeapFree non-global attribute value from DUT\n"); - err = TestReadsCurrentHeapFreeNonGlobalAttributeValueFromDut_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Read maxGroupKeysPerFabric\n"); + err = TestReadMaxGroupKeysPerFabric_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Reads CurrentHeapUsed non-global attribute value from DUT\n"); - if (ShouldSkip("A_CURRENTHEAPUSED")) { - NextTest(); - return; - } - err = TestReadsCurrentHeapUsedNonGlobalAttributeValueFromDut_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Add Group 1\n"); + err = TestAddGroup1_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Reads CurrentHeapHighWaterMark non-global attribute value from DUT\n"); - if (ShouldSkip("A_CURRENTHEAPHIGHWATERMARK")) { - NextTest(); - return; - } - err = TestReadsCurrentHeapHighWaterMarkNonGlobalAttributeValueFromDut_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Add Group 2\n"); + err = TestAddGroup2_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : KeySet Write 1\n"); + err = TestKeySetWrite1_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : KeySet Write 2\n"); + err = TestKeySetWrite2_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : KeySet Read\n"); + err = TestKeySetRead_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Write Group Keys (invalid)\n"); + err = TestWriteGroupKeysInvalid_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Write Group Keys\n"); + err = TestWriteGroupKeys_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Read Group Keys\n"); + err = TestReadGroupKeys_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Read GroupTable\n"); + err = TestReadGroupTable_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : KeySet Remove 1\n"); + err = TestKeySetRemove1_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : KeySet Read (removed)\n"); + err = TestKeySetReadRemoved_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : KeySet Read (not removed)\n"); + err = TestKeySetReadNotRemoved_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Remove All\n"); + err = TestRemoveAll_15(); + break; + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : KeySet Remove 2\n"); + err = TestKeySetRemove2_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : KeySet Read (also removed)\n"); + err = TestKeySetReadAlsoRemoved_17(); break; } @@ -67109,7 +75857,7 @@ class Test_TC_SWDIAG_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 5; + const uint16_t mTestCount = 18; chip::Optional mNodeId; chip::Optional mCluster; @@ -67122,572 +75870,539 @@ class Test_TC_SWDIAG_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsAListOfThreadMetricsStructNonGlobalAttributeFromDut_1() + CHIP_ERROR TestReadMaxGroupsPerFabric_1() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestSoftwareDiagnostics * cluster = [[CHIPTestSoftwareDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeThreadMetricsWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads a list of ThreadMetrics struct non-global attribute from DUT. Error: %@", err); + [cluster readAttributeMaxGroupsPerFabricWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read maxGroupsPerFabric Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("threadMetrics", "", "list")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadsCurrentHeapFreeNonGlobalAttributeValueFromDut_2() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestSoftwareDiagnostics * cluster = [[CHIPTestSoftwareDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeCurrentHeapFreeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads CurrentHeapFree non-global attribute value from DUT Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("maxGroupsPerFabric", [value unsignedShortValue], 2U)); } - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("currentHeapFree", "", "uint64")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsCurrentHeapUsedNonGlobalAttributeValueFromDut_3() + CHIP_ERROR TestReadMaxGroupKeysPerFabric_2() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestSoftwareDiagnostics * cluster = [[CHIPTestSoftwareDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentHeapUsedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads CurrentHeapUsed non-global attribute value from DUT Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + [cluster readAttributeMaxGroupKeysPerFabricWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read maxGroupKeysPerFabric Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("currentHeapUsed", "", "uint64")); + { + id actualValue = value; + VerifyOrReturn(CheckValue("MaxGroupKeysPerFabric", actualValue, 2U)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsCurrentHeapHighWaterMarkNonGlobalAttributeValueFromDut_4() + CHIP_ERROR TestAddGroup1_3() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestSoftwareDiagnostics * cluster = [[CHIPTestSoftwareDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentHeapHighWatermarkWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads CurrentHeapHighWaterMark non-global attribute value from DUT Error: %@", err); + __auto_type * params = [[CHIPGroupsClusterAddGroupParams alloc] init]; + params.groupId = [NSNumber numberWithUnsignedShort:257U]; + params.groupName = @"Group #1"; + [cluster addGroupWithParams:params + completionHandler:^(CHIPGroupsClusterAddGroupResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Add Group 1 Error: %@", err); - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0)); + } - VerifyOrReturn(CheckConstraintType("currentHeapHighWatermark", "", "uint64")); - NextTest(); - }]; + { + id actualValue = values.groupId; + VerifyOrReturn(CheckValue("groupId", actualValue, 257U)); + } - return CHIP_NO_ERROR; - } -}; + NextTest(); + }]; -class Test_TC_SWDIAG_2_1 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_SWDIAG_2_1() - : TestCommandBridge("Test_TC_SWDIAG_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); + return CHIP_NO_ERROR; } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - - ~Test_TC_SWDIAG_2_1() {} - /////////// TestCommand Interface ///////// - void NextTest() override + CHIP_ERROR TestAddGroup2_4() { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_SWDIAG_2_1\n"); - } - - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_SWDIAG_2_1\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } - - Wait(); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - // 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++) { - } + __auto_type * params = [[CHIPGroupsClusterAddGroupParams alloc] init]; + params.groupId = [NSNumber numberWithUnsignedShort:258U]; + params.groupName = @"Group #2"; + [cluster addGroupWithParams:params + completionHandler:^(CHIPGroupsClusterAddGroupResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Add Group 2 Error: %@", err); - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } + VerifyOrReturn(CheckValue("status", err, 0)); - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0)); + } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 0; + { + id actualValue = values.groupId; + VerifyOrReturn(CheckValue("groupId", actualValue, 258U)); + } - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; -}; + NextTest(); + }]; -class Test_TC_SWDIAG_3_1 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_SWDIAG_3_1() - : TestCommandBridge("Test_TC_SWDIAG_3_1") - , mTestIndex(0) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + return CHIP_NO_ERROR; } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - - ~Test_TC_SWDIAG_3_1() {} - /////////// TestCommand Interface ///////// - void NextTest() override + CHIP_ERROR TestKeySetWrite1_5() { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_SWDIAG_3_1\n"); - } - - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_SWDIAG_3_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 : Sends ResetWatermarks to DUT\n"); - if (ShouldSkip("CR_RESETWATERMARKS")) { - NextTest(); - return; - } - err = TestSendsResetWatermarksToDut_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Reads CurrentHeapUsed attribute value from DUT\n"); - if (ShouldSkip("A_CURRENTHEAPUSED")) { - NextTest(); - return; - } - err = TestReadsCurrentHeapUsedAttributeValueFromDut_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Reads CurrentHeapHighWaterMark attribute value from DUT\n"); - if (ShouldSkip("A_CURRENTHEAPHIGHWATERMARK")) { - NextTest(); - return; - } - err = TestReadsCurrentHeapHighWaterMarkAttributeValueFromDut_3(); - break; - } + CHIPDevice * device = GetConnectedDevice(); + CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } + __auto_type * params = [[CHIPGroupKeyManagementClusterKeySetWriteParams alloc] init]; + params.groupKeySet = [[CHIPGroupKeyManagementClusterGroupKeySetStruct alloc] init]; + ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySetID = + [NSNumber numberWithUnsignedShort:417U]; + ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySecurityPolicy = + [NSNumber numberWithUnsignedChar:0]; + ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey0 = + [[NSData alloc] initWithBytes:"\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257" length:16]; + ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime0 = + [NSNumber numberWithUnsignedLongLong:1110000ULL]; + ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey1 = + [[NSData alloc] initWithBytes:"\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277" length:16]; + ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime1 = + [NSNumber numberWithUnsignedLongLong:1110001ULL]; + ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey2 = + [[NSData alloc] initWithBytes:"\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317" length:16]; + ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime2 = + [NSNumber numberWithUnsignedLongLong:1110002ULL]; - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } + [cluster keySetWriteWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"KeySet Write 1 Error: %@", err); -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 4; + VerifyOrReturn(CheckValue("status", err, 0)); - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; + NextTest(); + }]; - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestSendsResetWatermarksToDut_1() + CHIP_ERROR TestKeySetWrite2_6() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestSoftwareDiagnostics * cluster = [[CHIPTestSoftwareDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster resetWatermarksWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Sends ResetWatermarks to DUT Error: %@", err); + __auto_type * params = [[CHIPGroupKeyManagementClusterKeySetWriteParams alloc] init]; + params.groupKeySet = [[CHIPGroupKeyManagementClusterGroupKeySetStruct alloc] init]; + ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySetID = + [NSNumber numberWithUnsignedShort:418U]; + ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySecurityPolicy = + [NSNumber numberWithUnsignedChar:1]; + ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey0 = + [[NSData alloc] initWithBytes:"\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337" length:16]; + ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime0 = + [NSNumber numberWithUnsignedLongLong:2110000ULL]; + ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey1 = + [[NSData alloc] initWithBytes:"\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357" length:16]; + ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime1 = + [NSNumber numberWithUnsignedLongLong:2110001ULL]; + ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey2 = + [[NSData alloc] initWithBytes:"\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377" length:16]; + ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime2 = + [NSNumber numberWithUnsignedLongLong:2110002ULL]; - VerifyOrReturn(CheckValue("status", err, 0)); + [cluster keySetWriteWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"KeySet Write 2 Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsCurrentHeapUsedAttributeValueFromDut_2() + CHIP_ERROR TestKeySetRead_7() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestSoftwareDiagnostics * cluster = [[CHIPTestSoftwareDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentHeapUsedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads CurrentHeapUsed attribute value from DUT Error: %@", err); + __auto_type * params = [[CHIPGroupKeyManagementClusterKeySetReadParams alloc] init]; + params.groupKeySetID = [NSNumber numberWithUnsignedShort:417U]; + [cluster + keySetReadWithParams:params + completionHandler:^( + CHIPGroupKeyManagementClusterKeySetReadResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"KeySet Read Error: %@", err); - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = values.groupKeySet; + VerifyOrReturn(CheckValue( + "GroupKeySetID", ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).groupKeySetID, 417U)); + VerifyOrReturn(CheckValue("GroupKeySecurityPolicy", + ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).groupKeySecurityPolicy, 0)); + VerifyOrReturn( + CheckValueNull("EpochKey0", ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochKey0)); + VerifyOrReturn(CheckValueNonNull( + "EpochStartTime0", ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime0)); + VerifyOrReturn(CheckValue("EpochStartTime0", + ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime0, 1110000ULL)); + VerifyOrReturn( + CheckValueNull("EpochKey1", ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochKey1)); + VerifyOrReturn(CheckValueNonNull( + "EpochStartTime1", ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime1)); + VerifyOrReturn(CheckValue("EpochStartTime1", + ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime1, 1110001ULL)); + VerifyOrReturn( + CheckValueNull("EpochKey2", ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochKey2)); + VerifyOrReturn(CheckValueNonNull( + "EpochStartTime2", ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime2)); + VerifyOrReturn(CheckValue("EpochStartTime2", + ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime2, 1110002ULL)); + } - VerifyOrReturn(CheckConstraintType("currentHeapUsed", "", "uint64")); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsCurrentHeapHighWaterMarkAttributeValueFromDut_3() + CHIP_ERROR TestWriteGroupKeysInvalid_8() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestSoftwareDiagnostics * cluster = [[CHIPTestSoftwareDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentHeapHighWatermarkWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads CurrentHeapHighWaterMark attribute value from DUT Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + id groupKeyMapArgument; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [[CHIPGroupKeyManagementClusterGroupKeyMapStruct alloc] init]; + ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[0]).groupId = [NSNumber numberWithUnsignedShort:258U]; + ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[0]).groupKeySetID = [NSNumber numberWithUnsignedShort:0U]; + ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedChar:1]; - VerifyOrReturn(CheckValue("status", err, 0)); + groupKeyMapArgument = temp_0; + } + [cluster writeAttributeGroupKeyMapWithValue:groupKeyMapArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write Group Keys (invalid) Error: %@", err); - VerifyOrReturn(CheckConstraintType("currentHeapHighWatermark", "", "uint64")); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } -}; -class TestSubscribe_OnOff : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - TestSubscribe_OnOff() - : TestCommandBridge("TestSubscribe_OnOff") - , mTestIndex(0) + CHIP_ERROR TestWriteGroupKeys_9() { - 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) - - ~TestSubscribe_OnOff() {} + CHIPDevice * device = GetConnectedDevice(); + CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; + id groupKeyMapArgument; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [[CHIPGroupKeyManagementClusterGroupKeyMapStruct alloc] init]; + ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[0]).groupId = [NSNumber numberWithUnsignedShort:257U]; + ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[0]).groupKeySetID = [NSNumber numberWithUnsignedShort:417U]; + ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedChar:1]; - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: TestSubscribe_OnOff\n"); - } + temp_0[1] = [[CHIPGroupKeyManagementClusterGroupKeyMapStruct alloc] init]; + ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[1]).groupId = [NSNumber numberWithUnsignedShort:258U]; + ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[1]).groupKeySetID = [NSNumber numberWithUnsignedShort:418U]; + ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[1]).fabricIndex = [NSNumber numberWithUnsignedChar:1]; - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: TestSubscribe_OnOff\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; + groupKeyMapArgument = temp_0; } + [cluster writeAttributeGroupKeyMapWithValue:groupKeyMapArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write Group Keys Error: %@", err); - Wait(); + VerifyOrReturn(CheckValue("status", err, 0)); - // 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 : Set OnOff Attribute to false\n"); - err = TestSetOnOffAttributeToFalse_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Report: Subscribe OnOff Attribute\n"); - err = TestReportSubscribeOnOffAttribute_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Subscribe OnOff Attribute\n"); - err = TestSubscribeOnOffAttribute_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Turn On the light to see attribute change\n"); - err = TestTurnOnTheLightToSeeAttributeChange_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Check for attribute report\n"); - err = TestCheckForAttributeReport_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Turn Off the light to see attribute change\n"); - err = TestTurnOffTheLightToSeeAttributeChange_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Check for attribute report\n"); - err = TestCheckForAttributeReport_7(); - break; - } + NextTest(); + }]; - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + return CHIP_NO_ERROR; } - chip::System::Clock::Timeout GetWaitDuration() const override + CHIP_ERROR TestReadGroupKeys_10() { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } + CHIPDevice * device = GetConnectedDevice(); + CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 8; + CHIPReadParams * params = [[CHIPReadParams alloc] init]; + params.fabricFiltered = [NSNumber numberWithBool:true]; + [cluster + readAttributeGroupKeyMapWithParams:params + completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read Group Keys Error: %@", err); - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("GroupKeyMap", [actualValue count], static_cast(2))); + VerifyOrReturn(CheckValue("GroupId", + ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[0]).groupId, 257U)); + VerifyOrReturn(CheckValue("GroupKeySetID", + ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[0]).groupKeySetID, 417U)); + VerifyOrReturn(CheckValue("FabricIndex", + ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[0]).fabricIndex, 1)); + VerifyOrReturn(CheckValue("GroupId", + ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[1]).groupId, 258U)); + VerifyOrReturn(CheckValue("GroupKeySetID", + ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[1]).groupKeySetID, 418U)); + VerifyOrReturn(CheckValue("FabricIndex", + ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[1]).fabricIndex, 1)); + } + + NextTest(); + }]; - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestSetOnOffAttributeToFalse_1() + CHIP_ERROR TestReadGroupTable_11() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Set OnOff Attribute to false Error: %@", err); + CHIPReadParams * params = [[CHIPReadParams alloc] init]; + params.fabricFiltered = [NSNumber numberWithBool:true]; + [cluster readAttributeGroupTableWithParams:params + completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read GroupTable Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValue("GroupTable", [actualValue count], static_cast(2))); + VerifyOrReturn(CheckValue("GroupId", + ((CHIPGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[0]).groupId, 257U)); + VerifyOrReturn(CheckValueAsString("GroupName", + ((CHIPGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[0]).groupName, + @"Group #1")); + VerifyOrReturn(CheckValue("FabricIndex", + ((CHIPGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[0]).fabricIndex, 1)); + VerifyOrReturn(CheckValue("GroupId", + ((CHIPGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[1]).groupId, 258U)); + VerifyOrReturn(CheckValueAsString("GroupName", + ((CHIPGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[1]).groupName, + @"Group #2")); + VerifyOrReturn(CheckValue("FabricIndex", + ((CHIPGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[1]).fabricIndex, 1)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - bool testSendClusterTestSubscribe_OnOff_000002_WaitForReport_Fulfilled = false; - ResponseHandler _Nullable test_TestSubscribe_OnOff_OnOff_Reported = nil; - CHIP_ERROR TestReportSubscribeOnOffAttribute_2() + CHIP_ERROR TestKeySetRemove1_12() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - test_TestSubscribe_OnOff_OnOff_Reported = ^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Report: Subscribe OnOff Attribute Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + __auto_type * params = [[CHIPGroupKeyManagementClusterKeySetRemoveParams alloc] init]; + params.groupKeySetID = [NSNumber numberWithUnsignedShort:417U]; + [cluster keySetRemoveWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"KeySet Remove 1 Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, false)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - testSendClusterTestSubscribe_OnOff_000002_WaitForReport_Fulfilled = true; - }; + NextTest(); + }]; - NextTest(); return CHIP_NO_ERROR; } - CHIP_ERROR TestSubscribeOnOffAttribute_3() + CHIP_ERROR TestKeySetReadRemoved_13() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - uint16_t minIntervalArgument = 2U; - uint16_t maxIntervalArgument = 5U; - CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; - [cluster subscribeAttributeOnOffWithMinInterval:[NSNumber numberWithUnsignedInt:minIntervalArgument] - maxInterval:[NSNumber numberWithUnsignedInt:maxIntervalArgument] - params:params - subscriptionEstablished:^{ - VerifyOrReturn(testSendClusterTestSubscribe_OnOff_000002_WaitForReport_Fulfilled, - SetCommandExitStatus(CHIP_ERROR_INCORRECT_STATE)); - NextTest(); - } - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Subscribe OnOff Attribute Error: %@", err); + __auto_type * params = [[CHIPGroupKeyManagementClusterKeySetReadParams alloc] init]; + params.groupKeySetID = [NSNumber numberWithUnsignedShort:417U]; + [cluster keySetReadWithParams:params + completionHandler:^( + CHIPGroupKeyManagementClusterKeySetReadResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"KeySet Read (removed) Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); - if (test_TestSubscribe_OnOff_OnOff_Reported != nil) { - ResponseHandler callback = test_TestSubscribe_OnOff_OnOff_Reported; - test_TestSubscribe_OnOff_OnOff_Reported = nil; - callback(value, err); - } - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_NOT_FOUND)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestTurnOnTheLightToSeeAttributeChange_4() + CHIP_ERROR TestKeySetReadNotRemoved_14() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster onWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Turn On the light to see attribute change Error: %@", err); + __auto_type * params = [[CHIPGroupKeyManagementClusterKeySetReadParams alloc] init]; + params.groupKeySetID = [NSNumber numberWithUnsignedShort:418U]; + [cluster + keySetReadWithParams:params + completionHandler:^( + CHIPGroupKeyManagementClusterKeySetReadResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"KeySet Read (not removed) Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = values.groupKeySet; + VerifyOrReturn(CheckValue( + "GroupKeySetID", ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).groupKeySetID, 418U)); + VerifyOrReturn(CheckValue("GroupKeySecurityPolicy", + ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).groupKeySecurityPolicy, 1)); + VerifyOrReturn( + CheckValueNull("EpochKey0", ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochKey0)); + VerifyOrReturn(CheckValueNonNull( + "EpochStartTime0", ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime0)); + VerifyOrReturn(CheckValue("EpochStartTime0", + ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime0, 2110000ULL)); + VerifyOrReturn( + CheckValueNull("EpochKey1", ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochKey1)); + VerifyOrReturn(CheckValueNonNull( + "EpochStartTime1", ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime1)); + VerifyOrReturn(CheckValue("EpochStartTime1", + ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime1, 2110001ULL)); + VerifyOrReturn( + CheckValueNull("EpochKey2", ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochKey2)); + VerifyOrReturn(CheckValueNonNull( + "EpochStartTime2", ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime2)); + VerifyOrReturn(CheckValue("EpochStartTime2", + ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime2, 2110002ULL)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckForAttributeReport_5() + CHIP_ERROR TestRemoveAll_15() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - test_TestSubscribe_OnOff_OnOff_Reported = ^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check for attribute report Error: %@", err); + [cluster removeAllGroupsWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Remove All Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, true)); - } - NextTest(); - }; + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestTurnOffTheLightToSeeAttributeChange_6() + CHIP_ERROR TestKeySetRemove2_16() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Turn Off the light to see attribute change Error: %@", err); + __auto_type * params = [[CHIPGroupKeyManagementClusterKeySetRemoveParams alloc] init]; + params.groupKeySetID = [NSNumber numberWithUnsignedShort:418U]; + [cluster keySetRemoveWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"KeySet Remove 2 Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckForAttributeReport_7() + CHIP_ERROR TestKeySetReadAlsoRemoved_17() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - test_TestSubscribe_OnOff_OnOff_Reported = ^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check for attribute report Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, false)); - } + __auto_type * params = [[CHIPGroupKeyManagementClusterKeySetReadParams alloc] init]; + params.groupKeySetID = [NSNumber numberWithUnsignedShort:418U]; + [cluster keySetReadWithParams:params + completionHandler:^( + CHIPGroupKeyManagementClusterKeySetReadResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"KeySet Read (also removed) Error: %@", err); - NextTest(); - }; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_NOT_FOUND)); + NextTest(); + }]; return CHIP_NO_ERROR; } @@ -67740,7 +76455,7 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), - make_unique(), + make_unique(), make_unique(), make_unique(), make_unique(), @@ -67748,11 +76463,11 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), - make_unique(), - make_unique(), make_unique(), make_unique(), make_unique(), + make_unique(), + make_unique(), make_unique(), make_unique(), make_unique(), @@ -67804,6 +76519,7 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), + make_unique(), make_unique(), make_unique(), make_unique(), @@ -67839,26 +76555,50 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), + make_unique(), + make_unique(), + make_unique(), make_unique(), make_unique(), + make_unique(), + make_unique(), make_unique(), make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), make_unique(), - make_unique(), make_unique(), make_unique(), + make_unique(), + make_unique(), make_unique(), - make_unique(), - make_unique(), + make_unique(), make_unique(), - make_unique(), make_unique(), + make_unique(), make_unique(), make_unique(), + make_unique(), + make_unique(), make_unique(), make_unique(), make_unique(), make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), #endif // CONFIG_ENABLE_YAML_TESTS };