diff --git a/examples/chip-tool-darwin/commands/common/CHIPCommandBridge.h b/examples/chip-tool-darwin/commands/common/CHIPCommandBridge.h index a29cadfbfdd626..09bd93c658febb 100644 --- a/examples/chip-tool-darwin/commands/common/CHIPCommandBridge.h +++ b/examples/chip-tool-darwin/commands/common/CHIPCommandBridge.h @@ -20,6 +20,8 @@ #import #include #include +#include +#include #pragma once @@ -71,7 +73,12 @@ class CHIPCommandBridge : public Command CHIP_ERROR StartWaiting(chip::System::Clock::Timeout seconds); void StopWaiting(); - CHIPDeviceController * mController; + + // Our three controllers: alpha, beta, gamma. + std::map mControllers; + + // The current controller; the one the current command should be using. + CHIPDeviceController * mCurrentController; std::condition_variable cvWaitingForResponse; std::mutex cvWaitingForResponseMutex; diff --git a/examples/chip-tool-darwin/commands/common/CHIPCommandBridge.mm b/examples/chip-tool-darwin/commands/common/CHIPCommandBridge.mm index 489e82ef91a325..877b1cc4d1fbe7 100644 --- a/examples/chip-tool-darwin/commands/common/CHIPCommandBridge.mm +++ b/examples/chip-tool-darwin/commands/common/CHIPCommandBridge.mm @@ -53,35 +53,49 @@ ipk = [nocSigner getIPK]; - auto controllerParams = [[CHIPDeviceControllerStartupParams alloc] initWithKeypair:nocSigner]; - controllerParams.vendorId = chip::VendorId::TestVendor1; - controllerParams.fabricId = 1; - controllerParams.ipk = ipk; - - // We're not sure whether we're creating a new fabric or using an - // existing one, so just try both. - mController = [factory startControllerOnExistingFabric:controllerParams]; - if (mController == nil) { - // Maybe we didn't have this fabric yet. - mController = [factory startControllerOnNewFabric:controllerParams]; - } - if (mController == nil) { - ChipLogError(chipTool, "Controller startup failure."); - return CHIP_ERROR_INTERNAL; + constexpr const char * identities[] = { "alpha", "beta", "gamma" }; + for (size_t i = 0; i < ArraySize(identities); ++i) { + auto controllerParams = [[CHIPDeviceControllerStartupParams alloc] initWithKeypair:nocSigner]; + controllerParams.vendorId = chip::VendorId::TestVendor1; + controllerParams.fabricId = i + 1; + controllerParams.ipk = ipk; + + // We're not sure whether we're creating a new fabric or using an + // existing one, so just try both. + auto controller = [factory startControllerOnExistingFabric:controllerParams]; + if (controller == nil) { + // Maybe we didn't have this fabric yet. + controller = [factory startControllerOnNewFabric:controllerParams]; + } + if (controller == nil) { + ChipLogError(chipTool, "Controller startup failure."); + return CHIP_ERROR_INTERNAL; + } + + mControllers[identities[i]] = controller; } + // Default to alpha. + SetIdentity("alpha"); + ReturnLogErrorOnFailure(RunCommand()); ReturnLogErrorOnFailure(StartWaiting(GetWaitDuration())); return CHIP_NO_ERROR; } -CHIPDeviceController * CHIPCommandBridge::CurrentCommissioner() { return mController; } +void CHIPCommandBridge::SetIdentity(const char * name) { mCurrentController = mControllers[name]; } + +CHIPDeviceController * CHIPCommandBridge::CurrentCommissioner() { return mCurrentController; } CHIP_ERROR CHIPCommandBridge::ShutdownCommissioner() { ChipLogProgress(chipTool, "Shutting down controller"); - [CurrentCommissioner() shutdown]; + for (auto & pair : mControllers) { + [pair.second shutdown]; + } + mControllers.clear(); + mCurrentController = nil; [[MatterControllerFactory sharedInstance] shutdown]; diff --git a/examples/chip-tool-darwin/commands/tests/TestCommandBridge.h b/examples/chip-tool-darwin/commands/tests/TestCommandBridge.h index 26b9bf7b816b8d..f84e243c887c32 100644 --- a/examples/chip-tool-darwin/commands/tests/TestCommandBridge.h +++ b/examples/chip-tool-darwin/commands/tests/TestCommandBridge.h @@ -24,10 +24,33 @@ #include #include #include +#include +#include #include +#import #import -#import +#import + +class TestCommandBridge; + +NS_ASSUME_NONNULL_BEGIN + +@interface TestPairingDelegate : NSObject +@property TestCommandBridge * commandBridge; +@property chip::NodeId deviceId; +@property BOOL active; // Whether to pass on notifications to the commandBridge + +- (void)onStatusUpdate:(CHIPPairingStatus)status; +- (void)onPairingComplete:(NSError * _Nullable)error; +- (void)onPairingDeleted:(NSError * _Nullable)error; +- (void)onCommissioningComplete:(NSError * _Nullable)error; + +- (instancetype)init NS_UNAVAILABLE; +- (instancetype)initWithTestCommandBridge:(TestCommandBridge *)commandBridge; +@end + +NS_ASSUME_NONNULL_END constexpr uint16_t kTimeoutInSeconds = 90; @@ -39,6 +62,7 @@ class TestCommandBridge : public CHIPCommandBridge, public: TestCommandBridge(const char * _Nonnull commandName) : CHIPCommandBridge(commandName) + , mPairingDelegate([[TestPairingDelegate alloc] initWithTestCommandBridge:this]) { AddArgument("delayInMs", 0, UINT64_MAX, &mDelayInMs); AddArgument("PICS", &mPICSFilePath); @@ -63,6 +87,11 @@ class TestCommandBridge : public CHIPCommandBridge, virtual void NextTest() = 0; + // Support for tests that asynchronously come up with a status of some + // sort. Subclasses are expected to compare the provided status to the + // expected status for the test. + virtual void OnStatusUpdate(const chip::app::StatusIB & status) = 0; + void Exit(std::string message, CHIP_ERROR err = CHIP_ERROR_INTERNAL) override { ChipLogError(chipTool, " ***** Test Failure: %s\n", message.c_str()); @@ -93,12 +122,12 @@ class TestCommandBridge : public CHIPCommandBridge, // 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 (GetConnectedDevice() != nil) { + auto device = [GetConnectedDevice() internalDevice]; if (device != nullptr) { device->Disconnect(); } - mConnectedDevice = nil; + mConnectedDevices[mCurrentIdentity] = nil; } [controller getConnectedDevice:nodeId @@ -107,11 +136,31 @@ class TestCommandBridge : public CHIPCommandBridge, CHIP_ERROR err = [CHIPError errorToCHIPErrorCode:error]; VerifyOrReturn(CHIP_NO_ERROR == err, SetCommandExitStatus(err)); - mConnectedDevice = device; + mConnectedDevices[mCurrentIdentity] = device; NextTest(); }]; } + /////////// CommissionerCommands-like Interface ///////// + CHIP_ERROR PairWithQRCode(chip::NodeId nodeId, const chip::CharSpan payload) + { + CHIPDeviceController * controller = CurrentCommissioner(); + VerifyOrReturnError(controller != nil, CHIP_ERROR_INCORRECT_STATE); + + [controller setPairingDelegate:mPairingDelegate queue:mCallbackQueue]; + [mPairingDelegate setDeviceId:nodeId]; + [mPairingDelegate setActive:YES]; + + NSString * payloadStr = [[NSString alloc] initWithBytes:payload.data() length:payload.size() encoding:NSUTF8StringEncoding]; + NSError * err; + BOOL ok = [controller pairDevice:nodeId onboardingPayload:payloadStr error:&err]; + if (ok == YES) { + return CHIP_NO_ERROR; + } + + return [CHIPError errorToCHIPErrorCode:err]; + } + /////////// SystemCommands Interface ///////// CHIP_ERROR ContinueOnChipMainThread(CHIP_ERROR err) override { @@ -124,11 +173,44 @@ class TestCommandBridge : public CHIPCommandBridge, return CHIP_NO_ERROR; } - CHIPDevice * _Nullable GetConnectedDevice(void) { return mConnectedDevice; } + CHIPDevice * _Nullable GetConnectedDevice(void) { return mConnectedDevices[mCurrentIdentity]; } + + // PairingDeleted and PairingComplete need to be public so our pairing + // delegate can call them. + void PairingDeleted() + { + // This should not happen! + Exit("Unexpected deletion of pairing"); + } + + void PairingComplete(chip::NodeId nodeId, NSError * _Nullable error) + { + CHIP_ERROR err = [CHIPError errorToCHIPErrorCode:error]; + if (err != CHIP_NO_ERROR) { + Exit("Pairing completed with error", err); + return; + } + + CHIPDeviceController * controller = CurrentCommissioner(); + VerifyOrReturn(controller != nil, Exit("No current commissioner")); + + NSError * commissionError = nil; + [controller commissionDevice:nodeId commissioningParams:[[CHIPCommissioningParameters alloc] init] error:&commissionError]; + err = [CHIPError errorToCHIPErrorCode:commissionError]; + if (err != CHIP_NO_ERROR) { + Exit("Failed to kick off commissioning", err); + return; + } + } + + void SetIdentity(const char * _Nonnull name) + { + mCurrentIdentity = name; + CHIPCommandBridge::SetIdentity(name); + } protected: dispatch_queue_t _Nullable mCallbackQueue; - CHIPDevice * _Nullable mConnectedDevice; void Wait() { @@ -286,4 +368,92 @@ class TestCommandBridge : public CHIPCommandBridge, Exit(std::string(itemName) + " expected to be null but isn't"); return false; } + +private: + TestPairingDelegate * _Nonnull mPairingDelegate; + + // Currently selected identity ("alpha", "beta", "gamma"). + std::string mCurrentIdentity; + + // Set of our connected devices, keyed by identity. + std::map mConnectedDevices; }; + +NS_ASSUME_NONNULL_BEGIN + +@implementation TestPairingDelegate +- (void)onStatusUpdate:(CHIPPairingStatus)status +{ + if (_active) { + if (status == kSecurePairingSuccess) { + NSLog(@"Secure pairing success"); + } else if (status == kSecurePairingFailed) { + _active = NO; + NSLog(@"Secure pairing failed"); + _commandBridge->OnStatusUpdate(chip::app::StatusIB(chip::Protocols::InteractionModel::Status::Failure)); + } + } +} + +- (void)onPairingComplete:(NSError * _Nullable)error +{ + if (_active) { + _commandBridge->PairingComplete(_deviceId, error); + } +} + +- (void)onPairingDeleted:(NSError * _Nullable)error +{ + if (_active) { + _commandBridge->PairingDeleted(); + } +} + +- (void)onCommissioningComplete:(NSError * _Nullable)error +{ + if (_active) { + _active = NO; + CHIP_ERROR err = [CHIPError errorToCHIPErrorCode:error]; + _commandBridge->OnStatusUpdate([self convertToStatusIB:err]); + } +} + +- (chip::app::StatusIB)convertToStatusIB:(CHIP_ERROR)err +{ + using chip::app::StatusIB; + using namespace chip; + using namespace chip::Protocols::InteractionModel; + using namespace chip::app::Clusters::OperationalCredentials; + + if (CHIP_ERROR_INVALID_PUBLIC_KEY == err) { + return StatusIB(Status::Failure, to_underlying(OperationalCertStatus::kInvalidPublicKey)); + } + if (CHIP_ERROR_WRONG_NODE_ID == err) { + return StatusIB(Status::Failure, to_underlying(OperationalCertStatus::kInvalidNodeOpId)); + } + if (CHIP_ERROR_UNSUPPORTED_CERT_FORMAT == err) { + return StatusIB(Status::Failure, to_underlying(OperationalCertStatus::kInvalidNOC)); + } + if (CHIP_ERROR_FABRIC_EXISTS == err) { + return StatusIB(Status::Failure, to_underlying(OperationalCertStatus::kFabricConflict)); + } + if (CHIP_ERROR_INVALID_FABRIC_ID == err) { + return StatusIB(Status::Failure, to_underlying(OperationalCertStatus::kInvalidFabricIndex)); + } + + return StatusIB(err); +} + +- (instancetype)initWithTestCommandBridge:(TestCommandBridge *)commandBridge +{ + if (!(self = [super init])) { + return nil; + } + + _commandBridge = commandBridge; + _active = NO; + return self; +} +@end + +NS_ASSUME_NONNULL_END 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 55ffd02d3c2eb0..b30dc92361cfab 100644 --- a/examples/chip-tool-darwin/templates/tests/partials/test_cluster.zapt +++ b/examples/chip-tool-darwin/templates/tests/partials/test_cluster.zapt @@ -70,6 +70,30 @@ class {{filename}}: public TestCommandBridge } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) + { + {{#chip_tests_items}} + case {{index}}: + {{! No support for expectMultipleResponses yet }} + {{#chip_tests_item_responses}} + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), {{error}})); + {{#if error}} + {{#if clusterError}} + VerifyOrReturn(CheckValue("clusterStatus present", status.mClusterStatus.HasValue(), true)); + VerifyOrReturn(CheckValue("clusterStatus value", status.mClusterStatus.Value(), {{clusterError}})); + {{/if}} + {{/if}} + {{/chip_tests_item_responses}} + break; + {{/chip_tests_items}} + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr({{chip_tests_config_get_default_value "timeout"}})); } private: @@ -102,6 +126,7 @@ class {{filename}}: public TestCommandBridge {{#*inline "testCommand"}}Test{{asUpperCamelCase label}}_{{index}}{{/inline}} CHIP_ERROR {{>testCommand}}() { + SetIdentity("{{identity}}"); {{#if (isTestOnlyCluster cluster)}} {{command}}( {{#chip_tests_item_parameters}} @@ -149,7 +174,7 @@ class {{filename}}: public TestCommandBridge {{else if isReadAttribute}} {{#if_is_fabric_scoped_struct attributeObject.type}} CHIPReadParams * params = [[CHIPReadParams alloc] init]; - params.fabricFiltered = [NSNumber numberWithBool:true]; + params.fabricFiltered = [NSNumber numberWithBool:{{fabricFiltered}}]; {{/if_is_fabric_scoped_struct}} [cluster readAttribute{{asUpperCamelCase attribute}}With {{~#if_is_fabric_scoped_struct attributeObject.type~}} diff --git a/examples/chip-tool-darwin/templates/tests/tests.js b/examples/chip-tool-darwin/templates/tests/tests.js index 525feea7890b95..c950365642c8a7 100644 --- a/examples/chip-tool-darwin/templates/tests/tests.js +++ b/examples/chip-tool-darwin/templates/tests/tests.js @@ -29,13 +29,6 @@ function getTests() { let tests = TestSuite.getTests(); - // TODO: These tests all need PairWithQRCode - tests.disable('Test_TC_MF_1_3'); - tests.disable('Test_TC_MF_1_4'); - tests.disable('Test_TC_MF_1_5'); - tests.disable('Test_TC_MF_1_6'); - tests.disable('Test_TC_MF_1_15'); - // TODO: This test needs FindCommissionable tests.disable('Test_TC_SC_4_2'); @@ -52,16 +45,10 @@ function getTests() { // TODO: TestConfigVariables not supported properly in codegen yet. tests.disable('TestConfigVariables'); - // TODO: TestGeneralCommissioning needs PairWithQRCode - tests.disable('TestGeneralCommissioning'); - // TODO: TestSystemCommands needs codegen changes or changes to the system // command implementation. tests.disable('TestSystemCommands'); - // TODO: TestMultiAdmin needs PairWithQRCode - tests.disable('TestMultiAdmin'); - // TODO: DL_UsersAndCredentials needs some sort of codegen fixes to produce compiling code. tests.disable('DL_UsersAndCredentials'); 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 90bcf287536429..97831fdf685248 100644 --- a/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h @@ -123,6 +123,11 @@ class TestList : public Command { printf("Test_TC_MC_9_1\n"); printf("Test_TC_MC_10_1\n"); printf("Test_TC_MOD_1_1\n"); + printf("Test_TC_MF_1_3\n"); + printf("Test_TC_MF_1_4\n"); + printf("Test_TC_MF_1_5\n"); + printf("Test_TC_MF_1_6\n"); + printf("Test_TC_MF_1_15\n"); printf("Test_TC_OCC_1_1\n"); printf("Test_TC_OCC_2_1\n"); printf("Test_TC_OCC_2_2\n"); @@ -195,6 +200,7 @@ class TestList : public Command { printf("TestSaveAs\n"); printf("TestDescriptorCluster\n"); printf("TestBasicInformation\n"); + printf("TestGeneralCommissioning\n"); printf("TestIdentifyCluster\n"); printf("TestOperationalCredentialsCluster\n"); printf("TestModeSelectCluster\n"); @@ -202,6 +208,7 @@ class TestList : public Command { printf("TestBinding\n"); printf("TestUserLabelCluster\n"); printf("TestArmFailSafe\n"); + printf("TestMultiAdmin\n"); printf("Test_TC_SWDIAG_1_1\n"); printf("Test_TC_SWDIAG_2_1\n"); printf("Test_TC_SWDIAG_3_1\n"); @@ -356,6 +363,81 @@ class TestAccessControlCluster : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 1)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 1)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 1)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 1)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 1)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 1)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -372,12 +454,14 @@ class TestAccessControlCluster : public TestCommandBridge { CHIP_ERROR TestWaitForCommissionee_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestWriteEntries_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestAccessControl * cluster = [[CHIPTestAccessControl alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -490,6 +574,7 @@ class TestAccessControlCluster : public TestCommandBridge { CHIP_ERROR TestVerify_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestAccessControl * cluster = [[CHIPTestAccessControl alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -745,6 +830,7 @@ class TestAccessControlCluster : public TestCommandBridge { CHIP_ERROR TestWriteEntriesEmptyLists_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestAccessControl * cluster = [[CHIPTestAccessControl alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -788,6 +874,7 @@ class TestAccessControlCluster : public TestCommandBridge { CHIP_ERROR TestVerify_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestAccessControl * cluster = [[CHIPTestAccessControl alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -833,6 +920,7 @@ class TestAccessControlCluster : public TestCommandBridge { CHIP_ERROR TestWriteEntryInvalidPrivilege_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestAccessControl * cluster = [[CHIPTestAccessControl alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -869,6 +957,7 @@ class TestAccessControlCluster : public TestCommandBridge { CHIP_ERROR TestVerify_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestAccessControl * cluster = [[CHIPTestAccessControl alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -904,6 +993,7 @@ class TestAccessControlCluster : public TestCommandBridge { CHIP_ERROR TestWriteEntryInvalidAuthMode_7() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestAccessControl * cluster = [[CHIPTestAccessControl alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -940,6 +1030,7 @@ class TestAccessControlCluster : public TestCommandBridge { CHIP_ERROR TestVerify_8() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestAccessControl * cluster = [[CHIPTestAccessControl alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -975,6 +1066,7 @@ class TestAccessControlCluster : public TestCommandBridge { CHIP_ERROR TestWriteEntryInvalidSubject_9() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestAccessControl * cluster = [[CHIPTestAccessControl alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -1015,6 +1107,7 @@ class TestAccessControlCluster : public TestCommandBridge { CHIP_ERROR TestVerify_10() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestAccessControl * cluster = [[CHIPTestAccessControl alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -1050,6 +1143,7 @@ class TestAccessControlCluster : public TestCommandBridge { CHIP_ERROR TestWriteEntryInvalidTarget_11() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestAccessControl * cluster = [[CHIPTestAccessControl alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -1094,6 +1188,7 @@ class TestAccessControlCluster : public TestCommandBridge { CHIP_ERROR TestVerify_12() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestAccessControl * cluster = [[CHIPTestAccessControl alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -1129,6 +1224,7 @@ class TestAccessControlCluster : public TestCommandBridge { CHIP_ERROR TestWriteEntryTooManySubjects_13() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestAccessControl * cluster = [[CHIPTestAccessControl alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -1188,6 +1284,7 @@ class TestAccessControlCluster : public TestCommandBridge { CHIP_ERROR TestVerify_14() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestAccessControl * cluster = [[CHIPTestAccessControl alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -1223,6 +1320,7 @@ class TestAccessControlCluster : public TestCommandBridge { CHIP_ERROR TestWriteEntryTooManyTargets_15() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestAccessControl * cluster = [[CHIPTestAccessControl alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -1362,6 +1460,7 @@ class TestAccessControlCluster : public TestCommandBridge { CHIP_ERROR TestVerify_16() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestAccessControl * cluster = [[CHIPTestAccessControl alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -1397,6 +1496,7 @@ class TestAccessControlCluster : public TestCommandBridge { CHIP_ERROR TestRestoreAcl_17() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestAccessControl * cluster = [[CHIPTestAccessControl alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -1427,6 +1527,7 @@ class TestAccessControlCluster : public TestCommandBridge { CHIP_ERROR TestVerify_18() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestAccessControl * cluster = [[CHIPTestAccessControl alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -1462,6 +1563,7 @@ class TestAccessControlCluster : public TestCommandBridge { CHIP_ERROR TestValidateResourceMinimaSubjectsPerAccessControlEntry_19() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestAccessControl * cluster = [[CHIPTestAccessControl alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -1484,6 +1586,7 @@ class TestAccessControlCluster : public TestCommandBridge { CHIP_ERROR TestValidateResourceMinimaTargetsPerAccessControlEntry_20() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestAccessControl * cluster = [[CHIPTestAccessControl alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -1506,6 +1609,7 @@ class TestAccessControlCluster : public TestCommandBridge { CHIP_ERROR TestValidateResourceMinimaAccessControlEntriesPerFabric_21() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestAccessControl * cluster = [[CHIPTestAccessControl alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -1606,6 +1710,39 @@ class Test_TC_BI_1_1 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -1622,12 +1759,14 @@ class Test_TC_BI_1_1 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 @@ -1652,6 +1791,7 @@ class Test_TC_BI_1_1 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 @@ -1672,6 +1812,7 @@ class Test_TC_BI_1_1 : public TestCommandBridge { CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 @@ -1695,6 +1836,7 @@ class Test_TC_BI_1_1 : public TestCommandBridge { CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 @@ -1719,6 +1861,7 @@ class Test_TC_BI_1_1 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeAttributeList_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 @@ -1739,6 +1882,7 @@ class Test_TC_BI_1_1 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 @@ -1759,6 +1903,7 @@ class Test_TC_BI_1_1 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_7() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 @@ -1875,6 +2020,51 @@ class Test_TC_BI_2_1 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -1891,12 +2081,14 @@ class Test_TC_BI_2_1 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestReadMandatoryNonGlobalAttributeOutOfService_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 @@ -1921,6 +2113,7 @@ class Test_TC_BI_2_1 : public TestCommandBridge { CHIP_ERROR TestReadMandatoryNonGlobalAttributeConstraintsOutOfService_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 @@ -1941,6 +2134,7 @@ class Test_TC_BI_2_1 : public TestCommandBridge { CHIP_ERROR TestWriteTheDefaultValuesToMandatoryNonGlobalAttributeOutOfService_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 @@ -1964,6 +2158,7 @@ class Test_TC_BI_2_1 : public TestCommandBridge { CHIP_ERROR TestReadsBackTheMandatoryNonGlobalAttributeOutOfService_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 @@ -1988,6 +2183,7 @@ class Test_TC_BI_2_1 : public TestCommandBridge { CHIP_ERROR TestReadMandatoryNonGlobalAttributeConstraintsPresentValue_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 @@ -2008,6 +2204,7 @@ class Test_TC_BI_2_1 : public TestCommandBridge { CHIP_ERROR TestWriteTheDefaultValuesToMandatoryNonGlobalAttributePresentValue_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 @@ -2031,6 +2228,7 @@ class Test_TC_BI_2_1 : public TestCommandBridge { CHIP_ERROR TestReadsBackTheMandatoryNonGlobalAttributePresentValue_7() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 @@ -2055,6 +2253,7 @@ class Test_TC_BI_2_1 : public TestCommandBridge { CHIP_ERROR TestReadMandatoryNonGlobalAttributeStatusFlags_8() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 @@ -2079,6 +2278,7 @@ class Test_TC_BI_2_1 : public TestCommandBridge { CHIP_ERROR TestReadMandatoryNonGlobalAttributeConstraintsStatusFlags_9() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 @@ -2106,6 +2306,7 @@ class Test_TC_BI_2_1 : public TestCommandBridge { CHIP_ERROR TestWriteTheDefaultValuesToMandatoryNonGlobalAttributeStatusFlags_10() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 @@ -2128,6 +2329,7 @@ class Test_TC_BI_2_1 : public TestCommandBridge { CHIP_ERROR TestReadsBackTheMandatoryNonGlobalAttributeStatusFlags_11() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 @@ -2265,6 +2467,42 @@ class Test_TC_BI_2_2 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -2281,12 +2519,14 @@ class Test_TC_BI_2_2 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestReadsPresentValueAttributeFromDut_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 @@ -2311,6 +2551,7 @@ class Test_TC_BI_2_2 : public TestCommandBridge { CHIP_ERROR TestReadsOutOfServiceAttributeFromDut_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 @@ -2335,6 +2576,7 @@ class Test_TC_BI_2_2 : public TestCommandBridge { CHIP_ERROR TestReadsStatusFlagsAttributeFromDut_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 @@ -2359,6 +2601,7 @@ class Test_TC_BI_2_2 : public TestCommandBridge { CHIP_ERROR TestReadsPresentValueAttributeFromDut_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 @@ -2383,6 +2626,7 @@ class Test_TC_BI_2_2 : public TestCommandBridge { CHIP_ERROR TestReadsOutOfServiceAttributeFromDut_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 @@ -2407,6 +2651,7 @@ class Test_TC_BI_2_2 : public TestCommandBridge { CHIP_ERROR TestReadsStatusFlagsAttributeFromDut_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 @@ -2431,6 +2676,7 @@ class Test_TC_BI_2_2 : public TestCommandBridge { CHIP_ERROR TestReadsStatusFlagsAttributeFromDut_7() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 @@ -2455,6 +2701,7 @@ class Test_TC_BI_2_2 : public TestCommandBridge { CHIP_ERROR TestReadsStatusFlagsAttributeFromDut_8() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 @@ -2568,6 +2815,39 @@ class Test_TC_BOOL_1_1 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -2584,12 +2864,14 @@ class Test_TC_BOOL_1_1 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBooleanState * cluster = [[CHIPTestBooleanState alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -2612,6 +2894,7 @@ class Test_TC_BOOL_1_1 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBooleanState * cluster = [[CHIPTestBooleanState alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -2630,6 +2913,7 @@ class Test_TC_BOOL_1_1 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBooleanState * cluster = [[CHIPTestBooleanState alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -2658,12 +2942,14 @@ class Test_TC_BOOL_1_1 : public TestCommandBridge { CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_4() { + SetIdentity("alpha"); UserPrompt(@"Please enter 'y' for success", @"y"); return CHIP_NO_ERROR; } CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBooleanState * cluster = [[CHIPTestBooleanState alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -2687,6 +2973,7 @@ class Test_TC_BOOL_1_1 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBooleanState * cluster = [[CHIPTestBooleanState alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -2710,6 +2997,7 @@ class Test_TC_BOOL_1_1 : public TestCommandBridge { CHIP_ERROR TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponseIndicatesFeatureMapAttributeHasTheValue0_7() { + SetIdentity("alpha"); UserPrompt(@"Please enter '0' for success", @"0"); return CHIP_NO_ERROR; } @@ -2773,6 +3061,24 @@ class Test_TC_BOOL_2_1 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -2789,12 +3095,14 @@ class Test_TC_BOOL_2_1 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestReadMandatoryNonGlobalAttributeStateValue_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBooleanState * cluster = [[CHIPTestBooleanState alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -2817,6 +3125,7 @@ class Test_TC_BOOL_2_1 : public TestCommandBridge { CHIP_ERROR TestReadMandatoryNonGlobalAttributeConstraintsStateValue_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBooleanState * cluster = [[CHIPTestBooleanState alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -2904,6 +3213,33 @@ class Test_TC_BRAC_1_1 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -2920,12 +3256,14 @@ class Test_TC_BRAC_1_1 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBridgedActions * cluster = [[CHIPTestBridgedActions alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -2948,6 +3286,7 @@ class Test_TC_BRAC_1_1 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBridgedActions * cluster = [[CHIPTestBridgedActions alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -2966,6 +3305,7 @@ class Test_TC_BRAC_1_1 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBridgedActions * cluster = [[CHIPTestBridgedActions alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -2984,6 +3324,7 @@ class Test_TC_BRAC_1_1 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBridgedActions * cluster = [[CHIPTestBridgedActions alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -3002,6 +3343,7 @@ class Test_TC_BRAC_1_1 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBridgedActions * cluster = [[CHIPTestBridgedActions alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -3118,6 +3460,45 @@ class Test_TC_CC_1_1 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -3134,12 +3515,14 @@ class Test_TC_CC_1_1 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -3162,6 +3545,7 @@ class Test_TC_CC_1_1 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -3180,6 +3564,7 @@ class Test_TC_CC_1_1 : public TestCommandBridge { CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -3201,6 +3586,7 @@ class Test_TC_CC_1_1 : public TestCommandBridge { CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -3223,6 +3609,7 @@ class Test_TC_CC_1_1 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeAttributeList_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -3241,12 +3628,14 @@ class Test_TC_CC_1_1 : public TestCommandBridge { CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_6() { + SetIdentity("alpha"); UserPrompt(@"Please enter 'y' for success", @"y"); return CHIP_NO_ERROR; } CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_7() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -3265,6 +3654,7 @@ class Test_TC_CC_1_1 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_8() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -3283,6 +3673,7 @@ class Test_TC_CC_1_1 : public TestCommandBridge { CHIP_ERROR TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponseIndicatesFeatureMapAttributeHasTheValue0_9() { + SetIdentity("alpha"); UserPrompt(@"Please enter '0' for success", @"0"); return CHIP_NO_ERROR; } @@ -3898,6 +4289,432 @@ class Test_TC_CC_2_1 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 34: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 35: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 36: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 37: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 38: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 39: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 40: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 41: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 42: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 43: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 44: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 45: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 46: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 47: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 48: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 49: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 50: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 51: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 52: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 53: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 54: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 55: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 56: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 57: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 58: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 59: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 60: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 61: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 62: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 63: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 64: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 65: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 66: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 67: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 68: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 69: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 70: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 71: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 72: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 73: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 74: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 75: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 76: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 77: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 78: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 79: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 80: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 81: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 82: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 83: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 84: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 85: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 86: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 87: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 88: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 89: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 90: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 91: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 92: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 93: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 94: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 95: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 96: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 97: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 98: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 99: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 100: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 101: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 102: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 103: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 104: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 105: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 106: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 107: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 108: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 109: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 110: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 111: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 112: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 113: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 114: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 115: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 116: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 117: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 118: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 119: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 120: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 121: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 122: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 123: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 124: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 125: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 126: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 127: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 128: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 129: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 130: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 131: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 132: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 133: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 134: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 135: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 136: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 137: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 138: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -3914,12 +4731,14 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestValidateConstraintsOfAttributeCurrentHue_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -3945,6 +4764,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestWriteTheDefaultValueToMandatoryAttributeCurrentHue_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -3964,6 +4784,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadsBackMandatoryAttributeCurrentHue_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -3989,6 +4810,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestValidateConstraintsOfAttributeCurrentSaturation_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -4014,6 +4836,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestWriteTheDefaultValueToMandatoryAttributeCurrentSaturation_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -4034,6 +4857,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadsBackMandatoryAttributeCurrentSaturation_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -4059,6 +4883,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestValidateConstraintsOfAttributeCurrentX_7() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -4084,6 +4909,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestWriteTheDefaultValueToMandatoryAttributeCurrentX_8() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -4103,6 +4929,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadsBackMandatoryAttributeCurrentX_9() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -4128,6 +4955,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestValidateConstraintsOfAttributeCurrentY_10() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -4153,6 +4981,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeCurrentY_11() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -4172,6 +5001,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadsBackMandatoryAttributeCurrentY_12() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -4197,6 +5027,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestValidateConstraintsOfAttributeColorTemperatureMireds_13() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -4222,6 +5053,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestValidateConstraintsOfAttributeColorMode_14() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -4247,6 +5079,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestValidateConstraintsOfAttributeOptions_15() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -4265,6 +5098,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeOptions_16() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -4285,6 +5119,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadsBackMandatoryAttributeOptions_17() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -4307,6 +5142,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestValidateConstraintsOfAttributeEnhancedCurrentHue_18() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -4325,6 +5161,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeEnhancedCurrentHue_19() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -4345,6 +5182,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadsBackMandatoryAttributeEnhancedCurrentHue_20() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -4363,6 +5201,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestValidateConstraintsOfAttributeEnhancedColorMode_21() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -4381,6 +5220,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestValidateConstraintsOfAttributeColorLoopActive_22() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -4399,6 +5239,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeColorLoopActive_23() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -4418,6 +5259,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadsBackMandatoryAttributeColorLoopActive_24() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -4436,6 +5278,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestValidateConstraintsOfAttributeColorLoopDirection_25() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -4454,6 +5297,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeColorLoopDirection_26() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -4474,6 +5318,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadsBackMandatoryAttributeColorLoopDirection_27() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -4492,6 +5337,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestValidateConstraintsOfAttributeColorLoopTime_28() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -4510,6 +5356,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeColorLoopTime_29() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -4529,6 +5376,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadsBackMandatoryAttributeColorLoopTime_30() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -4547,6 +5395,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestValidateConstraintsOfAttributeColorLoopStartEnhancedHue_31() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -4566,6 +5415,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeColorLoopStartEnhancedHue_32() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -4587,6 +5437,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadsBackMandatoryAttributeColorLoopStartEnhancedHue_33() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -4606,6 +5457,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestValidateConstraintsOfAttributeColorLoopStoredEnhancedHue_34() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -4625,6 +5477,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeColorLoopStoredEnhancedHue_35() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -4646,6 +5499,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadsBackMandatoryAttributeColorLoopStoredEnhancedHue_36() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -4665,6 +5519,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestValidateConstraintsOfAttributeColorCapabilities_37() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -4690,6 +5545,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeColorCapabilities_38() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -4710,6 +5566,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadsBackMandatoryAttributeColorCapabilities_39() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -4735,6 +5592,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestValidateConstraintsOfAttributeColorTempPhysicalMinMireds_40() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -4760,6 +5618,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeColorTempPhysicalMinMireds_41() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -4781,6 +5640,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadsBackMandatoryAttributeColorTempPhysicalMinMireds_42() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -4806,6 +5666,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestValidateConstraintsOfAttributeColorTempPhysicalMaxMireds_43() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -4831,6 +5692,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeColorTempPhysicalMaxMireds_44() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -4852,6 +5714,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadsBackMandatoryAttributeColorTempPhysicalMaxMireds_45() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -4877,6 +5740,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadTheOptionalAttributeCoupleColorTempToLevelMinMireds_46() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -4901,6 +5765,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestWriteTheDefaultValuesToOptionalAttributeCoupleColorTempToLevelMinMireds_47() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -4928,6 +5793,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadsBackOptionalAttributeCoupleColorTempToLevelMinMireds_48() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -4952,6 +5818,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadTheOptionalAttributeStartUpColorTemperatureMireds_49() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -4984,6 +5851,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestWriteTheDefaultValuesToOptionalAttributeStartUpColorTemperatureMireds_50() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -5011,6 +5879,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadsBackOptionalAttributeStartUpColorTemperatureMireds_51() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -5039,6 +5908,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestValidateConstraintsOfAttributeRemainingTime_52() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -5062,6 +5932,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestWriteTheDefaultValuesToOptionalAttributeRemainingTime_53() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -5086,6 +5957,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadsBackOptionalAttributeRemainingTime_54() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -5109,6 +5981,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadTheOptionalAttributeDriftCompensation_55() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -5139,6 +6012,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestWriteTheDefaultValuesToOptionalAttributeDriftCompensation_56() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -5164,6 +6038,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadsBackOptionalAttributeDriftCompensation_57() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -5194,6 +6069,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadTheOptionalAttributeCompensationText_58() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -5218,6 +6094,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestWriteTheDefaultValuesToOptionalAttributeCompensationText_59() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -5243,6 +6120,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadsBackOptionalAttributeCompensationText_60() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -5267,6 +6145,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadTheMandatoryAttributeNumberOfPrimaries_61() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -5292,6 +6171,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestWriteTheDefaultMandatoryAttributeNumberOfPrimaries_62() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -5311,6 +6191,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadBackTheMandatoryAttributeNumberOfPrimaries_63() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -5336,6 +6217,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadTheMandatoryAttributePrimary1X_64() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -5361,6 +6243,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestWriteTheDefaultMandatoryAttributePrimary1X_65() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -5380,6 +6263,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadBackTheMandatoryAttributePrimary1X_66() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -5405,6 +6289,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadTheMandatoryAttributePrimary1Y_67() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -5430,6 +6315,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestWriteTheDefaultMandatoryAttributePrimary1Y_68() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -5449,6 +6335,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadBackTheMandatoryAttributePrimary1Y_69() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -5474,6 +6361,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadTheMandatoryAttributePrimary1Intensity_70() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -5492,6 +6380,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadTheMandatoryAttributePrimary2X_71() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -5517,6 +6406,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestWriteTheDefaultMandatoryAttributePrimary2X_72() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -5536,6 +6426,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadBackTheMandatoryAttributePrimary2X_73() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -5561,6 +6452,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadTheMandatoryAttributePrimary2Y_74() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -5586,6 +6478,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestWriteTheDefaultMandatoryAttributePrimary2Y_75() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -5605,6 +6498,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadBackTheMandatoryAttributePrimary2Y_76() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -5630,6 +6524,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestValidateConstraintsOfAttributePrimary2Intensity_77() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -5648,6 +6543,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadTheMandatoryAttributePrimary3X_78() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -5673,6 +6569,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestWriteTheDefaultMandatoryAttributePrimary3X_79() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -5692,6 +6589,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadBackTheMandatoryAttributePrimary3X_80() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -5717,6 +6615,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadTheMandatoryAttributePrimary3Y_81() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -5742,6 +6641,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestWriteTheDefaultMandatoryAttributePrimary3Y_82() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -5761,6 +6661,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadBackTheMandatoryAttributePrimary3Y_83() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -5786,6 +6687,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadTheMandatoryAttributePrimary3Intensity_84() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -5804,6 +6706,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadTheMandatoryAttributePrimary4X_85() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -5829,6 +6732,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestWriteTheDefaultMandatoryAttributePrimary4X_86() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -5848,6 +6752,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadBackTheMandatoryAttributePrimary4X_87() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -5873,6 +6778,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadTheMandatoryAttributePrimary4Y_88() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -5898,6 +6804,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestWriteTheDefaultMandatoryAttributePrimary4Y_89() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -5917,6 +6824,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadBackTheMandatoryAttributePrimary4Y_90() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -5942,6 +6850,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadTheMandatoryAttributePrimary4Intensity_91() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -5960,6 +6869,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadTheMandatoryAttributePrimary5X_92() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -5985,6 +6895,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestWriteTheDefaultMandatoryAttributePrimary5X_93() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -6004,6 +6915,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadBackTheMandatoryAttributePrimary5X_94() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -6029,6 +6941,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadTheMandatoryAttributePrimary5Y_95() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -6054,6 +6967,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestWriteTheDefaultMandatoryAttributePrimary5Y_96() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -6073,6 +6987,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadBackTheMandatoryAttributePrimary5Y_97() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -6098,6 +7013,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadTheMandatoryAttributePrimary5Intensity_98() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -6116,6 +7032,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadTheMandatoryAttributePrimary6X_99() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -6141,6 +7058,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestWriteTheDefaultMandatoryAttributePrimary6X_100() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -6160,6 +7078,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadBackTheMandatoryAttributePrimary6X_101() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -6185,6 +7104,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadTheMandatoryAttributePrimary6Y_102() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -6210,6 +7130,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestWriteTheDefaultMandatoryAttributePrimary6Y_103() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -6229,6 +7150,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadBackTheMandatoryAttributePrimary6Y_104() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -6254,6 +7176,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadTheMandatoryAttributePrimary6Intensity_105() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -6272,6 +7195,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadTheOptionalAttributeWhitePointX_106() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -6302,6 +7226,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestWriteTheDefaultOptionalAttributeWhitePointX_107() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -6327,6 +7252,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadBackTheOptionalAttributeWhitePointX_108() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -6354,6 +7280,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadTheOptionalAttributeWhitePointY_109() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -6384,6 +7311,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestWriteTheDefaultOptionalAttributeWhitePointY_110() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -6409,6 +7337,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadBackTheOptionalAttributeWhitePointY_111() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -6436,6 +7365,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadTheOptionalAttributeColorPointRX_112() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -6466,6 +7396,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestWriteTheDefaultOptionalAttributeColorPointRX_113() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -6491,6 +7422,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadBackTheOptionalAttributeColorPointRX_114() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -6518,6 +7450,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadTheOptionalAttributeColorPointRY_115() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -6548,6 +7481,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestWriteTheDefaultOptionalAttributeColorPointRY_116() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -6573,6 +7507,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadBackTheOptionalAttributeColorPointRY_117() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -6600,6 +7535,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadTheOptionalAttributeColorPointRIntensity_118() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -6623,6 +7559,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestWriteTheDefaultOptionalAttributeColorPointRIntensity_119() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -6648,6 +7585,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadBackTheOptionalAttributeColorPointRIntensity_120() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -6675,6 +7613,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadTheOptionalAttributeColorPointGX_121() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -6705,6 +7644,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestWriteTheDefaultOptionalAttributeColorPointGX_122() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -6730,6 +7670,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadBackTheOptionalAttributeColorPointGX_123() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -6757,6 +7698,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadTheOptionalAttributeColorPointGY_124() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -6787,6 +7729,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestWriteTheDefaultOptionalAttributeColorPointGY_125() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -6812,6 +7755,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadBackTheOptionalAttributeColorPointGY_126() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -6839,6 +7783,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadTheOptionalAttributeColorPointGIntensity_127() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -6862,6 +7807,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestWriteTheDefaultOptionalAttributeColorPointGIntensity_128() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -6887,6 +7833,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadBackTheOptionalAttributeColorPointGIntensity_129() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -6914,6 +7861,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadTheOptionalAttributeColorPointBX_130() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -6944,6 +7892,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestWriteTheDefaultOptionalAttributeColorPointBX_131() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -6969,6 +7918,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadBackTheOptionalAttributeColorPointBX_132() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -6996,6 +7946,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadTheOptionalAttributeColorPointBY_133() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -7026,6 +7977,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestWriteTheDefaultOptionalAttributeColorPointBY_134() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -7051,6 +8003,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadBackTheOptionalAttributeColorPointBY_135() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -7078,6 +8031,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadTheOptionalAttributeColorPointBIntensity_136() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -7101,6 +8055,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestWriteTheDefaultOptionalAttributeColorPointBIntensity_137() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -7126,6 +8081,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { CHIP_ERROR TestReadBackTheOptionalAttributeColorPointBIntensity_138() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -7238,6 +8194,45 @@ class Test_TC_CC_3_1 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -7254,12 +8249,14 @@ class Test_TC_CC_3_1 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestTurnOnLightForColorControlTests_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -7277,6 +8274,7 @@ class Test_TC_CC_3_1 : public TestCommandBridge { CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -7299,6 +8297,7 @@ class Test_TC_CC_3_1 : public TestCommandBridge { CHIP_ERROR TestReadsCurrentHueAttributeFromDut_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -7324,6 +8323,7 @@ class Test_TC_CC_3_1 : public TestCommandBridge { CHIP_ERROR TestMoveToHueShortestDistanceCommand_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -7348,6 +8348,7 @@ class Test_TC_CC_3_1 : public TestCommandBridge { CHIP_ERROR TestMoveToHueLongestDistanceCommand_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -7372,6 +8373,7 @@ class Test_TC_CC_3_1 : public TestCommandBridge { CHIP_ERROR TestMoveToHueUpCommand_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -7396,6 +8398,7 @@ class Test_TC_CC_3_1 : public TestCommandBridge { CHIP_ERROR TestMoveToHueDownCommand_7() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -7420,6 +8423,7 @@ class Test_TC_CC_3_1 : public TestCommandBridge { CHIP_ERROR TestTurnOffLightThatWeTurnedOn_8() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -7437,6 +8441,7 @@ class Test_TC_CC_3_1 : public TestCommandBridge { CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_9() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -7540,6 +8545,42 @@ class Test_TC_CC_3_2 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -7556,12 +8597,14 @@ class Test_TC_CC_3_2 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestTurnOnLightForColorControlTests_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -7579,6 +8622,7 @@ class Test_TC_CC_3_2 : public TestCommandBridge { CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -7601,6 +8645,7 @@ class Test_TC_CC_3_2 : public TestCommandBridge { CHIP_ERROR TestMoveHueUpCommand_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -7624,6 +8669,7 @@ class Test_TC_CC_3_2 : public TestCommandBridge { CHIP_ERROR TestMoveHueStopCommand_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -7647,6 +8693,7 @@ class Test_TC_CC_3_2 : public TestCommandBridge { CHIP_ERROR TestMoveHueDownCommand_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -7670,6 +8717,7 @@ class Test_TC_CC_3_2 : public TestCommandBridge { CHIP_ERROR TestMoveHueStopCommand_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -7693,6 +8741,7 @@ class Test_TC_CC_3_2 : public TestCommandBridge { CHIP_ERROR TestTurnOffLightThatWeTurnedOn_7() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -7710,6 +8759,7 @@ class Test_TC_CC_3_2 : public TestCommandBridge { CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_8() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -7805,6 +8855,36 @@ class Test_TC_CC_3_3 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -7821,12 +8901,14 @@ class Test_TC_CC_3_3 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestTurnOnLightForColorControlTests_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -7844,6 +8926,7 @@ class Test_TC_CC_3_3 : public TestCommandBridge { CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -7866,6 +8949,7 @@ class Test_TC_CC_3_3 : public TestCommandBridge { CHIP_ERROR TestStepHueUpCommand_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -7890,6 +8974,7 @@ class Test_TC_CC_3_3 : public TestCommandBridge { CHIP_ERROR TestStepHueDownCommand_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -7914,6 +8999,7 @@ class Test_TC_CC_3_3 : public TestCommandBridge { CHIP_ERROR TestTurnOffLightThatWeTurnedOn_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -7931,6 +9017,7 @@ class Test_TC_CC_3_3 : public TestCommandBridge { CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -8022,216 +9109,31 @@ class Test_TC_CC_4_1 : public TestCommandBridge { } } - 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 TestTurnOnLightForColorControlTests_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(@"Turn on light for color control tests Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2() - { - 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(@"Check on/off attribute value is true after on command Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestMoveToSaturationCommand_3() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[CHIPColorControlClusterMoveToSaturationParams alloc] init]; - params.saturation = [NSNumber numberWithUnsignedChar:90]; - params.transitionTime = [NSNumber numberWithUnsignedShort:10U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster moveToSaturationWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Move to saturation command Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_4() - { - 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(@"Turn off light that we turned on Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5() - { - 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(@"Check on/off attribute value is false after off command Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } -}; - -class Test_TC_CC_4_2 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_CC_4_2() - : TestCommandBridge("Test_TC_CC_4_2") - , 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_CC_4_2() {} - - /////////// TestCommand Interface ///////// - void NextTest() override + void OnStatusUpdate(const chip::app::StatusIB & status) override { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_4_2\n"); - } - - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_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++) { + switch (mTestIndex - 1) { case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Turn on light for color control tests\n"); - err = TestTurnOnLightForColorControlTests_1(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Check on/off attribute value is true after on command\n"); - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Move saturation up command\n"); - err = TestMoveSaturationUpCommand_3(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Move saturation down command\n"); - err = TestMoveSaturationDownCommand_4(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Move saturation up command\n"); - err = TestMoveSaturationUpCommand_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Move saturation stop command\n"); - err = TestMoveSaturationStopCommand_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Move saturation down command\n"); - err = TestMoveSaturationDownCommand_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Move saturation stop command\n"); - err = TestMoveSaturationStopCommand_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_10(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; } - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + // Go on to the next test. + WaitForMs(0); } chip::System::Clock::Timeout GetWaitDuration() const override @@ -8241,7 +9143,7 @@ class Test_TC_CC_4_2 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 11; + const uint16_t mTestCount = 6; chip::Optional mNodeId; chip::Optional mCluster; @@ -8250,12 +9152,14 @@ class Test_TC_CC_4_2 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestTurnOnLightForColorControlTests_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -8273,6 +9177,267 @@ class Test_TC_CC_4_2 : public TestCommandBridge { CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2() { + SetIdentity("alpha"); + 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(@"Check on/off attribute value is true after on command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestMoveToSaturationCommand_3() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPColorControlClusterMoveToSaturationParams alloc] init]; + params.saturation = [NSNumber numberWithUnsignedChar:90]; + params.transitionTime = [NSNumber numberWithUnsignedShort:10U]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; + [cluster moveToSaturationWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Move to saturation command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_4() + { + SetIdentity("alpha"); + 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(@"Turn off light that we turned on Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5() + { + SetIdentity("alpha"); + 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(@"Check on/off attribute value is false after off command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CC_4_2 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_CC_4_2() + : TestCommandBridge("Test_TC_CC_4_2") + , 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_CC_4_2() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_4_2\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_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 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Turn on light for color control tests\n"); + err = TestTurnOnLightForColorControlTests_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Check on/off attribute value is true after on command\n"); + err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Move saturation up command\n"); + err = TestMoveSaturationUpCommand_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Move saturation down command\n"); + err = TestMoveSaturationDownCommand_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Move saturation up command\n"); + err = TestMoveSaturationUpCommand_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Move saturation stop command\n"); + err = TestMoveSaturationStopCommand_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Move saturation down command\n"); + err = TestMoveSaturationDownCommand_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Move saturation stop command\n"); + err = TestMoveSaturationStopCommand_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Turn off light that we turned on\n"); + err = TestTurnOffLightThatWeTurnedOn_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_10(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + + 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 = 11; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity("alpha"); + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTurnOnLightForColorControlTests_1() + { + SetIdentity("alpha"); + 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(@"Turn on light for color control tests Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2() + { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -8295,6 +9460,7 @@ class Test_TC_CC_4_2 : public TestCommandBridge { CHIP_ERROR TestMoveSaturationUpCommand_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -8318,6 +9484,7 @@ class Test_TC_CC_4_2 : public TestCommandBridge { CHIP_ERROR TestMoveSaturationDownCommand_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -8341,6 +9508,7 @@ class Test_TC_CC_4_2 : public TestCommandBridge { CHIP_ERROR TestMoveSaturationUpCommand_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -8364,6 +9532,7 @@ class Test_TC_CC_4_2 : public TestCommandBridge { CHIP_ERROR TestMoveSaturationStopCommand_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -8387,6 +9556,7 @@ class Test_TC_CC_4_2 : public TestCommandBridge { CHIP_ERROR TestMoveSaturationDownCommand_7() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -8410,6 +9580,7 @@ class Test_TC_CC_4_2 : public TestCommandBridge { CHIP_ERROR TestMoveSaturationStopCommand_8() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -8433,6 +9604,7 @@ class Test_TC_CC_4_2 : public TestCommandBridge { CHIP_ERROR TestTurnOffLightThatWeTurnedOn_9() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -8450,6 +9622,7 @@ class Test_TC_CC_4_2 : public TestCommandBridge { CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_10() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -8545,6 +9718,36 @@ class Test_TC_CC_4_3 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -8561,12 +9764,14 @@ class Test_TC_CC_4_3 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestTurnOnLightForColorControlTests_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -8584,6 +9789,7 @@ class Test_TC_CC_4_3 : public TestCommandBridge { CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -8606,6 +9812,7 @@ class Test_TC_CC_4_3 : public TestCommandBridge { CHIP_ERROR TestStepSaturationUpCommand_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -8630,6 +9837,7 @@ class Test_TC_CC_4_3 : public TestCommandBridge { CHIP_ERROR TestStepSaturationDownCommand_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -8654,6 +9862,7 @@ class Test_TC_CC_4_3 : public TestCommandBridge { CHIP_ERROR TestTurnOffLightThatWeTurnedOn_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -8671,6 +9880,7 @@ class Test_TC_CC_4_3 : public TestCommandBridge { CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -8762,6 +9972,33 @@ class Test_TC_CC_4_4 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -8778,12 +10015,14 @@ class Test_TC_CC_4_4 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestTurnOnLightForColorControlTests_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -8801,6 +10040,7 @@ class Test_TC_CC_4_4 : public TestCommandBridge { CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -8823,6 +10063,7 @@ class Test_TC_CC_4_4 : public TestCommandBridge { CHIP_ERROR TestMoveToCurrentHueAndSaturationCommand_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -8847,6 +10088,7 @@ class Test_TC_CC_4_4 : public TestCommandBridge { CHIP_ERROR TestTurnOffLightThatWeTurnedOn_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -8864,6 +10106,7 @@ class Test_TC_CC_4_4 : public TestCommandBridge { CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -8955,6 +10198,33 @@ class Test_TC_CC_5_1 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -8971,12 +10241,14 @@ class Test_TC_CC_5_1 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestTurnOnLightForColorControlTests_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -8994,6 +10266,7 @@ class Test_TC_CC_5_1 : public TestCommandBridge { CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -9016,6 +10289,7 @@ class Test_TC_CC_5_1 : public TestCommandBridge { CHIP_ERROR TestMoveToColorCommand_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -9040,6 +10314,7 @@ class Test_TC_CC_5_1 : public TestCommandBridge { CHIP_ERROR TestTurnOffLightThatWeTurnedOn_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -9057,6 +10332,7 @@ class Test_TC_CC_5_1 : public TestCommandBridge { CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -9152,6 +10428,36 @@ class Test_TC_CC_5_2 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -9168,12 +10474,14 @@ class Test_TC_CC_5_2 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestTurnOnLightForColorControlTests_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -9191,6 +10499,7 @@ class Test_TC_CC_5_2 : public TestCommandBridge { CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -9213,6 +10522,7 @@ class Test_TC_CC_5_2 : public TestCommandBridge { CHIP_ERROR TestMoveColorCommand_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -9236,6 +10546,7 @@ class Test_TC_CC_5_2 : public TestCommandBridge { CHIP_ERROR TestStopMoveStepCommand_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -9257,6 +10568,7 @@ class Test_TC_CC_5_2 : public TestCommandBridge { CHIP_ERROR TestTurnOffLightThatWeTurnedOn_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -9274,6 +10586,7 @@ class Test_TC_CC_5_2 : public TestCommandBridge { CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -9365,6 +10678,33 @@ class Test_TC_CC_5_3 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -9381,12 +10721,14 @@ class Test_TC_CC_5_3 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestTurnOnLightForColorControlTests_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -9404,6 +10746,7 @@ class Test_TC_CC_5_3 : public TestCommandBridge { CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -9426,6 +10769,7 @@ class Test_TC_CC_5_3 : public TestCommandBridge { CHIP_ERROR TestStepColorCommand_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -9450,6 +10794,7 @@ class Test_TC_CC_5_3 : public TestCommandBridge { CHIP_ERROR TestTurnOffLightThatWeTurnedOn_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -9467,6 +10812,7 @@ class Test_TC_CC_5_3 : public TestCommandBridge { CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -9558,6 +10904,33 @@ class Test_TC_CC_6_1 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -9574,12 +10947,14 @@ class Test_TC_CC_6_1 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestTurnOnLightForColorControlTests_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -9597,6 +10972,7 @@ class Test_TC_CC_6_1 : public TestCommandBridge { CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -9619,6 +10995,7 @@ class Test_TC_CC_6_1 : public TestCommandBridge { CHIP_ERROR TestMoveToColorTemperatureCommand_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -9642,6 +11019,7 @@ class Test_TC_CC_6_1 : public TestCommandBridge { CHIP_ERROR TestTurnOffLightThatWeTurnedOn_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -9659,6 +11037,7 @@ class Test_TC_CC_6_1 : public TestCommandBridge { CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -9774,6 +11153,51 @@ class Test_TC_CC_6_2 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -9790,12 +11214,14 @@ class Test_TC_CC_6_2 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestTurnOnLightForColorControlTests_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -9813,6 +11239,7 @@ class Test_TC_CC_6_2 : public TestCommandBridge { CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -9835,6 +11262,7 @@ class Test_TC_CC_6_2 : public TestCommandBridge { CHIP_ERROR TestReadCurrentColorTemprature_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -9860,6 +11288,7 @@ class Test_TC_CC_6_2 : public TestCommandBridge { CHIP_ERROR TestMoveUpColorTemperatureCommand_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -9885,6 +11314,7 @@ class Test_TC_CC_6_2 : public TestCommandBridge { CHIP_ERROR TestMoveDownColorTemperatureCommand_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -9910,6 +11340,7 @@ class Test_TC_CC_6_2 : public TestCommandBridge { CHIP_ERROR TestMoveUpColorTemperatureCommand_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -9935,6 +11366,7 @@ class Test_TC_CC_6_2 : public TestCommandBridge { CHIP_ERROR TestStopColorTemperatureCommand_7() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -9960,6 +11392,7 @@ class Test_TC_CC_6_2 : public TestCommandBridge { CHIP_ERROR TestMoveDownColorTemperatureCommand_8() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -9985,6 +11418,7 @@ class Test_TC_CC_6_2 : public TestCommandBridge { CHIP_ERROR TestStopColorTemperatureCommand_9() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -10010,6 +11444,7 @@ class Test_TC_CC_6_2 : public TestCommandBridge { CHIP_ERROR TestTurnOffLightThatWeTurnedOn_10() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -10027,6 +11462,7 @@ class Test_TC_CC_6_2 : public TestCommandBridge { CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_11() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -10122,241 +11558,34 @@ class Test_TC_CC_6_3 : public TestCommandBridge { } } - 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 TestTurnOnLightForColorControlTests_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(@"Turn on light for color control tests Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2() - { - 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(@"Check on/off attribute value is true after on command Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStepUpColorTemperatureCommand_3() + void OnStatusUpdate(const chip::app::StatusIB & status) override { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[CHIPColorControlClusterStepColorTemperatureParams alloc] init]; - params.stepMode = [NSNumber numberWithUnsignedChar:1]; - params.stepSize = [NSNumber numberWithUnsignedShort:5U]; - params.transitionTime = [NSNumber numberWithUnsignedShort:50U]; - params.colorTemperatureMinimum = [NSNumber numberWithUnsignedShort:5U]; - params.colorTemperatureMaximum = [NSNumber numberWithUnsignedShort:100U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster stepColorTemperatureWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Step up color temperature command Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStepDownColorTemperatureCommand_4() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[CHIPColorControlClusterStepColorTemperatureParams alloc] init]; - params.stepMode = [NSNumber numberWithUnsignedChar:3]; - params.stepSize = [NSNumber numberWithUnsignedShort:5U]; - params.transitionTime = [NSNumber numberWithUnsignedShort:50U]; - params.colorTemperatureMinimum = [NSNumber numberWithUnsignedShort:5U]; - params.colorTemperatureMaximum = [NSNumber numberWithUnsignedShort:100U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster stepColorTemperatureWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Step down color temperature command Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_5() - { - 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(@"Turn off light that we turned on Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_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(@"Check on/off attribute value is false after off command Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } -}; - -class Test_TC_CC_7_1 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_CC_7_1() - : TestCommandBridge("Test_TC_CC_7_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_CC_7_1() {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_7_1\n"); - } - - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_7_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++) { + switch (mTestIndex - 1) { case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Turn on light for color control tests\n"); - err = TestTurnOnLightForColorControlTests_1(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Check on/off attribute value is true after on command\n"); - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Enhanced Move To Hue command\n"); - err = TestEnhancedMoveToHueCommand_3(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Enhanced Move To Hue command\n"); - err = TestEnhancedMoveToHueCommand_4(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Enhanced Move To Hue command\n"); - err = TestEnhancedMoveToHueCommand_5(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Enhanced Move To Hue command\n"); - err = TestEnhancedMoveToHueCommand_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Enhanced Move To Hue command\n"); - err = TestEnhancedMoveToHueCommand_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_9(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; } - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + // Go on to the next test. + WaitForMs(0); } chip::System::Clock::Timeout GetWaitDuration() const override @@ -10366,7 +11595,7 @@ class Test_TC_CC_7_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 10; + const uint16_t mTestCount = 7; chip::Optional mNodeId; chip::Optional mCluster; @@ -10375,12 +11604,14 @@ class Test_TC_CC_7_1 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestTurnOnLightForColorControlTests_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -10398,6 +11629,290 @@ class Test_TC_CC_7_1 : public TestCommandBridge { CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2() { + SetIdentity("alpha"); + 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(@"Check on/off attribute value is true after on command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStepUpColorTemperatureCommand_3() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPColorControlClusterStepColorTemperatureParams alloc] init]; + params.stepMode = [NSNumber numberWithUnsignedChar:1]; + params.stepSize = [NSNumber numberWithUnsignedShort:5U]; + params.transitionTime = [NSNumber numberWithUnsignedShort:50U]; + params.colorTemperatureMinimum = [NSNumber numberWithUnsignedShort:5U]; + params.colorTemperatureMaximum = [NSNumber numberWithUnsignedShort:100U]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; + [cluster stepColorTemperatureWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Step up color temperature command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStepDownColorTemperatureCommand_4() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPColorControlClusterStepColorTemperatureParams alloc] init]; + params.stepMode = [NSNumber numberWithUnsignedChar:3]; + params.stepSize = [NSNumber numberWithUnsignedShort:5U]; + params.transitionTime = [NSNumber numberWithUnsignedShort:50U]; + params.colorTemperatureMinimum = [NSNumber numberWithUnsignedShort:5U]; + params.colorTemperatureMaximum = [NSNumber numberWithUnsignedShort:100U]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; + [cluster stepColorTemperatureWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Step down color temperature command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_5() + { + SetIdentity("alpha"); + 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(@"Turn off light that we turned on Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_6() + { + SetIdentity("alpha"); + 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(@"Check on/off attribute value is false after off command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CC_7_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_CC_7_1() + : TestCommandBridge("Test_TC_CC_7_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_CC_7_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_7_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_7_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 : Turn on light for color control tests\n"); + err = TestTurnOnLightForColorControlTests_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Check on/off attribute value is true after on command\n"); + err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Enhanced Move To Hue command\n"); + err = TestEnhancedMoveToHueCommand_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Enhanced Move To Hue command\n"); + err = TestEnhancedMoveToHueCommand_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Enhanced Move To Hue command\n"); + err = TestEnhancedMoveToHueCommand_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Enhanced Move To Hue command\n"); + err = TestEnhancedMoveToHueCommand_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Enhanced Move To Hue command\n"); + err = TestEnhancedMoveToHueCommand_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Turn off light that we turned on\n"); + err = TestTurnOffLightThatWeTurnedOn_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_9(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + + 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 = 10; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity("alpha"); + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTurnOnLightForColorControlTests_1() + { + SetIdentity("alpha"); + 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(@"Turn on light for color control tests Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2() + { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -10420,6 +11935,7 @@ class Test_TC_CC_7_1 : public TestCommandBridge { CHIP_ERROR TestEnhancedMoveToHueCommand_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -10444,6 +11960,7 @@ class Test_TC_CC_7_1 : public TestCommandBridge { CHIP_ERROR TestEnhancedMoveToHueCommand_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -10468,6 +11985,7 @@ class Test_TC_CC_7_1 : public TestCommandBridge { CHIP_ERROR TestEnhancedMoveToHueCommand_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -10492,6 +12010,7 @@ class Test_TC_CC_7_1 : public TestCommandBridge { CHIP_ERROR TestEnhancedMoveToHueCommand_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -10516,6 +12035,7 @@ class Test_TC_CC_7_1 : public TestCommandBridge { CHIP_ERROR TestEnhancedMoveToHueCommand_7() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -10540,6 +12060,7 @@ class Test_TC_CC_7_1 : public TestCommandBridge { CHIP_ERROR TestTurnOffLightThatWeTurnedOn_8() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -10557,6 +12078,7 @@ class Test_TC_CC_7_1 : public TestCommandBridge { CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_9() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -10664,6 +12186,45 @@ class Test_TC_CC_7_2 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -10680,12 +12241,14 @@ class Test_TC_CC_7_2 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestTurnOnLightForColorControlTests_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -10703,6 +12266,7 @@ class Test_TC_CC_7_2 : public TestCommandBridge { CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -10725,6 +12289,7 @@ class Test_TC_CC_7_2 : public TestCommandBridge { CHIP_ERROR TestCheckEnhancedCurrentHueAttributeFromDut_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -10750,6 +12315,7 @@ class Test_TC_CC_7_2 : public TestCommandBridge { CHIP_ERROR TestEnhancedMoveHueUpCommand_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -10773,6 +12339,7 @@ class Test_TC_CC_7_2 : public TestCommandBridge { CHIP_ERROR TestEnhancedMoveHueStopCommand_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -10796,6 +12363,7 @@ class Test_TC_CC_7_2 : public TestCommandBridge { CHIP_ERROR TestEnhancedMoveHueDownCommand_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -10819,6 +12387,7 @@ class Test_TC_CC_7_2 : public TestCommandBridge { CHIP_ERROR TestEnhancedMoveHueStopCommand_7() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -10842,6 +12411,7 @@ class Test_TC_CC_7_2 : public TestCommandBridge { CHIP_ERROR TestTurnOffLightThatWeTurnedOn_8() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -10859,6 +12429,7 @@ class Test_TC_CC_7_2 : public TestCommandBridge { CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_9() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -10954,6 +12525,36 @@ class Test_TC_CC_7_3 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -10970,12 +12571,14 @@ class Test_TC_CC_7_3 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestTurnOnLightForColorControlTests_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -10993,6 +12596,7 @@ class Test_TC_CC_7_3 : public TestCommandBridge { CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -11015,6 +12619,7 @@ class Test_TC_CC_7_3 : public TestCommandBridge { CHIP_ERROR TestEnhancedStepHueUpCommand_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -11039,6 +12644,7 @@ class Test_TC_CC_7_3 : public TestCommandBridge { CHIP_ERROR TestEnhancedStepHueDownCommand_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -11063,6 +12669,7 @@ class Test_TC_CC_7_3 : public TestCommandBridge { CHIP_ERROR TestTurnOffLightThatWeTurnedOn_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -11080,6 +12687,7 @@ class Test_TC_CC_7_3 : public TestCommandBridge { CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -11171,6 +12779,33 @@ class Test_TC_CC_7_4 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -11187,12 +12822,14 @@ class Test_TC_CC_7_4 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestTurnOnLightForColorControlTests_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -11210,6 +12847,7 @@ class Test_TC_CC_7_4 : public TestCommandBridge { CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -11232,6 +12870,7 @@ class Test_TC_CC_7_4 : public TestCommandBridge { CHIP_ERROR TestEnhancedMoveToHueAndSaturationCommand_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -11256,6 +12895,7 @@ class Test_TC_CC_7_4 : public TestCommandBridge { CHIP_ERROR TestTurnOffLightThatWeTurnedOn_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -11273,6 +12913,7 @@ class Test_TC_CC_7_4 : public TestCommandBridge { CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -11408,6 +13049,66 @@ class Test_TC_CC_8_1 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -11424,12 +13125,14 @@ class Test_TC_CC_8_1 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestTurnOnLightForColorControlTests_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -11447,6 +13150,7 @@ class Test_TC_CC_8_1 : public TestCommandBridge { CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -11469,6 +13173,7 @@ class Test_TC_CC_8_1 : public TestCommandBridge { CHIP_ERROR TestColorLoopSetCommandSetAllAttributes_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -11495,6 +13200,7 @@ class Test_TC_CC_8_1 : public TestCommandBridge { CHIP_ERROR TestCheckColorLoopDirectionValue_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -11517,6 +13223,7 @@ class Test_TC_CC_8_1 : public TestCommandBridge { CHIP_ERROR TestCheckColorLoopTimeValue_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -11539,6 +13246,7 @@ class Test_TC_CC_8_1 : public TestCommandBridge { CHIP_ERROR TestCheckColorLoopStartEnhancedHueValue_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -11562,6 +13270,7 @@ class Test_TC_CC_8_1 : public TestCommandBridge { CHIP_ERROR TestCheckColorLoopActiveValue_7() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -11584,6 +13293,7 @@ class Test_TC_CC_8_1 : public TestCommandBridge { CHIP_ERROR TestColorLoopSetCommandStartColorLoop_8() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -11610,6 +13320,7 @@ class Test_TC_CC_8_1 : public TestCommandBridge { CHIP_ERROR TestCheckColorLoopActiveValue_9() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -11632,6 +13343,7 @@ class Test_TC_CC_8_1 : public TestCommandBridge { CHIP_ERROR TestColorLoopSetCommandSetDirectionAndTimeWhileRunning_10() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -11658,6 +13370,7 @@ class Test_TC_CC_8_1 : public TestCommandBridge { CHIP_ERROR TestCheckColorLoopDirectionValue_11() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -11680,6 +13393,7 @@ class Test_TC_CC_8_1 : public TestCommandBridge { CHIP_ERROR TestCheckColorLoopTimeValue_12() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -11702,6 +13416,7 @@ class Test_TC_CC_8_1 : public TestCommandBridge { CHIP_ERROR TestColorLoopSetCommandSetDirectionWhileRunning_13() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -11728,6 +13443,7 @@ class Test_TC_CC_8_1 : public TestCommandBridge { CHIP_ERROR TestCheckColorLoopDirectionValue_14() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -11750,6 +13466,7 @@ class Test_TC_CC_8_1 : public TestCommandBridge { CHIP_ERROR TestTurnOffLightThatWeTurnedOn_15() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -11767,6 +13484,7 @@ class Test_TC_CC_8_1 : public TestCommandBridge { CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_16() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -12242,6 +13960,177 @@ class Test_TC_CC_9_1 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 34: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 35: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 36: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 37: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 38: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 39: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 40: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 41: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 42: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 43: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 44: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 45: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 46: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 47: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 48: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 49: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 50: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 51: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 52: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 53: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -12258,12 +14147,14 @@ class Test_TC_CC_9_1 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestPreconditionTurnOnLightForColorControlTests_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -12281,6 +14172,7 @@ class Test_TC_CC_9_1 : public TestCommandBridge { CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -12303,6 +14195,7 @@ class Test_TC_CC_9_1 : public TestCommandBridge { CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -12329,6 +14222,7 @@ class Test_TC_CC_9_1 : public TestCommandBridge { CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -12351,6 +14245,7 @@ class Test_TC_CC_9_1 : public TestCommandBridge { CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -12377,6 +14272,7 @@ class Test_TC_CC_9_1 : public TestCommandBridge { CHIP_ERROR TestReadColorLoopDirectionAttributeFromDut_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -12399,6 +14295,7 @@ class Test_TC_CC_9_1 : public TestCommandBridge { CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_7() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -12425,6 +14322,7 @@ class Test_TC_CC_9_1 : public TestCommandBridge { CHIP_ERROR TestReadColorLoopTimeAttributeFromDut_8() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -12447,6 +14345,7 @@ class Test_TC_CC_9_1 : public TestCommandBridge { CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_9() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -12473,6 +14372,7 @@ class Test_TC_CC_9_1 : public TestCommandBridge { CHIP_ERROR TestReadColorLoopStartEnhancedHueAttributeFromDut_10() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -12496,6 +14396,7 @@ class Test_TC_CC_9_1 : public TestCommandBridge { CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_11() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -12522,6 +14423,7 @@ class Test_TC_CC_9_1 : public TestCommandBridge { CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_12() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -12545,6 +14447,7 @@ class Test_TC_CC_9_1 : public TestCommandBridge { CHIP_ERROR TestReadEnhancedCurrentHueAttributeFromDut_13() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -12567,6 +14470,7 @@ class Test_TC_CC_9_1 : public TestCommandBridge { CHIP_ERROR TestReadColorLoopStoredEnhancedHueAttributeFromDut_14() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -12590,6 +14494,7 @@ class Test_TC_CC_9_1 : public TestCommandBridge { CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_15() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -12616,6 +14521,7 @@ class Test_TC_CC_9_1 : public TestCommandBridge { CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_16() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -12639,6 +14545,7 @@ class Test_TC_CC_9_1 : public TestCommandBridge { CHIP_ERROR TestReadColorLoopStoredEnhancedHueAttributeFromDut_17() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -12662,6 +14569,7 @@ class Test_TC_CC_9_1 : public TestCommandBridge { CHIP_ERROR TestReadEnhancedCurrentHueAttributeFromDut_18() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -12684,6 +14592,7 @@ class Test_TC_CC_9_1 : public TestCommandBridge { CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_19() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -12710,6 +14619,7 @@ class Test_TC_CC_9_1 : public TestCommandBridge { CHIP_ERROR TestReadColorLoopDirectionAttributeFromDut_20() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -12732,6 +14642,7 @@ class Test_TC_CC_9_1 : public TestCommandBridge { CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_21() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -12758,6 +14669,7 @@ class Test_TC_CC_9_1 : public TestCommandBridge { CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_22() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -12781,6 +14693,7 @@ class Test_TC_CC_9_1 : public TestCommandBridge { CHIP_ERROR TestReadEnhancedCurrentHueAttributeFromDut_23() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -12803,6 +14716,7 @@ class Test_TC_CC_9_1 : public TestCommandBridge { CHIP_ERROR TestReadColorLoopStoredEnhancedHueAttributeFromDut_24() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -12826,6 +14740,7 @@ class Test_TC_CC_9_1 : public TestCommandBridge { CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_25() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -12852,6 +14767,7 @@ class Test_TC_CC_9_1 : public TestCommandBridge { CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_26() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -12875,6 +14791,7 @@ class Test_TC_CC_9_1 : public TestCommandBridge { CHIP_ERROR TestReadColorLoopStoredEnhancedHueAttributeFromDut_27() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -12898,6 +14815,7 @@ class Test_TC_CC_9_1 : public TestCommandBridge { CHIP_ERROR TestReadEnhancedCurrentHueAttributeFromDut_28() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -12920,6 +14838,7 @@ class Test_TC_CC_9_1 : public TestCommandBridge { CHIP_ERROR TestEnhancedMoveToHueCommand_29() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -12944,12 +14863,14 @@ class Test_TC_CC_9_1 : public TestCommandBridge { CHIP_ERROR TestWait2000ms_30() { + SetIdentity("alpha"); WaitForMs(2000); return CHIP_NO_ERROR; } CHIP_ERROR TestReadEnhancedCurrentHueAttributeFromDut_31() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -12972,6 +14893,7 @@ class Test_TC_CC_9_1 : public TestCommandBridge { CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_32() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -12998,6 +14920,7 @@ class Test_TC_CC_9_1 : public TestCommandBridge { CHIP_ERROR TestReadColorLoopDirectionAttributeFromDut_33() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -13020,6 +14943,7 @@ class Test_TC_CC_9_1 : public TestCommandBridge { CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_34() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -13046,6 +14970,7 @@ class Test_TC_CC_9_1 : public TestCommandBridge { CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_35() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -13069,6 +14994,7 @@ class Test_TC_CC_9_1 : public TestCommandBridge { CHIP_ERROR TestReadEnhancedCurrentHueAttributeFromDut_36() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -13091,6 +15017,7 @@ class Test_TC_CC_9_1 : public TestCommandBridge { CHIP_ERROR TestReadColorLoopStoredEnhancedHueAttributeFromDut_37() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -13114,6 +15041,7 @@ class Test_TC_CC_9_1 : public TestCommandBridge { CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_38() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -13140,6 +15068,7 @@ class Test_TC_CC_9_1 : public TestCommandBridge { CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_39() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -13163,6 +15092,7 @@ class Test_TC_CC_9_1 : public TestCommandBridge { CHIP_ERROR TestReadColorLoopStoredEnhancedHueAttributeFromDut_40() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -13186,6 +15116,7 @@ class Test_TC_CC_9_1 : public TestCommandBridge { CHIP_ERROR TestReadEnhancedCurrentHueAttributeFromDut_41() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -13208,6 +15139,7 @@ class Test_TC_CC_9_1 : public TestCommandBridge { CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_42() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -13234,6 +15166,7 @@ class Test_TC_CC_9_1 : public TestCommandBridge { CHIP_ERROR TestReadColorLoopDirectionAttributeFromDut_43() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -13256,6 +15189,7 @@ class Test_TC_CC_9_1 : public TestCommandBridge { CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_44() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -13282,6 +15216,7 @@ class Test_TC_CC_9_1 : public TestCommandBridge { CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_45() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -13305,6 +15240,7 @@ class Test_TC_CC_9_1 : public TestCommandBridge { CHIP_ERROR TestReadEnhancedCurrentHueAttributeFromDut_46() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -13327,6 +15263,7 @@ class Test_TC_CC_9_1 : public TestCommandBridge { CHIP_ERROR TestReadColorLoopStoredEnhancedHueAttributeFromDut_47() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -13350,6 +15287,7 @@ class Test_TC_CC_9_1 : public TestCommandBridge { CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_48() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -13376,6 +15314,7 @@ class Test_TC_CC_9_1 : public TestCommandBridge { CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_49() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -13399,6 +15338,7 @@ class Test_TC_CC_9_1 : public TestCommandBridge { CHIP_ERROR TestReadColorLoopStoredEnhancedHueAttributeFromDut_50() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -13422,6 +15362,7 @@ class Test_TC_CC_9_1 : public TestCommandBridge { CHIP_ERROR TestReadEnhancedCurrentHueAttributeFromDut_51() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -13444,6 +15385,7 @@ class Test_TC_CC_9_1 : public TestCommandBridge { CHIP_ERROR TestTurnOffLightForColorControlTests_52() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -13461,6 +15403,7 @@ class Test_TC_CC_9_1 : public TestCommandBridge { CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_53() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -13668,6 +15611,75 @@ class Test_TC_CC_9_2 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -13684,12 +15696,14 @@ class Test_TC_CC_9_2 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestPreconditionTurnOnLightForColorControlTests_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -13707,6 +15721,7 @@ class Test_TC_CC_9_2 : public TestCommandBridge { CHIP_ERROR TestPreconditionCheckOnOffAttributeValueIsTrueAfterOnCommand_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -13729,6 +15744,7 @@ class Test_TC_CC_9_2 : public TestCommandBridge { CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -13755,6 +15771,7 @@ class Test_TC_CC_9_2 : public TestCommandBridge { CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -13777,6 +15794,7 @@ class Test_TC_CC_9_2 : public TestCommandBridge { CHIP_ERROR TestReadColorLoopDirectionAttributeFromDut_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -13799,6 +15817,7 @@ class Test_TC_CC_9_2 : public TestCommandBridge { CHIP_ERROR TestReadColorLoopTimeAttributeFromDut_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -13821,6 +15840,7 @@ class Test_TC_CC_9_2 : public TestCommandBridge { CHIP_ERROR TestReadColorLoopStartEnhancedHueAttributeFromDut_7() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -13845,6 +15865,7 @@ class Test_TC_CC_9_2 : public TestCommandBridge { CHIP_ERROR TestReadEnhancedCurrentHueAttributeFromDut_8() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -13867,6 +15888,7 @@ class Test_TC_CC_9_2 : public TestCommandBridge { CHIP_ERROR TestColorLoopSetCommandSetAllAttributes_9() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -13893,6 +15915,7 @@ class Test_TC_CC_9_2 : public TestCommandBridge { CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_10() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -13915,6 +15938,7 @@ class Test_TC_CC_9_2 : public TestCommandBridge { CHIP_ERROR TestReadColorLoopStoredEnhancedHueAttributeFromDut_11() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -13938,6 +15962,7 @@ class Test_TC_CC_9_2 : public TestCommandBridge { CHIP_ERROR TestColorLoopSetCommandStartColorLoop_12() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -13964,6 +15989,7 @@ class Test_TC_CC_9_2 : public TestCommandBridge { CHIP_ERROR TestReadColorLoopDirectionAttributeFromDut_13() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -13986,6 +16012,7 @@ class Test_TC_CC_9_2 : public TestCommandBridge { CHIP_ERROR TestColorLoopSetCommandStartColorLoop_14() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -14012,6 +16039,7 @@ class Test_TC_CC_9_2 : public TestCommandBridge { CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_15() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -14035,6 +16063,7 @@ class Test_TC_CC_9_2 : public TestCommandBridge { CHIP_ERROR TestReadColorLoopStoredEnhancedHueAttributeFromDut_16() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -14058,6 +16087,7 @@ class Test_TC_CC_9_2 : public TestCommandBridge { CHIP_ERROR TestReadEnhancedCurrentHueAttributeFromDut_17() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -14080,6 +16110,7 @@ class Test_TC_CC_9_2 : public TestCommandBridge { CHIP_ERROR TestTurnOffLightForColorControlTests_18() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -14097,6 +16128,7 @@ class Test_TC_CC_9_2 : public TestCommandBridge { CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_19() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -14304,6 +16336,75 @@ class Test_TC_CC_9_3 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -14320,12 +16421,14 @@ class Test_TC_CC_9_3 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestPreconditionTurnOnLightForColorControlTests_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -14343,6 +16446,7 @@ class Test_TC_CC_9_3 : public TestCommandBridge { CHIP_ERROR TestPreconditionCheckOnOffAttributeValueIsTrueAfterOnCommand_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -14365,6 +16469,7 @@ class Test_TC_CC_9_3 : public TestCommandBridge { CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -14391,6 +16496,7 @@ class Test_TC_CC_9_3 : public TestCommandBridge { CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -14413,6 +16519,7 @@ class Test_TC_CC_9_3 : public TestCommandBridge { CHIP_ERROR TestReadColorLoopDirectionAttributeFromDut_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -14435,6 +16542,7 @@ class Test_TC_CC_9_3 : public TestCommandBridge { CHIP_ERROR TestReadColorLoopTimeAttributeFromDut_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -14457,6 +16565,7 @@ class Test_TC_CC_9_3 : public TestCommandBridge { CHIP_ERROR TestReadColorLoopStartEnhancedHueAttributeFromDut_7() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -14480,6 +16589,7 @@ class Test_TC_CC_9_3 : public TestCommandBridge { CHIP_ERROR TestColorLoopSetCommandSetAllAttributes_8() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -14506,6 +16616,7 @@ class Test_TC_CC_9_3 : public TestCommandBridge { CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_9() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -14529,6 +16640,7 @@ class Test_TC_CC_9_3 : public TestCommandBridge { CHIP_ERROR TestReadEnhancedCurrentHueAttributeFromDut_10() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -14551,6 +16663,7 @@ class Test_TC_CC_9_3 : public TestCommandBridge { CHIP_ERROR TestReadColorLoopStoredEnhancedHueAttributeFromDut_11() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -14574,6 +16687,7 @@ class Test_TC_CC_9_3 : public TestCommandBridge { CHIP_ERROR TestColorLoopSetCommandStartColorLoop_12() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -14600,6 +16714,7 @@ class Test_TC_CC_9_3 : public TestCommandBridge { CHIP_ERROR TestReadColorLoopTimeAttributeFromDut_13() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -14622,6 +16737,7 @@ class Test_TC_CC_9_3 : public TestCommandBridge { CHIP_ERROR TestColorLoopSetCommandStartColorLoop_14() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -14648,6 +16764,7 @@ class Test_TC_CC_9_3 : public TestCommandBridge { CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_15() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -14671,6 +16788,7 @@ class Test_TC_CC_9_3 : public TestCommandBridge { CHIP_ERROR TestReadColorLoopStoredEnhancedHueAttributeFromDut_16() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -14694,6 +16812,7 @@ class Test_TC_CC_9_3 : public TestCommandBridge { CHIP_ERROR TestReadEnhancedCurrentHueAttributeFromDut_17() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -14716,6 +16835,7 @@ class Test_TC_CC_9_3 : public TestCommandBridge { CHIP_ERROR TestTurnOffLightForColorControlTests_18() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -14733,6 +16853,7 @@ class Test_TC_CC_9_3 : public TestCommandBridge { CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_19() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -14888,6 +17009,75 @@ class Test_TC_DM_1_1 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -14904,12 +17094,14 @@ class Test_TC_DM_1_1 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestQueryDataModelRevision_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -14928,6 +17120,7 @@ class Test_TC_DM_1_1 : public TestCommandBridge { CHIP_ERROR TestQueryVendorName_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -14947,6 +17140,7 @@ class Test_TC_DM_1_1 : public TestCommandBridge { CHIP_ERROR TestQueryVendorID_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -14965,6 +17159,7 @@ class Test_TC_DM_1_1 : public TestCommandBridge { CHIP_ERROR TestQueryProductName_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -14984,6 +17179,7 @@ class Test_TC_DM_1_1 : public TestCommandBridge { CHIP_ERROR TestQueryProductID_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -15002,6 +17198,7 @@ class Test_TC_DM_1_1 : public TestCommandBridge { CHIP_ERROR TestQueryNodeLabel_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -15021,6 +17218,7 @@ class Test_TC_DM_1_1 : public TestCommandBridge { CHIP_ERROR TestQueryUserLocation_7() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -15041,6 +17239,7 @@ class Test_TC_DM_1_1 : public TestCommandBridge { CHIP_ERROR TestQueryHardwareVersion_8() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -15059,6 +17258,7 @@ class Test_TC_DM_1_1 : public TestCommandBridge { CHIP_ERROR TestQueryHardwareVersionString_9() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -15079,6 +17279,7 @@ class Test_TC_DM_1_1 : public TestCommandBridge { CHIP_ERROR TestQuerySoftwareVersion_10() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -15097,6 +17298,7 @@ class Test_TC_DM_1_1 : public TestCommandBridge { CHIP_ERROR TestQuerySoftwareVersionString_11() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -15118,6 +17320,7 @@ class Test_TC_DM_1_1 : public TestCommandBridge { CHIP_ERROR TestQueryManufacturingDate_12() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -15144,6 +17347,7 @@ class Test_TC_DM_1_1 : public TestCommandBridge { CHIP_ERROR TestQueryPartNumber_13() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -15168,6 +17372,7 @@ class Test_TC_DM_1_1 : public TestCommandBridge { CHIP_ERROR TestQueryProductURL_14() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -15193,6 +17398,7 @@ class Test_TC_DM_1_1 : public TestCommandBridge { CHIP_ERROR TestQueryProductLabel_15() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -15217,6 +17423,7 @@ class Test_TC_DM_1_1 : public TestCommandBridge { CHIP_ERROR TestQuerySerialNumber_16() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -15241,6 +17448,7 @@ class Test_TC_DM_1_1 : public TestCommandBridge { CHIP_ERROR TestQueryLocalConfigDisabled_17() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -15264,6 +17472,7 @@ class Test_TC_DM_1_1 : public TestCommandBridge { CHIP_ERROR TestQueryReachable_18() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -15287,6 +17496,7 @@ class Test_TC_DM_1_1 : public TestCommandBridge { CHIP_ERROR TestQueryUniqueID_19() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -15368,6 +17578,24 @@ class Test_TC_DM_3_1 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -15384,12 +17612,14 @@ class Test_TC_DM_3_1 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestQueryMaxNetworks_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestNetworkCommissioning * cluster = [[CHIPTestNetworkCommissioning alloc] initWithDevice:device endpoint:0 @@ -15415,6 +17645,7 @@ class Test_TC_DM_3_1 : public TestCommandBridge { CHIP_ERROR TestQueryNetworks_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestNetworkCommissioning * cluster = [[CHIPTestNetworkCommissioning alloc] initWithDevice:device endpoint:0 @@ -15505,6 +17736,30 @@ class Test_TC_DM_2_2 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -15521,12 +17776,14 @@ class Test_TC_DM_2_2 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestQueryFabricsList_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device endpoint:0 @@ -15557,6 +17814,7 @@ class Test_TC_DM_2_2 : public TestCommandBridge { CHIP_ERROR TestQuerySupportedFabrics_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device endpoint:0 @@ -15582,6 +17840,7 @@ class Test_TC_DM_2_2 : public TestCommandBridge { CHIP_ERROR TestQueryCommissionedFabrics_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device endpoint:0 @@ -15607,6 +17866,7 @@ class Test_TC_DM_2_2 : public TestCommandBridge { CHIP_ERROR TestQueryUserTrustedRootCertificates_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device endpoint:0 @@ -15697,6 +17957,33 @@ class Test_TC_EMR_1_1 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -15713,12 +18000,14 @@ class Test_TC_EMR_1_1 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestElectricalMeasurement * cluster = [[CHIPTestElectricalMeasurement alloc] initWithDevice:device endpoint:1 @@ -15743,6 +18032,7 @@ class Test_TC_EMR_1_1 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestElectricalMeasurement * cluster = [[CHIPTestElectricalMeasurement alloc] initWithDevice:device endpoint:1 @@ -15763,6 +18053,7 @@ class Test_TC_EMR_1_1 : public TestCommandBridge { CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestElectricalMeasurement * cluster = [[CHIPTestElectricalMeasurement alloc] initWithDevice:device endpoint:1 @@ -15786,6 +18077,7 @@ class Test_TC_EMR_1_1 : public TestCommandBridge { CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestElectricalMeasurement * cluster = [[CHIPTestElectricalMeasurement alloc] initWithDevice:device endpoint:1 @@ -15810,6 +18102,7 @@ class Test_TC_EMR_1_1 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeAttributeList_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestElectricalMeasurement * cluster = [[CHIPTestElectricalMeasurement alloc] initWithDevice:device endpoint:1 @@ -15915,6 +18208,45 @@ class Test_TC_ETHDIAG_1_1 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -15931,12 +18263,14 @@ class Test_TC_ETHDIAG_1_1 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestReadPHYRateAttributeConstraints_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestEthernetNetworkDiagnostics * cluster = [[CHIPTestEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 @@ -15964,6 +18298,7 @@ class Test_TC_ETHDIAG_1_1 : public TestCommandBridge { CHIP_ERROR TestReadFullDuplexAttributeConstraints_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestEthernetNetworkDiagnostics * cluster = [[CHIPTestEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 @@ -15984,6 +18319,7 @@ class Test_TC_ETHDIAG_1_1 : public TestCommandBridge { CHIP_ERROR TestReadPacketRxCountAttributeConstraints_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestEthernetNetworkDiagnostics * cluster = [[CHIPTestEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 @@ -16004,6 +18340,7 @@ class Test_TC_ETHDIAG_1_1 : public TestCommandBridge { CHIP_ERROR TestReadPacketTxCountAttributeConstraints_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestEthernetNetworkDiagnostics * cluster = [[CHIPTestEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 @@ -16024,6 +18361,7 @@ class Test_TC_ETHDIAG_1_1 : public TestCommandBridge { CHIP_ERROR TestReadTxErrCountAttributeConstraints_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestEthernetNetworkDiagnostics * cluster = [[CHIPTestEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 @@ -16044,6 +18382,7 @@ class Test_TC_ETHDIAG_1_1 : public TestCommandBridge { CHIP_ERROR TestReadCollisionCountAttributeConstraints_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestEthernetNetworkDiagnostics * cluster = [[CHIPTestEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 @@ -16064,6 +18403,7 @@ class Test_TC_ETHDIAG_1_1 : public TestCommandBridge { CHIP_ERROR TestReadOverrunCountAttributeConstraints_7() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestEthernetNetworkDiagnostics * cluster = [[CHIPTestEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 @@ -16084,6 +18424,7 @@ class Test_TC_ETHDIAG_1_1 : public TestCommandBridge { CHIP_ERROR TestReadCarrierDetectAttributeConstraints_8() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestEthernetNetworkDiagnostics * cluster = [[CHIPTestEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 @@ -16104,6 +18445,7 @@ class Test_TC_ETHDIAG_1_1 : public TestCommandBridge { CHIP_ERROR TestReadTimeSinceResetAttributeConstraints_9() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestEthernetNetworkDiagnostics * cluster = [[CHIPTestEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 @@ -16173,6 +18515,18 @@ class Test_TC_ETHDIAG_2_1 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -16189,6 +18543,7 @@ class Test_TC_ETHDIAG_2_1 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } @@ -16293,6 +18648,45 @@ class Test_TC_FLW_1_1 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -16309,12 +18703,14 @@ class Test_TC_FLW_1_1 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -16337,6 +18733,7 @@ class Test_TC_FLW_1_1 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -16355,6 +18752,7 @@ class Test_TC_FLW_1_1 : public TestCommandBridge { CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -16376,6 +18774,7 @@ class Test_TC_FLW_1_1 : public TestCommandBridge { CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -16398,6 +18797,7 @@ class Test_TC_FLW_1_1 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeAttributeList_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -16416,12 +18816,14 @@ class Test_TC_FLW_1_1 : public TestCommandBridge { CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_6() { + SetIdentity("alpha"); UserPrompt(@"Please enter 'y' for success", @"y"); return CHIP_NO_ERROR; } CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_7() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -16440,6 +18842,7 @@ class Test_TC_FLW_1_1 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_8() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -16458,6 +18861,7 @@ class Test_TC_FLW_1_1 : public TestCommandBridge { CHIP_ERROR TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponseIndicatesFeatureMapAttributeHasTheValue0_9() { + SetIdentity("alpha"); UserPrompt(@"Please enter '0' for success", @"0"); return CHIP_NO_ERROR; } @@ -16565,6 +18969,57 @@ class Test_TC_FLW_2_1 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -16581,12 +19036,14 @@ class Test_TC_FLW_2_1 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestReadTheMandatoryAttributeMeasuredValue_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -16605,6 +19062,7 @@ class Test_TC_FLW_2_1 : public TestCommandBridge { CHIP_ERROR TestReadTheMandatoryAttributeMinMeasuredValue_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -16623,6 +19081,7 @@ class Test_TC_FLW_2_1 : public TestCommandBridge { CHIP_ERROR TestReadTheMandatoryAttributeMaxMeasuredValue_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -16641,6 +19100,7 @@ class Test_TC_FLW_2_1 : public TestCommandBridge { CHIP_ERROR TestWriteTheDefaultValueToOptionalAttributeMeasuredValue_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -16660,6 +19120,7 @@ class Test_TC_FLW_2_1 : public TestCommandBridge { CHIP_ERROR TestWriteTheDefaultValueToOptionalAttributeMinMeasuredValue_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -16679,6 +19140,7 @@ class Test_TC_FLW_2_1 : public TestCommandBridge { CHIP_ERROR TestWriteTheDefaultValueToOptionalAttributeMaxMeasuredValue_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -16698,6 +19160,7 @@ class Test_TC_FLW_2_1 : public TestCommandBridge { CHIP_ERROR TestReadTheMandatoryAttributeMeasuredValue_7() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -16716,6 +19179,7 @@ class Test_TC_FLW_2_1 : public TestCommandBridge { CHIP_ERROR TestReadTheMandatoryAttributeMinMeasuredValue_8() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -16734,6 +19198,7 @@ class Test_TC_FLW_2_1 : public TestCommandBridge { CHIP_ERROR TestReadTheMandatoryAttributeMaxMeasuredValue_9() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -16752,6 +19217,7 @@ class Test_TC_FLW_2_1 : public TestCommandBridge { CHIP_ERROR TestReadTheOptionalAttributeTolerance_10() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -16779,6 +19245,7 @@ class Test_TC_FLW_2_1 : public TestCommandBridge { CHIP_ERROR TestReadTheOptionalAttributeTolerance_11() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -16809,6 +19276,7 @@ class Test_TC_FLW_2_1 : public TestCommandBridge { CHIP_ERROR TestWriteTheDefaultValueToOptionalAttributeTolerance_12() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -16833,6 +19301,7 @@ class Test_TC_FLW_2_1 : public TestCommandBridge { CHIP_ERROR TestReadTheOptionalAttributeTolerance_13() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -16917,6 +19386,24 @@ class Test_TC_FLW_2_2 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -16933,12 +19420,14 @@ class Test_TC_FLW_2_2 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestReadTheMandatoryAttributeMeasuredValue_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -16957,6 +19446,7 @@ class Test_TC_FLW_2_2 : public TestCommandBridge { CHIP_ERROR TestReadTheMandatoryAttributeMeasuredValue_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -17044,6 +19534,33 @@ class Test_TC_GC_1_1 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -17060,12 +19577,14 @@ class Test_TC_GC_1_1 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestTh1ReadsTheBreadCrumbAttributeFromTheDut_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestGeneralCommissioning * cluster = [[CHIPTestGeneralCommissioning alloc] initWithDevice:device endpoint:0 @@ -17090,6 +19609,7 @@ class Test_TC_GC_1_1 : public TestCommandBridge { CHIP_ERROR TestTh1WritesTheBreadCrumbAttributeAs1ToTheDut_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestGeneralCommissioning * cluster = [[CHIPTestGeneralCommissioning alloc] initWithDevice:device endpoint:0 @@ -17112,6 +19632,7 @@ class Test_TC_GC_1_1 : public TestCommandBridge { CHIP_ERROR TestTh1ReadsTheBreadCrumbAttributeFromTheDut_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestGeneralCommissioning * cluster = [[CHIPTestGeneralCommissioning alloc] initWithDevice:device endpoint:0 @@ -17136,6 +19657,7 @@ class Test_TC_GC_1_1 : public TestCommandBridge { CHIP_ERROR TestTh1ReadsTheRegulatoryConfigAttributeFromTheDut_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestGeneralCommissioning * cluster = [[CHIPTestGeneralCommissioning alloc] initWithDevice:device endpoint:0 @@ -17162,6 +19684,7 @@ class Test_TC_GC_1_1 : public TestCommandBridge { CHIP_ERROR TestTh1ReadsTheLocationCapabilityAttributeFromTheDut_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestGeneralCommissioning * cluster = [[CHIPTestGeneralCommissioning alloc] initWithDevice:device endpoint:0 @@ -17277,6 +19800,39 @@ class Test_TC_I_1_1 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -17293,12 +19849,14 @@ class Test_TC_I_1_1 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestThReadsTheClusterRevisionAttributeFromTheDut_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -17321,6 +19879,7 @@ class Test_TC_I_1_1 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -17339,6 +19898,7 @@ class Test_TC_I_1_1 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -17368,6 +19928,7 @@ class Test_TC_I_1_1 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -17394,6 +19955,7 @@ class Test_TC_I_1_1 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -17418,12 +19980,14 @@ class Test_TC_I_1_1 : public TestCommandBridge { CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_6() { + SetIdentity("alpha"); UserPrompt(@"Please enter 'y' for success", @"y"); return CHIP_NO_ERROR; } CHIP_ERROR TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponseIndicatesFeatureMapAttributeHasTheValue0_7() { + SetIdentity("alpha"); UserPrompt(@"Please enter '0' for success", @"0"); return CHIP_NO_ERROR; } @@ -17487,6 +20051,24 @@ class Test_TC_I_2_1 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -17503,12 +20085,14 @@ class Test_TC_I_2_1 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestThReadsTheIdentifyTimeAttributeFromTheDut_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -17527,6 +20111,7 @@ class Test_TC_I_2_1 : public TestCommandBridge { CHIP_ERROR TestThReadsTheIdentifyTypeAttributeFromTheDut_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -17703,6 +20288,78 @@ class Test_TC_I_2_3 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -17719,6 +20376,7 @@ class Test_TC_I_2_3 : public TestCommandBridge { CHIP_ERROR Test1WaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } @@ -17726,6 +20384,7 @@ class Test_TC_I_2_3 : public TestCommandBridge { CHIP_ERROR TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0x00BlinkAndTheEffectVariantFieldSetTo0x00Default_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -17749,6 +20408,7 @@ class Test_TC_I_2_3 : public TestCommandBridge { CHIP_ERROR TestManuallyCheckDutExecutesABlinkEffect_2() { + SetIdentity("alpha"); UserPrompt(@"DUT executes a blink effect"); return CHIP_NO_ERROR; } @@ -17756,6 +20416,7 @@ class Test_TC_I_2_3 : public TestCommandBridge { CHIP_ERROR TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0x01BreatheAndTheEffectVariantFieldSetTo0x00Default_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -17779,6 +20440,7 @@ class Test_TC_I_2_3 : public TestCommandBridge { CHIP_ERROR TestCheckDutExecutesABreatheEffect_4() { + SetIdentity("alpha"); UserPrompt(@"DUT executes a breathe effect"); return CHIP_NO_ERROR; } @@ -17786,6 +20448,7 @@ class Test_TC_I_2_3 : public TestCommandBridge { CHIP_ERROR TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0x02OkayAndTheEffectVariantFieldSetTo0x00Default_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -17809,6 +20472,7 @@ class Test_TC_I_2_3 : public TestCommandBridge { CHIP_ERROR TestCheckDutExecutesAnOkayEffect_6() { + SetIdentity("alpha"); UserPrompt(@"DUT executes an okay effect"); return CHIP_NO_ERROR; } @@ -17816,6 +20480,7 @@ class Test_TC_I_2_3 : public TestCommandBridge { CHIP_ERROR TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0x0bChannelChangeAndTheEffectVariantFieldSetTo0x00Default_7() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -17839,6 +20504,7 @@ class Test_TC_I_2_3 : public TestCommandBridge { CHIP_ERROR TestCheckDutExecutesAChannelChangeEffect_8() { + SetIdentity("alpha"); UserPrompt(@"DUT executes a channel change effect"); return CHIP_NO_ERROR; } @@ -17846,6 +20512,7 @@ class Test_TC_I_2_3 : public TestCommandBridge { CHIP_ERROR TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0x01BreatheAndTheEffectVariantFieldSetTo0x00Default_9() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -17869,6 +20536,7 @@ class Test_TC_I_2_3 : public TestCommandBridge { CHIP_ERROR TestCheckDutExecutesABreatheEffect_10() { + SetIdentity("alpha"); UserPrompt(@"DUT executes a breathe effect"); return CHIP_NO_ERROR; } @@ -17876,6 +20544,7 @@ class Test_TC_I_2_3 : public TestCommandBridge { CHIP_ERROR TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0xfeFinishEffectAndTheEffectVariantFieldSetTo0x00Default_11() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -17899,6 +20568,7 @@ class Test_TC_I_2_3 : public TestCommandBridge { CHIP_ERROR TestManuallyCheckDutStopsTheBreatheEffectAfterTheCurrentEffectSequence_12() { + SetIdentity("alpha"); UserPrompt(@"DUT stops the breathe effect after the current effect sequence"); return CHIP_NO_ERROR; } @@ -17906,6 +20576,7 @@ class Test_TC_I_2_3 : public TestCommandBridge { CHIP_ERROR TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0x01BreatheAndTheEffectVariantFieldSetTo0x00Default_13() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -17929,6 +20600,7 @@ class Test_TC_I_2_3 : public TestCommandBridge { CHIP_ERROR TestManuallyCheckDutExecutesABreatheEffect_14() { + SetIdentity("alpha"); UserPrompt(@"DUT executes a breathe effect"); return CHIP_NO_ERROR; } @@ -17936,6 +20608,7 @@ class Test_TC_I_2_3 : public TestCommandBridge { CHIP_ERROR TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0xffStopEffectAndTheEffectVariantFieldSetTo0x00Default_15() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -17959,6 +20632,7 @@ class Test_TC_I_2_3 : public TestCommandBridge { CHIP_ERROR TestCheckDutStopsTheBreatheEffectAsSoonAsPossible_16() { + SetIdentity("alpha"); UserPrompt(@"DUT stops the breathe effect as soon as possible"); return CHIP_NO_ERROR; } @@ -17966,6 +20640,7 @@ class Test_TC_I_2_3 : public TestCommandBridge { CHIP_ERROR TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0x00BlinkAndTheEffectVariantFieldSetTo0x42Unknown_17() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -17989,6 +20664,7 @@ class Test_TC_I_2_3 : public TestCommandBridge { CHIP_ERROR TestCheckDutExecutesABlinkEffect_18() { + SetIdentity("alpha"); UserPrompt(@"DUT executes a blink effect"); return CHIP_NO_ERROR; } @@ -17996,6 +20672,7 @@ class Test_TC_I_2_3 : public TestCommandBridge { CHIP_ERROR TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0xffStopEffectAndTheEffectVariantFieldSetTo0x00Default_19() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -18019,6 +20696,7 @@ class Test_TC_I_2_3 : public TestCommandBridge { CHIP_ERROR TestCheckDutStopsAnyEffectThatMayBeStillRunningAsSoonAsPossible_20() { + SetIdentity("alpha"); UserPrompt(@"DUT stops any effect that may be still running as soon as possible"); return CHIP_NO_ERROR; } @@ -18114,6 +20792,39 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -18130,12 +20841,14 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device endpoint:1 @@ -18160,6 +20873,7 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device endpoint:1 @@ -18180,6 +20894,7 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device endpoint:1 @@ -18214,12 +20929,14 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_4() { + SetIdentity("alpha"); UserPrompt(@"Please enter 'y' for success", @"y"); return CHIP_NO_ERROR; } CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device endpoint:1 @@ -18245,6 +20962,7 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device endpoint:1 @@ -18270,6 +20988,7 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { CHIP_ERROR TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponseIndicatesFeatureMapAttributeHasTheValue0_7() { + SetIdentity("alpha"); UserPrompt(@"Please enter '0' for success", @"0"); return CHIP_NO_ERROR; } @@ -18341,6 +21060,30 @@ class Test_TC_ILL_2_1 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -18357,12 +21100,14 @@ class Test_TC_ILL_2_1 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestThReadsMinMeasuredValueAttributeFromDut_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device endpoint:1 @@ -18390,6 +21135,7 @@ class Test_TC_ILL_2_1 : public TestCommandBridge { CHIP_ERROR TestThReadsMaxMeasuredValueAttributeFromDut_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device endpoint:1 @@ -18417,6 +21163,7 @@ class Test_TC_ILL_2_1 : public TestCommandBridge { CHIP_ERROR TestThReadsToleranceAttributeFromDut_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device endpoint:1 @@ -18444,6 +21191,7 @@ class Test_TC_ILL_2_1 : public TestCommandBridge { CHIP_ERROR TestThReadsLightSensorTypeAttributeFromDut_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device endpoint:1 @@ -18547,6 +21295,36 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -18563,12 +21341,14 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -18591,6 +21371,7 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -18609,6 +21390,7 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -18646,12 +21428,14 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_4() { + SetIdentity("alpha"); UserPrompt(@"Please enter 'y' for success", @"y"); return CHIP_NO_ERROR; } CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -18683,6 +21467,7 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { CHIP_ERROR TestReadTheOptionalGlobalAttributeFeatureMap_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -18814,6 +21599,63 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -18830,12 +21672,14 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestResetLevelTo254_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -18859,12 +21703,14 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { CHIP_ERROR TestWait100ms_2() { + SetIdentity("alpha"); WaitForMs(100); return CHIP_NO_ERROR; } CHIP_ERROR TestReadsTheCurrentLevelAttribute_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -18888,6 +21734,7 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { CHIP_ERROR TestReadsTheRemainingTimeAttribute_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -18911,6 +21758,7 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { CHIP_ERROR TestReadsTheMinLevelAttribute_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -18934,6 +21782,7 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { CHIP_ERROR TestReadsTheMaxLevelAttribute_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -18952,6 +21801,7 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { CHIP_ERROR TestReadsTheCurrentFrequencyAttribute_7() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -18975,6 +21825,7 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { CHIP_ERROR TestReadsTheMinFrequencyAttribute_8() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -18998,6 +21849,7 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { CHIP_ERROR TestReadsTheMaxFrequencyAttribute_9() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -19021,6 +21873,7 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { CHIP_ERROR TestReadsTheOnOffTransitionTimeAttribute_10() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -19044,6 +21897,7 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { CHIP_ERROR TestReadsTheOnLevelAttribute_11() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -19062,6 +21916,7 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { CHIP_ERROR TestReadsTheOnTransitionTimeAttribute_12() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -19080,6 +21935,7 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { CHIP_ERROR TestReadsTheOffTransitionTimeAttribute_13() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -19098,6 +21954,7 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { CHIP_ERROR TestReadsTheDefaultMoveRateAttribute_14() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -19116,6 +21973,7 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { CHIP_ERROR TestReadsTheOptionsAttribute_15() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -19248,6 +22106,63 @@ class Test_TC_LVL_2_2 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -19264,12 +22179,14 @@ class Test_TC_LVL_2_2 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestReadsTheOnOffTransitionTimeAttributeFromTheDut_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -19293,6 +22210,7 @@ class Test_TC_LVL_2_2 : public TestCommandBridge { CHIP_ERROR TestWritesTheOnOffTransitionTimeAttributeOnTheDut_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -19313,6 +22231,7 @@ class Test_TC_LVL_2_2 : public TestCommandBridge { CHIP_ERROR TestReadsTheOnOffTransitionTimeAttributeFromTheDut_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -19336,6 +22255,7 @@ class Test_TC_LVL_2_2 : public TestCommandBridge { CHIP_ERROR TestWritesDefaultValueOfOnOffTransitionTimeAttribute_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -19356,6 +22276,7 @@ class Test_TC_LVL_2_2 : public TestCommandBridge { CHIP_ERROR TestWritesTheOnLevelAttributeOnTheDut_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -19376,6 +22297,7 @@ class Test_TC_LVL_2_2 : public TestCommandBridge { CHIP_ERROR TestReadsTheOnLevelAttributeFromTheDut_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -19400,6 +22322,7 @@ class Test_TC_LVL_2_2 : public TestCommandBridge { CHIP_ERROR TestWritesTheOnTransitionTimeAttributeOnTheDut_7() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -19420,6 +22343,7 @@ class Test_TC_LVL_2_2 : public TestCommandBridge { CHIP_ERROR TestReadsTheOnTransitionTimeAttributeFromTheDut_8() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -19444,6 +22368,7 @@ class Test_TC_LVL_2_2 : public TestCommandBridge { CHIP_ERROR TestWritesTheOffTransitionTimeAttributeOnTheDut_9() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -19464,6 +22389,7 @@ class Test_TC_LVL_2_2 : public TestCommandBridge { CHIP_ERROR TestReadsTheOffTransitionTimeAttributeFromTheDut_10() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -19488,6 +22414,7 @@ class Test_TC_LVL_2_2 : public TestCommandBridge { CHIP_ERROR TestReadsTheDefaultMoveRateAttributeFromTheDut_11() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -19512,6 +22439,7 @@ class Test_TC_LVL_2_2 : public TestCommandBridge { CHIP_ERROR TestWritesTheDefaultMoveRateAttributeOnTheDut_12() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -19532,6 +22460,7 @@ class Test_TC_LVL_2_2 : public TestCommandBridge { CHIP_ERROR TestReadsTheDefaultMoveRateAttributeFromTheDut_13() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -19556,6 +22485,7 @@ class Test_TC_LVL_2_2 : public TestCommandBridge { CHIP_ERROR TestWritesTheStartUpCurrentLevelAttributeOnTheDut_14() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -19576,6 +22506,7 @@ class Test_TC_LVL_2_2 : public TestCommandBridge { CHIP_ERROR TestReadsTheStartUpCurrentLevelAttributeFromTheDut_15() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -19709,6 +22640,63 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -19725,12 +22713,14 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestReadsCurrentLevelAttributeFromDut_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -19749,6 +22739,7 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { CHIP_ERROR TestReadsTheMinLevelAttribute_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -19767,6 +22758,7 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { CHIP_ERROR TestReadsTheMaxLevelAttribute_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -19785,6 +22777,7 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { CHIP_ERROR TestSendsAMoveToLevelCommand_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -19808,12 +22801,14 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { CHIP_ERROR TestWait100ms_5() { + SetIdentity("alpha"); WaitForMs(100); return CHIP_NO_ERROR; } CHIP_ERROR TestReadsCurrentLevelAttributeFromDut_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -19836,6 +22831,7 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { CHIP_ERROR TestSendsAMoveToLevelCommand_7() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -19859,12 +22855,14 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { CHIP_ERROR TestWait11000Second_8() { + SetIdentity("alpha"); WaitForMs(11000); return CHIP_NO_ERROR; } CHIP_ERROR TestReadsCurrentLevelAttributeFromDut_9() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -19887,6 +22885,7 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { CHIP_ERROR TestReadsOnOffTransitionTimeAttributeFromDut_10() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -19905,6 +22904,7 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { CHIP_ERROR TestSendsAMoveToLevelCommand_11() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -19928,12 +22928,14 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { CHIP_ERROR TestWait1000ms_12() { + SetIdentity("alpha"); WaitForMs(1000); return CHIP_NO_ERROR; } CHIP_ERROR TestReadsCurrentLevelAttributeFromDut_13() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -19956,6 +22958,7 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { CHIP_ERROR TestResetLevelTo254_14() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -19979,6 +22982,7 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { CHIP_ERROR TestWait100ms_15() { + SetIdentity("alpha"); WaitForMs(100); return CHIP_NO_ERROR; } @@ -20102,6 +23106,69 @@ class Test_TC_LVL_4_1 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -20118,6 +23185,7 @@ class Test_TC_LVL_4_1 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } @@ -20125,6 +23193,7 @@ class Test_TC_LVL_4_1 : public TestCommandBridge { CHIP_ERROR TestReadsMaxLevelAttributeFromDut_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -20147,6 +23216,7 @@ class Test_TC_LVL_4_1 : public TestCommandBridge { CHIP_ERROR TestSendsAMoveUpCommand_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -20170,6 +23240,7 @@ class Test_TC_LVL_4_1 : public TestCommandBridge { CHIP_ERROR TestUserPromptMessage_3() { + SetIdentity("alpha"); UserPrompt(@"Physically verify that the DUT moves at a rate of 32 units per second or as close as possible to this rate " @"and completes moving to its maximum level"); return CHIP_NO_ERROR; @@ -20177,12 +23248,14 @@ class Test_TC_LVL_4_1 : public TestCommandBridge { CHIP_ERROR TestWait3000ms_4() { + SetIdentity("alpha"); WaitForMs(3000); return CHIP_NO_ERROR; } CHIP_ERROR TestReadsCurrentLevelAttributeFromDut_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -20206,6 +23279,7 @@ class Test_TC_LVL_4_1 : public TestCommandBridge { CHIP_ERROR TestReadsMinLevelAttributeFromDut_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -20228,6 +23302,7 @@ class Test_TC_LVL_4_1 : public TestCommandBridge { CHIP_ERROR TestSendsAMoveDownCommand_7() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -20251,6 +23326,7 @@ class Test_TC_LVL_4_1 : public TestCommandBridge { CHIP_ERROR TestUserPromptMessage_8() { + SetIdentity("alpha"); UserPrompt(@"Physically verify that the DUT moves at a rate of 64 units per second or as close as possible to this rate " @"and complete moving to its minimum level"); return CHIP_NO_ERROR; @@ -20258,12 +23334,14 @@ class Test_TC_LVL_4_1 : public TestCommandBridge { CHIP_ERROR TestWait5000ms_9() { + SetIdentity("alpha"); WaitForMs(5000); return CHIP_NO_ERROR; } CHIP_ERROR TestReadsCurrentLevelAttributeFromDut_10() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -20294,6 +23372,7 @@ class Test_TC_LVL_4_1 : public TestCommandBridge { CHIP_ERROR TestReadsDefaultMoveRateAttributeFromDut_11() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -20316,6 +23395,7 @@ class Test_TC_LVL_4_1 : public TestCommandBridge { CHIP_ERROR TestSendsAMoveUpCommandAtDefaultMoveRate_12() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -20339,12 +23419,14 @@ class Test_TC_LVL_4_1 : public TestCommandBridge { CHIP_ERROR TestWait100ms_13() { + SetIdentity("alpha"); WaitForMs(100); return CHIP_NO_ERROR; } CHIP_ERROR TestReadsCurrentLevelAttributeFromDut_14() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -20366,6 +23448,7 @@ class Test_TC_LVL_4_1 : public TestCommandBridge { CHIP_ERROR TestUserPromptMessage_15() { + SetIdentity("alpha"); UserPrompt( @"Physically verify that the device moves at the rate recorded in step 3a and completes moving to its maximum level."); return CHIP_NO_ERROR; @@ -20373,6 +23456,7 @@ class Test_TC_LVL_4_1 : public TestCommandBridge { CHIP_ERROR TestResetLevelTo254_16() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -20396,6 +23480,7 @@ class Test_TC_LVL_4_1 : public TestCommandBridge { CHIP_ERROR TestWait100ms_17() { + SetIdentity("alpha"); WaitForMs(100); return CHIP_NO_ERROR; } @@ -20503,6 +23588,57 @@ class Test_TC_LVL_5_1 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -20519,12 +23655,14 @@ class Test_TC_LVL_5_1 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestSendingOnCommand_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -20542,6 +23680,7 @@ class Test_TC_LVL_5_1 : public TestCommandBridge { CHIP_ERROR TestPreconditionDutLevelIsSetToItsLowestPoint_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -20566,6 +23705,7 @@ class Test_TC_LVL_5_1 : public TestCommandBridge { CHIP_ERROR TestWait3000ms_3() { + SetIdentity("alpha"); WaitForMs(3000); return CHIP_NO_ERROR; } @@ -20573,6 +23713,7 @@ class Test_TC_LVL_5_1 : public TestCommandBridge { CHIP_ERROR TestReadsCurrentLevelAttributeFromDut_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -20595,6 +23736,7 @@ class Test_TC_LVL_5_1 : public TestCommandBridge { CHIP_ERROR TestSendsStepUpCommandToDut_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -20619,12 +23761,14 @@ class Test_TC_LVL_5_1 : public TestCommandBridge { CHIP_ERROR TestWait5000ms_6() { + SetIdentity("alpha"); WaitForMs(5000); return CHIP_NO_ERROR; } CHIP_ERROR TestReadsCurrentLevelAttributeFromDut_7() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -20646,6 +23790,7 @@ class Test_TC_LVL_5_1 : public TestCommandBridge { CHIP_ERROR TestSendsAStepDownCommand_8() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -20670,12 +23815,14 @@ class Test_TC_LVL_5_1 : public TestCommandBridge { CHIP_ERROR TestWait4000ms_9() { + SetIdentity("alpha"); WaitForMs(4000); return CHIP_NO_ERROR; } CHIP_ERROR TestReadsCurrentLevelAttributeFromDut_10() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -20698,6 +23845,7 @@ class Test_TC_LVL_5_1 : public TestCommandBridge { CHIP_ERROR TestResetLevelTo254_11() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -20721,12 +23869,14 @@ class Test_TC_LVL_5_1 : public TestCommandBridge { CHIP_ERROR TestWait100ms_12() { + SetIdentity("alpha"); WaitForMs(100); return CHIP_NO_ERROR; } CHIP_ERROR TestSendingOffCommand_13() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -20837,6 +23987,51 @@ class Test_TC_LVL_6_1 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -20853,12 +24048,14 @@ class Test_TC_LVL_6_1 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestSendingOnCommand_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -20876,6 +24073,7 @@ class Test_TC_LVL_6_1 : public TestCommandBridge { CHIP_ERROR TestPreconditionSetDutToLowestPoint_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -20899,6 +24097,7 @@ class Test_TC_LVL_6_1 : public TestCommandBridge { CHIP_ERROR TestWait100ms_3() { + SetIdentity("alpha"); WaitForMs(100); return CHIP_NO_ERROR; } @@ -20906,6 +24105,7 @@ class Test_TC_LVL_6_1 : public TestCommandBridge { CHIP_ERROR TestReadsCurrentLevelAttributeFromDut_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -20933,6 +24133,7 @@ class Test_TC_LVL_6_1 : public TestCommandBridge { CHIP_ERROR TestSendsAMoveUpCommandToDut_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -20956,12 +24157,14 @@ class Test_TC_LVL_6_1 : public TestCommandBridge { CHIP_ERROR TestWait2000ms_6() { + SetIdentity("alpha"); WaitForMs(2000); return CHIP_NO_ERROR; } CHIP_ERROR TestSendsStopCommandToDut_7() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -20983,6 +24186,7 @@ class Test_TC_LVL_6_1 : public TestCommandBridge { CHIP_ERROR TestReadsCurrentLevelAttributeFromDut_8() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -21004,6 +24208,7 @@ class Test_TC_LVL_6_1 : public TestCommandBridge { CHIP_ERROR TestResetLevelTo254_9() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -21027,12 +24232,14 @@ class Test_TC_LVL_6_1 : public TestCommandBridge { CHIP_ERROR TestWait100ms_10() { + SetIdentity("alpha"); WaitForMs(100); return CHIP_NO_ERROR; } CHIP_ERROR TestSendingOffCommand_11() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -21135,6 +24342,36 @@ class Test_TC_MC_1_1 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -21151,12 +24388,14 @@ class Test_TC_MC_1_1 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLowPower * cluster = [[CHIPTestLowPower alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -21180,6 +24419,7 @@ class Test_TC_MC_1_1 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeAttributeList_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLowPower * cluster = [[CHIPTestLowPower alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -21207,12 +24447,14 @@ class Test_TC_MC_1_1 : public TestCommandBridge { CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_3() { + SetIdentity("alpha"); UserPrompt(@"Please enter 'y' for success", @"y"); return CHIP_NO_ERROR; } CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLowPower * cluster = [[CHIPTestLowPower alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -21237,6 +24479,7 @@ class Test_TC_MC_1_1 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLowPower * cluster = [[CHIPTestLowPower alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -21261,6 +24504,7 @@ class Test_TC_MC_1_1 : public TestCommandBridge { CHIP_ERROR TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponseIndicatesEitherValue0OrThrowsAGeneralErrorIfTheAttributeIsNotSupported_6() { + SetIdentity("alpha"); UserPrompt(@"Please enter 'y' for success", @"y"); return CHIP_NO_ERROR; } @@ -21363,6 +24607,39 @@ class Test_TC_MC_1_2 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -21379,12 +24656,14 @@ class Test_TC_MC_1_2 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -21407,6 +24686,7 @@ class Test_TC_MC_1_2 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -21425,6 +24705,7 @@ class Test_TC_MC_1_2 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -21453,12 +24734,14 @@ class Test_TC_MC_1_2 : public TestCommandBridge { CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_4() { + SetIdentity("alpha"); UserPrompt(@"Please enter 'y' for success", @"y"); return CHIP_NO_ERROR; } CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -21483,6 +24766,7 @@ class Test_TC_MC_1_2 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -21507,6 +24791,7 @@ class Test_TC_MC_1_2 : public TestCommandBridge { CHIP_ERROR TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponse_7() { + SetIdentity("alpha"); UserPrompt(@"Please enter 'y' for success", @"y"); return CHIP_NO_ERROR; } @@ -21614,6 +24899,39 @@ class Test_TC_MC_1_3 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -21630,12 +24948,14 @@ class Test_TC_MC_1_3 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestApplicationLauncher * cluster = [[CHIPTestApplicationLauncher alloc] initWithDevice:device endpoint:1 @@ -21660,6 +24980,7 @@ class Test_TC_MC_1_3 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestApplicationLauncher * cluster = [[CHIPTestApplicationLauncher alloc] initWithDevice:device endpoint:1 @@ -21680,6 +25001,7 @@ class Test_TC_MC_1_3 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestApplicationLauncher * cluster = [[CHIPTestApplicationLauncher alloc] initWithDevice:device endpoint:1 @@ -21712,12 +25034,14 @@ class Test_TC_MC_1_3 : public TestCommandBridge { CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_4() { + SetIdentity("alpha"); UserPrompt(@"Please enter 'y' for success", @"y"); return CHIP_NO_ERROR; } CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestApplicationLauncher * cluster = [[CHIPTestApplicationLauncher alloc] initWithDevice:device endpoint:1 @@ -21746,6 +25070,7 @@ class Test_TC_MC_1_3 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestApplicationLauncher * cluster = [[CHIPTestApplicationLauncher alloc] initWithDevice:device endpoint:1 @@ -21773,6 +25098,7 @@ class Test_TC_MC_1_3 : public TestCommandBridge { CHIP_ERROR TestReadAttributeFeatureMapAndVerifyThatDutResponseIndicatesThatTheFeatureMapAttributeHasBit0SetTo1IfTheDutSupportsTheApplicationPlatformFeaturePicsApSIsTrue_7() { + SetIdentity("alpha"); UserPrompt(@"Please enter 'y' for success", @"y"); return CHIP_NO_ERROR; } @@ -21872,6 +25198,39 @@ class Test_TC_MC_1_4 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -21888,12 +25247,14 @@ class Test_TC_MC_1_4 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestMediaInput * cluster = [[CHIPTestMediaInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -21916,6 +25277,7 @@ class Test_TC_MC_1_4 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestMediaInput * cluster = [[CHIPTestMediaInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -21934,6 +25296,7 @@ class Test_TC_MC_1_4 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestMediaInput * cluster = [[CHIPTestMediaInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -21964,12 +25327,14 @@ class Test_TC_MC_1_4 : public TestCommandBridge { CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_4() { + SetIdentity("alpha"); UserPrompt(@"Please enter 'y' for success", @"y"); return CHIP_NO_ERROR; } CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestMediaInput * cluster = [[CHIPTestMediaInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -21997,6 +25362,7 @@ class Test_TC_MC_1_4 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestMediaInput * cluster = [[CHIPTestMediaInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -22021,6 +25387,7 @@ class Test_TC_MC_1_4 : public TestCommandBridge { CHIP_ERROR TestReadAttributeFeatureMapAndVerifyThatTheDutResponseIndicatesThatTheFeatureMapAttributeHasBit0SetTo1IfTheDutSupportsTheNameUpdatesFeaturePicsNuSIsTrue_7() { + SetIdentity("alpha"); UserPrompt(@"Please enter 'y' for success", @"y"); return CHIP_NO_ERROR; } @@ -22119,6 +25486,39 @@ class Test_TC_MC_1_5 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -22135,12 +25535,14 @@ class Test_TC_MC_1_5 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestWakeOnLan * cluster = [[CHIPTestWakeOnLan alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -22163,6 +25565,7 @@ class Test_TC_MC_1_5 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestWakeOnLan * cluster = [[CHIPTestWakeOnLan alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -22181,6 +25584,7 @@ class Test_TC_MC_1_5 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestWakeOnLan * cluster = [[CHIPTestWakeOnLan alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -22210,12 +25614,14 @@ class Test_TC_MC_1_5 : public TestCommandBridge { CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_4() { + SetIdentity("alpha"); UserPrompt(@"Please enter 'y' for success", @"y"); return CHIP_NO_ERROR; } CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestWakeOnLan * cluster = [[CHIPTestWakeOnLan alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -22239,6 +25645,7 @@ class Test_TC_MC_1_5 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestWakeOnLan * cluster = [[CHIPTestWakeOnLan alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -22262,6 +25669,7 @@ class Test_TC_MC_1_5 : public TestCommandBridge { CHIP_ERROR TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponse_7() { + SetIdentity("alpha"); UserPrompt(@"Please enter 'y' for success", @"y"); return CHIP_NO_ERROR; } @@ -22370,6 +25778,39 @@ class Test_TC_MC_1_6 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -22386,12 +25827,14 @@ class Test_TC_MC_1_6 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestChannel * cluster = [[CHIPTestChannel alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -22414,6 +25857,7 @@ class Test_TC_MC_1_6 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestChannel * cluster = [[CHIPTestChannel alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -22432,6 +25876,7 @@ class Test_TC_MC_1_6 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestChannel * cluster = [[CHIPTestChannel alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -22463,12 +25908,14 @@ class Test_TC_MC_1_6 : public TestCommandBridge { CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_4() { + SetIdentity("alpha"); UserPrompt(@"Please enter 'y' for success", @"y"); return CHIP_NO_ERROR; } CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestChannel * cluster = [[CHIPTestChannel alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -22487,6 +25934,7 @@ class Test_TC_MC_1_6 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestChannel * cluster = [[CHIPTestChannel alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -22506,6 +25954,7 @@ class Test_TC_MC_1_6 : public TestCommandBridge { CHIP_ERROR TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponseValuesBasedOnFeaturePicsSupportBit0SetTo1IfTheDutSupportsChannelListsPicsClSIsTrueBit1SetTo1IfTheDutSupportsLineupInfoPicsLiSIsTrue_7() { + SetIdentity("alpha"); UserPrompt(@"Please enter 'y' for success", @"y"); return CHIP_NO_ERROR; } @@ -22604,6 +26053,36 @@ class Test_TC_MC_1_7 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -22620,12 +26099,14 @@ class Test_TC_MC_1_7 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -22648,6 +26129,7 @@ class Test_TC_MC_1_7 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -22666,6 +26148,7 @@ class Test_TC_MC_1_7 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -22701,6 +26184,7 @@ class Test_TC_MC_1_7 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -22735,6 +26219,7 @@ class Test_TC_MC_1_7 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -22760,6 +26245,7 @@ class Test_TC_MC_1_7 : public TestCommandBridge { CHIP_ERROR TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutValuesBasedOnFeaturePicsSupportBit0SetTo1IfTheDutSupportsAdvancedSeekPicsAdvancedseekIsTrueBit1SetTo1IfTheDutSupportsVariableSpeedPicsVariablespeedIsTrue_6() { + SetIdentity("alpha"); UserPrompt(@"Please enter 'y' for success", @"y"); return CHIP_NO_ERROR; } @@ -22867,6 +26353,39 @@ class Test_TC_MC_1_8 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -22883,12 +26402,14 @@ class Test_TC_MC_1_8 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestAudioOutput * cluster = [[CHIPTestAudioOutput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -22911,6 +26432,7 @@ class Test_TC_MC_1_8 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestAudioOutput * cluster = [[CHIPTestAudioOutput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -22929,6 +26451,7 @@ class Test_TC_MC_1_8 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestAudioOutput * cluster = [[CHIPTestAudioOutput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -22959,12 +26482,14 @@ class Test_TC_MC_1_8 : public TestCommandBridge { CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_4() { + SetIdentity("alpha"); UserPrompt(@"Please enter 'y' for success", @"y"); return CHIP_NO_ERROR; } CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestAudioOutput * cluster = [[CHIPTestAudioOutput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -22989,6 +26514,7 @@ class Test_TC_MC_1_8 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestAudioOutput * cluster = [[CHIPTestAudioOutput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -23014,6 +26540,7 @@ class Test_TC_MC_1_8 : public TestCommandBridge { CHIP_ERROR TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutHasBit1SetTo1IfTheDeviceSupportsNameUpdatesPicsNameupdatesIsTrue_7() { + SetIdentity("alpha"); UserPrompt(@"Please enter 'y' for success", @"y"); return CHIP_NO_ERROR; } @@ -23117,6 +26644,39 @@ class Test_TC_MC_1_9 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -23133,12 +26693,14 @@ class Test_TC_MC_1_9 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTargetNavigator * cluster = [[CHIPTestTargetNavigator alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -23161,6 +26723,7 @@ class Test_TC_MC_1_9 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTargetNavigator * cluster = [[CHIPTestTargetNavigator alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -23179,6 +26742,7 @@ class Test_TC_MC_1_9 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTargetNavigator * cluster = [[CHIPTestTargetNavigator alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -23208,12 +26772,14 @@ class Test_TC_MC_1_9 : public TestCommandBridge { CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_4() { + SetIdentity("alpha"); UserPrompt(@"Please enter 'y' for success", @"y"); return CHIP_NO_ERROR; } CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTargetNavigator * cluster = [[CHIPTestTargetNavigator alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -23238,6 +26804,7 @@ class Test_TC_MC_1_9 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTargetNavigator * cluster = [[CHIPTestTargetNavigator alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -23263,6 +26830,7 @@ class Test_TC_MC_1_9 : public TestCommandBridge { CHIP_ERROR TestReadFeatureMapAttributeFromTheDutAndVerifyResponseHasTheValue0OrThrowsAGeneralErrorIfTheAttributeIsNotSupported_7() { + SetIdentity("alpha"); UserPrompt(@"Please enter 'y' for success", @"y"); return CHIP_NO_ERROR; } @@ -23370,6 +26938,39 @@ class Test_TC_MC_1_10 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -23386,12 +26987,14 @@ class Test_TC_MC_1_10 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestApplicationBasic * cluster = [[CHIPTestApplicationBasic alloc] initWithDevice:device endpoint:1 @@ -23416,6 +27019,7 @@ class Test_TC_MC_1_10 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestApplicationBasic * cluster = [[CHIPTestApplicationBasic alloc] initWithDevice:device endpoint:1 @@ -23436,6 +27040,7 @@ class Test_TC_MC_1_10 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestApplicationBasic * cluster = [[CHIPTestApplicationBasic alloc] initWithDevice:device endpoint:1 @@ -23473,12 +27078,14 @@ class Test_TC_MC_1_10 : public TestCommandBridge { CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_4() { + SetIdentity("alpha"); UserPrompt(@"Please enter 'y' for success", @"y"); return CHIP_NO_ERROR; } CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestApplicationBasic * cluster = [[CHIPTestApplicationBasic alloc] initWithDevice:device endpoint:1 @@ -23506,6 +27113,7 @@ class Test_TC_MC_1_10 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestApplicationBasic * cluster = [[CHIPTestApplicationBasic alloc] initWithDevice:device endpoint:1 @@ -23533,6 +27141,7 @@ class Test_TC_MC_1_10 : public TestCommandBridge { CHIP_ERROR TestReadFeatureMapAttributeFromTheDutAndVerifyResponseHasTheValue0OrThrowsAGeneralErrorIfTheAttributeIsNotSupported_7() { + SetIdentity("alpha"); UserPrompt(@"Please enter 'y' for success", @"y"); return CHIP_NO_ERROR; } @@ -23641,6 +27250,39 @@ class Test_TC_MC_1_11 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -23657,12 +27299,14 @@ class Test_TC_MC_1_11 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestContentLauncher * cluster = [[CHIPTestContentLauncher alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -23685,6 +27329,7 @@ class Test_TC_MC_1_11 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestContentLauncher * cluster = [[CHIPTestContentLauncher alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -23703,6 +27348,7 @@ class Test_TC_MC_1_11 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestContentLauncher * cluster = [[CHIPTestContentLauncher alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -23732,12 +27378,14 @@ class Test_TC_MC_1_11 : public TestCommandBridge { CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_4() { + SetIdentity("alpha"); UserPrompt(@"Please enter 'y' for success", @"y"); return CHIP_NO_ERROR; } CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestContentLauncher * cluster = [[CHIPTestContentLauncher alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -23762,6 +27410,7 @@ class Test_TC_MC_1_11 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestContentLauncher * cluster = [[CHIPTestContentLauncher alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -23787,6 +27436,7 @@ class Test_TC_MC_1_11 : public TestCommandBridge { CHIP_ERROR TestReadFeatureMapAttributeFromTheDutValuesBasedOnFeaturePicsSupportBit0SetTo1IfTheDutSupportsContentSearchPicsContentsearchIsTrueBit1SetTo1IfTheDutSupportsUrlPlaybackPicsUrlplaybackIsTrue_7() { + SetIdentity("alpha"); UserPrompt(@"Please enter 'y' for success", @"y"); return CHIP_NO_ERROR; } @@ -23889,6 +27539,39 @@ class Test_TC_MC_1_12 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -23905,12 +27588,14 @@ class Test_TC_MC_1_12 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestAccountLogin * cluster = [[CHIPTestAccountLogin alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -23933,6 +27618,7 @@ class Test_TC_MC_1_12 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestAccountLogin * cluster = [[CHIPTestAccountLogin alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -23951,6 +27637,7 @@ class Test_TC_MC_1_12 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestAccountLogin * cluster = [[CHIPTestAccountLogin alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -23978,12 +27665,14 @@ class Test_TC_MC_1_12 : public TestCommandBridge { CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_4() { + SetIdentity("alpha"); UserPrompt(@"Please enter 'y' for success", @"y"); return CHIP_NO_ERROR; } CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestAccountLogin * cluster = [[CHIPTestAccountLogin alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -24010,6 +27699,7 @@ class Test_TC_MC_1_12 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestAccountLogin * cluster = [[CHIPTestAccountLogin alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -24034,6 +27724,7 @@ class Test_TC_MC_1_12 : public TestCommandBridge { CHIP_ERROR TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponse_7() { + SetIdentity("alpha"); UserPrompt(@"Please enter 'y' for success", @"y"); return CHIP_NO_ERROR; } @@ -24093,6 +27784,21 @@ class Test_TC_MC_2_1 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -24109,12 +27815,14 @@ class Test_TC_MC_2_1 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestPutTheDeviceIntoLowPowerMode_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestLowPower * cluster = [[CHIPTestLowPower alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -24301,6 +28009,63 @@ class Test_TC_MC_3_1 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -24317,12 +28082,14 @@ class Test_TC_MC_3_1 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestSendSelect_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -24343,6 +28110,7 @@ class Test_TC_MC_3_1 : public TestCommandBridge { CHIP_ERROR TestSendUp_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -24363,6 +28131,7 @@ class Test_TC_MC_3_1 : public TestCommandBridge { CHIP_ERROR TestSendDown_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -24383,6 +28152,7 @@ class Test_TC_MC_3_1 : public TestCommandBridge { CHIP_ERROR TestSendLeft_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -24403,6 +28173,7 @@ class Test_TC_MC_3_1 : public TestCommandBridge { CHIP_ERROR TestSendRight_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -24423,6 +28194,7 @@ class Test_TC_MC_3_1 : public TestCommandBridge { CHIP_ERROR TestSendRightUp_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -24443,6 +28215,7 @@ class Test_TC_MC_3_1 : public TestCommandBridge { CHIP_ERROR TestSendRightDown_7() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -24463,6 +28236,7 @@ class Test_TC_MC_3_1 : public TestCommandBridge { CHIP_ERROR TestSendLeftUp_8() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -24483,6 +28257,7 @@ class Test_TC_MC_3_1 : public TestCommandBridge { CHIP_ERROR TestSendLeftDown_9() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -24503,6 +28278,7 @@ class Test_TC_MC_3_1 : public TestCommandBridge { CHIP_ERROR TestSendRootMenu_10() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -24523,6 +28299,7 @@ class Test_TC_MC_3_1 : public TestCommandBridge { CHIP_ERROR TestSendSetupMenu_11() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -24543,6 +28320,7 @@ class Test_TC_MC_3_1 : public TestCommandBridge { CHIP_ERROR TestSendContentsMenu_12() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -24563,6 +28341,7 @@ class Test_TC_MC_3_1 : public TestCommandBridge { CHIP_ERROR TestSendFavoriteMenu_13() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -24583,6 +28362,7 @@ class Test_TC_MC_3_1 : public TestCommandBridge { CHIP_ERROR TestSendExit_14() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -24603,6 +28383,7 @@ class Test_TC_MC_3_1 : public TestCommandBridge { CHIP_ERROR TestSendInvalid_15() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -24687,6 +28468,24 @@ class Test_TC_MC_3_2 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -24703,12 +28502,14 @@ class Test_TC_MC_3_2 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestSendRootMenu_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -24729,6 +28530,7 @@ class Test_TC_MC_3_2 : public TestCommandBridge { CHIP_ERROR TestSendSetupMenu_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -24870,6 +28672,45 @@ class Test_TC_MC_3_3 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -24886,12 +28727,14 @@ class Test_TC_MC_3_3 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestSendNumbers1_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -24912,6 +28755,7 @@ class Test_TC_MC_3_3 : public TestCommandBridge { CHIP_ERROR TestSendNumbers2_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -24932,6 +28776,7 @@ class Test_TC_MC_3_3 : public TestCommandBridge { CHIP_ERROR TestSendNumbers3_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -24952,6 +28797,7 @@ class Test_TC_MC_3_3 : public TestCommandBridge { CHIP_ERROR TestSendNumbers4_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -24972,6 +28818,7 @@ class Test_TC_MC_3_3 : public TestCommandBridge { CHIP_ERROR TestSendNumbers5_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -24992,6 +28839,7 @@ class Test_TC_MC_3_3 : public TestCommandBridge { CHIP_ERROR TestSendNumbers6_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -25012,6 +28860,7 @@ class Test_TC_MC_3_3 : public TestCommandBridge { CHIP_ERROR TestSendNumbers7_7() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -25032,6 +28881,7 @@ class Test_TC_MC_3_3 : public TestCommandBridge { CHIP_ERROR TestSendNumbers8_8() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -25052,6 +28902,7 @@ class Test_TC_MC_3_3 : public TestCommandBridge { CHIP_ERROR TestSendNumbers9_9() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -25201,6 +29052,48 @@ class Test_TC_MC_3_4 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -25217,12 +29110,14 @@ class Test_TC_MC_3_4 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestSendRootMenu_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -25243,6 +29138,7 @@ class Test_TC_MC_3_4 : public TestCommandBridge { CHIP_ERROR TestSendRootMenu_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -25263,6 +29159,7 @@ class Test_TC_MC_3_4 : public TestCommandBridge { CHIP_ERROR TestSendRootMenu_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -25283,6 +29180,7 @@ class Test_TC_MC_3_4 : public TestCommandBridge { CHIP_ERROR TestSendRootMenu_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -25303,6 +29201,7 @@ class Test_TC_MC_3_4 : public TestCommandBridge { CHIP_ERROR TestSendRootMenu_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -25323,6 +29222,7 @@ class Test_TC_MC_3_4 : public TestCommandBridge { CHIP_ERROR TestSendRootMenu_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -25343,6 +29243,7 @@ class Test_TC_MC_3_4 : public TestCommandBridge { CHIP_ERROR TestSendRootMenu_7() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -25363,6 +29264,7 @@ class Test_TC_MC_3_4 : public TestCommandBridge { CHIP_ERROR TestSendRootMenu_8() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -25383,6 +29285,7 @@ class Test_TC_MC_3_4 : public TestCommandBridge { CHIP_ERROR TestSendRootMenu_9() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -25403,6 +29306,7 @@ class Test_TC_MC_3_4 : public TestCommandBridge { CHIP_ERROR TestSendRootMenu_10() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -25476,6 +29380,21 @@ class Test_TC_MC_3_5 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -25492,12 +29411,14 @@ class Test_TC_MC_3_5 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestReadCatalogListAttribute_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestApplicationLauncher * cluster = [[CHIPTestApplicationLauncher alloc] initWithDevice:device endpoint:1 @@ -25567,75 +29488,16 @@ class Test_TC_MC_3_6 : public TestCommandBridge { } } - 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 = 1; - - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + void OnStatusUpdate(const chip::app::StatusIB & status) override { - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); - return CHIP_NO_ERROR; - } -}; - -class Test_TC_MC_3_7 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_MC_3_7() - : TestCommandBridge("Test_TC_MC_3_7") - , 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_MC_3_7() {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_3_7\n"); - } - - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_3_7\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } - - Wait(); - - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) { + switch (mTestIndex - 1) { case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; } - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + // Go on to the next test. + WaitForMs(0); } chip::System::Clock::Timeout GetWaitDuration() const override @@ -25654,16 +29516,17 @@ class Test_TC_MC_3_7 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } }; -class Test_TC_MC_3_8 : public TestCommandBridge { +class Test_TC_MC_3_7 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_MC_3_8() - : TestCommandBridge("Test_TC_MC_3_8") + Test_TC_MC_3_7() + : TestCommandBridge("Test_TC_MC_3_7") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -25673,7 +29536,7 @@ class Test_TC_MC_3_8 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_MC_3_8() {} + ~Test_TC_MC_3_7() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -25681,11 +29544,11 @@ class Test_TC_MC_3_8 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_3_8\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_3_7\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_3_8\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_3_7\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -25709,75 +29572,16 @@ class Test_TC_MC_3_8 : public TestCommandBridge { } } - 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 = 1; - - 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; - } -}; - -class Test_TC_MC_3_9 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_MC_3_9() - : TestCommandBridge("Test_TC_MC_3_9") - , mTestIndex(0) + void OnStatusUpdate(const chip::app::StatusIB & status) override { - 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_MC_3_9() {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_3_9\n"); - } - - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_3_9\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } - - Wait(); - - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) { + switch (mTestIndex - 1) { case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; } - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + // Go on to the next test. + WaitForMs(0); } chip::System::Clock::Timeout GetWaitDuration() const override @@ -25796,16 +29600,17 @@ class Test_TC_MC_3_9 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } }; -class Test_TC_MC_3_10 : public TestCommandBridge { +class Test_TC_MC_3_8 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_MC_3_10() - : TestCommandBridge("Test_TC_MC_3_10") + Test_TC_MC_3_8() + : TestCommandBridge("Test_TC_MC_3_8") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -25815,7 +29620,7 @@ class Test_TC_MC_3_10 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_MC_3_10() {} + ~Test_TC_MC_3_8() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -25823,11 +29628,11 @@ class Test_TC_MC_3_10 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_3_10\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_3_8\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_3_10\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_3_8\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -25851,6 +29656,102 @@ class Test_TC_MC_3_10 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + + 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 = 1; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity("alpha"); + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MC_3_9 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_MC_3_9() + : TestCommandBridge("Test_TC_MC_3_9") + , 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_MC_3_9() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_3_9\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_3_9\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; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -25867,6 +29768,91 @@ class Test_TC_MC_3_10 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MC_3_10 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_MC_3_10() + : TestCommandBridge("Test_TC_MC_3_10") + , 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_MC_3_10() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_3_10\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_3_10\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; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + + 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 = 1; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } @@ -25922,6 +29908,18 @@ class Test_TC_MC_3_11 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -25938,6 +29936,7 @@ class Test_TC_MC_3_11 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } @@ -25997,6 +29996,21 @@ class Test_TC_MC_5_1 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -26013,12 +30027,14 @@ class Test_TC_MC_5_1 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestReadsTheChannelListAttributeFromTheDut_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestChannel * cluster = [[CHIPTestChannel alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -26090,6 +30106,21 @@ class Test_TC_MC_5_2 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -26106,12 +30137,14 @@ class Test_TC_MC_5_2 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestLogACommand_1() { + SetIdentity("alpha"); UserPrompt(@"verify that the channel has changed on the device."); return CHIP_NO_ERROR; } @@ -26171,6 +30204,21 @@ class Test_TC_MC_5_3 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -26187,12 +30235,14 @@ class Test_TC_MC_5_3 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestLogACommand_1() { + SetIdentity("alpha"); UserPrompt(@"verify that the channel has changed on the device"); return CHIP_NO_ERROR; } @@ -26268,6 +30318,33 @@ class Test_TC_MC_6_1 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -26284,24 +30361,28 @@ class Test_TC_MC_6_1 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestLogACommand_1() { + SetIdentity("alpha"); UserPrompt(@"Verify that media is paused"); return CHIP_NO_ERROR; } CHIP_ERROR TestLogACommand_2() { + SetIdentity("alpha"); UserPrompt(@"Physically verify that the media is playing"); return CHIP_NO_ERROR; } CHIP_ERROR TestReadsThePlaybackStateAttribute_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -26324,12 +30405,14 @@ class Test_TC_MC_6_1 : public TestCommandBridge { CHIP_ERROR TestLogACommand_4() { + SetIdentity("alpha"); UserPrompt(@"Physically verify that the media is paused"); return CHIP_NO_ERROR; } CHIP_ERROR TestLogACommand_5() { + SetIdentity("alpha"); UserPrompt(@"Physically verify that the media is stoped"); return CHIP_NO_ERROR; } @@ -26417,6 +30500,42 @@ class Test_TC_MC_6_2 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -26433,24 +30552,28 @@ class Test_TC_MC_6_2 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestLogACommand_1() { + SetIdentity("alpha"); UserPrompt(@"Verify that media is paused"); return CHIP_NO_ERROR; } CHIP_ERROR TestLogACommand_2() { + SetIdentity("alpha"); UserPrompt(@"Physically verify that the media is playing"); return CHIP_NO_ERROR; } CHIP_ERROR TestReadsTheCurrentStateAttribute_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -26473,30 +30596,35 @@ class Test_TC_MC_6_2 : public TestCommandBridge { CHIP_ERROR TestLogACommand_4() { + SetIdentity("alpha"); UserPrompt(@"Physically verify that the media is started over"); return CHIP_NO_ERROR; } CHIP_ERROR TestLogACommand_5() { + SetIdentity("alpha"); UserPrompt(@"Verify that the next media item in the queue has been loaded"); return CHIP_NO_ERROR; } CHIP_ERROR TestLogACommand_6() { + SetIdentity("alpha"); UserPrompt(@"Verify that the previous media item in the queue has been loaded"); return CHIP_NO_ERROR; } CHIP_ERROR TestLogACommand_7() { + SetIdentity("alpha"); UserPrompt(@"Verify that the media has skipped forward 10 seconds"); return CHIP_NO_ERROR; } CHIP_ERROR TestLogACommand_8() { + SetIdentity("alpha"); UserPrompt(@"Verify that the media has skipped backward 10 seconds"); return CHIP_NO_ERROR; } @@ -26564,6 +30692,27 @@ class Test_TC_MC_6_3 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -26580,24 +30729,28 @@ class Test_TC_MC_6_3 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestLogACommand_1() { + SetIdentity("alpha"); UserPrompt(@"Verify that media is paused"); return CHIP_NO_ERROR; } CHIP_ERROR TestLogACommand_2() { + SetIdentity("alpha"); UserPrompt(@"Verify that the media has moved to 10 seconds from the starting point."); return CHIP_NO_ERROR; } CHIP_ERROR TestLogACommand_3() { + SetIdentity("alpha"); UserPrompt(@"User prompt needed to enter the value beyond the furthest valid position"); return CHIP_NO_ERROR; } @@ -26689,6 +30842,45 @@ class Test_TC_MC_6_4 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -26705,18 +30897,21 @@ class Test_TC_MC_6_4 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestLogACommand_1() { + SetIdentity("alpha"); UserPrompt(@"Verify that media is paused"); return CHIP_NO_ERROR; } CHIP_ERROR TestReadsThePlaybackSpeedAttributeFromTheDut_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -26739,12 +30934,14 @@ class Test_TC_MC_6_4 : public TestCommandBridge { CHIP_ERROR TestLogACommand_3() { + SetIdentity("alpha"); UserPrompt(@"Verify that the media is playing"); return CHIP_NO_ERROR; } CHIP_ERROR TestReadsTheCurrentStateAttribute_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -26767,18 +30964,21 @@ class Test_TC_MC_6_4 : public TestCommandBridge { CHIP_ERROR TestLogACommand_5() { + SetIdentity("alpha"); UserPrompt(@"Verify that the media play speed has increased"); return CHIP_NO_ERROR; } CHIP_ERROR TestLogACommand_6() { + SetIdentity("alpha"); UserPrompt(@"Verify that the media play has reversed direction"); return CHIP_NO_ERROR; } CHIP_ERROR TestReadsTheCurrentStateAttribute_7() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -26801,12 +31001,14 @@ class Test_TC_MC_6_4 : public TestCommandBridge { CHIP_ERROR TestLogACommand_8() { + SetIdentity("alpha"); UserPrompt(@"Verify that the media play has reversed direction"); return CHIP_NO_ERROR; } CHIP_ERROR TestLogACommand_9() { + SetIdentity("alpha"); UserPrompt(@"Verify that the media is has resumed playing forward at the default speed"); return CHIP_NO_ERROR; } @@ -26862,6 +31064,18 @@ class Test_TC_MC_7_1 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -26878,6 +31092,7 @@ class Test_TC_MC_7_1 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } @@ -26933,6 +31148,18 @@ class Test_TC_MC_7_2 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -26949,6 +31176,7 @@ class Test_TC_MC_7_2 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } @@ -27012,6 +31240,24 @@ class Test_TC_MC_8_1 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -27028,12 +31274,14 @@ class Test_TC_MC_8_1 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestReadsTheCurrentTargetAttribute_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTargetNavigator * cluster = [[CHIPTestTargetNavigator alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -27052,6 +31300,7 @@ class Test_TC_MC_8_1 : public TestCommandBridge { CHIP_ERROR TestReadsTheTargetListAttribute_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTargetNavigator * cluster = [[CHIPTestTargetNavigator alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -27147,6 +31396,39 @@ class Test_TC_MC_9_1 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -27163,18 +31445,21 @@ class Test_TC_MC_9_1 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestPrecondition_1() { + SetIdentity("alpha"); Log(@"DUT has one or more Content Apps available"); return CHIP_NO_ERROR; } CHIP_ERROR TestReadsTheVendorNameAttribute_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestApplicationBasic * cluster = [[CHIPTestApplicationBasic alloc] initWithDevice:device endpoint:1 @@ -27196,6 +31481,7 @@ class Test_TC_MC_9_1 : public TestCommandBridge { CHIP_ERROR TestReadsTheVendorIDAttribute_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestApplicationBasic * cluster = [[CHIPTestApplicationBasic alloc] initWithDevice:device endpoint:1 @@ -27216,6 +31502,7 @@ class Test_TC_MC_9_1 : public TestCommandBridge { CHIP_ERROR TestReadsTheApplicationNameAttribute_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestApplicationBasic * cluster = [[CHIPTestApplicationBasic alloc] initWithDevice:device endpoint:1 @@ -27237,6 +31524,7 @@ class Test_TC_MC_9_1 : public TestCommandBridge { CHIP_ERROR TestReadsTheProductIDAttribute_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestApplicationBasic * cluster = [[CHIPTestApplicationBasic alloc] initWithDevice:device endpoint:1 @@ -27257,6 +31545,7 @@ class Test_TC_MC_9_1 : public TestCommandBridge { CHIP_ERROR TestReadsTheStatusAttribute_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestApplicationBasic * cluster = [[CHIPTestApplicationBasic alloc] initWithDevice:device endpoint:1 @@ -27281,6 +31570,7 @@ class Test_TC_MC_9_1 : public TestCommandBridge { CHIP_ERROR TestReadsTheApplicationVersionAttribute_7() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestApplicationBasic * cluster = [[CHIPTestApplicationBasic alloc] initWithDevice:device endpoint:1 @@ -27359,6 +31649,24 @@ class Test_TC_MC_10_1 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -27375,12 +31683,14 @@ class Test_TC_MC_10_1 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestThReadsTheAcceptHeaderAttributeFromTheDut_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestContentLauncher * cluster = [[CHIPTestContentLauncher alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -27399,6 +31709,7 @@ class Test_TC_MC_10_1 : public TestCommandBridge { CHIP_ERROR TestThReadsTheSupportedStreamingProtocolsAttributeFromTheDut_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestContentLauncher * cluster = [[CHIPTestContentLauncher alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -27483,6 +31794,30 @@ class Test_TC_MOD_1_1 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -27499,12 +31834,14 @@ class Test_TC_MOD_1_1 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestThReadsTheClusterRevisionAttributeFromTheDut_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -27528,6 +31865,7 @@ class Test_TC_MOD_1_1 : public TestCommandBridge { CHIP_ERROR TestThReadsTheAttributeListAttributeFromTheDut_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -27546,6 +31884,7 @@ class Test_TC_MOD_1_1 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -27564,6 +31903,7 @@ class Test_TC_MOD_1_1 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -27581,21 +31921,23 @@ class Test_TC_MOD_1_1 : public TestCommandBridge { } }; -class Test_TC_OCC_1_1 : public TestCommandBridge { +class Test_TC_MF_1_3 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_OCC_1_1() - : TestCommandBridge("Test_TC_OCC_1_1") + Test_TC_MF_1_3() + : TestCommandBridge("Test_TC_MF_1_3") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); + AddArgument("nodeId2", 0, UINT64_MAX, &mNodeId2); 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) - ~Test_TC_OCC_1_1() {} + ~Test_TC_MF_1_3() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -27603,11 +31945,11 @@ class Test_TC_OCC_1_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_OCC_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MF_1_3\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OCC_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MF_1_3\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -27620,56 +31962,62 @@ class Test_TC_OCC_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 : Reboot target device\n"); + err = TestRebootTargetDevice_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : read the global attribute: ClusterRevision\n"); - err = TestReadTheGlobalAttributeClusterRevision_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : TH_CR1 starts a commissioning process with DUT_CE\n"); + err = TestThCr1StartsACommissioningProcessWithDutCe_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute constraints: ClusterRevision\n"); - err = TestReadTheGlobalAttributeConstraintsClusterRevision_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : TH_CR1 opens a commissioning window on DUT_CE\n"); + err = TestThCr1OpensACommissioningWindowOnDutCe_2(); break; case 3: - ChipLogProgress( - chipTool, " ***** Test Step 3 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3(); + ChipLogProgress(chipTool, + " ***** Test Step 3 : TH_CR1 writes the Basic Information Clusters NodeLabel mandatory attribute of DUT_CE\n"); + err = TestThCr1WritesTheBasicInformationClustersNodeLabelMandatoryAttributeOfDutCe_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : reads back global attribute: ClusterRevision\n"); - err = TestReadsBackGlobalAttributeClusterRevision_4(); + ChipLogProgress(chipTool, + " ***** Test Step 4 : TH_CR1 reads the Basic Information Clusters NodeLabel mandatory attribute of DUT_CE\n"); + err = TestThCr1ReadsTheBasicInformationClustersNodeLabelMandatoryAttributeOfDutCe_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: AttributeList\n"); - err = TestReadTheGlobalAttributeAttributeList_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Commission from beta\n"); + err = TestCommissionFromBeta_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 : TH_CR2 starts a commissioning process with DUT_CE\n"); + err = TestThCr2StartsACommissioningProcessWithDutCe_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Read the global attribute: AcceptedCommandList\n"); - err = TestReadTheGlobalAttributeAcceptedCommandList_7(); + ChipLogProgress(chipTool, " ***** Test Step 7 : Query fabrics list\n"); + err = TestQueryFabricsList_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Read the global attribute: GeneratedCommandList\n"); - err = TestReadTheGlobalAttributeGeneratedCommandList_8(); + ChipLogProgress(chipTool, " ***** Test Step 8 : Query fabrics list\n"); + err = TestQueryFabricsList_8(); break; case 9: - ChipLogProgress( - chipTool, " ***** Test Step 9 : Read FeatureMap attribute from the DUT and Verify that the DUT response\n"); - if (ShouldSkip("PICS_USER_PROMPT")) { - NextTest(); - return; - } - err = TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponse_9(); + ChipLogProgress(chipTool, + " ***** Test Step 9 : TH_CR1 writes the Basic Information Clusters NodeLabel mandatory attribute of DUT_CE\n"); + err = TestThCr1WritesTheBasicInformationClustersNodeLabelMandatoryAttributeOfDutCe_9(); + break; + case 10: + ChipLogProgress(chipTool, + " ***** Test Step 10 : TH_CR1 reads the Basic Information Clusters NodeLabel mandatory attribute of DUT_CE\n"); + err = TestThCr1ReadsTheBasicInformationClustersNodeLabelMandatoryAttributeOfDutCe_10(); + break; + case 11: + ChipLogProgress(chipTool, + " ***** Test Step 11 : TH_CR2 writes the Basic Information Clusters NodeLabel mandatory attribute of DUT_CE\n"); + err = TestThCr2WritesTheBasicInformationClustersNodeLabelMandatoryAttributeOfDutCe_11(); + break; + case 12: + ChipLogProgress(chipTool, + " ***** Test Step 12 : TH_CR2 reads the Basic Information Clusters NodeLabel mandatory attribute of DUT_CE\n"); + err = TestThCr2ReadsTheBasicInformationClustersNodeLabelMandatoryAttributeOfDutCe_12(); break; } @@ -27679,6 +32027,54 @@ class Test_TC_OCC_1_1 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -27686,198 +32082,302 @@ class Test_TC_OCC_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 10; + const uint16_t mTestCount = 13; chip::Optional mNodeId; - chip::Optional mCluster; + chip::Optional mNodeId2; chip::Optional mEndpoint; + chip::Optional mDiscriminator; + chip::Optional mPayload; chip::Optional mTimeout; - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + CHIP_ERROR TestRebootTargetDevice_0() + { + SetIdentity("alpha"); + Reboot(mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThCr1StartsACommissioningProcessWithDutCe_1() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + CHIP_ERROR TestThCr1OpensACommissioningWindowOnDutCe_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestAdministratorCommissioning * cluster = [[CHIPTestAdministratorCommissioning alloc] initWithDevice:device + endpoint:0 + 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); + __auto_type * params = [[CHIPAdministratorCommissioningClusterOpenCommissioningWindowParams alloc] init]; + params.commissioningTimeout = [NSNumber numberWithUnsignedShort:180U]; + params.pakeVerifier = + [[NSData alloc] initWithBytes:"\006\307V\337\374\327\042e4R\241-\315\224]\214T\332+\017<\275\033M\303\361\255\262#" + "\256\262k\004|\322L\226\206o\227\233\035\203\354P\342\264\2560\315\362\375\263+" + "\330\242\021\2707\334\224\355\315V\364\321Cw\031\020v\277\305\235\231\267\3350S\357\326" + "\360,D4\362\275\322z\244\371\316\247\015s\216L" + length:97]; + params.discriminator = [NSNumber numberWithUnsignedShort:3840U]; + params.iterations = [NSNumber numberWithUnsignedInt:1000UL]; + params.salt = [[NSData alloc] initWithBytes:"SPAKE2P Key Salt" length:16]; + [cluster openCommissioningWindowWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH_CR1 opens a commissioning window on DUT_CE Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThCr1WritesTheBasicInformationClustersNodeLabelMandatoryAttributeOfDutCe_3() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id nodeLabelArgument; + nodeLabelArgument = @"chiptest"; + [cluster writeAttributeNodeLabelWithValue:nodeLabelArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH_CR1 writes the Basic Information Clusters NodeLabel mandatory attribute of DUT_CE " + @"Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThCr1ReadsTheBasicInformationClustersNodeLabelMandatoryAttributeOfDutCe_4() + { + SetIdentity("alpha"); + 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(@"TH_CR1 reads the Basic Information Clusters NodeLabel mandatory attribute of DUT_CE Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 3U)); + VerifyOrReturn(CheckValueAsString("NodeLabel", actualValue, @"chiptest")); } + VerifyOrReturn(CheckConstraintType("nodeLabel", "", "string")); + VerifyOrReturn(CheckConstraintMaxLength("nodeLabel", [value length], 32)); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() + CHIP_ERROR TestCommissionFromBeta_5() + { + SetIdentity("beta"); + PairWithQRCode(mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL, + mPayload.HasValue() ? mPayload.Value() : chip::CharSpan::fromCharString("MT:0000000000I31506010")); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThCr2StartsACommissioningProcessWithDutCe_6() + { + SetIdentity("beta"); + WaitForCommissionee(mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestQueryFabricsList_7() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing 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 readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); + 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); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValue("Fabrics", [actualValue count], static_cast(1))); + VerifyOrReturn(CheckValueAsString("Label", + ((CHIPOperationalCredentialsClusterFabricDescriptor *) actualValue[0]).label, @"")); + } + + VerifyOrReturn(CheckConstraintType("fabrics", "", "list")); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3() + CHIP_ERROR TestQueryFabricsList_8() { + SetIdentity("beta"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing 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 clusterRevisionArgument; - clusterRevisionArgument = [NSNumber numberWithUnsignedShort:3U]; - [cluster - writeAttributeClusterRevisionWithValue:clusterRevisionArgument - completionHandler:^(NSError * _Nullable err) { - NSLog( - @"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); + CHIPReadParams * params = [[CHIPReadParams alloc] init]; + params.fabricFiltered = [NSNumber numberWithBool:false]; + [cluster readAttributeFabricsWithParams:params + completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Query fabrics list Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("Fabrics", [actualValue count], static_cast(2))); + VerifyOrReturn(CheckValueAsString("Label", + ((CHIPOperationalCredentialsClusterFabricDescriptor *) actualValue[0]).label, @"")); + VerifyOrReturn(CheckValueAsString("Label", + ((CHIPOperationalCredentialsClusterFabricDescriptor *) actualValue[1]).label, @"")); + } + + VerifyOrReturn(CheckConstraintType("fabrics", "", "list")); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_4() + CHIP_ERROR TestThCr1WritesTheBasicInformationClustersNodeLabelMandatoryAttributeOfDutCe_9() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing 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 readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"reads back global attribute: ClusterRevision Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id nodeLabelArgument; + nodeLabelArgument = @"chiptest1"; + [cluster writeAttributeNodeLabelWithValue:nodeLabelArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH_CR1 writes the Basic Information Clusters NodeLabel mandatory attribute of DUT_CE " + @"Error: %@", + err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 3U)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAttributeList_5() + CHIP_ERROR TestThCr1ReadsTheBasicInformationClustersNodeLabelMandatoryAttributeOfDutCe_10() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing 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 readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AttributeList Error: %@", err); + [cluster readAttributeNodeLabelWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH_CR1 reads the Basic Information Clusters NodeLabel mandatory attribute of DUT_CE Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); + { + id actualValue = value; + VerifyOrReturn(CheckValueAsString("NodeLabel", actualValue, @"chiptest1")); + } + + VerifyOrReturn(CheckConstraintType("nodeLabel", "", "string")); + VerifyOrReturn(CheckConstraintMaxLength("nodeLabel", [value length], 32)); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_6() - { - UserPrompt(@"Please enter 'y' for success", @"y"); - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_7() + CHIP_ERROR TestThCr2WritesTheBasicInformationClustersNodeLabelMandatoryAttributeOfDutCe_11() { + SetIdentity("beta"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing 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 readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + id nodeLabelArgument; + nodeLabelArgument = @"chiptest2"; + [cluster writeAttributeNodeLabelWithValue:nodeLabelArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH_CR2 writes the Basic Information Clusters NodeLabel mandatory attribute of DUT_CE " + @"Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_8() + CHIP_ERROR TestThCr2ReadsTheBasicInformationClustersNodeLabelMandatoryAttributeOfDutCe_12() { + SetIdentity("beta"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing 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 readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); + [cluster readAttributeNodeLabelWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH_CR2 reads the Basic Information Clusters NodeLabel mandatory attribute of DUT_CE Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); + { + id actualValue = value; + VerifyOrReturn(CheckValueAsString("NodeLabel", actualValue, @"chiptest2")); + } + + VerifyOrReturn(CheckConstraintType("nodeLabel", "", "string")); + VerifyOrReturn(CheckConstraintMaxLength("nodeLabel", [value length], 32)); NextTest(); }]; return CHIP_NO_ERROR; } - - CHIP_ERROR TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponse_9() - { - UserPrompt(@"Please enter '0' for success", @"0"); - return CHIP_NO_ERROR; - } }; -class Test_TC_OCC_2_1 : public TestCommandBridge { +class Test_TC_MF_1_4 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_OCC_2_1() - : TestCommandBridge("Test_TC_OCC_2_1") + Test_TC_MF_1_4() + : TestCommandBridge("Test_TC_MF_1_4") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); + AddArgument("nodeId2", 0, UINT64_MAX, &mNodeId2); 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) - ~Test_TC_OCC_2_1() {} + ~Test_TC_MF_1_4() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -27885,11 +32385,11 @@ class Test_TC_OCC_2_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_OCC_2_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MF_1_4\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OCC_2_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MF_1_4\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -27902,47 +32402,62 @@ class Test_TC_OCC_2_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 : Reboot target device\n"); + err = TestRebootTargetDevice_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Reads mandatory attribute constrains: Occupancy\n"); - err = TestReadsMandatoryAttributeConstrainsOccupancy_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : TH_CR1 starts a commissioning process with DUT_CE\n"); + err = TestThCr1StartsACommissioningProcessWithDutCe_1(); break; case 2: - ChipLogProgress( - chipTool, " ***** Test Step 2 : Writes the respective default value to mandatory attribute: Occupancy\n"); - err = TestWritesTheRespectiveDefaultValueToMandatoryAttributeOccupancy_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : TH_CR1 opens a commissioning window on DUT_CE\n"); + err = TestThCr1OpensACommissioningWindowOnDutCe_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Reads back mandatory attribute: Occupancy\n"); - err = TestReadsBackMandatoryAttributeOccupancy_3(); + ChipLogProgress(chipTool, + " ***** Test Step 3 : TH_CR1 writes the Basic Information Clusters NodeLabel mandatory attribute of DUT_CE\n"); + err = TestThCr1WritesTheBasicInformationClustersNodeLabelMandatoryAttributeOfDutCe_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Reads mandatory attribute constrains: OccupancySensorType\n"); - err = TestReadsMandatoryAttributeConstrainsOccupancySensorType_4(); + ChipLogProgress(chipTool, + " ***** Test Step 4 : TH_CR1 reads the Basic Information Clusters NodeLabel mandatory attribute of DUT_CE\n"); + err = TestThCr1ReadsTheBasicInformationClustersNodeLabelMandatoryAttributeOfDutCe_4(); break; case 5: - ChipLogProgress( - chipTool, " ***** Test Step 5 : Writes the respective default value to mandatory attribute: OccupancySensorType\n"); - err = TestWritesTheRespectiveDefaultValueToMandatoryAttributeOccupancySensorType_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Commission from beta\n"); + err = TestCommissionFromBeta_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Reads back mandatory attribute: OccupancySensorType\n"); - err = TestReadsBackMandatoryAttributeOccupancySensorType_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : TH_CR2 starts a commissioning process with DUT_CE\n"); + err = TestThCr2StartsACommissioningProcessWithDutCe_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Reads mandatory attribute constrains: OccupancySensorTypeBitmap\n"); - err = TestReadsMandatoryAttributeConstrainsOccupancySensorTypeBitmap_7(); + ChipLogProgress(chipTool, " ***** Test Step 7 : Query fabrics list\n"); + err = TestQueryFabricsList_7(); break; case 8: - ChipLogProgress(chipTool, - " ***** Test Step 8 : Writes the respective default value to mandatory attribute: OccupancySensorTypeBitmap\n"); - err = TestWritesTheRespectiveDefaultValueToMandatoryAttributeOccupancySensorTypeBitmap_8(); + ChipLogProgress(chipTool, " ***** Test Step 8 : Query fabrics list\n"); + err = TestQueryFabricsList_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Reads back mandatory attribute: OccupancySensorTypeBitmap\n"); - err = TestReadsBackMandatoryAttributeOccupancySensorTypeBitmap_9(); + ChipLogProgress(chipTool, + " ***** Test Step 9 : TH_CR1 writes the Basic Information Clusters NodeLabel mandatory attribute of DUT_CE\n"); + err = TestThCr1WritesTheBasicInformationClustersNodeLabelMandatoryAttributeOfDutCe_9(); + break; + case 10: + ChipLogProgress(chipTool, + " ***** Test Step 10 : TH_CR1 reads the Basic Information Clusters NodeLabel mandatory attribute of DUT_CE\n"); + err = TestThCr1ReadsTheBasicInformationClustersNodeLabelMandatoryAttributeOfDutCe_10(); + break; + case 11: + ChipLogProgress(chipTool, + " ***** Test Step 11 : TH_CR1 writes the Basic Information Clusters NodeLabel mandatory attribute of DUT_CE\n"); + err = TestThCr1WritesTheBasicInformationClustersNodeLabelMandatoryAttributeOfDutCe_11(); + break; + case 12: + ChipLogProgress(chipTool, + " ***** Test Step 12 : TH_CR1 reads the Basic Information Clusters NodeLabel mandatory attribute of DUT_CE\n"); + err = TestThCr1ReadsTheBasicInformationClustersNodeLabelMandatoryAttributeOfDutCe_12(); break; } @@ -27952,6 +32467,54 @@ class Test_TC_OCC_2_1 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -27959,257 +32522,278 @@ class Test_TC_OCC_2_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 10; + const uint16_t mTestCount = 13; chip::Optional mNodeId; - chip::Optional mCluster; + chip::Optional mNodeId2; chip::Optional mEndpoint; + chip::Optional mDiscriminator; + chip::Optional mPayload; chip::Optional mTimeout; - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + CHIP_ERROR TestRebootTargetDevice_0() { + SetIdentity("alpha"); + Reboot(mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThCr1StartsACommissioningProcessWithDutCe_1() + { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsMandatoryAttributeConstrainsOccupancy_1() + CHIP_ERROR TestThCr1OpensACommissioningWindowOnDutCe_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestAdministratorCommissioning * cluster = [[CHIPTestAdministratorCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOccupancyWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads mandatory attribute constrains: Occupancy Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + __auto_type * params = [[CHIPAdministratorCommissioningClusterOpenBasicCommissioningWindowParams alloc] init]; + params.commissioningTimeout = [NSNumber numberWithUnsignedShort:180U]; + [cluster openBasicCommissioningWindowWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH_CR1 opens a commissioning window on DUT_CE Error: %@", err); - VerifyOrReturn(CheckConstraintType("occupancy", "", "map8")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("occupancy", [value unsignedCharValue], 0)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("occupancy", [value unsignedCharValue], 1)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesTheRespectiveDefaultValueToMandatoryAttributeOccupancy_2() + CHIP_ERROR TestThCr1WritesTheBasicInformationClustersNodeLabelMandatoryAttributeOfDutCe_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing 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 occupancyArgument; - occupancyArgument = [NSNumber numberWithUnsignedChar:0]; - [cluster writeAttributeOccupancyWithValue:occupancyArgument + id nodeLabelArgument; + nodeLabelArgument = @"chiptest"; + [cluster writeAttributeNodeLabelWithValue:nodeLabelArgument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes the respective default value to mandatory attribute: Occupancy Error: %@", err); + NSLog(@"TH_CR1 writes the Basic Information Clusters NodeLabel mandatory attribute of DUT_CE " + @"Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsBackMandatoryAttributeOccupancy_3() + CHIP_ERROR TestThCr1ReadsTheBasicInformationClustersNodeLabelMandatoryAttributeOfDutCe_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing 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 readAttributeOccupancyWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads back mandatory attribute: Occupancy Error: %@", err); + [cluster readAttributeNodeLabelWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH_CR1 reads the Basic Information Clusters NodeLabel mandatory attribute of DUT_CE Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("occupancy", actualValue, 0)); - } - + VerifyOrReturn(CheckConstraintType("nodeLabel", "", "string")); + VerifyOrReturn(CheckConstraintMaxLength("nodeLabel", [value length], 32)); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsMandatoryAttributeConstrainsOccupancySensorType_4() + CHIP_ERROR TestCommissionFromBeta_5() { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeOccupancySensorTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads mandatory attribute constrains: OccupancySensorType Error: %@", err); + SetIdentity("beta"); + PairWithQRCode(mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL, + mPayload.HasValue() ? mPayload.Value() : chip::CharSpan::fromCharString("MT:-24J0AFN00KA0648G00")); + return CHIP_NO_ERROR; + } - VerifyOrReturn(CheckValue("status", err, 0)); + CHIP_ERROR TestThCr2StartsACommissioningProcessWithDutCe_6() + { + SetIdentity("beta"); + WaitForCommissionee(mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL); + return CHIP_NO_ERROR; + } - VerifyOrReturn(CheckConstraintType("occupancySensorType", "", "enum8")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("occupancySensorType", [value unsignedCharValue], 0)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("occupancySensorType", [value unsignedCharValue], 3)); - } + CHIP_ERROR TestQueryFabricsList_7() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - NextTest(); - }]; + 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); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("Fabrics", [actualValue count], static_cast(1))); + VerifyOrReturn(CheckValueAsString("Label", + ((CHIPOperationalCredentialsClusterFabricDescriptor *) actualValue[0]).label, @"")); + } + + VerifyOrReturn(CheckConstraintType("fabrics", "", "list")); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesTheRespectiveDefaultValueToMandatoryAttributeOccupancySensorType_5() + CHIP_ERROR TestQueryFabricsList_8() { + SetIdentity("beta"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing 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 occupancySensorTypeArgument; - occupancySensorTypeArgument = [NSNumber numberWithUnsignedChar:0]; - [cluster writeAttributeOccupancySensorTypeWithValue:occupancySensorTypeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes the respective default value to mandatory attribute: " - @"OccupancySensorType Error: %@", - err); + 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); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("Fabrics", [actualValue count], static_cast(1))); + VerifyOrReturn(CheckValueAsString("Label", + ((CHIPOperationalCredentialsClusterFabricDescriptor *) actualValue[0]).label, @"")); + } + + VerifyOrReturn(CheckConstraintType("fabrics", "", "list")); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsBackMandatoryAttributeOccupancySensorType_6() + CHIP_ERROR TestThCr1WritesTheBasicInformationClustersNodeLabelMandatoryAttributeOfDutCe_9() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing 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 readAttributeOccupancySensorTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads back mandatory attribute: OccupancySensorType Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id nodeLabelArgument; + nodeLabelArgument = @"chiptest"; + [cluster writeAttributeNodeLabelWithValue:nodeLabelArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH_CR1 writes the Basic Information Clusters NodeLabel mandatory attribute of DUT_CE " + @"Error: %@", + err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("occupancy sensor type", actualValue, 0)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsMandatoryAttributeConstrainsOccupancySensorTypeBitmap_7() + CHIP_ERROR TestThCr1ReadsTheBasicInformationClustersNodeLabelMandatoryAttributeOfDutCe_10() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing 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 - readAttributeOccupancySensorTypeBitmapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads mandatory attribute constrains: OccupancySensorTypeBitmap Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + [cluster readAttributeNodeLabelWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH_CR1 reads the Basic Information Clusters NodeLabel mandatory attribute of DUT_CE Error: %@", err); - VerifyOrReturn(CheckConstraintType("occupancySensorTypeBitmap", "", "map8")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("occupancySensorTypeBitmap", [value unsignedCharValue], 1)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("occupancySensorTypeBitmap", [value unsignedCharValue], 7)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("nodeLabel", "", "string")); + VerifyOrReturn(CheckConstraintMaxLength("nodeLabel", [value length], 32)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesTheRespectiveDefaultValueToMandatoryAttributeOccupancySensorTypeBitmap_8() + CHIP_ERROR TestThCr1WritesTheBasicInformationClustersNodeLabelMandatoryAttributeOfDutCe_11() { + SetIdentity("beta"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing 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 occupancySensorTypeBitmapArgument; - occupancySensorTypeBitmapArgument = [NSNumber numberWithUnsignedChar:1]; - [cluster writeAttributeOccupancySensorTypeBitmapWithValue:occupancySensorTypeBitmapArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes the respective default value to mandatory attribute: " - @"OccupancySensorTypeBitmap Error: %@", - err); + id nodeLabelArgument; + nodeLabelArgument = @"chiptest"; + [cluster writeAttributeNodeLabelWithValue:nodeLabelArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH_CR1 writes the Basic Information Clusters NodeLabel mandatory attribute of DUT_CE " + @"Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsBackMandatoryAttributeOccupancySensorTypeBitmap_9() + CHIP_ERROR TestThCr1ReadsTheBasicInformationClustersNodeLabelMandatoryAttributeOfDutCe_12() { + SetIdentity("beta"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing 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 - readAttributeOccupancySensorTypeBitmapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads back mandatory attribute: OccupancySensorTypeBitmap Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + [cluster readAttributeNodeLabelWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH_CR1 reads the Basic Information Clusters NodeLabel mandatory attribute of DUT_CE Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("occupancy sensor type bitmap", actualValue, 1)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("nodeLabel", "", "string")); + VerifyOrReturn(CheckConstraintMaxLength("nodeLabel", [value length], 32)); + NextTest(); + }]; return CHIP_NO_ERROR; } }; -class Test_TC_OCC_2_2 : public TestCommandBridge { +class Test_TC_MF_1_5 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_OCC_2_2() - : TestCommandBridge("Test_TC_OCC_2_2") + Test_TC_MF_1_5() + : TestCommandBridge("Test_TC_MF_1_5") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + AddArgument("nodeIdForDuplicateCommissioning", 0, UINT64_MAX, &mNodeIdForDuplicateCommissioning); + AddArgument("nodeId2", 0, UINT64_MAX, &mNodeId2); + AddArgument("nodeId3", 0, UINT64_MAX, &mNodeId3); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("discriminator", 0, UINT16_MAX, &mDiscriminator); + AddArgument("payload", &mPayload); } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_OCC_2_2() {} + ~Test_TC_MF_1_5() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -28217,11 +32801,11 @@ class Test_TC_OCC_2_2 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_OCC_2_2\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MF_1_5\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OCC_2_2\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MF_1_5\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -28234,24 +32818,68 @@ class Test_TC_OCC_2_2 : 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 : Reboot target device\n"); + err = TestRebootTargetDevice_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Reads Occupancy attribute from DUT\n"); - if (ShouldSkip("A_OCCUPANCY")) { - NextTest(); - return; - } - err = TestReadsOccupancyAttributeFromDut_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : TH_CR1 starts a commissioning process with DUT_CE\n"); + err = TestThCr1StartsACommissioningProcessWithDutCe_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Reads back Occupancy attribute from DUT after few seconds\n"); - if (ShouldSkip("A_OCCUPANCY")) { - NextTest(); - return; - } - err = TestReadsBackOccupancyAttributeFromDutAfterFewSeconds_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : TH_CR1 opens a new commissioning window on DUT_CE\n"); + err = TestThCr1OpensANewCommissioningWindowOnDutCe_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Wait for PIXIT_COMM_WIN(180) + 10 seconds\n"); + err = TestWaitForPixitCommWin18010Seconds_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Wait for PIXIT_COMM_WIN(180) + 10 seconds\n"); + err = TestWaitForPixitCommWin18010Seconds_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Wait for PIXIT_COMM_WIN(180) + 10 seconds\n"); + err = TestWaitForPixitCommWin18010Seconds_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Wait for PIXIT_COMM_WIN(180) + 10 seconds\n"); + err = TestWaitForPixitCommWin18010Seconds_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : TH_CR2 starts a commissioning process with DUT_CE\n"); + err = TestThCr2StartsACommissioningProcessWithDutCe_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : TH_CR1 opens a new commissioning window on DUT_CE\n"); + err = TestThCr1OpensANewCommissioningWindowOnDutCe_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : TH_CR1 revokes the commissioning window on DUT_CE\n"); + err = TestThCr1RevokesTheCommissioningWindowOnDutCe_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : TH_CR2 starts a commissioning process with DUT_CE\n"); + err = TestThCr2StartsACommissioningProcessWithDutCe_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : TH_CR1 revokes the commissioning window on DUT_CE\n"); + err = TestThCr1RevokesTheCommissioningWindowOnDutCe_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : TH_CR1 writes the mandatory attribute NodeLabel of DUT_CE\n"); + err = TestThCr1WritesTheMandatoryAttributeNodeLabelOfDutCe_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : TH_CR1 read the mandatory attribute NodeLabel of DUT_CE\n"); + err = TestThCr1ReadTheMandatoryAttributeNodeLabelOfDutCe_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : TH_CR1 opens a new commissioning window on DUT_CE\n"); + err = TestThCr1OpensANewCommissioningWindowOnDutCe_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : TH_CR3 starts a commissioning process with DUT_CE\n"); + err = TestThCr3StartsACommissioningProcessWithDutCe_15(); break; } @@ -28261,334 +32889,343 @@ class Test_TC_OCC_2_2 : public TestCommandBridge { } } - chip::System::Clock::Timeout GetWaitDuration() const override + void OnStatusUpdate(const chip::app::StatusIB & status) override { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + } + + // Go on to the next test. + WaitForMs(0); } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(300)); } + private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 3; + const uint16_t mTestCount = 16; chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; chip::Optional mTimeout; + chip::Optional mNodeIdForDuplicateCommissioning; + chip::Optional mNodeId2; + chip::Optional mNodeId3; + chip::Optional mEndpoint; + chip::Optional mDiscriminator; + chip::Optional mPayload; - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + CHIP_ERROR TestRebootTargetDevice_0() { - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + SetIdentity("alpha"); + Reboot(mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U); return CHIP_NO_ERROR; } - NSNumber * _Nonnull OccupancyValue; - CHIP_ERROR TestReadsOccupancyAttributeFromDut_1() + CHIP_ERROR TestThCr1StartsACommissioningProcessWithDutCe_1() { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeOccupancyWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads Occupancy attribute from DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("occupancy", actualValue, 0)); - } - { - OccupancyValue = value; - } - - NextTest(); - }]; - + SetIdentity("alpha"); + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsBackOccupancyAttributeFromDutAfterFewSeconds_2() + CHIP_ERROR TestThCr1OpensANewCommissioningWindowOnDutCe_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestAdministratorCommissioning * cluster = [[CHIPTestAdministratorCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOccupancyWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads back Occupancy attribute from DUT after few seconds Error: %@", err); + __auto_type * params = [[CHIPAdministratorCommissioningClusterOpenCommissioningWindowParams alloc] init]; + params.commissioningTimeout = [NSNumber numberWithUnsignedShort:180U]; + params.pakeVerifier = + [[NSData alloc] initWithBytes:"\006\307V\337\374\327\042e4R\241-\315\224]\214T\332+\017<\275\033M\303\361\255\262#" + "\256\262k\004|\322L\226\206o\227\233\035\203\354P\342\264\2560\315\362\375\263+" + "\330\242\021\2707\334\224\355\315V\364\321Cw\031\020v\277\305\235\231\267\3350S\357\326" + "\360,D4\362\275\322z\244\371\316\247\015s\216L" + length:97]; + params.discriminator = [NSNumber numberWithUnsignedShort:3840U]; + params.iterations = [NSNumber numberWithUnsignedInt:1000UL]; + params.salt = [[NSData alloc] initWithBytes:"SPAKE2P Key Salt" length:16]; + [cluster openCommissioningWindowWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH_CR1 opens a new commissioning window on DUT_CE Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } -}; -class Test_TC_OO_1_1 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_OO_1_1() - : TestCommandBridge("Test_TC_OO_1_1") - , mTestIndex(0) + CHIP_ERROR TestWaitForPixitCommWin18010Seconds_3() { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + SetIdentity("alpha"); + WaitForMs(54000); + return CHIP_NO_ERROR; } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - - ~Test_TC_OO_1_1() {} - /////////// TestCommand Interface ///////// - void NextTest() override + CHIP_ERROR TestWaitForPixitCommWin18010Seconds_4() { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_OO_1_1\n"); - } - - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OO_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: AttributeList\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { - NextTest(); - return; - } - err = TestReadTheGlobalAttributeAttributeList_2(); - break; - case 3: - ChipLogProgress(chipTool, - " ***** Test Step 3 : 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_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read the global attribute: AcceptedCommandList\n"); - if (ShouldSkip("OO_LT")) { - NextTest(); - return; - } - 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 6 : read the optional global attribute: FeatureMap\n"); - if (ShouldSkip("OO_LT")) { - NextTest(); - return; - } - err = TestReadTheOptionalGlobalAttributeFeatureMap_6(); - break; - } - - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + SetIdentity("alpha"); + WaitForMs(54000); + return CHIP_NO_ERROR; } - chip::System::Clock::Timeout GetWaitDuration() const override + CHIP_ERROR TestWaitForPixitCommWin18010Seconds_5() { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + SetIdentity("alpha"); + WaitForMs(54000); + return CHIP_NO_ERROR; } -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 TestWaitForPixitCommWin18010Seconds_6() + { + SetIdentity("alpha"); + WaitForMs(28000); + return CHIP_NO_ERROR; + } - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + CHIP_ERROR TestThCr2StartsACommissioningProcessWithDutCe_7() { - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + SetIdentity("beta"); + PairWithQRCode(mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL, + mPayload.HasValue() ? mPayload.Value() : chip::CharSpan::fromCharString("MT:-24J0AFN00KA0648G00")); return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + CHIP_ERROR TestThCr1OpensANewCommissioningWindowOnDutCe_8() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestAdministratorCommissioning * cluster = [[CHIPTestAdministratorCommissioning alloc] initWithDevice:device + endpoint:0 + 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)); + __auto_type * params = [[CHIPAdministratorCommissioningClusterOpenCommissioningWindowParams alloc] init]; + params.commissioningTimeout = [NSNumber numberWithUnsignedShort:180U]; + params.pakeVerifier = + [[NSData alloc] initWithBytes:"\006\307V\337\374\327\042e4R\241-\315\224]\214T\332+\017<\275\033M\303\361\255\262#" + "\256\262k\004|\322L\226\206o\227\233\035\203\354P\342\264\2560\315\362\375\263+" + "\330\242\021\2707\334\224\355\315V\364\321Cw\031\020v\277\305\235\231\267\3350S\357\326" + "\360,D4\362\275\322z\244\371\316\247\015s\216L" + length:97]; + params.discriminator = [NSNumber numberWithUnsignedShort:3840U]; + params.iterations = [NSNumber numberWithUnsignedInt:1000UL]; + params.salt = [[NSData alloc] initWithBytes:"SPAKE2P Key Salt" length:16]; + [cluster openCommissioningWindowWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH_CR1 opens a new commissioning window on DUT_CE Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 4U)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAttributeList_2() + CHIP_ERROR TestThCr1RevokesTheCommissioningWindowOnDutCe_9() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestAdministratorCommissioning * cluster = [[CHIPTestAdministratorCommissioning alloc] initWithDevice:device + endpoint:0 + 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); + [cluster revokeCommissioningWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"TH_CR1 revokes the commissioning window on DUT_CE Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("AttributeList", [actualValue count], static_cast(5))); - VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); - VerifyOrReturn(CheckValue("", actualValue[1], 16384UL)); - VerifyOrReturn(CheckValue("", actualValue[2], 16385UL)); - VerifyOrReturn(CheckValue("", actualValue[3], 16386UL)); - VerifyOrReturn(CheckValue("", actualValue[4], 16387UL)); - } - - VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_3() + CHIP_ERROR TestThCr2StartsACommissioningProcessWithDutCe_10() { - UserPrompt(@"Please enter 'y' for success", @"y"); + SetIdentity("beta"); + PairWithQRCode(mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL, + mPayload.HasValue() ? mPayload.Value() : chip::CharSpan::fromCharString("MT:-24J0AFN00KA0648G00")); return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_4() + CHIP_ERROR TestThCr1RevokesTheCommissioningWindowOnDutCe_11() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestAdministratorCommissioning * cluster = [[CHIPTestAdministratorCommissioning alloc] initWithDevice:device + endpoint:0 + 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(6))); - VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); - VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); - VerifyOrReturn(CheckValue("", actualValue[2], 2UL)); - VerifyOrReturn(CheckValue("", actualValue[3], 64UL)); - VerifyOrReturn(CheckValue("", actualValue[4], 65UL)); - VerifyOrReturn(CheckValue("", actualValue[5], 66UL)); - } + [cluster revokeCommissioningWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"TH_CR1 revokes the commissioning window on DUT_CE Error: %@", err); - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_FAILURE)); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_5() + CHIP_ERROR TestThCr1WritesTheMandatoryAttributeNodeLabelOfDutCe_12() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff 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 readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id nodeLabelArgument; + nodeLabelArgument = @"chiptest"; + [cluster writeAttributeNodeLabelWithValue:nodeLabelArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH_CR1 writes the mandatory attribute NodeLabel of DUT_CE Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); - } + VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalGlobalAttributeFeatureMap_6() + CHIP_ERROR TestThCr1ReadTheMandatoryAttributeNodeLabelOfDutCe_13() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff 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 readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional global attribute: FeatureMap Error: %@", err); + [cluster readAttributeNodeLabelWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH_CR1 read the mandatory attribute NodeLabel of DUT_CE Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("FeatureMap", actualValue, 1UL)); + VerifyOrReturn(CheckValueAsString("NodeLabel", actualValue, @"chiptest")); } - VerifyOrReturn(CheckConstraintType("featureMap", "", "map32")); NextTest(); }]; return CHIP_NO_ERROR; } -}; -class Test_TC_OO_2_1 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_OO_2_1() - : TestCommandBridge("Test_TC_OO_2_1") - , mTestIndex(0) + CHIP_ERROR TestThCr1OpensANewCommissioningWindowOnDutCe_14() { - 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_OO_2_1() {} + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestAdministratorCommissioning * cluster = [[CHIPTestAdministratorCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPAdministratorCommissioningClusterOpenCommissioningWindowParams alloc] init]; + params.commissioningTimeout = [NSNumber numberWithUnsignedShort:180U]; + params.pakeVerifier = + [[NSData alloc] initWithBytes:"\006\307V\337\374\327\042e4R\241-\315\224]\214T\332+\017<\275\033M\303\361\255\262#" + "\256\262k\004|\322L\226\206o\227\233\035\203\354P\342\264\2560\315\362\375\263+" + "\330\242\021\2707\334\224\355\315V\364\321Cw\031\020v\277\305\235\231\267\3350S\357\326" + "\360,D4\362\275\322z\244\371\316\247\015s\216L" + length:97]; + params.discriminator = [NSNumber numberWithUnsignedShort:3840U]; + params.iterations = [NSNumber numberWithUnsignedInt:1000UL]; + params.salt = [[NSData alloc] initWithBytes:"SPAKE2P Key Salt" length:16]; + [cluster openCommissioningWindowWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH_CR1 opens a new commissioning window on DUT_CE Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThCr3StartsACommissioningProcessWithDutCe_15() + { + SetIdentity("gamma"); + PairWithQRCode(mNodeId3.HasValue() ? mNodeId3.Value() : 12586990ULL, + mPayload.HasValue() ? mPayload.Value() : chip::CharSpan::fromCharString("MT:-24J0AFN00KA0648G00")); + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MF_1_6 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_MF_1_6() + : TestCommandBridge("Test_TC_MF_1_6") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + AddArgument("nodeIdForDuplicateCommissioning", 0, UINT64_MAX, &mNodeIdForDuplicateCommissioning); + AddArgument("nodeId2", 0, UINT64_MAX, &mNodeId2); + AddArgument("nodeId3", 0, UINT64_MAX, &mNodeId3); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("discriminator", 0, UINT16_MAX, &mDiscriminator); + AddArgument("payload", &mPayload); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_MF_1_6() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -28596,11 +33233,11 @@ class Test_TC_OO_2_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_OO_2_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MF_1_6\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OO_2_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MF_1_6\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -28613,28 +33250,76 @@ class Test_TC_OO_2_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 : Reboot target device\n"); + err = TestRebootTargetDevice_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : read the mandatory attribute: OnOff\n"); - err = TestReadTheMandatoryAttributeOnOff_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : TH_CR1 starts a commissioning process with DUT_CE\n"); + err = TestThCr1StartsACommissioningProcessWithDutCe_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : read LT attribute: GlobalSceneControl\n"); - err = TestReadLtAttributeGlobalSceneControl_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : TH_CR1 opens a commissioning window on DUT_CE\n"); + err = TestThCr1OpensACommissioningWindowOnDutCe_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : read LT attribute: OnTime\n"); - err = TestReadLtAttributeOnTime_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Wait for PIXIT_COMM_WIN(180) + 10\n"); + err = TestWaitForPixitCommWin18010_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : read LT attribute: OffWaitTime\n"); - err = TestReadLtAttributeOffWaitTime_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Wait for PIXIT_COMM_WIN(180) + 10\n"); + err = TestWaitForPixitCommWin18010_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : read LT attribute: StartUpOnOff\n"); - err = TestReadLtAttributeStartUpOnOff_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Wait for PIXIT_COMM_WIN(180) + 10\n"); + err = TestWaitForPixitCommWin18010_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Wait for PIXIT_COMM_WIN(180) + 10\n"); + err = TestWaitForPixitCommWin18010_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Commission from beta\n"); + err = TestCommissionFromBeta_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : TH_CR1 opens a commissioning window on DUT_CE\n"); + err = TestThCr1OpensACommissioningWindowOnDutCe_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : TH_CR1 revokes the commissioning window on DUT_CE\n"); + err = TestThCr1RevokesTheCommissioningWindowOnDutCe_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Commission from beta\n"); + err = TestCommissionFromBeta_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : TH_CR1 revokes the commissioning window on DUT_CE\n"); + err = TestThCr1RevokesTheCommissioningWindowOnDutCe_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : TH_CR1 writes the mandatory attribute NodeLabel of DUT_CE\n"); + err = TestThCr1WritesTheMandatoryAttributeNodeLabelOfDutCe_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : TH_CR1 read the mandatory attribute NodeLabel of DUT_CE\n"); + err = TestThCr1ReadTheMandatoryAttributeNodeLabelOfDutCe_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : TH_CR1 opens a commissioning window on DUT_CE\n"); + err = TestThCr1OpensACommissioningWindowOnDutCe_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Commission from beta\n"); + err = TestCommissionFromBeta_15(); + break; + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : TH_CR2 starts a commissioning process on DUT_CE\n"); + err = TestThCr2StartsACommissioningProcessOnDutCe_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : TH_CR3 starts a commissioning process with DUT_CE\n"); + err = TestThCr3StartsACommissioningProcessWithDutCe_17(); break; } @@ -28644,152 +33329,337 @@ class Test_TC_OO_2_1 : public TestCommandBridge { } } - chip::System::Clock::Timeout GetWaitDuration() const override + void OnStatusUpdate(const chip::app::StatusIB & status) override { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + } + + // Go on to the next test. + WaitForMs(0); } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(300)); } + private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 6; + const uint16_t mTestCount = 18; chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; chip::Optional mTimeout; + chip::Optional mNodeIdForDuplicateCommissioning; + chip::Optional mNodeId2; + chip::Optional mNodeId3; + chip::Optional mEndpoint; + chip::Optional mDiscriminator; + chip::Optional mPayload; - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + CHIP_ERROR TestRebootTargetDevice_0() + { + SetIdentity("alpha"); + Reboot(mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThCr1StartsACommissioningProcessWithDutCe_1() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheMandatoryAttributeOnOff_1() + CHIP_ERROR TestThCr1OpensACommissioningWindowOnDutCe_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestAdministratorCommissioning * cluster = [[CHIPTestAdministratorCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: OnOff Error: %@", err); + __auto_type * params = [[CHIPAdministratorCommissioningClusterOpenBasicCommissioningWindowParams alloc] init]; + params.commissioningTimeout = [NSNumber numberWithUnsignedShort:180U]; + [cluster openBasicCommissioningWindowWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH_CR1 opens a commissioning window on DUT_CE Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("onOff", "", "bool")); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadLtAttributeGlobalSceneControl_2() + CHIP_ERROR TestWaitForPixitCommWin18010_3() + { + SetIdentity("alpha"); + WaitForMs(54000); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWaitForPixitCommWin18010_4() + { + SetIdentity("alpha"); + WaitForMs(54000); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWaitForPixitCommWin18010_5() + { + SetIdentity("alpha"); + WaitForMs(54000); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWaitForPixitCommWin18010_6() + { + SetIdentity("alpha"); + WaitForMs(28000); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCommissionFromBeta_7() + { + SetIdentity("beta"); + PairWithQRCode(mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL, + mPayload.HasValue() ? mPayload.Value() : chip::CharSpan::fromCharString("MT:-24J0AFN00KA0648G00")); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThCr1OpensACommissioningWindowOnDutCe_8() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestAdministratorCommissioning * cluster = [[CHIPTestAdministratorCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeGlobalSceneControlWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read LT attribute: GlobalSceneControl Error: %@", err); + __auto_type * params = [[CHIPAdministratorCommissioningClusterOpenBasicCommissioningWindowParams alloc] init]; + params.commissioningTimeout = [NSNumber numberWithUnsignedShort:180U]; + [cluster openBasicCommissioningWindowWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH_CR1 opens a commissioning window on DUT_CE Error: %@", err); - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThCr1RevokesTheCommissioningWindowOnDutCe_9() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestAdministratorCommissioning * cluster = [[CHIPTestAdministratorCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster revokeCommissioningWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"TH_CR1 revokes the commissioning window on DUT_CE Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("globalSceneControl", "", "bool")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadLtAttributeOnTime_3() + CHIP_ERROR TestCommissionFromBeta_10() + { + SetIdentity("beta"); + PairWithQRCode(mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL, + mPayload.HasValue() ? mPayload.Value() : chip::CharSpan::fromCharString("MT:-24J0AFN00KA0648G00")); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThCr1RevokesTheCommissioningWindowOnDutCe_11() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestAdministratorCommissioning * cluster = [[CHIPTestAdministratorCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read LT attribute: OnTime Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - - VerifyOrReturn(CheckValue("status", err, 0)); + [cluster revokeCommissioningWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"TH_CR1 revokes the commissioning window on DUT_CE Error: %@", err); - VerifyOrReturn(CheckConstraintType("onTime", "", "uint16")); + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_FAILURE)); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadLtAttributeOffWaitTime_4() + CHIP_ERROR TestThCr1WritesTheMandatoryAttributeNodeLabelOfDutCe_12() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff 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 readAttributeOffWaitTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read LT attribute: OffWaitTime Error: %@", err); + id nodeLabelArgument; + nodeLabelArgument = @"chiptest"; + [cluster writeAttributeNodeLabelWithValue:nodeLabelArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH_CR1 writes the mandatory attribute NodeLabel of DUT_CE Error: %@", err); - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThCr1ReadTheMandatoryAttributeNodeLabelOfDutCe_13() + { + SetIdentity("alpha"); + 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(@"TH_CR1 read the mandatory attribute NodeLabel of DUT_CE Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("offWaitTime", "", "uint16")); + { + id actualValue = value; + VerifyOrReturn(CheckValueAsString("NodeLabel", actualValue, @"chiptest")); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadLtAttributeStartUpOnOff_5() + CHIP_ERROR TestThCr1OpensACommissioningWindowOnDutCe_14() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestAdministratorCommissioning * cluster = [[CHIPTestAdministratorCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeStartUpOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read LT attribute: StartUpOnOff Error: %@", err); + __auto_type * params = [[CHIPAdministratorCommissioningClusterOpenBasicCommissioningWindowParams alloc] init]; + params.commissioningTimeout = [NSNumber numberWithUnsignedShort:180U]; + [cluster openBasicCommissioningWindowWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH_CR1 opens a commissioning window on DUT_CE Error: %@", err); - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckValue("status", err, 0)); + NextTest(); + }]; - VerifyOrReturn(CheckConstraintType("startUpOnOff", "", "enum8")); - NextTest(); - }]; + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCommissionFromBeta_15() + { + SetIdentity("beta"); + PairWithQRCode(mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL, + mPayload.HasValue() ? mPayload.Value() : chip::CharSpan::fromCharString("MT:-24J0AFN00KA0648G00")); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThCr2StartsACommissioningProcessOnDutCe_16() + { + SetIdentity("beta"); + WaitForCommissionee(mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL); + return CHIP_NO_ERROR; + } + CHIP_ERROR TestThCr3StartsACommissioningProcessWithDutCe_17() + { + SetIdentity("gamma"); + PairWithQRCode(mNodeId3.HasValue() ? mNodeId3.Value() : 12586990ULL, + mPayload.HasValue() ? mPayload.Value() : chip::CharSpan::fromCharString("MT:-24J0AFN00KA0648G00")); return CHIP_NO_ERROR; } }; -class Test_TC_OO_2_2 : public TestCommandBridge { +class Test_TC_MF_1_15 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_OO_2_2() - : TestCommandBridge("Test_TC_OO_2_2") + Test_TC_MF_1_15() + : TestCommandBridge("Test_TC_MF_1_15") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + AddArgument("nodeIdForDuplicateCommissioning", 0, UINT64_MAX, &mNodeIdForDuplicateCommissioning); + AddArgument("nodeId2", 0, UINT64_MAX, &mNodeId2); + AddArgument("nodeId3", 0, UINT64_MAX, &mNodeId3); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("discriminator", 0, UINT16_MAX, &mDiscriminator); + AddArgument("payload", &mPayload); } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_OO_2_2() {} + ~Test_TC_MF_1_15() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -28797,11 +33667,11 @@ class Test_TC_OO_2_2 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_OO_2_2\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MF_1_15\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OO_2_2\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MF_1_15\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -28814,88 +33684,100 @@ class Test_TC_OO_2_2 : 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 : Reboot target device\n"); + err = TestRebootTargetDevice_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Send Off Command\n"); - err = TestSendOffCommand_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : TH_CR1 starts a commissioning process with DUT_CE\n"); + err = TestThCr1StartsACommissioningProcessWithDutCe_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : TH_CR1 opens a commissioning window on DUT_CE\n"); + err = TestThCr1OpensACommissioningWindowOnDutCe_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Send On Command\n"); - err = TestSendOnCommand_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Commission from gamma\n"); + err = TestCommissionFromGamma_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Check on/off attribute value is true after on command\n"); - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : TH_CR3 starts a commissioning process with DUT_CE\n"); + err = TestThCr3StartsACommissioningProcessWithDutCe_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Send On Command\n"); - err = TestSendOnCommand_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : TH_CR1 opens a commissioning window on DUT_CE\n"); + err = TestThCr1OpensACommissioningWindowOnDutCe_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Check on/off attribute value is true after on command\n"); - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : Commission from beta\n"); + err = TestCommissionFromBeta_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Send Off Command\n"); - err = TestSendOffCommand_7(); + ChipLogProgress(chipTool, " ***** Test Step 7 : TH_CR2 starts a commissioning process with DUT_CE\n"); + err = TestThCr2StartsACommissioningProcessWithDutCe_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_8(); + ChipLogProgress(chipTool, " ***** Test Step 8 : TH_CR1 opens a commissioning window on DUT_CE\n"); + err = TestThCr1OpensACommissioningWindowOnDutCe_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Send Off Command\n"); - err = TestSendOffCommand_9(); + ChipLogProgress(chipTool, " ***** Test Step 9 : TH_CR1 opens a new commissioning window on DUT_CE\n"); + err = TestThCr1OpensANewCommissioningWindowOnDutCe_9(); break; case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_10(); + ChipLogProgress(chipTool, " ***** Test Step 10 : TH_CR1 reads the list of Fabrics on DUT_CE\n"); + err = TestThCr1ReadsTheListOfFabricsOnDutCe_10(); break; case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Send Toggle Command\n"); - err = TestSendToggleCommand_11(); + ChipLogProgress(chipTool, " ***** Test Step 11 : Wait for the expiration of PIXIT_COMM_WIN seconds\n"); + err = TestWaitForTheExpirationOfPixitCommWinSeconds_11(); break; case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Wait 1000ms\n"); - err = TestWait1000ms_12(); + ChipLogProgress(chipTool, " ***** Test Step 12 : Wait for the expiration of PIXIT_COMM_WIN seconds\n"); + err = TestWaitForTheExpirationOfPixitCommWinSeconds_12(); break; case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Check on/off attribute value is true after toggle command\n"); - err = TestCheckOnOffAttributeValueIsTrueAfterToggleCommand_13(); + ChipLogProgress(chipTool, " ***** Test Step 13 : Wait for the expiration of PIXIT_COMM_WIN seconds\n"); + err = TestWaitForTheExpirationOfPixitCommWinSeconds_13(); break; case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Send Toggle Command\n"); - err = TestSendToggleCommand_14(); + ChipLogProgress(chipTool, " ***** Test Step 14 : Wait for the expiration of PIXIT_COMM_WIN seconds\n"); + err = TestWaitForTheExpirationOfPixitCommWinSeconds_14(); break; case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Wait 1000ms\n"); - err = TestWait1000ms_15(); + ChipLogProgress(chipTool, " ***** Test Step 15 : TH_CR1 re-opens new commissioning window on DUT_CE\n"); + err = TestThCr1ReOpensNewCommissioningWindowOnDutCe_15(); break; case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : Check on/off attribute value is false after toggle command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterToggleCommand_16(); + ChipLogProgress(chipTool, " ***** Test Step 16 : TH_CR3 opens a new commissioning window on DUT_CE\n"); + err = TestThCr3OpensANewCommissioningWindowOnDutCe_16(); break; case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : User prompt Set OnOff attribute manually to on\n"); - err = TestUserPromptSetOnOffAttributeManuallyToOn_17(); + ChipLogProgress(chipTool, " ***** Test Step 17 : TH_CR1 reads the list of Fabrics on DUT_CE\n"); + err = TestThCr1ReadsTheListOfFabricsOnDutCe_17(); break; case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : User prompt Set OnOff attribute manually to off\n"); - err = TestUserPromptSetOnOffAttributeManuallyToOff_18(); + ChipLogProgress(chipTool, " ***** Test Step 18 : Wait for the expiration of PIXIT_COMM_WIN seconds\n"); + err = TestWaitForTheExpirationOfPixitCommWinSeconds_18(); break; case 19: - ChipLogProgress(chipTool, " ***** Test Step 19 : Reset Off Command\n"); - err = TestResetOffCommand_19(); + ChipLogProgress(chipTool, " ***** Test Step 19 : Wait for the expiration of PIXIT_COMM_WIN seconds\n"); + err = TestWaitForTheExpirationOfPixitCommWinSeconds_19(); break; case 20: - ChipLogProgress(chipTool, " ***** Test Step 20 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_20(); + ChipLogProgress(chipTool, " ***** Test Step 20 : Wait for the expiration of PIXIT_COMM_WIN seconds\n"); + err = TestWaitForTheExpirationOfPixitCommWinSeconds_20(); + break; + case 21: + ChipLogProgress(chipTool, " ***** Test Step 21 : Wait for the expiration of PIXIT_COMM_WIN seconds\n"); + err = TestWaitForTheExpirationOfPixitCommWinSeconds_21(); + break; + case 22: + ChipLogProgress(chipTool, " ***** Test Step 22 : TH_CR1 opens a new commissioning window on DUT_CE\n"); + err = TestThCr1OpensANewCommissioningWindowOnDutCe_22(); + break; + case 23: + ChipLogProgress(chipTool, " ***** Test Step 23 : TH_CR2 opens a new commissioning window on DUT_CE\n"); + err = TestThCr2OpensANewCommissioningWindowOnDutCe_23(); break; } @@ -28905,258 +33787,674 @@ class Test_TC_OO_2_2 : public TestCommandBridge { } } - chip::System::Clock::Timeout GetWaitDuration() const override + void OnStatusUpdate(const chip::app::StatusIB & status) override { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + } + + // Go on to the next test. + WaitForMs(0); } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(500)); } + private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 21; + const uint16_t mTestCount = 24; chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; chip::Optional mTimeout; + chip::Optional mNodeIdForDuplicateCommissioning; + chip::Optional mNodeId2; + chip::Optional mNodeId3; + chip::Optional mEndpoint; + chip::Optional mDiscriminator; + chip::Optional mPayload; - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + CHIP_ERROR TestRebootTargetDevice_0() { - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + SetIdentity("alpha"); + Reboot(mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U); return CHIP_NO_ERROR; } - CHIP_ERROR TestSendOffCommand_1() + CHIP_ERROR TestThCr1StartsACommissioningProcessWithDutCe_1() { - 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(@"Send Off Command Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - + SetIdentity("alpha"); + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_2() + CHIP_ERROR TestThCr1OpensACommissioningWindowOnDutCe_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestAdministratorCommissioning * cluster = [[CHIPTestAdministratorCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + __auto_type * params = [[CHIPAdministratorCommissioningClusterOpenBasicCommissioningWindowParams alloc] init]; + params.commissioningTimeout = [NSNumber numberWithUnsignedShort:180U]; + [cluster openBasicCommissioningWindowWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH_CR1 opens a commissioning window on DUT_CE Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendOnCommand_3() + CHIP_ERROR TestCommissionFromGamma_3() { - 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(@"Send On Command Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; + SetIdentity("gamma"); + PairWithQRCode(mNodeId3.HasValue() ? mNodeId3.Value() : 12586990ULL, + mPayload.HasValue() ? mPayload.Value() : chip::CharSpan::fromCharString("MT:-24J0AFN00KA0648G00")); + return CHIP_NO_ERROR; + } + CHIP_ERROR TestThCr3StartsACommissioningProcessWithDutCe_4() + { + SetIdentity("gamma"); + WaitForCommissionee(mNodeId3.HasValue() ? mNodeId3.Value() : 12586990ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_4() + CHIP_ERROR TestThCr1OpensACommissioningWindowOnDutCe_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestAdministratorCommissioning * cluster = [[CHIPTestAdministratorCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is true after on command Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + __auto_type * params = [[CHIPAdministratorCommissioningClusterOpenBasicCommissioningWindowParams alloc] init]; + params.commissioningTimeout = [NSNumber numberWithUnsignedShort:180U]; + [cluster openBasicCommissioningWindowWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH_CR1 opens a commissioning window on DUT_CE Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendOnCommand_5() + CHIP_ERROR TestCommissionFromBeta_6() { - 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(@"Send On Command Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; + SetIdentity("beta"); + PairWithQRCode(mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL, + mPayload.HasValue() ? mPayload.Value() : chip::CharSpan::fromCharString("MT:-24J0AFN00KA0648G00")); + return CHIP_NO_ERROR; + } + CHIP_ERROR TestThCr2StartsACommissioningProcessWithDutCe_7() + { + SetIdentity("beta"); + WaitForCommissionee(mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_6() + CHIP_ERROR TestThCr1OpensACommissioningWindowOnDutCe_8() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestAdministratorCommissioning * cluster = [[CHIPTestAdministratorCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is true after on command Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + __auto_type * params = [[CHIPAdministratorCommissioningClusterOpenBasicCommissioningWindowParams alloc] init]; + params.commissioningTimeout = [NSNumber numberWithUnsignedShort:180U]; + [cluster openBasicCommissioningWindowWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH_CR1 opens a commissioning window on DUT_CE Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendOffCommand_7() + CHIP_ERROR TestThCr1OpensANewCommissioningWindowOnDutCe_9() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestAdministratorCommissioning * cluster = [[CHIPTestAdministratorCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Send Off Command Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + __auto_type * params = [[CHIPAdministratorCommissioningClusterOpenCommissioningWindowParams alloc] init]; + params.commissioningTimeout = [NSNumber numberWithUnsignedShort:180U]; + params.pakeVerifier = + [[NSData alloc] initWithBytes:"\006\307V\337\374\327\042e4R\241-\315\224]\214T\332+\017<\275\033M\303\361\255\262#" + "\256\262k\004|\322L\226\206o\227\233\035\203\354P\342\264\2560\315\362\375\263+" + "\330\242\021\2707\334\224\355\315V\364\321Cw\031\020v\277\305\235\231\267\3350S\357\326" + "\360,D4\362\275\322z\244\371\316\247\015s\216L" + length:97]; + params.discriminator = [NSNumber numberWithUnsignedShort:3840U]; + params.iterations = [NSNumber numberWithUnsignedInt:1000UL]; + params.salt = [[NSData alloc] initWithBytes:"SPAKE2P Key Salt" length:16]; + [cluster openCommissioningWindowWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH_CR1 opens a new commissioning window on DUT_CE Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_FAILURE)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_8() + CHIP_ERROR TestThCr1ReadsTheListOfFabricsOnDutCe_10() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff 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 readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); + CHIPReadParams * params = [[CHIPReadParams alloc] init]; + params.fabricFiltered = [NSNumber numberWithBool:false]; + [cluster readAttributeFabricsWithParams:params + completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH_CR1 reads the list of Fabrics on DUT_CE Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); - } + { + id actualValue = value; + VerifyOrReturn(CheckValue("Fabrics", [actualValue count], static_cast(3))); + VerifyOrReturn(CheckValueAsString("Label", + ((CHIPOperationalCredentialsClusterFabricDescriptor *) actualValue[0]).label, @"")); + VerifyOrReturn(CheckValueAsString("Label", + ((CHIPOperationalCredentialsClusterFabricDescriptor *) actualValue[1]).label, @"")); + VerifyOrReturn(CheckValueAsString("Label", + ((CHIPOperationalCredentialsClusterFabricDescriptor *) actualValue[2]).label, @"")); + } - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("fabrics", "", "list")); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendOffCommand_9() + CHIP_ERROR TestWaitForTheExpirationOfPixitCommWinSeconds_11() + { + SetIdentity("alpha"); + WaitForMs(54000); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWaitForTheExpirationOfPixitCommWinSeconds_12() + { + SetIdentity("alpha"); + WaitForMs(54000); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWaitForTheExpirationOfPixitCommWinSeconds_13() + { + SetIdentity("alpha"); + WaitForMs(54000); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWaitForTheExpirationOfPixitCommWinSeconds_14() + { + SetIdentity("alpha"); + WaitForMs(18000); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThCr1ReOpensNewCommissioningWindowOnDutCe_15() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestAdministratorCommissioning * cluster = [[CHIPTestAdministratorCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Send Off Command Error: %@", err); + __auto_type * params = [[CHIPAdministratorCommissioningClusterOpenCommissioningWindowParams alloc] init]; + params.commissioningTimeout = [NSNumber numberWithUnsignedShort:180U]; + params.pakeVerifier = + [[NSData alloc] initWithBytes:"\006\307V\337\374\327\042e4R\241-\315\224]\214T\332+\017<\275\033M\303\361\255\262#" + "\256\262k\004|\322L\226\206o\227\233\035\203\354P\342\264\2560\315\362\375\263+" + "\330\242\021\2707\334\224\355\315V\364\321Cw\031\020v\277\305\235\231\267\3350S\357\326" + "\360,D4\362\275\322z\244\371\316\247\015s\216L" + length:97]; + params.discriminator = [NSNumber numberWithUnsignedShort:3840U]; + params.iterations = [NSNumber numberWithUnsignedInt:1000UL]; + params.salt = [[NSData alloc] initWithBytes:"SPAKE2P Key Salt" length:16]; + [cluster openCommissioningWindowWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH_CR1 re-opens new commissioning window on DUT_CE Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_10() + CHIP_ERROR TestThCr3OpensANewCommissioningWindowOnDutCe_16() { + SetIdentity("gamma"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestAdministratorCommissioning * cluster = [[CHIPTestAdministratorCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); + __auto_type * params = [[CHIPAdministratorCommissioningClusterOpenCommissioningWindowParams alloc] init]; + params.commissioningTimeout = [NSNumber numberWithUnsignedShort:180U]; + params.pakeVerifier = + [[NSData alloc] initWithBytes:"\006\307V\337\374\327\042e4R\241-\315\224]\214T\332+\017<\275\033M\303\361\255\262#" + "\256\262k\004|\322L\226\206o\227\233\035\203\354P\342\264\2560\315\362\375\263+" + "\330\242\021\2707\334\224\355\315V\364\321Cw\031\020v\277\305\235\231\267\3350S\357\326" + "\360,D4\362\275\322z\244\371\316\247\015s\216L" + length:97]; + params.discriminator = [NSNumber numberWithUnsignedShort:3840U]; + params.iterations = [NSNumber numberWithUnsignedInt:1000UL]; + params.salt = [[NSData alloc] initWithBytes:"SPAKE2P Key Salt" length:16]; + [cluster openCommissioningWindowWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH_CR3 opens a new commissioning window on DUT_CE Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_FAILURE)); + NextTest(); + }]; - { - id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); - } + return CHIP_NO_ERROR; + } - NextTest(); - }]; + CHIP_ERROR TestThCr1ReadsTheListOfFabricsOnDutCe_17() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + CHIPReadParams * params = [[CHIPReadParams alloc] init]; + params.fabricFiltered = [NSNumber numberWithBool:false]; + [cluster readAttributeFabricsWithParams:params + completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH_CR1 reads the list of Fabrics on DUT_CE Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("Fabrics", [actualValue count], static_cast(3))); + VerifyOrReturn(CheckValueAsString("Label", + ((CHIPOperationalCredentialsClusterFabricDescriptor *) actualValue[0]).label, @"")); + VerifyOrReturn(CheckValueAsString("Label", + ((CHIPOperationalCredentialsClusterFabricDescriptor *) actualValue[1]).label, @"")); + VerifyOrReturn(CheckValueAsString("Label", + ((CHIPOperationalCredentialsClusterFabricDescriptor *) actualValue[2]).label, @"")); + } + + VerifyOrReturn(CheckConstraintType("fabrics", "", "list")); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendToggleCommand_11() + CHIP_ERROR TestWaitForTheExpirationOfPixitCommWinSeconds_18() + { + SetIdentity("alpha"); + WaitForMs(54000); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWaitForTheExpirationOfPixitCommWinSeconds_19() + { + SetIdentity("alpha"); + WaitForMs(54000); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWaitForTheExpirationOfPixitCommWinSeconds_20() + { + SetIdentity("alpha"); + WaitForMs(54000); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWaitForTheExpirationOfPixitCommWinSeconds_21() + { + SetIdentity("alpha"); + WaitForMs(18000); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThCr1OpensANewCommissioningWindowOnDutCe_22() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestAdministratorCommissioning * cluster = [[CHIPTestAdministratorCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster toggleWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Send Toggle Command Error: %@", err); + __auto_type * params = [[CHIPAdministratorCommissioningClusterOpenCommissioningWindowParams alloc] init]; + params.commissioningTimeout = [NSNumber numberWithUnsignedShort:180U]; + params.pakeVerifier = + [[NSData alloc] initWithBytes:"\006\307V\337\374\327\042e4R\241-\315\224]\214T\332+\017<\275\033M\303\361\255\262#" + "\256\262k\004|\322L\226\206o\227\233\035\203\354P\342\264\2560\315\362\375\263+" + "\330\242\021\2707\334\224\355\315V\364\321Cw\031\020v\277\305\235\231\267\3350S\357\326" + "\360,D4\362\275\322z\244\371\316\247\015s\216L" + length:97]; + params.discriminator = [NSNumber numberWithUnsignedShort:3840U]; + params.iterations = [NSNumber numberWithUnsignedInt:1000UL]; + params.salt = [[NSData alloc] initWithBytes:"SPAKE2P Key Salt" length:16]; + [cluster openCommissioningWindowWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH_CR1 opens a new commissioning window on DUT_CE Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWait1000ms_12() + CHIP_ERROR TestThCr2OpensANewCommissioningWindowOnDutCe_23() { - WaitForMs(1000); + SetIdentity("beta"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestAdministratorCommissioning * cluster = [[CHIPTestAdministratorCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPAdministratorCommissioningClusterOpenCommissioningWindowParams alloc] init]; + params.commissioningTimeout = [NSNumber numberWithUnsignedShort:180U]; + params.pakeVerifier = + [[NSData alloc] initWithBytes:"\006\307V\337\374\327\042e4R\241-\315\224]\214T\332+\017<\275\033M\303\361\255\262#" + "\256\262k\004|\322L\226\206o\227\233\035\203\354P\342\264\2560\315\362\375\263+" + "\330\242\021\2707\334\224\355\315V\364\321Cw\031\020v\277\305\235\231\267\3350S\357\326" + "\360,D4\362\275\322z\244\371\316\247\015s\216L" + length:97]; + params.discriminator = [NSNumber numberWithUnsignedShort:3840U]; + params.iterations = [NSNumber numberWithUnsignedInt:1000UL]; + params.salt = [[NSData alloc] initWithBytes:"SPAKE2P Key Salt" length:16]; + [cluster openCommissioningWindowWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH_CR2 opens a new commissioning window on DUT_CE Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_FAILURE)); + NextTest(); + }]; + return CHIP_NO_ERROR; } +}; - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterToggleCommand_13() +class Test_TC_OCC_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_OCC_1_1() + : TestCommandBridge("Test_TC_OCC_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_OCC_1_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_OCC_1_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OCC_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 : write the default values to mandatory global attribute: ClusterRevision\n"); + err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : reads back global attribute: ClusterRevision\n"); + err = TestReadsBackGlobalAttributeClusterRevision_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_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(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_8(); + break; + case 9: + ChipLogProgress( + chipTool, " ***** Test Step 9 : Read FeatureMap attribute from the DUT and Verify that the DUT response\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponse_9(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + + 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 = 10; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity("alpha"); + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is true after toggle command Error: %@", err); + [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("OnOff", actualValue, 1)); + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 3U)); } NextTest(); @@ -29165,43 +34463,68 @@ class Test_TC_OO_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestSendToggleCommand_14() + CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster toggleWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Send Toggle Command Error: %@", err); + [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 TestWait1000ms_15() + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3() { - WaitForMs(1000); + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id clusterRevisionArgument; + clusterRevisionArgument = [NSNumber numberWithUnsignedShort:3U]; + [cluster + writeAttributeClusterRevisionWithValue:clusterRevisionArgument + completionHandler:^(NSError * _Nullable err) { + NSLog( + @"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + NextTest(); + }]; + return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterToggleCommand_16() + CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is false after toggle command Error: %@", err); + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"reads back global attribute: ClusterRevision Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 3U)); } NextTest(); @@ -29210,63 +34533,89 @@ class Test_TC_OO_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestUserPromptSetOnOffAttributeManuallyToOn_17() + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_5() { - UserPrompt(@"Operate on device to set OnOff attribute manually to on"); + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing 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)); + + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); + NextTest(); + }]; + return CHIP_NO_ERROR; } - CHIP_ERROR TestUserPromptSetOnOffAttributeManuallyToOff_18() + CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_6() { - UserPrompt(@"Operate on device to set OnOff attribute manually to off"); + SetIdentity("alpha"); + UserPrompt(@"Please enter 'y' for success", @"y"); return CHIP_NO_ERROR; } - CHIP_ERROR TestResetOffCommand_19() + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_7() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Reset Off Command Error: %@", err); + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_20() + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_8() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is false after off command 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("OnOff", actualValue, 0)); - } - + VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } + + CHIP_ERROR TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponse_9() + { + SetIdentity("alpha"); + UserPrompt(@"Please enter '0' for success", @"0"); + return CHIP_NO_ERROR; + } }; -class Test_TC_OO_2_3 : public TestCommandBridge { +class Test_TC_OCC_2_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_OO_2_3() - : TestCommandBridge("Test_TC_OO_2_3") + Test_TC_OCC_2_1() + : TestCommandBridge("Test_TC_OCC_2_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -29276,7 +34625,7 @@ class Test_TC_OO_2_3 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_OO_2_3() {} + ~Test_TC_OCC_2_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -29284,11 +34633,11 @@ class Test_TC_OO_2_3 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_OO_2_3\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_OCC_2_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OO_2_3\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OCC_2_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -29305,367 +34654,89 @@ class Test_TC_OO_2_3 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Send On Command\n"); - if (ShouldSkip("CR_ON")) { - NextTest(); - return; - } - err = TestSendOnCommand_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Reads mandatory attribute constrains: Occupancy\n"); + err = TestReadsMandatoryAttributeConstrainsOccupancy_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Wait 1000ms\n"); - err = TestWait1000ms_2(); + ChipLogProgress( + chipTool, " ***** Test Step 2 : Writes the respective default value to mandatory attribute: Occupancy\n"); + err = TestWritesTheRespectiveDefaultValueToMandatoryAttributeOccupancy_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Reads OnOff attribute from DUT\n"); - if (ShouldSkip("A_ONOFF")) { - NextTest(); - return; - } - err = TestReadsOnOffAttributeFromDut_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Reads back mandatory attribute: Occupancy\n"); + err = TestReadsBackMandatoryAttributeOccupancy_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Reads GlobalSceneControl attribute from DUT\n"); - if (ShouldSkip("A_GLOBALSCENECONTROL")) { - NextTest(); - return; - } - err = TestReadsGlobalSceneControlAttributeFromDut_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Reads mandatory attribute constrains: OccupancySensorType\n"); + err = TestReadsMandatoryAttributeConstrainsOccupancySensorType_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Send On Command\n"); - if (ShouldSkip("CR_ON")) { - NextTest(); - return; - } - err = TestSendOnCommand_5(); + ChipLogProgress( + chipTool, " ***** Test Step 5 : Writes the respective default value to mandatory attribute: OccupancySensorType\n"); + err = TestWritesTheRespectiveDefaultValueToMandatoryAttributeOccupancySensorType_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Wait 1000ms\n"); - err = TestWait1000ms_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : Reads back mandatory attribute: OccupancySensorType\n"); + err = TestReadsBackMandatoryAttributeOccupancySensorType_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Reads OnOff attribute from DUT\n"); - if (ShouldSkip("A_ONOFF")) { - NextTest(); - return; - } - err = TestReadsOnOffAttributeFromDut_7(); + ChipLogProgress(chipTool, " ***** Test Step 7 : Reads mandatory attribute constrains: OccupancySensorTypeBitmap\n"); + err = TestReadsMandatoryAttributeConstrainsOccupancySensorTypeBitmap_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Reads GlobalSceneControl attribute from DUT\n"); - if (ShouldSkip("A_GLOBALSCENECONTROL")) { - NextTest(); - return; - } - err = TestReadsGlobalSceneControlAttributeFromDut_8(); + ChipLogProgress(chipTool, + " ***** Test Step 8 : Writes the respective default value to mandatory attribute: OccupancySensorTypeBitmap\n"); + err = TestWritesTheRespectiveDefaultValueToMandatoryAttributeOccupancySensorTypeBitmap_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Send On Command\n"); - if (ShouldSkip("CR_ON")) { - NextTest(); - return; - } - err = TestSendOnCommand_9(); + ChipLogProgress(chipTool, " ***** Test Step 9 : Reads back mandatory attribute: OccupancySensorTypeBitmap\n"); + err = TestReadsBackMandatoryAttributeOccupancySensorTypeBitmap_9(); break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Wait 1000ms\n"); - err = TestWait1000ms_10(); + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Reads OnOff attribute from DUT\n"); - if (ShouldSkip("A_ONOFF")) { - NextTest(); - return; - } - err = TestReadsOnOffAttributeFromDut_11(); + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Reads GlobalSceneControl attribute from DUT\n"); - if (ShouldSkip("A_GLOBALSCENECONTROL")) { - NextTest(); - return; - } - err = TestReadsGlobalSceneControlAttributeFromDut_12(); + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Reads OnTime attribute from DUT\n"); - if (ShouldSkip("A_ONTIME")) { - NextTest(); - return; - } - err = TestReadsOnTimeAttributeFromDut_13(); + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Reads OffWaitTime attribute from DUT\n"); - if (ShouldSkip("A_OFFWAITTIME")) { - NextTest(); - return; - } - err = TestReadsOffWaitTimeAttributeFromDut_14(); + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Send On Command\n"); - if (ShouldSkip("CR_ON")) { - NextTest(); - return; - } - err = TestSendOnCommand_15(); - break; - case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : Reads OnOff attribute from DUT\n"); - if (ShouldSkip("A_ONOFF")) { - NextTest(); - return; - } - err = TestReadsOnOffAttributeFromDut_16(); - break; - case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : Reads OnTime attribute from DUT\n"); - if (ShouldSkip("A_ONTIME")) { - NextTest(); - return; - } - err = TestReadsOnTimeAttributeFromDut_17(); - break; - case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : Reads OffWaitTime attribute from DUT\n"); - if (ShouldSkip("A_OFFWAITTIME")) { - NextTest(); - return; - } - err = TestReadsOffWaitTimeAttributeFromDut_18(); - break; - case 19: - ChipLogProgress(chipTool, " ***** Test Step 19 : Send Off Command\n"); - if (ShouldSkip("CR_OFF")) { - NextTest(); - return; - } - err = TestSendOffCommand_19(); - break; - case 20: - ChipLogProgress(chipTool, " ***** Test Step 20 : Reads OnOff attribute from DUT\n"); - if (ShouldSkip("A_ONOFF")) { - NextTest(); - return; - } - err = TestReadsOnOffAttributeFromDut_20(); - break; - case 21: - ChipLogProgress(chipTool, " ***** Test Step 21 : Reads OnTime attribute from DUT\n"); - if (ShouldSkip("A_ONTIME")) { - NextTest(); - return; - } - err = TestReadsOnTimeAttributeFromDut_21(); - break; - case 22: - ChipLogProgress(chipTool, " ***** Test Step 22 : Reads OnOff attribute from DUT\n"); - if (ShouldSkip("A_ONOFF")) { - NextTest(); - return; - } - err = TestReadsOnOffAttributeFromDut_22(); - break; - case 23: - ChipLogProgress(chipTool, " ***** Test Step 23 : Reads OnTime attribute from DUT\n"); - if (ShouldSkip("A_ONTIME")) { - NextTest(); - return; - } - err = TestReadsOnTimeAttributeFromDut_23(); - break; - case 24: - ChipLogProgress(chipTool, " ***** Test Step 24 : Reads OffWaitTime attribute from DUT\n"); - if (ShouldSkip("A_OFFWAITTIME")) { - NextTest(); - return; - } - err = TestReadsOffWaitTimeAttributeFromDut_24(); - break; - case 25: - ChipLogProgress(chipTool, " ***** Test Step 25 : Send On Command\n"); - if (ShouldSkip("CR_ON")) { - NextTest(); - return; - } - err = TestSendOnCommand_25(); - break; - case 26: - ChipLogProgress(chipTool, " ***** Test Step 26 : Reads OnTime attribute from DUT\n"); - if (ShouldSkip("A_ONTIME")) { - NextTest(); - return; - } - err = TestReadsOnTimeAttributeFromDut_26(); - break; - case 27: - ChipLogProgress(chipTool, " ***** Test Step 27 : Reads OffWaitTime attribute from DUT\n"); - if (ShouldSkip("A_OFFWAITTIME")) { - NextTest(); - return; - } - err = TestReadsOffWaitTimeAttributeFromDut_27(); - break; - case 28: - ChipLogProgress(chipTool, " ***** Test Step 28 : Send Off Command\n"); - if (ShouldSkip("CR_OFF")) { - NextTest(); - return; - } - err = TestSendOffCommand_28(); - break; - case 29: - ChipLogProgress(chipTool, " ***** Test Step 29 : Reads OnOff attribute from DUT\n"); - if (ShouldSkip("A_ONOFF")) { - NextTest(); - return; - } - err = TestReadsOnOffAttributeFromDut_29(); - break; - case 30: - ChipLogProgress(chipTool, " ***** Test Step 30 : Reads OnTime attribute from DUT\n"); - if (ShouldSkip("A_ONTIME")) { - NextTest(); - return; - } - err = TestReadsOnTimeAttributeFromDut_30(); - break; - case 31: - ChipLogProgress(chipTool, " ***** Test Step 31 : Reads OnOff attribute from DUT\n"); - if (ShouldSkip("A_ONOFF")) { - NextTest(); - return; - } - err = TestReadsOnOffAttributeFromDut_31(); - break; - case 32: - ChipLogProgress(chipTool, " ***** Test Step 32 : Reads OnTime attribute from DUT\n"); - if (ShouldSkip("A_ONTIME")) { - NextTest(); - return; - } - err = TestReadsOnTimeAttributeFromDut_32(); - break; - case 33: - ChipLogProgress(chipTool, " ***** Test Step 33 : Send On Command\n"); - if (ShouldSkip("CR_ON")) { - NextTest(); - return; - } - err = TestSendOnCommand_33(); - break; - case 34: - ChipLogProgress(chipTool, " ***** Test Step 34 : Reads OnOff attribute from DUT\n"); - if (ShouldSkip("A_ONOFF")) { - NextTest(); - return; - } - err = TestReadsOnOffAttributeFromDut_34(); - break; - case 35: - ChipLogProgress(chipTool, " ***** Test Step 35 : Reads OnTime attribute from DUT\n"); - if (ShouldSkip("A_ONTIME")) { - NextTest(); - return; - } - err = TestReadsOnTimeAttributeFromDut_35(); - break; - case 36: - ChipLogProgress(chipTool, " ***** Test Step 36 : Reads OffWaitTime attribute from DUT\n"); - if (ShouldSkip("A_OFFWAITTIME")) { - NextTest(); - return; - } - err = TestReadsOffWaitTimeAttributeFromDut_36(); - break; - case 37: - ChipLogProgress(chipTool, " ***** Test Step 37 : Send Off Command\n"); - if (ShouldSkip("CR_OFF")) { - NextTest(); - return; - } - err = TestSendOffCommand_37(); - break; - case 38: - ChipLogProgress(chipTool, " ***** Test Step 38 : Reads OnOff attribute from DUT\n"); - if (ShouldSkip("A_ONOFF")) { - NextTest(); - return; - } - err = TestReadsOnOffAttributeFromDut_38(); - break; - case 39: - ChipLogProgress(chipTool, " ***** Test Step 39 : Reads OnTime attribute from DUT\n"); - if (ShouldSkip("A_ONTIME")) { - NextTest(); - return; - } - err = TestReadsOnTimeAttributeFromDut_39(); - break; - case 40: - ChipLogProgress(chipTool, " ***** Test Step 40 : Reads OnOff attribute from DUT\n"); - if (ShouldSkip("A_ONOFF")) { - NextTest(); - return; - } - err = TestReadsOnOffAttributeFromDut_40(); - break; - case 41: - ChipLogProgress(chipTool, " ***** Test Step 41 : Reads OnTime attribute from DUT\n"); - if (ShouldSkip("A_ONTIME")) { - NextTest(); - return; - } - err = TestReadsOnTimeAttributeFromDut_41(); - break; - case 42: - ChipLogProgress(chipTool, " ***** Test Step 42 : Reads OffWaitTime attribute from DUT\n"); - if (ShouldSkip("A_OFFWAITTIME")) { - NextTest(); - return; - } - err = TestReadsOffWaitTimeAttributeFromDut_42(); + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); break; - case 43: - ChipLogProgress(chipTool, " ***** Test Step 43 : Reads OnOff attribute from DUT\n"); - if (ShouldSkip("A_ONOFF")) { - NextTest(); - return; - } - err = TestReadsOnOffAttributeFromDut_43(); + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 44: - ChipLogProgress(chipTool, " ***** Test Step 44 : Reads OnTime attribute from DUT\n"); - if (ShouldSkip("A_ONTIME")) { - NextTest(); - return; - } - err = TestReadsOnTimeAttributeFromDut_44(); + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 45: - ChipLogProgress(chipTool, " ***** Test Step 45 : Reads OffWaitTime attribute from DUT\n"); - if (ShouldSkip("A_OFFWAITTIME")) { - NextTest(); - return; - } - err = TestReadsOffWaitTimeAttributeFromDut_45(); + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); break; - case 46: - ChipLogProgress(chipTool, " ***** Test Step 46 : Send Off Command\n"); - if (ShouldSkip("CR_OFF")) { - NextTest(); - return; - } - err = TestSendOffCommand_46(); + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; } - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + // Go on to the next test. + WaitForMs(0); } chip::System::Clock::Timeout GetWaitDuration() const override @@ -29675,7 +34746,7 @@ class Test_TC_OO_2_3 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 47; + const uint16_t mTestCount = 10; chip::Optional mNodeId; chip::Optional mCluster; @@ -29684,69 +34755,78 @@ class Test_TC_OO_2_3 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestSendOnCommand_1() + CHIP_ERROR TestReadsMandatoryAttributeConstrainsOccupancy_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster onWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Send On Command Error: %@", err); + [cluster readAttributeOccupancyWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads mandatory attribute constrains: Occupancy Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckConstraintType("occupancy", "", "map8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("occupancy", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("occupancy", [value unsignedCharValue], 1)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWait1000ms_2() - { - WaitForMs(1000); - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadsOnOffAttributeFromDut_3() + CHIP_ERROR TestWritesTheRespectiveDefaultValueToMandatoryAttributeOccupancy_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads OnOff attribute from DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); - } + id occupancyArgument; + occupancyArgument = [NSNumber numberWithUnsignedChar:0]; + [cluster writeAttributeOccupancyWithValue:occupancyArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes the respective default value to mandatory attribute: Occupancy Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsGlobalSceneControlAttributeFromDut_4() + CHIP_ERROR TestReadsBackMandatoryAttributeOccupancy_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeGlobalSceneControlWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads GlobalSceneControl attribute from DUT Error: %@", err); + [cluster readAttributeOccupancyWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads back mandatory attribute: Occupancy Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("GlobalSceneControl", actualValue, 1)); + VerifyOrReturn(CheckValue("occupancy", actualValue, 0)); } NextTest(); @@ -29755,65 +34835,75 @@ class Test_TC_OO_2_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestSendOnCommand_5() + CHIP_ERROR TestReadsMandatoryAttributeConstrainsOccupancySensorType_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster onWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Send On Command Error: %@", err); + [cluster readAttributeOccupancySensorTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads mandatory attribute constrains: OccupancySensorType Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckConstraintType("occupancySensorType", "", "enum8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("occupancySensorType", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("occupancySensorType", [value unsignedCharValue], 3)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWait1000ms_6() - { - WaitForMs(1000); - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadsOnOffAttributeFromDut_7() + CHIP_ERROR TestWritesTheRespectiveDefaultValueToMandatoryAttributeOccupancySensorType_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads OnOff attribute from DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); - } + id occupancySensorTypeArgument; + occupancySensorTypeArgument = [NSNumber numberWithUnsignedChar:0]; + [cluster writeAttributeOccupancySensorTypeWithValue:occupancySensorTypeArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes the respective default value to mandatory attribute: " + @"OccupancySensorType Error: %@", + err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsGlobalSceneControlAttributeFromDut_8() + CHIP_ERROR TestReadsBackMandatoryAttributeOccupancySensorType_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeGlobalSceneControlWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads GlobalSceneControl attribute from DUT Error: %@", err); + [cluster readAttributeOccupancySensorTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads back mandatory attribute: OccupancySensorType Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("GlobalSceneControl", actualValue, 1)); + VerifyOrReturn(CheckValue("occupancy sensor type", actualValue, 0)); } NextTest(); @@ -29822,148 +34912,212 @@ class Test_TC_OO_2_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestSendOnCommand_9() + CHIP_ERROR TestReadsMandatoryAttributeConstrainsOccupancySensorTypeBitmap_7() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster onWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Send On Command Error: %@", err); + [cluster + readAttributeOccupancySensorTypeBitmapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads mandatory attribute constrains: OccupancySensorTypeBitmap Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("occupancySensorTypeBitmap", "", "map8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("occupancySensorTypeBitmap", [value unsignedCharValue], 1)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("occupancySensorTypeBitmap", [value unsignedCharValue], 7)); + } - return CHIP_NO_ERROR; - } + NextTest(); + }]; - CHIP_ERROR TestWait1000ms_10() - { - WaitForMs(1000); return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsOnOffAttributeFromDut_11() + CHIP_ERROR TestWritesTheRespectiveDefaultValueToMandatoryAttributeOccupancySensorTypeBitmap_8() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads OnOff attribute from DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); - } + id occupancySensorTypeBitmapArgument; + occupancySensorTypeBitmapArgument = [NSNumber numberWithUnsignedChar:1]; + [cluster writeAttributeOccupancySensorTypeBitmapWithValue:occupancySensorTypeBitmapArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes the respective default value to mandatory attribute: " + @"OccupancySensorTypeBitmap Error: %@", + err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsGlobalSceneControlAttributeFromDut_12() + CHIP_ERROR TestReadsBackMandatoryAttributeOccupancySensorTypeBitmap_9() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeGlobalSceneControlWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads GlobalSceneControl attribute from DUT Error: %@", err); + [cluster + readAttributeOccupancySensorTypeBitmapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads back mandatory attribute: OccupancySensorTypeBitmap Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("GlobalSceneControl", actualValue, 1)); - } + { + id actualValue = value; + VerifyOrReturn(CheckValue("occupancy sensor type bitmap", actualValue, 1)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } +}; - CHIP_ERROR TestReadsOnTimeAttributeFromDut_13() +class Test_TC_OCC_2_2 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_OCC_2_2() + : TestCommandBridge("Test_TC_OCC_2_2") + , mTestIndex(0) { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeOnTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads OnTime attribute from DUT Error: %@", err); + 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) - VerifyOrReturn(CheckValue("status", err, 0)); + ~Test_TC_OCC_2_2() {} - { - id actualValue = value; - VerifyOrReturn(CheckValue("OnTime", actualValue, 0U)); - } + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; - NextTest(); - }]; + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_OCC_2_2\n"); + } - return CHIP_NO_ERROR; - } + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OCC_2_2\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } - CHIP_ERROR TestReadsOffWaitTimeAttributeFromDut_14() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + Wait(); - [cluster readAttributeOffWaitTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads OffWaitTime attribute from DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("OffWaitTime", actualValue, 0U)); + // 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 Occupancy attribute from DUT\n"); + if (ShouldSkip("A_OCCUPANCY")) { + NextTest(); + return; } + err = TestReadsOccupancyAttributeFromDut_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Reads back Occupancy attribute from DUT after few seconds\n"); + if (ShouldSkip("A_OCCUPANCY")) { + NextTest(); + return; + } + err = TestReadsBackOccupancyAttributeFromDutAfterFewSeconds_2(); + break; + } - NextTest(); - }]; - - return CHIP_NO_ERROR; + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - CHIP_ERROR TestSendOnCommand_15() + void OnStatusUpdate(const chip::app::StatusIB & status) override { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } - [cluster onWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Send On Command Error: %@", err); + // Go on to the next test. + WaitForMs(0); + } - 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 = 3; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity("alpha"); + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } + NSNumber * _Nonnull OccupancyValue; - CHIP_ERROR TestReadsOnOffAttributeFromDut_16() + CHIP_ERROR TestReadsOccupancyAttributeFromDut_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads OnOff attribute from DUT Error: %@", err); + [cluster readAttributeOccupancyWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads Occupancy attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); + VerifyOrReturn(CheckValue("occupancy", actualValue, 0)); + } + { + OccupancyValue = value; } NextTest(); @@ -29972,351 +35126,775 @@ class Test_TC_OO_2_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsOnTimeAttributeFromDut_17() + CHIP_ERROR TestReadsBackOccupancyAttributeFromDutAfterFewSeconds_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads OnTime attribute from DUT Error: %@", err); + [cluster readAttributeOccupancyWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads back Occupancy attribute from DUT after few seconds Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("OnTime", actualValue, 0U)); - } - NextTest(); }]; return CHIP_NO_ERROR; } +}; - CHIP_ERROR TestReadsOffWaitTimeAttributeFromDut_18() +class Test_TC_OO_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_OO_1_1() + : TestCommandBridge("Test_TC_OO_1_1") + , mTestIndex(0) { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff 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 readAttributeOffWaitTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads OffWaitTime attribute from DUT Error: %@", err); + ~Test_TC_OO_1_1() {} - VerifyOrReturn(CheckValue("status", err, 0)); + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; - { - id actualValue = value; - VerifyOrReturn(CheckValue("OffWaitTime", actualValue, 0U)); - } + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_OO_1_1\n"); + } - NextTest(); - }]; + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OO_1_1\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 : read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: AttributeList\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeAttributeList_2(); + break; + case 3: + ChipLogProgress(chipTool, + " ***** Test Step 3 : 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_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Read the global attribute: AcceptedCommandList\n"); + if (ShouldSkip("OO_LT")) { + NextTest(); + return; + } + 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 6 : read the optional global attribute: FeatureMap\n"); + if (ShouldSkip("OO_LT")) { + NextTest(); + return; + } + err = TestReadTheOptionalGlobalAttributeFeatureMap_6(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - CHIP_ERROR TestSendOffCommand_19() + void OnStatusUpdate(const chip::app::StatusIB & status) override { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } - [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Send Off Command Error: %@", err); + // Go on to the next test. + WaitForMs(0); + } - 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 = 7; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity("alpha"); + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsOnOffAttributeFromDut_20() + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { + SetIdentity("alpha"); 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(@"Reads OnOff attribute from DUT Error: %@", err); + [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("OnOff", actualValue, 0)); + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 4U)); } + VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsOnTimeAttributeFromDut_21() + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads OnTime attribute from DUT Error: %@", err); + [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("OnTime", actualValue, 0U)); + VerifyOrReturn(CheckValue("AttributeList", [actualValue count], static_cast(5))); + VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); + VerifyOrReturn(CheckValue("", actualValue[1], 16384UL)); + VerifyOrReturn(CheckValue("", actualValue[2], 16385UL)); + VerifyOrReturn(CheckValue("", actualValue[3], 16386UL)); + VerifyOrReturn(CheckValue("", actualValue[4], 16387UL)); } + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsOnOffAttributeFromDut_22() + CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_3() + { + SetIdentity("alpha"); + UserPrompt(@"Please enter 'y' for success", @"y"); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_4() { + SetIdentity("alpha"); 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(@"Reads OnOff attribute from DUT Error: %@", err); + [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("OnOff", actualValue, 0)); + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(6))); + VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); + VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); + VerifyOrReturn(CheckValue("", actualValue[2], 2UL)); + VerifyOrReturn(CheckValue("", actualValue[3], 64UL)); + VerifyOrReturn(CheckValue("", actualValue[4], 65UL)); + VerifyOrReturn(CheckValue("", actualValue[5], 66UL)); } + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsOnTimeAttributeFromDut_23() + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads OnTime attribute from DUT 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("OnTime", actualValue, 0U)); + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); } + VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsOffWaitTimeAttributeFromDut_24() + CHIP_ERROR TestReadTheOptionalGlobalAttributeFeatureMap_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOffWaitTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads OffWaitTime attribute from DUT Error: %@", err); + [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("OffWaitTime", actualValue, 0U)); + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 1UL)); } + VerifyOrReturn(CheckConstraintType("featureMap", "", "map32")); NextTest(); }]; return CHIP_NO_ERROR; } +}; - CHIP_ERROR TestSendOnCommand_25() +class Test_TC_OO_2_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_OO_2_1() + : TestCommandBridge("Test_TC_OO_2_1") + , mTestIndex(0) { - 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(@"Send On Command 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 TestReadsOnTimeAttributeFromDut_26() + ~Test_TC_OO_2_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + CHIP_ERROR err = CHIP_NO_ERROR; - [cluster readAttributeOnTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads OnTime attribute from DUT Error: %@", err); + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_OO_2_1\n"); + } - VerifyOrReturn(CheckValue("status", err, 0)); + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OO_2_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } - { - id actualValue = value; - VerifyOrReturn(CheckValue("OnTime", actualValue, 0U)); - } + 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 : read the mandatory attribute: OnOff\n"); + err = TestReadTheMandatoryAttributeOnOff_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : read LT attribute: GlobalSceneControl\n"); + err = TestReadLtAttributeGlobalSceneControl_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : read LT attribute: OnTime\n"); + err = TestReadLtAttributeOnTime_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : read LT attribute: OffWaitTime\n"); + err = TestReadLtAttributeOffWaitTime_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : read LT attribute: StartUpOnOff\n"); + err = TestReadLtAttributeStartUpOnOff_5(); + break; + } - return CHIP_NO_ERROR; + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - CHIP_ERROR TestReadsOffWaitTimeAttributeFromDut_27() + void OnStatusUpdate(const chip::app::StatusIB & status) override { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } - [cluster readAttributeOffWaitTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads OffWaitTime attribute from DUT Error: %@", err); + // Go on to the next test. + WaitForMs(0); + } - VerifyOrReturn(CheckValue("status", err, 0)); + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } - { - id actualValue = value; - VerifyOrReturn(CheckValue("OffWaitTime", actualValue, 0U)); - } +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 6; - NextTest(); - }]; + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity("alpha"); + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestSendOffCommand_28() + CHIP_ERROR TestReadTheMandatoryAttributeOnOff_1() { + SetIdentity("alpha"); 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(@"Send Off Command Error: %@", err); + [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the mandatory attribute: OnOff Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckConstraintType("onOff", "", "bool")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsOnOffAttributeFromDut_29() + CHIP_ERROR TestReadLtAttributeGlobalSceneControl_2() { + SetIdentity("alpha"); 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(@"Reads OnOff attribute from DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + [cluster readAttributeGlobalSceneControlWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read LT attribute: GlobalSceneControl Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; } + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("globalSceneControl", "", "bool")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsOnTimeAttributeFromDut_30() + CHIP_ERROR TestReadLtAttributeOnTime_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeOnTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads OnTime attribute from DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + NSLog(@"read LT attribute: OnTime Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("OnTime", actualValue, 0U)); + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; } + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("onTime", "", "uint16")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsOnOffAttributeFromDut_31() + CHIP_ERROR TestReadLtAttributeOffWaitTime_4() { + SetIdentity("alpha"); 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(@"Reads OnOff attribute from DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + [cluster readAttributeOffWaitTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read LT attribute: OffWaitTime Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; } + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("offWaitTime", "", "uint16")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsOnTimeAttributeFromDut_32() + CHIP_ERROR TestReadLtAttributeStartUpOnOff_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads OnTime attribute from DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + [cluster readAttributeStartUpOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read LT attribute: StartUpOnOff Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("OnTime", actualValue, 0U)); + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; } + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("startUpOnOff", "", "enum8")); NextTest(); }]; return CHIP_NO_ERROR; } +}; - CHIP_ERROR TestSendOnCommand_33() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; +class Test_TC_OO_2_2 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_OO_2_2() + : TestCommandBridge("Test_TC_OO_2_2") + , 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_OO_2_2() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_OO_2_2\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OO_2_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 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Send Off Command\n"); + err = TestSendOffCommand_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Send On Command\n"); + err = TestSendOnCommand_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Check on/off attribute value is true after on command\n"); + err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Send On Command\n"); + err = TestSendOnCommand_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Check on/off attribute value is true after on command\n"); + err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Send Off Command\n"); + err = TestSendOffCommand_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Send Off Command\n"); + err = TestSendOffCommand_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Send Toggle Command\n"); + err = TestSendToggleCommand_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Wait 1000ms\n"); + err = TestWait1000ms_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : Check on/off attribute value is true after toggle command\n"); + err = TestCheckOnOffAttributeValueIsTrueAfterToggleCommand_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Send Toggle Command\n"); + err = TestSendToggleCommand_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Wait 1000ms\n"); + err = TestWait1000ms_15(); + break; + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : Check on/off attribute value is false after toggle command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterToggleCommand_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : User prompt Set OnOff attribute manually to on\n"); + err = TestUserPromptSetOnOffAttributeManuallyToOn_17(); + break; + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : User prompt Set OnOff attribute manually to off\n"); + err = TestUserPromptSetOnOffAttributeManuallyToOff_18(); + break; + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : Reset Off Command\n"); + err = TestResetOffCommand_19(); + break; + case 20: + ChipLogProgress(chipTool, " ***** Test Step 20 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_20(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + + 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 = 21; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity("alpha"); + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSendOffCommand_1() + { + SetIdentity("alpha"); + 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(@"Send On Command Error: %@", err); + [cluster offWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Send Off Command Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -30326,20 +35904,21 @@ class Test_TC_OO_2_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsOnOffAttributeFromDut_34() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_2() { + SetIdentity("alpha"); 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(@"Reads OnOff attribute from DUT Error: %@", err); + NSLog(@"Check on/off attribute value is false after off command Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); + VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); } NextTest(); @@ -30348,20 +35927,39 @@ class Test_TC_OO_2_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsOnTimeAttributeFromDut_35() + CHIP_ERROR TestSendOnCommand_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads OnTime attribute from DUT Error: %@", err); + [cluster onWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Send On Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_4() + { + SetIdentity("alpha"); + 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(@"Check on/off attribute value is true after on command Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("OnTime", actualValue, 0U)); + VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); } NextTest(); @@ -30370,20 +35968,39 @@ class Test_TC_OO_2_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsOffWaitTimeAttributeFromDut_36() + CHIP_ERROR TestSendOnCommand_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOffWaitTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads OffWaitTime attribute from DUT Error: %@", err); + [cluster onWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Send On Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_6() + { + SetIdentity("alpha"); + 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(@"Check on/off attribute value is true after on command Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("OffWaitTime", actualValue, 0U)); + VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); } NextTest(); @@ -30392,8 +36009,9 @@ class Test_TC_OO_2_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestSendOffCommand_37() + CHIP_ERROR TestSendOffCommand_7() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -30409,14 +36027,15 @@ class Test_TC_OO_2_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsOnOffAttributeFromDut_38() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_8() { + SetIdentity("alpha"); 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(@"Reads OnOff attribute from DUT Error: %@", err); + NSLog(@"Check on/off attribute value is false after off command Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -30431,36 +36050,33 @@ class Test_TC_OO_2_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsOnTimeAttributeFromDut_39() + CHIP_ERROR TestSendOffCommand_9() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads OnTime attribute from DUT Error: %@", err); + [cluster offWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Send Off Command Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("OnTime", actualValue, 0U)); - } - NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsOnOffAttributeFromDut_40() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_10() { + SetIdentity("alpha"); 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(@"Reads OnOff attribute from DUT Error: %@", err); + NSLog(@"Check on/off attribute value is false after off command Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -30475,42 +36091,46 @@ class Test_TC_OO_2_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsOnTimeAttributeFromDut_41() + CHIP_ERROR TestSendToggleCommand_11() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads OnTime attribute from DUT Error: %@", err); + [cluster toggleWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Send Toggle Command Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("OnTime", actualValue, 0U)); - } - NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsOffWaitTimeAttributeFromDut_42() + CHIP_ERROR TestWait1000ms_12() + { + SetIdentity("alpha"); + WaitForMs(1000); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterToggleCommand_13() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOffWaitTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads OffWaitTime attribute from DUT Error: %@", err); + [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check on/off attribute value is true after toggle command Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("OffWaitTime", actualValue, 0U)); + VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); } NextTest(); @@ -30519,42 +36139,46 @@ class Test_TC_OO_2_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsOnOffAttributeFromDut_43() + CHIP_ERROR TestSendToggleCommand_14() { + SetIdentity("alpha"); 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(@"Reads OnOff attribute from DUT Error: %@", err); + [cluster toggleWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Send Toggle Command Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); - } - NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsOnTimeAttributeFromDut_44() + CHIP_ERROR TestWait1000ms_15() { + SetIdentity("alpha"); + WaitForMs(1000); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterToggleCommand_16() + { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads OnTime attribute from DUT Error: %@", err); + [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check on/off attribute value is false after toggle command Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("OnTime", actualValue, 0U)); + VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); } NextTest(); @@ -30563,39 +36187,55 @@ class Test_TC_OO_2_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsOffWaitTimeAttributeFromDut_45() + CHIP_ERROR TestUserPromptSetOnOffAttributeManuallyToOn_17() + { + SetIdentity("alpha"); + UserPrompt(@"Operate on device to set OnOff attribute manually to on"); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestUserPromptSetOnOffAttributeManuallyToOff_18() + { + SetIdentity("alpha"); + UserPrompt(@"Operate on device to set OnOff attribute manually to off"); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestResetOffCommand_19() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOffWaitTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads OffWaitTime attribute from DUT Error: %@", err); + [cluster offWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Reset Off Command Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("OffWaitTime", actualValue, 0U)); - } - NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendOffCommand_46() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_20() { + SetIdentity("alpha"); 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(@"Send Off Command Error: %@", err); + [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check on/off attribute value is false after off command Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); + } + NextTest(); }]; @@ -30603,22 +36243,21 @@ class Test_TC_OO_2_3 : public TestCommandBridge { } }; -class Test_TC_OO_2_4 : public TestCommandBridge { +class Test_TC_OO_2_3 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_OO_2_4() - : TestCommandBridge("Test_TC_OO_2_4") + Test_TC_OO_2_3() + : TestCommandBridge("Test_TC_OO_2_3") , 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() {} + ~Test_TC_OO_2_3() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -30626,11 +36265,11 @@ class Test_TC_OO_2_4 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_OO_2_4\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_OO_2_3\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OO_2_4\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OO_2_3\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -30647,104 +36286,360 @@ class Test_TC_OO_2_4 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : TH sends On command to DUT\n"); - err = TestThSendsOnCommandToDut_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Send On Command\n"); + if (ShouldSkip("CR_ON")) { + NextTest(); + return; + } + err = TestSendOnCommand_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : TH writes a value of 0 to StartUpOnOff attribute of DUT\n"); - err = TestThWritesAValueOf0ToStartUpOnOffAttributeOfDut_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Wait 1000ms\n"); + err = TestWait1000ms_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads the StartUpOnOff attribute from the DUT\n"); - err = TestThReadsTheStartUpOnOffAttributeFromTheDut_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Reads OnOff attribute from DUT\n"); + if (ShouldSkip("A_ONOFF")) { + NextTest(); + return; + } + err = TestReadsOnOffAttributeFromDut_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Power off DUT\n"); - err = TestPowerOffDut_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Reads GlobalSceneControl attribute from DUT\n"); + if (ShouldSkip("A_GLOBALSCENECONTROL")) { + NextTest(); + return; + } + err = TestReadsGlobalSceneControlAttributeFromDut_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Send On Command\n"); + if (ShouldSkip("CR_ON")) { + NextTest(); + return; + } + err = TestSendOnCommand_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : TH reads the OnOff attribute from the DUT\n"); - err = TestThReadsTheOnOffAttributeFromTheDut_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : Wait 1000ms\n"); + err = TestWait1000ms_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : TH writes a value of 1 to StartUpOnOff attribute of DUT\n"); - err = TestThWritesAValueOf1ToStartUpOnOffAttributeOfDut_7(); + ChipLogProgress(chipTool, " ***** Test Step 7 : Reads OnOff attribute from DUT\n"); + if (ShouldSkip("A_ONOFF")) { + NextTest(); + return; + } + err = TestReadsOnOffAttributeFromDut_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Power off DUT\n"); - err = TestPowerOffDut_8(); + ChipLogProgress(chipTool, " ***** Test Step 8 : Reads GlobalSceneControl attribute from DUT\n"); + if (ShouldSkip("A_GLOBALSCENECONTROL")) { + NextTest(); + return; + } + err = TestReadsGlobalSceneControlAttributeFromDut_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_9(); + ChipLogProgress(chipTool, " ***** Test Step 9 : Send On Command\n"); + if (ShouldSkip("CR_ON")) { + NextTest(); + return; + } + err = TestSendOnCommand_9(); break; case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : TH reads the OnOff attribute from the DUT\n"); - err = TestThReadsTheOnOffAttributeFromTheDut_10(); + ChipLogProgress(chipTool, " ***** Test Step 10 : Wait 1000ms\n"); + err = TestWait1000ms_10(); break; case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : TH writes a value of 2 to StartUpOnOff attribute of DUT\n"); - err = TestThWritesAValueOf2ToStartUpOnOffAttributeOfDut_11(); + ChipLogProgress(chipTool, " ***** Test Step 11 : Reads OnOff attribute from DUT\n"); + if (ShouldSkip("A_ONOFF")) { + NextTest(); + return; + } + err = TestReadsOnOffAttributeFromDut_11(); break; case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Power off DUT\n"); - err = TestPowerOffDut_12(); + ChipLogProgress(chipTool, " ***** Test Step 12 : Reads GlobalSceneControl attribute from DUT\n"); + if (ShouldSkip("A_GLOBALSCENECONTROL")) { + NextTest(); + return; + } + err = TestReadsGlobalSceneControlAttributeFromDut_12(); break; case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_13(); + ChipLogProgress(chipTool, " ***** Test Step 13 : Reads OnTime attribute from DUT\n"); + if (ShouldSkip("A_ONTIME")) { + NextTest(); + return; + } + err = TestReadsOnTimeAttributeFromDut_13(); break; case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : TH reads the OnOff attribute from the DUT\n"); - err = TestThReadsTheOnOffAttributeFromTheDut_14(); + ChipLogProgress(chipTool, " ***** Test Step 14 : Reads OffWaitTime attribute from DUT\n"); + if (ShouldSkip("A_OFFWAITTIME")) { + NextTest(); + return; + } + err = TestReadsOffWaitTimeAttributeFromDut_14(); break; case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Power off DUT\n"); - err = TestPowerOffDut_15(); + ChipLogProgress(chipTool, " ***** Test Step 15 : Send On Command\n"); + if (ShouldSkip("CR_ON")) { + NextTest(); + return; + } + err = TestSendOnCommand_15(); break; case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_16(); + ChipLogProgress(chipTool, " ***** Test Step 16 : Reads OnOff attribute from DUT\n"); + if (ShouldSkip("A_ONOFF")) { + NextTest(); + return; + } + err = TestReadsOnOffAttributeFromDut_16(); break; case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : TH reads the OnOff attribute from the DUT\n"); - err = TestThReadsTheOnOffAttributeFromTheDut_17(); + ChipLogProgress(chipTool, " ***** Test Step 17 : Reads OnTime attribute from DUT\n"); + if (ShouldSkip("A_ONTIME")) { + NextTest(); + return; + } + err = TestReadsOnTimeAttributeFromDut_17(); break; case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : TH writes NULL to StartUpOnOff attribute of DUT\n"); - err = TestThWritesNullToStartUpOnOffAttributeOfDut_18(); + ChipLogProgress(chipTool, " ***** Test Step 18 : Reads OffWaitTime attribute from DUT\n"); + if (ShouldSkip("A_OFFWAITTIME")) { + NextTest(); + return; + } + err = TestReadsOffWaitTimeAttributeFromDut_18(); break; case 19: - ChipLogProgress(chipTool, " ***** Test Step 19 : Power off DUT\n"); - err = TestPowerOffDut_19(); + ChipLogProgress(chipTool, " ***** Test Step 19 : Send Off Command\n"); + if (ShouldSkip("CR_OFF")) { + NextTest(); + return; + } + err = TestSendOffCommand_19(); break; case 20: - ChipLogProgress(chipTool, " ***** Test Step 20 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_20(); + ChipLogProgress(chipTool, " ***** Test Step 20 : Reads OnOff attribute from DUT\n"); + if (ShouldSkip("A_ONOFF")) { + NextTest(); + return; + } + err = TestReadsOnOffAttributeFromDut_20(); break; case 21: - ChipLogProgress(chipTool, " ***** Test Step 21 : TH reads the OnOff attribute from the DUT\n"); - err = TestThReadsTheOnOffAttributeFromTheDut_21(); + ChipLogProgress(chipTool, " ***** Test Step 21 : Reads OnTime attribute from DUT\n"); + if (ShouldSkip("A_ONTIME")) { + NextTest(); + return; + } + err = TestReadsOnTimeAttributeFromDut_21(); break; case 22: - ChipLogProgress(chipTool, " ***** Test Step 22 : TH sends Off command to DUT\n"); - err = TestThSendsOffCommandToDut_22(); + ChipLogProgress(chipTool, " ***** Test Step 22 : Reads OnOff attribute from DUT\n"); + if (ShouldSkip("A_ONOFF")) { + NextTest(); + return; + } + err = TestReadsOnOffAttributeFromDut_22(); break; case 23: - ChipLogProgress(chipTool, " ***** Test Step 23 : Power off DUT\n"); - err = TestPowerOffDut_23(); + ChipLogProgress(chipTool, " ***** Test Step 23 : Reads OnTime attribute from DUT\n"); + if (ShouldSkip("A_ONTIME")) { + NextTest(); + return; + } + err = TestReadsOnTimeAttributeFromDut_23(); break; case 24: - ChipLogProgress(chipTool, " ***** Test Step 24 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_24(); + ChipLogProgress(chipTool, " ***** Test Step 24 : Reads OffWaitTime attribute from DUT\n"); + if (ShouldSkip("A_OFFWAITTIME")) { + NextTest(); + return; + } + err = TestReadsOffWaitTimeAttributeFromDut_24(); break; case 25: - ChipLogProgress(chipTool, " ***** Test Step 25 : TH reads the OnOff attribute from the DUT\n"); - err = TestThReadsTheOnOffAttributeFromTheDut_25(); + ChipLogProgress(chipTool, " ***** Test Step 25 : Send On Command\n"); + if (ShouldSkip("CR_ON")) { + NextTest(); + return; + } + err = TestSendOnCommand_25(); + break; + case 26: + ChipLogProgress(chipTool, " ***** Test Step 26 : Reads OnTime attribute from DUT\n"); + if (ShouldSkip("A_ONTIME")) { + NextTest(); + return; + } + err = TestReadsOnTimeAttributeFromDut_26(); + break; + case 27: + ChipLogProgress(chipTool, " ***** Test Step 27 : Reads OffWaitTime attribute from DUT\n"); + if (ShouldSkip("A_OFFWAITTIME")) { + NextTest(); + return; + } + err = TestReadsOffWaitTimeAttributeFromDut_27(); + break; + case 28: + ChipLogProgress(chipTool, " ***** Test Step 28 : Send Off Command\n"); + if (ShouldSkip("CR_OFF")) { + NextTest(); + return; + } + err = TestSendOffCommand_28(); + break; + case 29: + ChipLogProgress(chipTool, " ***** Test Step 29 : Reads OnOff attribute from DUT\n"); + if (ShouldSkip("A_ONOFF")) { + NextTest(); + return; + } + err = TestReadsOnOffAttributeFromDut_29(); + break; + case 30: + ChipLogProgress(chipTool, " ***** Test Step 30 : Reads OnTime attribute from DUT\n"); + if (ShouldSkip("A_ONTIME")) { + NextTest(); + return; + } + err = TestReadsOnTimeAttributeFromDut_30(); + break; + case 31: + ChipLogProgress(chipTool, " ***** Test Step 31 : Reads OnOff attribute from DUT\n"); + if (ShouldSkip("A_ONOFF")) { + NextTest(); + return; + } + err = TestReadsOnOffAttributeFromDut_31(); + break; + case 32: + ChipLogProgress(chipTool, " ***** Test Step 32 : Reads OnTime attribute from DUT\n"); + if (ShouldSkip("A_ONTIME")) { + NextTest(); + return; + } + err = TestReadsOnTimeAttributeFromDut_32(); + break; + case 33: + ChipLogProgress(chipTool, " ***** Test Step 33 : Send On Command\n"); + if (ShouldSkip("CR_ON")) { + NextTest(); + return; + } + err = TestSendOnCommand_33(); + break; + case 34: + ChipLogProgress(chipTool, " ***** Test Step 34 : Reads OnOff attribute from DUT\n"); + if (ShouldSkip("A_ONOFF")) { + NextTest(); + return; + } + err = TestReadsOnOffAttributeFromDut_34(); + break; + case 35: + ChipLogProgress(chipTool, " ***** Test Step 35 : Reads OnTime attribute from DUT\n"); + if (ShouldSkip("A_ONTIME")) { + NextTest(); + return; + } + err = TestReadsOnTimeAttributeFromDut_35(); + break; + case 36: + ChipLogProgress(chipTool, " ***** Test Step 36 : Reads OffWaitTime attribute from DUT\n"); + if (ShouldSkip("A_OFFWAITTIME")) { + NextTest(); + return; + } + err = TestReadsOffWaitTimeAttributeFromDut_36(); + break; + case 37: + ChipLogProgress(chipTool, " ***** Test Step 37 : Send Off Command\n"); + if (ShouldSkip("CR_OFF")) { + NextTest(); + return; + } + err = TestSendOffCommand_37(); + break; + case 38: + ChipLogProgress(chipTool, " ***** Test Step 38 : Reads OnOff attribute from DUT\n"); + if (ShouldSkip("A_ONOFF")) { + NextTest(); + return; + } + err = TestReadsOnOffAttributeFromDut_38(); + break; + case 39: + ChipLogProgress(chipTool, " ***** Test Step 39 : Reads OnTime attribute from DUT\n"); + if (ShouldSkip("A_ONTIME")) { + NextTest(); + return; + } + err = TestReadsOnTimeAttributeFromDut_39(); + break; + case 40: + ChipLogProgress(chipTool, " ***** Test Step 40 : Reads OnOff attribute from DUT\n"); + if (ShouldSkip("A_ONOFF")) { + NextTest(); + return; + } + err = TestReadsOnOffAttributeFromDut_40(); + break; + case 41: + ChipLogProgress(chipTool, " ***** Test Step 41 : Reads OnTime attribute from DUT\n"); + if (ShouldSkip("A_ONTIME")) { + NextTest(); + return; + } + err = TestReadsOnTimeAttributeFromDut_41(); + break; + case 42: + ChipLogProgress(chipTool, " ***** Test Step 42 : Reads OffWaitTime attribute from DUT\n"); + if (ShouldSkip("A_OFFWAITTIME")) { + NextTest(); + return; + } + err = TestReadsOffWaitTimeAttributeFromDut_42(); + break; + case 43: + ChipLogProgress(chipTool, " ***** Test Step 43 : Reads OnOff attribute from DUT\n"); + if (ShouldSkip("A_ONOFF")) { + NextTest(); + return; + } + err = TestReadsOnOffAttributeFromDut_43(); + break; + case 44: + ChipLogProgress(chipTool, " ***** Test Step 44 : Reads OnTime attribute from DUT\n"); + if (ShouldSkip("A_ONTIME")) { + NextTest(); + return; + } + err = TestReadsOnTimeAttributeFromDut_44(); + break; + case 45: + ChipLogProgress(chipTool, " ***** Test Step 45 : Reads OffWaitTime attribute from DUT\n"); + if (ShouldSkip("A_OFFWAITTIME")) { + NextTest(); + return; + } + err = TestReadsOffWaitTimeAttributeFromDut_45(); + break; + case 46: + ChipLogProgress(chipTool, " ***** Test Step 46 : Send Off Command\n"); + if (ShouldSkip("CR_OFF")) { + NextTest(); + return; + } + err = TestSendOffCommand_46(); break; } @@ -30754,6 +36649,156 @@ class Test_TC_OO_2_4 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 34: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 35: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 36: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 37: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 38: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 39: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 40: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 41: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 42: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 43: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 44: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 45: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 46: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -30761,28 +36806,29 @@ class Test_TC_OO_2_4 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 26; + const uint16_t mTestCount = 47; chip::Optional mNodeId; chip::Optional mCluster; chip::Optional mEndpoint; - chip::Optional mDiscriminator; chip::Optional mTimeout; CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsOnCommandToDut_1() + CHIP_ERROR TestSendOnCommand_1() { + SetIdentity("alpha"); 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); + NSLog(@"Send On Command Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -30792,41 +36838,28 @@ class Test_TC_OO_2_4 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThWritesAValueOf0ToStartUpOnOffAttributeOfDut_2() + CHIP_ERROR TestWait1000ms_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(); - }]; - + SetIdentity("alpha"); + WaitForMs(1000); return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsTheStartUpOnOffAttributeFromTheDut_3() + CHIP_ERROR TestReadsOnOffAttributeFromDut_3() { + SetIdentity("alpha"); 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); + [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads OnOff attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("StartUpOnOff", actualValue)); - VerifyOrReturn(CheckValue("StartUpOnOff", actualValue, 0)); + VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); } NextTest(); @@ -30835,32 +36868,21 @@ class Test_TC_OO_2_4 : public TestCommandBridge { 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() + CHIP_ERROR TestReadsGlobalSceneControlAttributeFromDut_4() { + SetIdentity("alpha"); 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); + [cluster readAttributeGlobalSceneControlWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads GlobalSceneControl attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); + VerifyOrReturn(CheckValue("GlobalSceneControl", actualValue, 1)); } NextTest(); @@ -30869,46 +36891,40 @@ class Test_TC_OO_2_4 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThWritesAValueOf1ToStartUpOnOffAttributeOfDut_7() + CHIP_ERROR TestSendOnCommand_5() { + SetIdentity("alpha"); 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)); + [cluster onWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Send On Command Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); - return CHIP_NO_ERROR; - } + NextTest(); + }]; - CHIP_ERROR TestPowerOffDut_8() - { - Reboot(mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U); return CHIP_NO_ERROR; } - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_9() + CHIP_ERROR TestWait1000ms_6() { - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + SetIdentity("alpha"); + WaitForMs(1000); return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsTheOnOffAttributeFromTheDut_10() + CHIP_ERROR TestReadsOnOffAttributeFromDut_7() { + SetIdentity("alpha"); 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); + NSLog(@"Reads OnOff attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -30923,80 +36939,63 @@ class Test_TC_OO_2_4 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThWritesAValueOf2ToStartUpOnOffAttributeOfDut_11() + CHIP_ERROR TestReadsGlobalSceneControlAttributeFromDut_8() { + SetIdentity("alpha"); 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)); + [cluster readAttributeGlobalSceneControlWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads GlobalSceneControl attribute from DUT Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); - return CHIP_NO_ERROR; - } + { + id actualValue = value; + VerifyOrReturn(CheckValue("GlobalSceneControl", actualValue, 1)); + } - CHIP_ERROR TestPowerOffDut_12() - { - Reboot(mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U); - return CHIP_NO_ERROR; - } + NextTest(); + }]; - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_13() - { - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsTheOnOffAttributeFromTheDut_14() + CHIP_ERROR TestSendOnCommand_9() { + SetIdentity("alpha"); 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); + [cluster onWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Send On Command 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() + CHIP_ERROR TestWait1000ms_10() { - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + SetIdentity("alpha"); + WaitForMs(1000); return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsTheOnOffAttributeFromTheDut_17() + CHIP_ERROR TestReadsOnOffAttributeFromDut_11() { + SetIdentity("alpha"); 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); + NSLog(@"Reads OnOff attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -31011,52 +37010,44 @@ class Test_TC_OO_2_4 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThWritesNullToStartUpOnOffAttributeOfDut_18() + CHIP_ERROR TestReadsGlobalSceneControlAttributeFromDut_12() { + SetIdentity("alpha"); 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)); + [cluster readAttributeGlobalSceneControlWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads GlobalSceneControl attribute from DUT Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); - return CHIP_NO_ERROR; - } + { + id actualValue = value; + VerifyOrReturn(CheckValue("GlobalSceneControl", actualValue, 1)); + } - CHIP_ERROR TestPowerOffDut_19() - { - Reboot(mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U); - return CHIP_NO_ERROR; - } + NextTest(); + }]; - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_20() - { - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsTheOnOffAttributeFromTheDut_21() + CHIP_ERROR TestReadsOnTimeAttributeFromDut_13() { + SetIdentity("alpha"); 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); + [cluster readAttributeOnTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads OnTime attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); + VerifyOrReturn(CheckValue("OnTime", actualValue, 0U)); } NextTest(); @@ -31065,49 +37056,62 @@ class Test_TC_OO_2_4 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsOffCommandToDut_22() + CHIP_ERROR TestReadsOffWaitTimeAttributeFromDut_14() { + SetIdentity("alpha"); 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); + [cluster readAttributeOffWaitTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads OffWaitTime attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("OffWaitTime", actualValue, 0U)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestPowerOffDut_23() + CHIP_ERROR TestSendOnCommand_15() { - Reboot(mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U); - return CHIP_NO_ERROR; - } + SetIdentity("alpha"); + 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(@"Send On Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_24() - { - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsTheOnOffAttributeFromTheDut_25() + CHIP_ERROR TestReadsOnOffAttributeFromDut_16() { + SetIdentity("alpha"); 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); + NSLog(@"Reads OnOff attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); + VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); } NextTest(); @@ -31115,130 +37119,45 @@ class Test_TC_OO_2_4 : public TestCommandBridge { return CHIP_NO_ERROR; } -}; - -class Test_TC_PS_1_1 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_PS_1_1() - : TestCommandBridge("Test_TC_PS_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_PS_1_1() {} - /////////// TestCommand Interface ///////// - void NextTest() override + CHIP_ERROR TestReadsOnTimeAttributeFromDut_17() { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_PS_1_1\n"); - } + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PS_1_1\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + [cluster readAttributeOnTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads OnTime 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 : 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; + { + id actualValue = value; + VerifyOrReturn(CheckValue("OnTime", actualValue, 0U)); } - 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(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : read the optional global attribute: FeatureMap\n"); - err = TestReadTheOptionalGlobalAttributeFeatureMap_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; + NextTest(); + }]; - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + CHIP_ERROR TestReadsOffWaitTimeAttributeFromDut_18() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestPowerSource * cluster = [[CHIPTestPowerSource 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 readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the global attribute: ClusterRevision Error: %@", err); + [cluster readAttributeOffWaitTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads OffWaitTime attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + VerifyOrReturn(CheckValue("OffWaitTime", actualValue, 0U)); } NextTest(); @@ -31247,127 +37166,108 @@ class Test_TC_PS_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() + CHIP_ERROR TestSendOffCommand_19() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestPowerSource * cluster = [[CHIPTestPowerSource 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 readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); + [cluster offWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Send Off Command Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() + CHIP_ERROR TestReadsOnOffAttributeFromDut_20() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestPowerSource * cluster = [[CHIPTestPowerSource 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 readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AttributeList Error: %@", err); + [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads OnOff attribute from DUT 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], 5UL)); - VerifyOrReturn(CheckValue("", actualValue[4], 11UL)); - VerifyOrReturn(CheckValue("", actualValue[5], 12UL)); - VerifyOrReturn(CheckValue("", actualValue[6], 13UL)); - VerifyOrReturn(CheckValue("", actualValue[7], 14UL)); - VerifyOrReturn(CheckValue("", actualValue[8], 15UL)); - VerifyOrReturn(CheckValue("", actualValue[9], 16UL)); - VerifyOrReturn(CheckValue("", actualValue[10], 19UL)); - VerifyOrReturn(CheckValue("", actualValue[11], 26UL)); - VerifyOrReturn(CheckValue("", actualValue[12], 28UL)); - VerifyOrReturn(CheckValue("", actualValue[13], 25UL)); + VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); } - 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() + CHIP_ERROR TestReadsOnTimeAttributeFromDut_21() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestPowerSource * cluster = [[CHIPTestPowerSource 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 readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + [cluster readAttributeOnTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads OnTime attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); + VerifyOrReturn(CheckValue("OnTime", actualValue, 0U)); } - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_6() + CHIP_ERROR TestReadsOnOffAttributeFromDut_22() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestPowerSource * cluster = [[CHIPTestPowerSource 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 readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); + [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads OnOff attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); } - VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalGlobalAttributeFeatureMap_7() + CHIP_ERROR TestReadsOnTimeAttributeFromDut_23() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestPowerSource * cluster = [[CHIPTestPowerSource 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 readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional global attribute: FeatureMap Error: %@", err); + [cluster readAttributeOnTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads OnTime attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); + VerifyOrReturn(CheckValue("OnTime", actualValue, 0U)); } NextTest(); @@ -31375,131 +37275,63 @@ class Test_TC_PS_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } -}; - -class Test_TC_PS_2_1 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_PS_2_1() - : TestCommandBridge("Test_TC_PS_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_PS_2_1() {} - /////////// TestCommand Interface ///////// - void NextTest() override + CHIP_ERROR TestReadsOffWaitTimeAttributeFromDut_24() { - CHIP_ERROR err = CHIP_NO_ERROR; + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_PS_2_1\n"); - } + [cluster readAttributeOffWaitTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads OffWaitTime attribute from DUT Error: %@", err); - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PS_2_1\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + VerifyOrReturn(CheckValue("status", err, 0)); - Wait(); + { + id actualValue = value; + VerifyOrReturn(CheckValue("OffWaitTime", actualValue, 0U)); + } - // 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 : Test Harness Client reads Status attribute from Server DUT\n"); - err = TestTestHarnessClientReadsStatusAttributeFromServerDut_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Test Harness Client reads Order attribute from Server DUT\n"); - err = TestTestHarnessClientReadsOrderAttributeFromServerDut_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Test Harness Client reads Description attribute from Server DUT\n"); - err = TestTestHarnessClientReadsDescriptionAttributeFromServerDut_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Test Harness Client reads BatVoltage from Server DUT\n"); - err = TestTestHarnessClientReadsBatVoltageFromServerDut_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Test Harness Client reads BatPercentRemaining from Server DUT\n"); - err = TestTestHarnessClientReadsBatPercentRemainingFromServerDut_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Test Harness Client reads BatTimeRemaining from Server DUT\n"); - err = TestTestHarnessClientReadsBatTimeRemainingFromServerDut_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Test Harness Client reads BatChargeLevel from Server DUT\n"); - err = TestTestHarnessClientReadsBatChargeLevelFromServerDut_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Test Harness Client reads ActiveBatFaults from Server DUT\n"); - err = TestTestHarnessClientReadsActiveBatFaultsFromServerDut_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Test Harness Client reads BatChargeState from Server DUT\n"); - err = TestTestHarnessClientReadsBatChargeStateFromServerDut_9(); - 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 TestSendOnCommand_25() { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 10; + [cluster onWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Send On Command Error: %@", err); - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestTestHarnessClientReadsStatusAttributeFromServerDut_1() + CHIP_ERROR TestReadsOnTimeAttributeFromDut_26() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestPowerSource * cluster = [[CHIPTestPowerSource 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 readAttributeStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Test Harness Client reads Status attribute from Server DUT Error: %@", err); + [cluster readAttributeOnTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads OnTime attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("status", "", "enum8")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("status", [value unsignedCharValue], 0)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("status", [value unsignedCharValue], 3)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("OnTime", actualValue, 0U)); } NextTest(); @@ -31508,77 +37340,85 @@ class Test_TC_PS_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestTestHarnessClientReadsOrderAttributeFromServerDut_2() + CHIP_ERROR TestReadsOffWaitTimeAttributeFromDut_27() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestPowerSource * cluster = [[CHIPTestPowerSource 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 readAttributeOrderWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Test Harness Client reads Order attribute from Server DUT Error: %@", err); + [cluster readAttributeOffWaitTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads OffWaitTime attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("order", "", "uint8")); + { + id actualValue = value; + VerifyOrReturn(CheckValue("OffWaitTime", actualValue, 0U)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestTestHarnessClientReadsDescriptionAttributeFromServerDut_3() + CHIP_ERROR TestSendOffCommand_28() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestPowerSource * cluster = [[CHIPTestPowerSource 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 readAttributeDescriptionWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Test Harness Client reads Description attribute from Server DUT Error: %@", err); + [cluster offWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Send Off Command Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("description", "", "string")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestTestHarnessClientReadsBatVoltageFromServerDut_4() + CHIP_ERROR TestReadsOnOffAttributeFromDut_29() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestPowerSource * cluster = [[CHIPTestPowerSource 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 readAttributeBatteryVoltageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Test Harness Client reads BatVoltage from Server DUT Error: %@", err); + [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads OnOff attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("batteryVoltage", "", "uint32")); + { + id actualValue = value; + VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestTestHarnessClientReadsBatPercentRemainingFromServerDut_5() + CHIP_ERROR TestReadsOnTimeAttributeFromDut_30() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestPowerSource * cluster = [[CHIPTestPowerSource 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 readAttributeBatteryPercentRemainingWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Test Harness Client reads BatPercentRemaining from Server DUT Error: %@", err); + [cluster readAttributeOnTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads OnTime attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("batteryPercentRemaining", "", "uint8")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("batteryPercentRemaining", [value unsignedCharValue], 0)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("batteryPercentRemaining", [value unsignedCharValue], 200)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("OnTime", actualValue, 0U)); } NextTest(); @@ -31587,41 +37427,44 @@ class Test_TC_PS_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestTestHarnessClientReadsBatTimeRemainingFromServerDut_6() + CHIP_ERROR TestReadsOnOffAttributeFromDut_31() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestPowerSource * cluster = [[CHIPTestPowerSource 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 readAttributeBatteryTimeRemainingWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Test Harness Client reads BatTimeRemaining from Server DUT Error: %@", err); + [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads OnOff attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("batteryTimeRemaining", "", "uint32")); + { + id actualValue = value; + VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestTestHarnessClientReadsBatChargeLevelFromServerDut_7() + CHIP_ERROR TestReadsOnTimeAttributeFromDut_32() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestPowerSource * cluster = [[CHIPTestPowerSource 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 readAttributeBatteryChargeLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Test Harness Client reads BatChargeLevel from Server DUT Error: %@", err); + [cluster readAttributeOnTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads OnTime attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("batteryChargeLevel", "", "enum8")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("batteryChargeLevel", [value unsignedCharValue], 0)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("batteryChargeLevel", [value unsignedCharValue], 2)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("OnTime", actualValue, 0U)); } NextTest(); @@ -31630,41 +37473,39 @@ class Test_TC_PS_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestTestHarnessClientReadsActiveBatFaultsFromServerDut_8() + CHIP_ERROR TestSendOnCommand_33() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestPowerSource * cluster = [[CHIPTestPowerSource 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 readAttributeActiveBatteryFaultsWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Test Harness Client reads ActiveBatFaults from Server DUT Error: %@", err); + [cluster onWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Send On Command Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("activeBatteryFaults", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestTestHarnessClientReadsBatChargeStateFromServerDut_9() + CHIP_ERROR TestReadsOnOffAttributeFromDut_34() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestPowerSource * cluster = [[CHIPTestPowerSource 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 readAttributeBatteryChargeStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Test Harness Client reads BatChargeState from Server DUT Error: %@", err); + [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads OnOff attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("batteryChargeState", "", "enum8")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("batteryChargeState", [value unsignedCharValue], 0)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("batteryChargeState", [value unsignedCharValue], 3)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); } NextTest(); @@ -31672,152 +37513,86 @@ class Test_TC_PS_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } -}; -class Test_TC_PRS_1_1 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_PRS_1_1() - : TestCommandBridge("Test_TC_PRS_1_1") - , mTestIndex(0) + CHIP_ERROR TestReadsOnTimeAttributeFromDut_35() { - 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) + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - ~Test_TC_PRS_1_1() {} + [cluster readAttributeOnTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads OnTime attribute from DUT 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_PRS_1_1\n"); - } + { + id actualValue = value; + VerifyOrReturn(CheckValue("OnTime", actualValue, 0U)); + } - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PRS_1_1\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + NextTest(); + }]; - Wait(); + return CHIP_NO_ERROR; + } - // 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 : Write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Reads back global attribute: ClusterRevision\n"); - err = TestReadsBackGlobalAttributeClusterRevision_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global mandatory attribute constraints: AttributeList\n"); - err = TestReadTheGlobalMandatoryAttributeConstraintsAttributeList_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(); - break; - case 7: - ChipLogProgress(chipTool, - " ***** Test Step 7 : Read AcceptedCommandList attribute from the DUT and Verify that the DUT response\n"); - if (ShouldSkip("PICS_USER_PROMPT")) { - NextTest(); - return; - } - err = TestReadAcceptedCommandListAttributeFromTheDutAndVerifyThatTheDutResponse_7(); - break; - case 8: - ChipLogProgress(chipTool, - " ***** Test Step 8 : Read GeneratedCommandList attribute from the DUT and Verify that the DUT response\n"); - if (ShouldSkip("PICS_USER_PROMPT")) { - NextTest(); - return; - } - err = TestReadGeneratedCommandListAttributeFromTheDutAndVerifyThatTheDutResponse_8(); - break; - case 9: - ChipLogProgress( - chipTool, " ***** Test Step 9 : Read FeatureMap attribute from the DUT and Verify that the DUT response\n"); - if (ShouldSkip("PICS_USER_PROMPT")) { - NextTest(); - return; + CHIP_ERROR TestReadsOffWaitTimeAttributeFromDut_36() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOffWaitTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads OffWaitTime attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("OffWaitTime", actualValue, 0U)); } - err = TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponse_9(); - 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 TestSendOffCommand_37() { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 10; + [cluster offWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Send Off Command Error: %@", err); - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + CHIP_ERROR TestReadsOnOffAttributeFromDut_38() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement 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 readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: ClusterRevision Error: %@", err); + [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads OnOff attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 3U)); + VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); } NextTest(); @@ -31826,65 +37601,67 @@ class Test_TC_PRS_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() + CHIP_ERROR TestReadsOnTimeAttributeFromDut_39() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement 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 readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); + [cluster readAttributeOnTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads OnTime attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); + { + id actualValue = value; + VerifyOrReturn(CheckValue("OnTime", actualValue, 0U)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3() + CHIP_ERROR TestReadsOnOffAttributeFromDut_40() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement 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 clusterRevisionArgument; - clusterRevisionArgument = [NSNumber numberWithUnsignedShort:3U]; - [cluster - writeAttributeClusterRevisionWithValue:clusterRevisionArgument - completionHandler:^(NSError * _Nullable err) { - NSLog( - @"Write the default values to mandatory global attribute: ClusterRevision Error: %@", err); + [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads OnOff attribute from DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_4() + CHIP_ERROR TestReadsOnTimeAttributeFromDut_41() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement 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 readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads back global attribute: ClusterRevision Error: %@", err); + [cluster readAttributeOnTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads OnTime attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 3U)); + VerifyOrReturn(CheckValue("OnTime", actualValue, 0U)); } NextTest(); @@ -31893,66 +37670,133 @@ class Test_TC_PRS_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalMandatoryAttributeConstraintsAttributeList_5() + CHIP_ERROR TestReadsOffWaitTimeAttributeFromDut_42() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement 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 readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global mandatory attribute constraints: AttributeList Error: %@", err); + [cluster readAttributeOffWaitTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads OffWaitTime attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); + { + id actualValue = value; + VerifyOrReturn(CheckValue("OffWaitTime", actualValue, 0U)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_6() + CHIP_ERROR TestReadsOnOffAttributeFromDut_43() { - UserPrompt(@"Please enter 'y' for success", @"y"); + SetIdentity("alpha"); + 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(@"Reads OnOff attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); + } + + NextTest(); + }]; + return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAcceptedCommandListAttributeFromTheDutAndVerifyThatTheDutResponse_7() + CHIP_ERROR TestReadsOnTimeAttributeFromDut_44() { - UserPrompt(@"Please enter 'y' for success", @"y"); + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOnTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads OnTime attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("OnTime", actualValue, 0U)); + } + + NextTest(); + }]; + return CHIP_NO_ERROR; } - CHIP_ERROR TestReadGeneratedCommandListAttributeFromTheDutAndVerifyThatTheDutResponse_8() + CHIP_ERROR TestReadsOffWaitTimeAttributeFromDut_45() { - UserPrompt(@"Please enter 'y' for success", @"y"); + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOffWaitTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads OffWaitTime attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("OffWaitTime", actualValue, 0U)); + } + + NextTest(); + }]; + return CHIP_NO_ERROR; } - CHIP_ERROR TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponse_9() + CHIP_ERROR TestSendOffCommand_46() { - UserPrompt(@"Please enter '0' for success", @"0"); + SetIdentity("alpha"); + 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(@"Send Off Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + return CHIP_NO_ERROR; } }; -class Test_TC_PRS_2_1 : public TestCommandBridge { +class Test_TC_OO_2_4 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_PRS_2_1() - : TestCommandBridge("Test_TC_PRS_2_1") + 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_PRS_2_1() {} + ~Test_TC_OO_2_4() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -31960,11 +37804,11 @@ class Test_TC_PRS_2_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_PRS_2_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_OO_2_4\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PRS_2_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OO_2_4\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -31981,40 +37825,104 @@ class Test_TC_PRS_2_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read the mandatory attribute constraints: MeasuredValue\n"); - err = TestReadTheMandatoryAttributeConstraintsMeasuredValue_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : TH sends On command to DUT\n"); + err = TestThSendsOnCommandToDut_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Write the default values to mandatory attribute: MeasuredValue\n"); - err = TestWriteTheDefaultValuesToMandatoryAttributeMeasuredValue_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 : Reads back mandatory attribute: MeasuredValue\n"); - err = TestReadsBackMandatoryAttributeMeasuredValue_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 : Read the mandatory attribute constraints: MinMeasuredValue\n"); - err = TestReadTheMandatoryAttributeConstraintsMinMeasuredValue_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Power off DUT\n"); + err = TestPowerOffDut_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Write the default values to mandatory attribute: MinMeasuredValue\n"); - err = TestWriteTheDefaultValuesToMandatoryAttributeMinMeasuredValue_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 : Reads back mandatory attribute: MinMeasuredValue\n"); - err = TestReadsBackMandatoryAttributeMinMeasuredValue_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 : Read the mandatory attribute constraints: MaxMeasuredValue\n"); - err = TestReadTheMandatoryAttributeConstraintsMaxMeasuredValue_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 : Write the default values to mandatory attribute: MaxMeasuredValue\n"); - err = TestWriteTheDefaultValuesToMandatoryAttributeMaxMeasuredValue_8(); + ChipLogProgress(chipTool, " ***** Test Step 8 : Power off DUT\n"); + err = TestPowerOffDut_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Reads back mandatory attribute: MaxMeasuredValue\n"); - err = TestReadsBackMandatoryAttributeMaxMeasuredValue_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; } @@ -32024,6 +37932,93 @@ class Test_TC_PRS_2_1 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -32031,77 +38026,76 @@ class Test_TC_PRS_2_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 10; + const uint16_t mTestCount = 26; chip::Optional mNodeId; chip::Optional mCluster; chip::Optional mEndpoint; + chip::Optional mDiscriminator; chip::Optional mTimeout; CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheMandatoryAttributeConstraintsMeasuredValue_1() + CHIP_ERROR TestThSendsOnCommandToDut_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement 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 readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute constraints: MeasuredValue Error: %@", err); + [cluster onWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends On command to DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("measuredValue", "", "int16")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeMeasuredValue_2() + CHIP_ERROR TestThWritesAValueOf0ToStartUpOnOffAttributeOfDut_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement 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 measuredValueArgument; - measuredValueArgument = [NSNumber numberWithShort:0]; - [cluster writeAttributeMeasuredValueWithValue:measuredValueArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write the default values to mandatory attribute: MeasuredValue Error: %@", err); + 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, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsBackMandatoryAttributeMeasuredValue_3() + CHIP_ERROR TestThReadsTheStartUpOnOffAttributeFromTheDut_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement 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 readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads back mandatory attribute: MeasuredValue Error: %@", err); + [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("MeasuredValue", actualValue)); - VerifyOrReturn(CheckValue("MeasuredValue", actualValue, 0)); + VerifyOrReturn(CheckValueNonNull("StartUpOnOff", actualValue)); + VerifyOrReturn(CheckValue("StartUpOnOff", actualValue, 0)); } NextTest(); @@ -32110,65 +38104,93 @@ class Test_TC_PRS_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheMandatoryAttributeConstraintsMinMeasuredValue_4() + CHIP_ERROR TestPowerOffDut_4() + { + SetIdentity("alpha"); + Reboot(mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_5() { + SetIdentity("alpha"); + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsTheOnOffAttributeFromTheDut_6() + { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement 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 readAttributeMinMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute constraints: MinMeasuredValue Error: %@", err); + [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the OnOff attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("minMeasuredValue", "", "int16")); + { + id actualValue = value; + VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeMinMeasuredValue_5() + CHIP_ERROR TestThWritesAValueOf1ToStartUpOnOffAttributeOfDut_7() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement 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 minMeasuredValueArgument; - minMeasuredValueArgument = [NSNumber numberWithShort:0]; - [cluster - writeAttributeMinMeasuredValueWithValue:minMeasuredValueArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write the default values to mandatory attribute: MinMeasuredValue Error: %@", err); + 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, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsBackMandatoryAttributeMinMeasuredValue_6() + CHIP_ERROR TestPowerOffDut_8() + { + SetIdentity("alpha"); + Reboot(mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_9() + { + SetIdentity("alpha"); + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsTheOnOffAttributeFromTheDut_10() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement 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 readAttributeMinMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads back mandatory attribute: MinMeasuredValue Error: %@", err); + [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(CheckValueNonNull("MinMeasuredValue", actualValue)); - VerifyOrReturn(CheckValue("MinMeasuredValue", actualValue, 0)); + VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); } NextTest(); @@ -32177,65 +38199,206 @@ class Test_TC_PRS_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheMandatoryAttributeConstraintsMaxMeasuredValue_7() + CHIP_ERROR TestThWritesAValueOf2ToStartUpOnOffAttributeOfDut_11() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement 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 readAttributeMaxMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute constraints: MaxMeasuredValue Error: %@", err); + 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() + { + SetIdentity("alpha"); + Reboot(mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_13() + { + SetIdentity("alpha"); + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsTheOnOffAttributeFromTheDut_14() + { + SetIdentity("alpha"); + 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)); - VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "", "int16")); + { + id actualValue = value; + VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeMaxMeasuredValue_8() + CHIP_ERROR TestPowerOffDut_15() + { + SetIdentity("alpha"); + Reboot(mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_16() + { + SetIdentity("alpha"); + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsTheOnOffAttributeFromTheDut_17() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement 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 maxMeasuredValueArgument; - maxMeasuredValueArgument = [NSNumber numberWithShort:0]; - [cluster - writeAttributeMaxMeasuredValueWithValue:maxMeasuredValueArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write the default values to mandatory attribute: MaxMeasuredValue Error: %@", err); + [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the OnOff attribute from the DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsBackMandatoryAttributeMaxMeasuredValue_9() + CHIP_ERROR TestThWritesNullToStartUpOnOffAttributeOfDut_18() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement 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 readAttributeMaxMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads back mandatory attribute: MaxMeasuredValue Error: %@", err); + 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() + { + SetIdentity("alpha"); + Reboot(mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_20() + { + SetIdentity("alpha"); + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsTheOnOffAttributeFromTheDut_21() + { + SetIdentity("alpha"); + 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(CheckValueNonNull("MaxMeasuredValue", actualValue)); - VerifyOrReturn(CheckValue("MaxMeasuredValue", actualValue, 0)); + VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThSendsOffCommandToDut_22() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + Reboot(mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_24() + { + SetIdentity("alpha"); + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsTheOnOffAttributeFromTheDut_25() + { + SetIdentity("alpha"); + 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(); @@ -32245,11 +38408,11 @@ class Test_TC_PRS_2_1 : public TestCommandBridge { } }; -class Test_TC_PCC_1_1 : public TestCommandBridge { +class Test_TC_PS_1_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_PCC_1_1() - : TestCommandBridge("Test_TC_PCC_1_1") + Test_TC_PS_1_1() + : TestCommandBridge("Test_TC_PS_1_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -32259,7 +38422,7 @@ class Test_TC_PCC_1_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_PCC_1_1() {} + ~Test_TC_PS_1_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -32267,11 +38430,11 @@ class Test_TC_PCC_1_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_PCC_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_PS_1_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PCC_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PS_1_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -32288,42 +38451,43 @@ class Test_TC_PCC_1_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute constraints: ClusterRevision\n"); - err = TestReadTheGlobalAttributeConstraintsClusterRevision_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_1(); break; case 2: - ChipLogProgress( - chipTool, " ***** Test Step 2 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_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 the global attribute: AcceptedCommandList\n"); - err = TestReadTheGlobalAttributeAcceptedCommandList_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: GeneratedCommandList\n"); - err = TestReadTheGlobalAttributeGeneratedCommandList_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(); + ChipLogProgress(chipTool, " ***** Test Step 6 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_6(); break; case 7: ChipLogProgress(chipTool, " ***** Test Step 7 : read the optional global attribute: FeatureMap\n"); err = TestReadTheOptionalGlobalAttributeFeatureMap_7(); break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : write the default values to optional global attribute: FeatureMap\n"); - err = TestWriteTheDefaultValuesToOptionalGlobalAttributeFeatureMap_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : reads back optional global attribute: FeatureMap\n"); - err = TestReadsBackOptionalGlobalAttributeFeatureMap_9(); - break; } if (CHIP_NO_ERROR != err) { @@ -32332,6 +38496,39 @@ class Test_TC_PCC_1_1 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -32339,7 +38536,7 @@ class Test_TC_PCC_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 10; + const uint16_t mTestCount = 8; chip::Optional mNodeId; chip::Optional mCluster; @@ -32348,59 +38545,58 @@ class Test_TC_PCC_1_1 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_1() + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource 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); + NSLog(@"read the global attribute: ClusterRevision Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2() + CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id clusterRevisionArgument; - clusterRevisionArgument = [NSNumber numberWithUnsignedShort:3U]; - [cluster - writeAttributeClusterRevisionWithValue:clusterRevisionArgument - completionHandler:^(NSError * _Nullable err) { - NSLog( - @"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); + NextTest(); + }]; return CHIP_NO_ERROR; } CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { @@ -32408,6 +38604,25 @@ class Test_TC_PCC_1_1 : public TestCommandBridge { 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], 5UL)); + VerifyOrReturn(CheckValue("", actualValue[4], 11UL)); + VerifyOrReturn(CheckValue("", actualValue[5], 12UL)); + VerifyOrReturn(CheckValue("", actualValue[6], 13UL)); + VerifyOrReturn(CheckValue("", actualValue[7], 14UL)); + VerifyOrReturn(CheckValue("", actualValue[8], 15UL)); + VerifyOrReturn(CheckValue("", actualValue[9], 16UL)); + VerifyOrReturn(CheckValue("", actualValue[10], 19UL)); + VerifyOrReturn(CheckValue("", actualValue[11], 26UL)); + VerifyOrReturn(CheckValue("", actualValue[12], 28UL)); + VerifyOrReturn(CheckValue("", actualValue[13], 25UL)); + } + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); NextTest(); }]; @@ -32415,12 +38630,18 @@ class Test_TC_PCC_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_4() + CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_4() + { + SetIdentity("alpha"); + UserPrompt(@"Please enter 'y' for success", @"y"); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { @@ -32428,6 +38649,11 @@ class Test_TC_PCC_1_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); + } + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); NextTest(); }]; @@ -32435,12 +38661,11 @@ class Test_TC_PCC_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_5() + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { @@ -32448,31 +38673,12 @@ class Test_TC_PCC_1_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheOptionalGlobalAttributeFeatureMap_6() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl 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, 0UL)); + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); } + VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); NextTest(); }]; @@ -32481,10 +38687,9 @@ class Test_TC_PCC_1_1 : public TestCommandBridge { CHIP_ERROR TestReadTheOptionalGlobalAttributeFeatureMap_7() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { @@ -32492,53 +38697,11 @@ class Test_TC_PCC_1_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("featureMap", "", "map32")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestWriteTheDefaultValuesToOptionalGlobalAttributeFeatureMap_8() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id featureMapArgument; - featureMapArgument = [NSNumber numberWithUnsignedInt:0UL]; - [cluster writeAttributeFeatureMapWithValue:featureMapArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"write the default values to optional global attribute: FeatureMap Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadsBackOptionalGlobalAttributeFeatureMap_9() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"reads back optional global attribute: FeatureMap Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - { id actualValue = value; VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); } - VerifyOrReturn(CheckConstraintType("featureMap", "", "map32")); NextTest(); }]; @@ -32546,11 +38709,11 @@ class Test_TC_PCC_1_1 : public TestCommandBridge { } }; -class Test_TC_PCC_2_1 : public TestCommandBridge { +class Test_TC_PS_2_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_PCC_2_1() - : TestCommandBridge("Test_TC_PCC_2_1") + Test_TC_PS_2_1() + : TestCommandBridge("Test_TC_PS_2_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -32560,7 +38723,7 @@ class Test_TC_PCC_2_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_PCC_2_1() {} + ~Test_TC_PS_2_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -32568,11 +38731,11 @@ class Test_TC_PCC_2_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_PCC_2_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_PS_2_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PCC_2_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PS_2_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -32589,207 +38752,86 @@ class Test_TC_PCC_2_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : read the mandatory attribute: MaxPressure\n"); - err = TestReadTheMandatoryAttributeMaxPressure_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Test Harness Client reads Status attribute from Server DUT\n"); + err = TestTestHarnessClientReadsStatusAttributeFromServerDut_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : read the mandatory attribute: MaxSpeed\n"); - err = TestReadTheMandatoryAttributeMaxSpeed_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Test Harness Client reads Order attribute from Server DUT\n"); + err = TestTestHarnessClientReadsOrderAttributeFromServerDut_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : read the mandatory attribute: MaxFlow\n"); - err = TestReadTheMandatoryAttributeMaxFlow_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Test Harness Client reads Description attribute from Server DUT\n"); + err = TestTestHarnessClientReadsDescriptionAttributeFromServerDut_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : read the mandatory attribute: EffectiveOperationMode\n"); - err = TestReadTheMandatoryAttributeEffectiveOperationMode_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Test Harness Client reads BatVoltage from Server DUT\n"); + err = TestTestHarnessClientReadsBatVoltageFromServerDut_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : read the mandatory attribute: EffectiveControlMode\n"); - err = TestReadTheMandatoryAttributeEffectiveControlMode_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Test Harness Client reads BatPercentRemaining from Server DUT\n"); + err = TestTestHarnessClientReadsBatPercentRemainingFromServerDut_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : read the mandatory attribute: Capacity\n"); - err = TestReadTheMandatoryAttributeCapacity_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : Test Harness Client reads BatTimeRemaining from Server DUT\n"); + err = TestTestHarnessClientReadsBatTimeRemainingFromServerDut_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : read the mandatory attribute: MaxPressure\n"); - err = TestReadTheMandatoryAttributeMaxPressure_7(); + ChipLogProgress(chipTool, " ***** Test Step 7 : Test Harness Client reads BatChargeLevel from Server DUT\n"); + err = TestTestHarnessClientReadsBatChargeLevelFromServerDut_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : read the mandatory attribute: MaxSpeed\n"); - err = TestReadTheMandatoryAttributeMaxSpeed_8(); + ChipLogProgress(chipTool, " ***** Test Step 8 : Test Harness Client reads ActiveBatFaults from Server DUT\n"); + err = TestTestHarnessClientReadsActiveBatFaultsFromServerDut_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : read the mandatory attribute: MaxFlow\n"); - err = TestReadTheMandatoryAttributeMaxFlow_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : read the mandatory attribute: EffectiveOperationMode\n"); - err = TestReadTheMandatoryAttributeEffectiveOperationMode_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : read the mandatory attribute: EffectiveControlMode\n"); - err = TestReadTheMandatoryAttributeEffectiveControlMode_11(); + ChipLogProgress(chipTool, " ***** Test Step 9 : Test Harness Client reads BatChargeState from Server DUT\n"); + err = TestTestHarnessClientReadsBatChargeStateFromServerDut_9(); break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : read the mandatory attribute: Capacity\n"); - err = TestReadTheMandatoryAttributeCapacity_12(); - break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : read the optional attribute: MinConstPressure\n"); - err = TestReadTheOptionalAttributeMinConstPressure_13(); - break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : read the optional attribute: MaxConstPressure\n"); - err = TestReadTheOptionalAttributeMaxConstPressure_14(); - break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : read the optional attribute: MinCompPressure\n"); - err = TestReadTheOptionalAttributeMinCompPressure_15(); - break; - case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : read the optional attribute: MaxCompPressure\n"); - err = TestReadTheOptionalAttributeMaxCompPressure_16(); - break; - case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : read the optional attribute: MinConstSpeed\n"); - err = TestReadTheOptionalAttributeMinConstSpeed_17(); - break; - case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : read the optional attribute: MaxConstSpeed\n"); - err = TestReadTheOptionalAttributeMaxConstSpeed_18(); - break; - case 19: - ChipLogProgress(chipTool, " ***** Test Step 19 : read the optional attribute: MinConstFlow\n"); - err = TestReadTheOptionalAttributeMinConstFlow_19(); - break; - case 20: - ChipLogProgress(chipTool, " ***** Test Step 20 : read the optional attribute: MaxConstFlow\n"); - err = TestReadTheOptionalAttributeMaxConstFlow_20(); - break; - case 21: - ChipLogProgress(chipTool, " ***** Test Step 21 : read the optional attribute: MinConstTemp\n"); - err = TestReadTheOptionalAttributeMinConstTemp_21(); - break; - case 22: - ChipLogProgress(chipTool, " ***** Test Step 22 : read the optional attribute: MaxConstTemp\n"); - err = TestReadTheOptionalAttributeMaxConstTemp_22(); - break; - case 23: - ChipLogProgress(chipTool, " ***** Test Step 23 : read the optional attribute: PumpStatus\n"); - err = TestReadTheOptionalAttributePumpStatus_23(); - break; - case 24: - ChipLogProgress(chipTool, " ***** Test Step 24 : read the optional attribute: PumpStatus\n"); - err = TestReadTheOptionalAttributePumpStatus_24(); - break; - case 25: - ChipLogProgress(chipTool, " ***** Test Step 25 : read the optional attribute: Speed\n"); - err = TestReadTheOptionalAttributeSpeed_25(); - break; - case 26: - ChipLogProgress(chipTool, " ***** Test Step 26 : read the optional attribute: LifetimeRunningHours\n"); - err = TestReadTheOptionalAttributeLifetimeRunningHours_26(); - break; - case 27: - ChipLogProgress(chipTool, " ***** Test Step 27 : read the optional attribute: LifetimeRunningHours\n"); - err = TestReadTheOptionalAttributeLifetimeRunningHours_27(); - break; - case 28: - ChipLogProgress(chipTool, " ***** Test Step 28 : read the optional attribute: Power\n"); - err = TestReadTheOptionalAttributePower_28(); - break; - case 29: - ChipLogProgress(chipTool, " ***** Test Step 29 : read the optional attribute: LifetimeEnergyConsumed\n"); - err = TestReadTheOptionalAttributeLifetimeEnergyConsumed_29(); - break; - case 30: - ChipLogProgress(chipTool, " ***** Test Step 30 : read the optional attribute: LifetimeEnergyConsumed\n"); - err = TestReadTheOptionalAttributeLifetimeEnergyConsumed_30(); - break; - case 31: - ChipLogProgress(chipTool, " ***** Test Step 31 : write to the optional attribute: LifetimeEnergyConsumed\n"); - err = TestWriteToTheOptionalAttributeLifetimeEnergyConsumed_31(); - break; - case 32: - ChipLogProgress(chipTool, " ***** Test Step 32 : read the optional attribute: MinConstPressure\n"); - err = TestReadTheOptionalAttributeMinConstPressure_32(); - break; - case 33: - ChipLogProgress(chipTool, " ***** Test Step 33 : read the optional attribute: MaxConstPressure\n"); - err = TestReadTheOptionalAttributeMaxConstPressure_33(); - break; - case 34: - ChipLogProgress(chipTool, " ***** Test Step 34 : read the optional attribute: MinCompPressure\n"); - err = TestReadTheOptionalAttributeMinCompPressure_34(); - break; - case 35: - ChipLogProgress(chipTool, " ***** Test Step 35 : read the optional attribute: MaxCompPressure\n"); - err = TestReadTheOptionalAttributeMaxCompPressure_35(); - break; - case 36: - ChipLogProgress(chipTool, " ***** Test Step 36 : read the optional attribute: MinConstSpeed\n"); - err = TestReadTheOptionalAttributeMinConstSpeed_36(); - break; - case 37: - ChipLogProgress(chipTool, " ***** Test Step 37 : read the optional attribute: MaxConstSpeed\n"); - err = TestReadTheOptionalAttributeMaxConstSpeed_37(); - break; - case 38: - ChipLogProgress(chipTool, " ***** Test Step 38 : read the optional attribute: MinConstFlow\n"); - err = TestReadTheOptionalAttributeMinConstFlow_38(); - break; - case 39: - ChipLogProgress(chipTool, " ***** Test Step 39 : read the optional attribute: MaxConstFlow\n"); - err = TestReadTheOptionalAttributeMaxConstFlow_39(); - break; - case 40: - ChipLogProgress(chipTool, " ***** Test Step 40 : read the optional attribute: MinConstTemp\n"); - err = TestReadTheOptionalAttributeMinConstTemp_40(); + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 41: - ChipLogProgress(chipTool, " ***** Test Step 41 : read the optional attribute: MaxConstTemp\n"); - err = TestReadTheOptionalAttributeMaxConstTemp_41(); + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 42: - ChipLogProgress(chipTool, " ***** Test Step 42 : read the optional attribute: PumpStatus\n"); - err = TestReadTheOptionalAttributePumpStatus_42(); + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 43: - ChipLogProgress(chipTool, " ***** Test Step 43 : read the optional attribute: PumpStatus\n"); - err = TestReadTheOptionalAttributePumpStatus_43(); + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 44: - ChipLogProgress(chipTool, " ***** Test Step 44 : read the optional attribute: Speed\n"); - err = TestReadTheOptionalAttributeSpeed_44(); + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 45: - ChipLogProgress(chipTool, " ***** Test Step 45 : read the optional attribute: LifetimeRunningHours\n"); - err = TestReadTheOptionalAttributeLifetimeRunningHours_45(); + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 46: - ChipLogProgress(chipTool, " ***** Test Step 46 : read the optional attribute: LifetimeRunningHours\n"); - err = TestReadTheOptionalAttributeLifetimeRunningHours_46(); + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 47: - ChipLogProgress(chipTool, " ***** Test Step 47 : read the optional attribute: Power\n"); - err = TestReadTheOptionalAttributePower_47(); + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 48: - ChipLogProgress(chipTool, " ***** Test Step 48 : read the optional attribute: LifetimeEnergyConsumed\n"); - err = TestReadTheOptionalAttributeLifetimeEnergyConsumed_48(); + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 49: - ChipLogProgress(chipTool, " ***** Test Step 49 : read the optional attribute: LifetimeEnergyConsumed\n"); - err = TestReadTheOptionalAttributeLifetimeEnergyConsumed_49(); + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; } - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + // Go on to the next test. + WaitForMs(0); } chip::System::Clock::Timeout GetWaitDuration() const override @@ -32799,7 +38841,7 @@ class Test_TC_PCC_2_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 50; + const uint16_t mTestCount = 10; chip::Optional mNodeId; chip::Optional mCluster; @@ -32808,529 +38850,731 @@ class Test_TC_PCC_2_1 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheMandatoryAttributeMaxPressure_1() + CHIP_ERROR TestTestHarnessClientReadsStatusAttributeFromServerDut_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMaxPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: MaxPressure Error: %@", err); + [cluster readAttributeStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test Harness Client reads Status attribute from Server DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("maxPressure", "", "int16")); + VerifyOrReturn(CheckConstraintType("status", "", "enum8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("status", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("status", [value unsignedCharValue], 3)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheMandatoryAttributeMaxSpeed_2() + CHIP_ERROR TestTestHarnessClientReadsOrderAttributeFromServerDut_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMaxSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: MaxSpeed Error: %@", err); + [cluster readAttributeOrderWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test Harness Client reads Order attribute from Server DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("maxSpeed", "", "uint16")); + VerifyOrReturn(CheckConstraintType("order", "", "uint8")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheMandatoryAttributeMaxFlow_3() + CHIP_ERROR TestTestHarnessClientReadsDescriptionAttributeFromServerDut_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMaxFlowWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: MaxFlow Error: %@", err); + [cluster readAttributeDescriptionWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test Harness Client reads Description attribute from Server DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("maxFlow", "", "uint16")); + VerifyOrReturn(CheckConstraintType("description", "", "string")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheMandatoryAttributeEffectiveOperationMode_4() + CHIP_ERROR TestTestHarnessClientReadsBatVoltageFromServerDut_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEffectiveOperationModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: EffectiveOperationMode Error: %@", err); + [cluster readAttributeBatteryVoltageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test Harness Client reads BatVoltage from Server DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("effectiveOperationMode", "", "enum8")); + VerifyOrReturn(CheckConstraintType("batteryVoltage", "", "uint32")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheMandatoryAttributeEffectiveControlMode_5() + CHIP_ERROR TestTestHarnessClientReadsBatPercentRemainingFromServerDut_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEffectiveControlModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: EffectiveControlMode Error: %@", err); + [cluster readAttributeBatteryPercentRemainingWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test Harness Client reads BatPercentRemaining from Server DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("effectiveControlMode", "", "enum8")); + VerifyOrReturn(CheckConstraintType("batteryPercentRemaining", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("batteryPercentRemaining", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("batteryPercentRemaining", [value unsignedCharValue], 200)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheMandatoryAttributeCapacity_6() + CHIP_ERROR TestTestHarnessClientReadsBatTimeRemainingFromServerDut_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCapacityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: Capacity Error: %@", err); + [cluster readAttributeBatteryTimeRemainingWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test Harness Client reads BatTimeRemaining from Server DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("capacity", "", "int16")); + VerifyOrReturn(CheckConstraintType("batteryTimeRemaining", "", "uint32")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheMandatoryAttributeMaxPressure_7() + CHIP_ERROR TestTestHarnessClientReadsBatChargeLevelFromServerDut_7() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMaxPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: MaxPressure Error: %@", err); + [cluster readAttributeBatteryChargeLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test Harness Client reads BatChargeLevel from Server DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("maxPressure", "", "int16")); + VerifyOrReturn(CheckConstraintType("batteryChargeLevel", "", "enum8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("batteryChargeLevel", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("batteryChargeLevel", [value unsignedCharValue], 2)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheMandatoryAttributeMaxSpeed_8() + CHIP_ERROR TestTestHarnessClientReadsActiveBatFaultsFromServerDut_8() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMaxSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: MaxSpeed Error: %@", err); + [cluster readAttributeActiveBatteryFaultsWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test Harness Client reads ActiveBatFaults from Server DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("maxSpeed", "", "uint16")); + VerifyOrReturn(CheckConstraintType("activeBatteryFaults", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheMandatoryAttributeMaxFlow_9() + CHIP_ERROR TestTestHarnessClientReadsBatChargeStateFromServerDut_9() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMaxFlowWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: MaxFlow Error: %@", err); + [cluster readAttributeBatteryChargeStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test Harness Client reads BatChargeState from Server DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("maxFlow", "", "uint16")); + VerifyOrReturn(CheckConstraintType("batteryChargeState", "", "enum8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("batteryChargeState", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("batteryChargeState", [value unsignedCharValue], 3)); + } + NextTest(); }]; return CHIP_NO_ERROR; } +}; - CHIP_ERROR TestReadTheMandatoryAttributeEffectiveOperationMode_10() +class Test_TC_PRS_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_PRS_1_1() + : TestCommandBridge("Test_TC_PRS_1_1") + , mTestIndex(0) { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl 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 readAttributeEffectiveOperationModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: EffectiveOperationMode Error: %@", err); + ~Test_TC_PRS_1_1() {} - VerifyOrReturn(CheckValue("status", err, 0)); + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; - VerifyOrReturn(CheckConstraintType("effectiveOperationMode", "", "enum8")); - NextTest(); - }]; + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_PRS_1_1\n"); + } - return CHIP_NO_ERROR; + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PRS_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 : Write the default values to mandatory global attribute: ClusterRevision\n"); + err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Reads back global attribute: ClusterRevision\n"); + err = TestReadsBackGlobalAttributeClusterRevision_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global mandatory attribute constraints: AttributeList\n"); + err = TestReadTheGlobalMandatoryAttributeConstraintsAttributeList_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(); + break; + case 7: + ChipLogProgress(chipTool, + " ***** Test Step 7 : Read AcceptedCommandList attribute from the DUT and Verify that the DUT response\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadAcceptedCommandListAttributeFromTheDutAndVerifyThatTheDutResponse_7(); + break; + case 8: + ChipLogProgress(chipTool, + " ***** Test Step 8 : Read GeneratedCommandList attribute from the DUT and Verify that the DUT response\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadGeneratedCommandListAttributeFromTheDutAndVerifyThatTheDutResponse_8(); + break; + case 9: + ChipLogProgress( + chipTool, " ***** Test Step 9 : Read FeatureMap attribute from the DUT and Verify that the DUT response\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponse_9(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - CHIP_ERROR TestReadTheMandatoryAttributeEffectiveControlMode_11() + void OnStatusUpdate(const chip::app::StatusIB & status) override { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } - [cluster readAttributeEffectiveControlModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: EffectiveControlMode Error: %@", err); + // Go on to the next test. + WaitForMs(0); + } - VerifyOrReturn(CheckValue("status", err, 0)); + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } - VerifyOrReturn(CheckConstraintType("effectiveControlMode", "", "enum8")); - NextTest(); - }]; +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 10; + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity("alpha"); + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheMandatoryAttributeCapacity_12() + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCapacityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: Capacity Error: %@", err); + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: ClusterRevision Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("capacity", "", "int16")); + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 3U)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeMinConstPressure_13() + CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMinConstPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: MinConstPressure Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("minConstPressure", "", "int16")); + VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeMaxConstPressure_14() + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMaxConstPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: MaxConstPressure Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - - VerifyOrReturn(CheckValue("status", err, 0)); + id clusterRevisionArgument; + clusterRevisionArgument = [NSNumber numberWithUnsignedShort:3U]; + [cluster + writeAttributeClusterRevisionWithValue:clusterRevisionArgument + completionHandler:^(NSError * _Nullable err) { + NSLog( + @"Write the default values to mandatory global attribute: ClusterRevision Error: %@", err); - VerifyOrReturn(CheckConstraintType("maxConstPressure", "", "int16")); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeMinCompPressure_15() + CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMinCompPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: MinCompPressure Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads back global attribute: ClusterRevision Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("minCompPressure", "", "int16")); + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 3U)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeMaxCompPressure_16() + CHIP_ERROR TestReadTheGlobalMandatoryAttributeConstraintsAttributeList_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMaxCompPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: MaxCompPressure Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global mandatory attribute constraints: AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("maxCompPressure", "", "int16")); + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeMinConstSpeed_17() + CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_6() { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeMinConstSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: MinConstSpeed Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("minConstSpeed", "", "uint16")); - NextTest(); - }]; - + SetIdentity("alpha"); + UserPrompt(@"Please enter 'y' for success", @"y"); return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeMaxConstSpeed_18() + CHIP_ERROR TestReadAcceptedCommandListAttributeFromTheDutAndVerifyThatTheDutResponse_7() { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeMaxConstSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: MaxConstSpeed Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - - VerifyOrReturn(CheckValue("status", err, 0)); + SetIdentity("alpha"); + UserPrompt(@"Please enter 'y' for success", @"y"); + return CHIP_NO_ERROR; + } - VerifyOrReturn(CheckConstraintType("maxConstSpeed", "", "uint16")); - NextTest(); - }]; + CHIP_ERROR TestReadGeneratedCommandListAttributeFromTheDutAndVerifyThatTheDutResponse_8() + { + SetIdentity("alpha"); + UserPrompt(@"Please enter 'y' for success", @"y"); + return CHIP_NO_ERROR; + } + CHIP_ERROR TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponse_9() + { + SetIdentity("alpha"); + UserPrompt(@"Please enter '0' for success", @"0"); return CHIP_NO_ERROR; } +}; - CHIP_ERROR TestReadTheOptionalAttributeMinConstFlow_19() +class Test_TC_PRS_2_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_PRS_2_1() + : TestCommandBridge("Test_TC_PRS_2_1") + , mTestIndex(0) { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl 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 readAttributeMinConstFlowWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: MinConstFlow Error: %@", err); + ~Test_TC_PRS_2_1() {} - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + /////////// 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_PRS_2_1\n"); + } - VerifyOrReturn(CheckConstraintType("minConstFlow", "", "uint16")); - NextTest(); - }]; + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PRS_2_1\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 : Read the mandatory attribute constraints: MeasuredValue\n"); + err = TestReadTheMandatoryAttributeConstraintsMeasuredValue_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Write the default values to mandatory attribute: MeasuredValue\n"); + err = TestWriteTheDefaultValuesToMandatoryAttributeMeasuredValue_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Reads back mandatory attribute: MeasuredValue\n"); + err = TestReadsBackMandatoryAttributeMeasuredValue_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Read the mandatory attribute constraints: MinMeasuredValue\n"); + err = TestReadTheMandatoryAttributeConstraintsMinMeasuredValue_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Write the default values to mandatory attribute: MinMeasuredValue\n"); + err = TestWriteTheDefaultValuesToMandatoryAttributeMinMeasuredValue_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Reads back mandatory attribute: MinMeasuredValue\n"); + err = TestReadsBackMandatoryAttributeMinMeasuredValue_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Read the mandatory attribute constraints: MaxMeasuredValue\n"); + err = TestReadTheMandatoryAttributeConstraintsMaxMeasuredValue_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Write the default values to mandatory attribute: MaxMeasuredValue\n"); + err = TestWriteTheDefaultValuesToMandatoryAttributeMaxMeasuredValue_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Reads back mandatory attribute: MaxMeasuredValue\n"); + err = TestReadsBackMandatoryAttributeMaxMeasuredValue_9(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - CHIP_ERROR TestReadTheOptionalAttributeMaxConstFlow_20() + void OnStatusUpdate(const chip::app::StatusIB & status) override { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } - [cluster readAttributeMaxConstFlowWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: MaxConstFlow Error: %@", err); + // Go on to the next test. + WaitForMs(0); + } - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } - VerifyOrReturn(CheckValue("status", err, 0)); +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 10; - VerifyOrReturn(CheckConstraintType("maxConstFlow", "", "uint16")); - NextTest(); - }]; + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity("alpha"); + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeMinConstTemp_21() + CHIP_ERROR TestReadTheMandatoryAttributeConstraintsMeasuredValue_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMinConstTempWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: MinConstTemp Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + [cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the mandatory attribute constraints: MeasuredValue Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("minConstTemp", "", "int16")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("minConstTemp", [value shortValue], -27315)); - } - + VerifyOrReturn(CheckConstraintType("measuredValue", "", "int16")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeMaxConstTemp_22() + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeMeasuredValue_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMaxConstTempWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: MaxConstTemp Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("maxConstTemp", "", "int16")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("maxConstTemp", [value shortValue], -27315)); - } + id measuredValueArgument; + measuredValueArgument = [NSNumber numberWithShort:0]; + [cluster writeAttributeMeasuredValueWithValue:measuredValueArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write the default values to mandatory attribute: MeasuredValue Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributePumpStatus_23() + CHIP_ERROR TestReadsBackMandatoryAttributeMeasuredValue_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributePumpStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: PumpStatus Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + [cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads back mandatory attribute: MeasuredValue Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("PumpStatus", actualValue, 0U)); + VerifyOrReturn(CheckValueNonNull("MeasuredValue", actualValue)); + VerifyOrReturn(CheckValue("MeasuredValue", actualValue, 0)); } NextTest(); @@ -33339,78 +39583,68 @@ class Test_TC_PCC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributePumpStatus_24() + CHIP_ERROR TestReadTheMandatoryAttributeConstraintsMinMeasuredValue_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributePumpStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: PumpStatus Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + [cluster readAttributeMinMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the mandatory attribute constraints: MinMeasuredValue Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("pumpStatus", "", "map16")); + VerifyOrReturn(CheckConstraintType("minMeasuredValue", "", "int16")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeSpeed_25() + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeMinMeasuredValue_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: Speed Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - - VerifyOrReturn(CheckValue("status", err, 0)); + id minMeasuredValueArgument; + minMeasuredValueArgument = [NSNumber numberWithShort:0]; + [cluster + writeAttributeMinMeasuredValueWithValue:minMeasuredValueArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write the default values to mandatory attribute: MinMeasuredValue Error: %@", err); - VerifyOrReturn(CheckConstraintType("speed", "", "uint16")); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeLifetimeRunningHours_26() + CHIP_ERROR TestReadsBackMandatoryAttributeMinMeasuredValue_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeLifetimeRunningHoursWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: LifetimeRunningHours Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + [cluster readAttributeMinMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads back mandatory attribute: MinMeasuredValue Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("LifetimeRunningHours", actualValue)); - VerifyOrReturn(CheckValue("LifetimeRunningHours", actualValue, 0UL)); + VerifyOrReturn(CheckValueNonNull("MinMeasuredValue", actualValue)); + VerifyOrReturn(CheckValue("MinMeasuredValue", actualValue, 0)); } NextTest(); @@ -33419,78 +39653,68 @@ class Test_TC_PCC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeLifetimeRunningHours_27() + CHIP_ERROR TestReadTheMandatoryAttributeConstraintsMaxMeasuredValue_7() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeLifetimeRunningHoursWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: LifetimeRunningHours Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + [cluster readAttributeMaxMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the mandatory attribute constraints: MaxMeasuredValue Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("lifetimeRunningHours", "", "uint24")); + VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "", "int16")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributePower_28() + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeMaxMeasuredValue_8() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributePowerWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: Power Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - - VerifyOrReturn(CheckValue("status", err, 0)); + id maxMeasuredValueArgument; + maxMeasuredValueArgument = [NSNumber numberWithShort:0]; + [cluster + writeAttributeMaxMeasuredValueWithValue:maxMeasuredValueArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write the default values to mandatory attribute: MaxMeasuredValue Error: %@", err); - VerifyOrReturn(CheckConstraintType("power", "", "uint24")); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeLifetimeEnergyConsumed_29() + CHIP_ERROR TestReadsBackMandatoryAttributeMaxMeasuredValue_9() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeLifetimeEnergyConsumedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: LifetimeEnergyConsumed Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + [cluster readAttributeMaxMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads back mandatory attribute: MaxMeasuredValue Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("LifetimeEnergyConsumed", actualValue)); - VerifyOrReturn(CheckValue("LifetimeEnergyConsumed", actualValue, 0UL)); + VerifyOrReturn(CheckValueNonNull("MaxMeasuredValue", actualValue)); + VerifyOrReturn(CheckValue("MaxMeasuredValue", actualValue, 0)); } NextTest(); @@ -33498,419 +39722,280 @@ class Test_TC_PCC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } +}; - CHIP_ERROR TestReadTheOptionalAttributeLifetimeEnergyConsumed_30() +class Test_TC_PCC_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_PCC_1_1() + : TestCommandBridge("Test_TC_PCC_1_1") + , mTestIndex(0) { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl 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 readAttributeLifetimeEnergyConsumedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: LifetimeEnergyConsumed Error: %@", err); + ~Test_TC_PCC_1_1() {} - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + /////////// 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_PCC_1_1\n"); + } - VerifyOrReturn(CheckConstraintType("lifetimeEnergyConsumed", "", "uint32")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestWriteToTheOptionalAttributeLifetimeEnergyConsumed_31() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id lifetimeEnergyConsumedArgument; - lifetimeEnergyConsumedArgument = [NSNumber numberWithUnsignedInt:0UL]; - [cluster writeAttributeLifetimeEnergyConsumedWithValue:lifetimeEnergyConsumedArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"write to the optional attribute: LifetimeEnergyConsumed Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheOptionalAttributeMinConstPressure_32() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeMinConstPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: MinConstPressure Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("minConstPressure", "", "int16")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheOptionalAttributeMaxConstPressure_33() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeMaxConstPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: MaxConstPressure Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("maxConstPressure", "", "int16")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheOptionalAttributeMinCompPressure_34() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeMinCompPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: MinCompPressure Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("minCompPressure", "", "int16")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheOptionalAttributeMaxCompPressure_35() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeMaxCompPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: MaxCompPressure Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PCC_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } - VerifyOrReturn(CheckValue("status", err, 0)); + Wait(); - VerifyOrReturn(CheckConstraintType("maxCompPressure", "", "int16")); - 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 : Read the global attribute constraints: ClusterRevision\n"); + err = TestReadTheGlobalAttributeConstraintsClusterRevision_1(); + break; + case 2: + ChipLogProgress( + chipTool, " ***** Test Step 2 : write the default values to mandatory global attribute: ClusterRevision\n"); + err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); + 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 6 : read the optional global attribute: FeatureMap\n"); + err = TestReadTheOptionalGlobalAttributeFeatureMap_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : read the optional global attribute: FeatureMap\n"); + err = TestReadTheOptionalGlobalAttributeFeatureMap_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : write the default values to optional global attribute: FeatureMap\n"); + err = TestWriteTheDefaultValuesToOptionalGlobalAttributeFeatureMap_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : reads back optional global attribute: FeatureMap\n"); + err = TestReadsBackOptionalGlobalAttributeFeatureMap_9(); + break; + } - return CHIP_NO_ERROR; + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - CHIP_ERROR TestReadTheOptionalAttributeMinConstSpeed_36() + void OnStatusUpdate(const chip::app::StatusIB & status) override { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeMinConstSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: MinConstSpeed Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("minConstSpeed", "", "uint16")); - NextTest(); - }]; + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } - return CHIP_NO_ERROR; + // Go on to the next test. + WaitForMs(0); } - CHIP_ERROR TestReadTheOptionalAttributeMaxConstSpeed_37() + chip::System::Clock::Timeout GetWaitDuration() const override { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeMaxConstSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: MaxConstSpeed Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("maxConstSpeed", "", "uint16")); - NextTest(); - }]; - - return CHIP_NO_ERROR; + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); } - CHIP_ERROR TestReadTheOptionalAttributeMinConstFlow_38() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeMinConstFlowWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: MinConstFlow Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("minConstFlow", "", "uint16")); - NextTest(); - }]; +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 10; - return CHIP_NO_ERROR; - } + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; - CHIP_ERROR TestReadTheOptionalAttributeMaxConstFlow_39() + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeMaxConstFlowWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: MaxConstFlow Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("maxConstFlow", "", "uint16")); - NextTest(); - }]; - + SetIdentity("alpha"); + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeMinConstTemp_40() + CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMinConstTempWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: MinConstTemp Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("minConstTemp", "", "int16")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("minConstTemp", [value shortValue], -27315)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("minConstTemp", [value shortValue], 32767)); - } - + VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeMaxConstTemp_41() + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMaxConstTempWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: MaxConstTemp Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("maxConstTemp", "", "int16")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("maxConstTemp", [value shortValue], -27315)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("maxConstTemp", [value shortValue], 32767)); - } + id clusterRevisionArgument; + clusterRevisionArgument = [NSNumber numberWithUnsignedShort:3U]; + [cluster + writeAttributeClusterRevisionWithValue:clusterRevisionArgument + completionHandler:^(NSError * _Nullable err) { + NSLog( + @"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributePumpStatus_42() + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributePumpStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: PumpStatus Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + [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("PumpStatus", actualValue, 0U)); - } - + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributePumpStatus_43() + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributePumpStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: PumpStatus Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("pumpStatus", "", "map16")); + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeSpeed_44() + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: Speed Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("speed", "", "uint16")); + VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeLifetimeRunningHours_45() + CHIP_ERROR TestReadTheOptionalGlobalAttributeFeatureMap_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeLifetimeRunningHoursWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: LifetimeRunningHours Error: %@", err); + [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(CheckValueNonNull("LifetimeRunningHours", actualValue)); - VerifyOrReturn(CheckValue("LifetimeRunningHours", actualValue, 0UL)); + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); } NextTest(); @@ -33919,105 +40004,69 @@ class Test_TC_PCC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeLifetimeRunningHours_46() + CHIP_ERROR TestReadTheOptionalGlobalAttributeFeatureMap_7() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeLifetimeRunningHoursWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: LifetimeRunningHours Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the optional global attribute: FeatureMap Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("lifetimeRunningHours", "", "uint24")); + VerifyOrReturn(CheckConstraintType("featureMap", "", "map32")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributePower_47() + CHIP_ERROR TestWriteTheDefaultValuesToOptionalGlobalAttributeFeatureMap_8() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributePowerWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: Power Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - - VerifyOrReturn(CheckValue("status", err, 0)); + id featureMapArgument; + featureMapArgument = [NSNumber numberWithUnsignedInt:0UL]; + [cluster writeAttributeFeatureMapWithValue:featureMapArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"write the default values to optional global attribute: FeatureMap Error: %@", err); - VerifyOrReturn(CheckConstraintType("power", "", "uint24")); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeLifetimeEnergyConsumed_48() + CHIP_ERROR TestReadsBackOptionalGlobalAttributeFeatureMap_9() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeLifetimeEnergyConsumedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: LifetimeEnergyConsumed Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"reads back optional global attribute: FeatureMap Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("LifetimeEnergyConsumed", actualValue)); - VerifyOrReturn(CheckValue("LifetimeEnergyConsumed", actualValue, 0UL)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheOptionalAttributeLifetimeEnergyConsumed_49() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeLifetimeEnergyConsumedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: LifetimeEnergyConsumed Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); } - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("lifetimeEnergyConsumed", "", "uint32")); + VerifyOrReturn(CheckConstraintType("featureMap", "", "map32")); NextTest(); }]; @@ -34025,11 +40074,11 @@ class Test_TC_PCC_2_1 : public TestCommandBridge { } }; -class Test_TC_PCC_2_2 : public TestCommandBridge { +class Test_TC_PCC_2_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_PCC_2_2() - : TestCommandBridge("Test_TC_PCC_2_2") + Test_TC_PCC_2_1() + : TestCommandBridge("Test_TC_PCC_2_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -34039,7 +40088,7 @@ class Test_TC_PCC_2_2 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_PCC_2_2() {} + ~Test_TC_PCC_2_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -34047,11 +40096,11 @@ class Test_TC_PCC_2_2 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_PCC_2_2\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_PCC_2_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PCC_2_2\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PCC_2_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -34068,52 +40117,200 @@ class Test_TC_PCC_2_2 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Write 1 to the OperationMode attribute to DUT: OperationMode\n"); - if (ShouldSkip("A_OPERATIONMODE")) { - NextTest(); - return; - } - err = TestWrite1ToTheOperationModeAttributeToDutOperationMode_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : read the mandatory attribute: MaxPressure\n"); + err = TestReadTheMandatoryAttributeMaxPressure_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Reads the attribute: EffectiveOperationMode\n"); - if (ShouldSkip("A_EFFECTIVEOPERATIONMODE")) { - NextTest(); - return; - } - err = TestReadsTheAttributeEffectiveOperationMode_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : read the mandatory attribute: MaxSpeed\n"); + err = TestReadTheMandatoryAttributeMaxSpeed_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Write 2 to the OperationMode attribute to DUT: OperationMode\n"); - if (ShouldSkip("A_OPERATIONMODE")) { - NextTest(); - return; - } - err = TestWrite2ToTheOperationModeAttributeToDutOperationMode_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : read the mandatory attribute: MaxFlow\n"); + err = TestReadTheMandatoryAttributeMaxFlow_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Reads the attribute: EffectiveOperationMode\n"); - if (ShouldSkip("A_EFFECTIVEOPERATIONMODE")) { - NextTest(); - return; - } - err = TestReadsTheAttributeEffectiveOperationMode_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : read the mandatory attribute: EffectiveOperationMode\n"); + err = TestReadTheMandatoryAttributeEffectiveOperationMode_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Write 3 to the OperationMode attribute to DUT: OperationMode\n"); - if (ShouldSkip("A_OPERATIONMODE")) { - NextTest(); - return; - } - err = TestWrite3ToTheOperationModeAttributeToDutOperationMode_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : read the mandatory attribute: EffectiveControlMode\n"); + err = TestReadTheMandatoryAttributeEffectiveControlMode_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Reads the attribute: EffectiveOperationMode\n"); - if (ShouldSkip("A_EFFECTIVEOPERATIONMODE")) { - NextTest(); - return; - } - err = TestReadsTheAttributeEffectiveOperationMode_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : read the mandatory attribute: Capacity\n"); + err = TestReadTheMandatoryAttributeCapacity_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : read the mandatory attribute: MaxPressure\n"); + err = TestReadTheMandatoryAttributeMaxPressure_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : read the mandatory attribute: MaxSpeed\n"); + err = TestReadTheMandatoryAttributeMaxSpeed_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : read the mandatory attribute: MaxFlow\n"); + err = TestReadTheMandatoryAttributeMaxFlow_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : read the mandatory attribute: EffectiveOperationMode\n"); + err = TestReadTheMandatoryAttributeEffectiveOperationMode_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : read the mandatory attribute: EffectiveControlMode\n"); + err = TestReadTheMandatoryAttributeEffectiveControlMode_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : read the mandatory attribute: Capacity\n"); + err = TestReadTheMandatoryAttributeCapacity_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : read the optional attribute: MinConstPressure\n"); + err = TestReadTheOptionalAttributeMinConstPressure_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : read the optional attribute: MaxConstPressure\n"); + err = TestReadTheOptionalAttributeMaxConstPressure_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : read the optional attribute: MinCompPressure\n"); + err = TestReadTheOptionalAttributeMinCompPressure_15(); + break; + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : read the optional attribute: MaxCompPressure\n"); + err = TestReadTheOptionalAttributeMaxCompPressure_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : read the optional attribute: MinConstSpeed\n"); + err = TestReadTheOptionalAttributeMinConstSpeed_17(); + break; + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : read the optional attribute: MaxConstSpeed\n"); + err = TestReadTheOptionalAttributeMaxConstSpeed_18(); + break; + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : read the optional attribute: MinConstFlow\n"); + err = TestReadTheOptionalAttributeMinConstFlow_19(); + break; + case 20: + ChipLogProgress(chipTool, " ***** Test Step 20 : read the optional attribute: MaxConstFlow\n"); + err = TestReadTheOptionalAttributeMaxConstFlow_20(); + break; + case 21: + ChipLogProgress(chipTool, " ***** Test Step 21 : read the optional attribute: MinConstTemp\n"); + err = TestReadTheOptionalAttributeMinConstTemp_21(); + break; + case 22: + ChipLogProgress(chipTool, " ***** Test Step 22 : read the optional attribute: MaxConstTemp\n"); + err = TestReadTheOptionalAttributeMaxConstTemp_22(); + break; + case 23: + ChipLogProgress(chipTool, " ***** Test Step 23 : read the optional attribute: PumpStatus\n"); + err = TestReadTheOptionalAttributePumpStatus_23(); + break; + case 24: + ChipLogProgress(chipTool, " ***** Test Step 24 : read the optional attribute: PumpStatus\n"); + err = TestReadTheOptionalAttributePumpStatus_24(); + break; + case 25: + ChipLogProgress(chipTool, " ***** Test Step 25 : read the optional attribute: Speed\n"); + err = TestReadTheOptionalAttributeSpeed_25(); + break; + case 26: + ChipLogProgress(chipTool, " ***** Test Step 26 : read the optional attribute: LifetimeRunningHours\n"); + err = TestReadTheOptionalAttributeLifetimeRunningHours_26(); + break; + case 27: + ChipLogProgress(chipTool, " ***** Test Step 27 : read the optional attribute: LifetimeRunningHours\n"); + err = TestReadTheOptionalAttributeLifetimeRunningHours_27(); + break; + case 28: + ChipLogProgress(chipTool, " ***** Test Step 28 : read the optional attribute: Power\n"); + err = TestReadTheOptionalAttributePower_28(); + break; + case 29: + ChipLogProgress(chipTool, " ***** Test Step 29 : read the optional attribute: LifetimeEnergyConsumed\n"); + err = TestReadTheOptionalAttributeLifetimeEnergyConsumed_29(); + break; + case 30: + ChipLogProgress(chipTool, " ***** Test Step 30 : read the optional attribute: LifetimeEnergyConsumed\n"); + err = TestReadTheOptionalAttributeLifetimeEnergyConsumed_30(); + break; + case 31: + ChipLogProgress(chipTool, " ***** Test Step 31 : write to the optional attribute: LifetimeEnergyConsumed\n"); + err = TestWriteToTheOptionalAttributeLifetimeEnergyConsumed_31(); + break; + case 32: + ChipLogProgress(chipTool, " ***** Test Step 32 : read the optional attribute: MinConstPressure\n"); + err = TestReadTheOptionalAttributeMinConstPressure_32(); + break; + case 33: + ChipLogProgress(chipTool, " ***** Test Step 33 : read the optional attribute: MaxConstPressure\n"); + err = TestReadTheOptionalAttributeMaxConstPressure_33(); + break; + case 34: + ChipLogProgress(chipTool, " ***** Test Step 34 : read the optional attribute: MinCompPressure\n"); + err = TestReadTheOptionalAttributeMinCompPressure_34(); + break; + case 35: + ChipLogProgress(chipTool, " ***** Test Step 35 : read the optional attribute: MaxCompPressure\n"); + err = TestReadTheOptionalAttributeMaxCompPressure_35(); + break; + case 36: + ChipLogProgress(chipTool, " ***** Test Step 36 : read the optional attribute: MinConstSpeed\n"); + err = TestReadTheOptionalAttributeMinConstSpeed_36(); + break; + case 37: + ChipLogProgress(chipTool, " ***** Test Step 37 : read the optional attribute: MaxConstSpeed\n"); + err = TestReadTheOptionalAttributeMaxConstSpeed_37(); + break; + case 38: + ChipLogProgress(chipTool, " ***** Test Step 38 : read the optional attribute: MinConstFlow\n"); + err = TestReadTheOptionalAttributeMinConstFlow_38(); + break; + case 39: + ChipLogProgress(chipTool, " ***** Test Step 39 : read the optional attribute: MaxConstFlow\n"); + err = TestReadTheOptionalAttributeMaxConstFlow_39(); + break; + case 40: + ChipLogProgress(chipTool, " ***** Test Step 40 : read the optional attribute: MinConstTemp\n"); + err = TestReadTheOptionalAttributeMinConstTemp_40(); + break; + case 41: + ChipLogProgress(chipTool, " ***** Test Step 41 : read the optional attribute: MaxConstTemp\n"); + err = TestReadTheOptionalAttributeMaxConstTemp_41(); + break; + case 42: + ChipLogProgress(chipTool, " ***** Test Step 42 : read the optional attribute: PumpStatus\n"); + err = TestReadTheOptionalAttributePumpStatus_42(); + break; + case 43: + ChipLogProgress(chipTool, " ***** Test Step 43 : read the optional attribute: PumpStatus\n"); + err = TestReadTheOptionalAttributePumpStatus_43(); + break; + case 44: + ChipLogProgress(chipTool, " ***** Test Step 44 : read the optional attribute: Speed\n"); + err = TestReadTheOptionalAttributeSpeed_44(); + break; + case 45: + ChipLogProgress(chipTool, " ***** Test Step 45 : read the optional attribute: LifetimeRunningHours\n"); + err = TestReadTheOptionalAttributeLifetimeRunningHours_45(); + break; + case 46: + ChipLogProgress(chipTool, " ***** Test Step 46 : read the optional attribute: LifetimeRunningHours\n"); + err = TestReadTheOptionalAttributeLifetimeRunningHours_46(); + break; + case 47: + ChipLogProgress(chipTool, " ***** Test Step 47 : read the optional attribute: Power\n"); + err = TestReadTheOptionalAttributePower_47(); + break; + case 48: + ChipLogProgress(chipTool, " ***** Test Step 48 : read the optional attribute: LifetimeEnergyConsumed\n"); + err = TestReadTheOptionalAttributeLifetimeEnergyConsumed_48(); + break; + case 49: + ChipLogProgress(chipTool, " ***** Test Step 49 : read the optional attribute: LifetimeEnergyConsumed\n"); + err = TestReadTheOptionalAttributeLifetimeEnergyConsumed_49(); break; } @@ -34123,6 +40320,165 @@ class Test_TC_PCC_2_2 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 34: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 35: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 36: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 37: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 38: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 39: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 40: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 41: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 42: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 43: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 44: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 45: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 46: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 47: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 48: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 49: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -34130,7 +40486,7 @@ class Test_TC_PCC_2_2 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 7; + const uint16_t mTestCount = 50; chip::Optional mNodeId; chip::Optional mCluster; @@ -34139,80 +40495,77 @@ class Test_TC_PCC_2_2 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestWrite1ToTheOperationModeAttributeToDutOperationMode_1() + CHIP_ERROR TestReadTheMandatoryAttributeMaxPressure_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id operationModeArgument; - operationModeArgument = [NSNumber numberWithUnsignedChar:1]; - [cluster writeAttributeOperationModeWithValue:operationModeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write 1 to the OperationMode attribute to DUT: OperationMode Error: %@", err); + [cluster readAttributeMaxPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the mandatory attribute: MaxPressure Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("maxPressure", "", "int16")); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsTheAttributeEffectiveOperationMode_2() + CHIP_ERROR TestReadTheMandatoryAttributeMaxSpeed_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEffectiveOperationModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the attribute: EffectiveOperationMode Error: %@", err); + [cluster readAttributeMaxSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the mandatory attribute: MaxSpeed Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("EffectiveOperationMode", actualValue, 1)); - } - + VerifyOrReturn(CheckConstraintType("maxSpeed", "", "uint16")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWrite2ToTheOperationModeAttributeToDutOperationMode_3() + CHIP_ERROR TestReadTheMandatoryAttributeMaxFlow_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id operationModeArgument; - operationModeArgument = [NSNumber numberWithUnsignedChar:2]; - [cluster writeAttributeOperationModeWithValue:operationModeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write 2 to the OperationMode attribute to DUT: OperationMode Error: %@", err); + [cluster readAttributeMaxFlowWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the mandatory attribute: MaxFlow Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("maxFlow", "", "uint16")); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsTheAttributeEffectiveOperationMode_4() + CHIP_ERROR TestReadTheMandatoryAttributeEffectiveOperationMode_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device endpoint:1 @@ -34220,380 +40573,415 @@ class Test_TC_PCC_2_2 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeEffectiveOperationModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the attribute: EffectiveOperationMode Error: %@", err); + NSLog(@"read the mandatory attribute: EffectiveOperationMode Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("EffectiveOperationMode", actualValue, 2)); - } + VerifyOrReturn(CheckConstraintType("effectiveOperationMode", "", "enum8")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheMandatoryAttributeEffectiveControlMode_5() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEffectiveControlModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the mandatory attribute: EffectiveControlMode Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckConstraintType("effectiveControlMode", "", "enum8")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWrite3ToTheOperationModeAttributeToDutOperationMode_5() + CHIP_ERROR TestReadTheMandatoryAttributeCapacity_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id operationModeArgument; - operationModeArgument = [NSNumber numberWithUnsignedChar:3]; - [cluster writeAttributeOperationModeWithValue:operationModeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write 3 to the OperationMode attribute to DUT: OperationMode Error: %@", err); + [cluster readAttributeCapacityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the mandatory attribute: Capacity Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("capacity", "", "int16")); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsTheAttributeEffectiveOperationMode_6() + CHIP_ERROR TestReadTheMandatoryAttributeMaxPressure_7() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEffectiveOperationModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the attribute: EffectiveOperationMode Error: %@", err); + [cluster readAttributeMaxPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the mandatory attribute: MaxPressure Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("EffectiveOperationMode", actualValue, 3)); - } + VerifyOrReturn(CheckConstraintType("maxPressure", "", "int16")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheMandatoryAttributeMaxSpeed_8() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMaxSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the mandatory attribute: MaxSpeed Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckConstraintType("maxSpeed", "", "uint16")); NextTest(); }]; return CHIP_NO_ERROR; } -}; -class Test_TC_PCC_2_3 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_PCC_2_3() - : TestCommandBridge("Test_TC_PCC_2_3") - , mTestIndex(0) + CHIP_ERROR TestReadTheMandatoryAttributeMaxFlow_9() { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMaxFlowWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the mandatory attribute: MaxFlow Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("maxFlow", "", "uint16")); + NextTest(); + }]; + + return CHIP_NO_ERROR; } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_PCC_2_3() {} + CHIP_ERROR TestReadTheMandatoryAttributeEffectiveOperationMode_10() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - /////////// TestCommand Interface ///////// - void NextTest() override + [cluster readAttributeEffectiveOperationModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the mandatory attribute: EffectiveOperationMode Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("effectiveOperationMode", "", "enum8")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheMandatoryAttributeEffectiveControlMode_11() { - CHIP_ERROR err = CHIP_NO_ERROR; + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_PCC_2_3\n"); - } + [cluster readAttributeEffectiveControlModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the mandatory attribute: EffectiveControlMode Error: %@", err); - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PCC_2_3\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + VerifyOrReturn(CheckValue("status", err, 0)); - Wait(); + VerifyOrReturn(CheckConstraintType("effectiveControlMode", "", "enum8")); + 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 : Write 0 to the OperationMode attribute to DUT\n"); - if (ShouldSkip("A_OPERATIONMODE")) { - NextTest(); - return; - } - err = TestWrite0ToTheOperationModeAttributeToDut_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Reads the attribute: EffectiveOperationMode\n"); - if (ShouldSkip("A_EFFECTIVEOPERATIONMODE")) { - NextTest(); - return; - } - err = TestReadsTheAttributeEffectiveOperationMode_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Write 0 to the ControlMode attribute to DUT\n"); - if (ShouldSkip("A_CONTROLMODE")) { - NextTest(); - return; - } - err = TestWrite0ToTheControlModeAttributeToDut_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Reads the attribute: EffectiveControlMode\n"); - if (ShouldSkip("A_EFFECTIVECONTROLMODE")) { - NextTest(); - return; - } - err = TestReadsTheAttributeEffectiveControlMode_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Write 1 to the ControlMode attribute to DUT\n"); - if (ShouldSkip("A_CONTROLMODE")) { - NextTest(); - return; - } - err = TestWrite1ToTheControlModeAttributeToDut_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Reads the attribute: EffectiveControlMode\n"); - if (ShouldSkip("A_EFFECTIVECONTROLMODE")) { - NextTest(); - return; - } - err = TestReadsTheAttributeEffectiveControlMode_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Write 2 to the ControlMode attribute to DUT\n"); - if (ShouldSkip("A_CONTROLMODE")) { - NextTest(); - return; - } - err = TestWrite2ToTheControlModeAttributeToDut_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Reads the attribute: EffectiveControlMode\n"); - if (ShouldSkip("A_EFFECTIVECONTROLMODE")) { - NextTest(); - return; - } - err = TestReadsTheAttributeEffectiveControlMode_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Write 3 to the ControlMode attribute to DUT\n"); - if (ShouldSkip("A_CONTROLMODE")) { - NextTest(); - return; - } - err = TestWrite3ToTheControlModeAttributeToDut_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Reads the attribute: EffectiveControlMode\n"); - if (ShouldSkip("A_EFFECTIVECONTROLMODE")) { - NextTest(); - return; - } - err = TestReadsTheAttributeEffectiveControlMode_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Write 5 to the ControlMode attribute to DUT\n"); - if (ShouldSkip("A_CONTROLMODE")) { - NextTest(); - return; - } - err = TestWrite5ToTheControlModeAttributeToDut_11(); - break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Reads the attribute: EffectiveControlMode\n"); - if (ShouldSkip("A_EFFECTIVECONTROLMODE")) { - NextTest(); - return; - } - err = TestReadsTheAttributeEffectiveControlMode_12(); - break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Write 7 to the ControlMode attribute to DUT\n"); - if (ShouldSkip("A_CONTROLMODE")) { + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheMandatoryAttributeCapacity_12() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCapacityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the mandatory attribute: Capacity Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("capacity", "", "int16")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalAttributeMinConstPressure_13() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMinConstPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the optional attribute: MinConstPressure Error: %@", err); + + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { NextTest(); return; } - err = TestWrite7ToTheControlModeAttributeToDut_13(); - break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Reads the attribute: EffectiveControlMode\n"); - if (ShouldSkip("A_EFFECTIVECONTROLMODE")) { + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("minConstPressure", "", "int16")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalAttributeMaxConstPressure_14() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMaxConstPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the optional attribute: MaxConstPressure Error: %@", err); + + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { NextTest(); return; } - err = TestReadsTheAttributeEffectiveControlMode_14(); - break; - } - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("maxConstPressure", "", "int16")); + NextTest(); + }]; + + return CHIP_NO_ERROR; } - chip::System::Clock::Timeout GetWaitDuration() const override + CHIP_ERROR TestReadTheOptionalAttributeMinCompPressure_15() { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 15; + [cluster readAttributeMinCompPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the optional attribute: MinCompPressure Error: %@", err); - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("minCompPressure", "", "int16")); + NextTest(); + }]; - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestWrite0ToTheOperationModeAttributeToDut_1() + CHIP_ERROR TestReadTheOptionalAttributeMaxCompPressure_16() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id operationModeArgument; - operationModeArgument = [NSNumber numberWithUnsignedChar:0]; - [cluster writeAttributeOperationModeWithValue:operationModeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write 0 to the OperationMode attribute to DUT Error: %@", err); + [cluster readAttributeMaxCompPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the optional attribute: MaxCompPressure Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("maxCompPressure", "", "int16")); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsTheAttributeEffectiveOperationMode_2() + CHIP_ERROR TestReadTheOptionalAttributeMinConstSpeed_17() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEffectiveOperationModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the attribute: EffectiveOperationMode Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + [cluster readAttributeMinConstSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the optional attribute: MinConstSpeed Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("EffectiveOperationMode", actualValue, 0)); + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; } + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("minConstSpeed", "", "uint16")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWrite0ToTheControlModeAttributeToDut_3() + CHIP_ERROR TestReadTheOptionalAttributeMaxConstSpeed_18() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id controlModeArgument; - controlModeArgument = [NSNumber numberWithUnsignedChar:0]; - [cluster writeAttributeControlModeWithValue:controlModeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write 0 to the ControlMode attribute to DUT Error: %@", err); + [cluster readAttributeMaxConstSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the optional attribute: MaxConstSpeed Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("maxConstSpeed", "", "uint16")); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsTheAttributeEffectiveControlMode_4() + CHIP_ERROR TestReadTheOptionalAttributeMinConstFlow_19() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEffectiveControlModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the attribute: EffectiveControlMode Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + [cluster readAttributeMinConstFlowWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the optional attribute: MinConstFlow Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("EffectiveControlMode", actualValue, 0)); + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; } + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("minConstFlow", "", "uint16")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWrite1ToTheControlModeAttributeToDut_5() + CHIP_ERROR TestReadTheOptionalAttributeMaxConstFlow_20() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id controlModeArgument; - controlModeArgument = [NSNumber numberWithUnsignedChar:1]; - [cluster writeAttributeControlModeWithValue:controlModeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write 1 to the ControlMode attribute to DUT Error: %@", err); + [cluster readAttributeMaxConstFlowWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the optional attribute: MaxConstFlow Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("maxConstFlow", "", "uint16")); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsTheAttributeEffectiveControlMode_6() + CHIP_ERROR TestReadTheOptionalAttributeMinConstTemp_21() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEffectiveControlModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the attribute: EffectiveControlMode Error: %@", err); + [cluster readAttributeMinConstTempWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the optional attribute: MinConstTemp Error: %@", err); + + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("EffectiveControlMode", actualValue, 1)); + VerifyOrReturn(CheckConstraintType("minConstTemp", "", "int16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("minConstTemp", [value shortValue], -27315)); } NextTest(); @@ -34602,44 +40990,58 @@ class Test_TC_PCC_2_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWrite2ToTheControlModeAttributeToDut_7() + CHIP_ERROR TestReadTheOptionalAttributeMaxConstTemp_22() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id controlModeArgument; - controlModeArgument = [NSNumber numberWithUnsignedChar:2]; - [cluster writeAttributeControlModeWithValue:controlModeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write 2 to the ControlMode attribute to DUT Error: %@", err); + [cluster readAttributeMaxConstTempWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the optional attribute: MaxConstTemp Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("maxConstTemp", "", "int16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("maxConstTemp", [value shortValue], -27315)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsTheAttributeEffectiveControlMode_8() + CHIP_ERROR TestReadTheOptionalAttributePumpStatus_23() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEffectiveControlModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the attribute: EffectiveControlMode Error: %@", err); + [cluster readAttributePumpStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the optional attribute: PumpStatus Error: %@", err); + + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("EffectiveControlMode", actualValue, 2)); + VerifyOrReturn(CheckValue("PumpStatus", actualValue, 0U)); } NextTest(); @@ -34648,136 +41050,164 @@ class Test_TC_PCC_2_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWrite3ToTheControlModeAttributeToDut_9() + CHIP_ERROR TestReadTheOptionalAttributePumpStatus_24() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id controlModeArgument; - controlModeArgument = [NSNumber numberWithUnsignedChar:3]; - [cluster writeAttributeControlModeWithValue:controlModeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write 3 to the ControlMode attribute to DUT Error: %@", err); + [cluster readAttributePumpStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the optional attribute: PumpStatus Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("pumpStatus", "", "map16")); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsTheAttributeEffectiveControlMode_10() + CHIP_ERROR TestReadTheOptionalAttributeSpeed_25() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEffectiveControlModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the attribute: EffectiveControlMode Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + [cluster readAttributeSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the optional attribute: Speed Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("EffectiveControlMode", actualValue, 3)); + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; } + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("speed", "", "uint16")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWrite5ToTheControlModeAttributeToDut_11() + CHIP_ERROR TestReadTheOptionalAttributeLifetimeRunningHours_26() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id controlModeArgument; - controlModeArgument = [NSNumber numberWithUnsignedChar:5]; - [cluster writeAttributeControlModeWithValue:controlModeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write 5 to the ControlMode attribute to DUT Error: %@", err); + [cluster readAttributeLifetimeRunningHoursWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the optional attribute: LifetimeRunningHours Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("LifetimeRunningHours", actualValue)); + VerifyOrReturn(CheckValue("LifetimeRunningHours", actualValue, 0UL)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsTheAttributeEffectiveControlMode_12() + CHIP_ERROR TestReadTheOptionalAttributeLifetimeRunningHours_27() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEffectiveControlModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the attribute: EffectiveControlMode Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + [cluster readAttributeLifetimeRunningHoursWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the optional attribute: LifetimeRunningHours Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("EffectiveControlMode", actualValue, 5)); + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; } + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("lifetimeRunningHours", "", "uint24")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWrite7ToTheControlModeAttributeToDut_13() + CHIP_ERROR TestReadTheOptionalAttributePower_28() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id controlModeArgument; - controlModeArgument = [NSNumber numberWithUnsignedChar:7]; - [cluster writeAttributeControlModeWithValue:controlModeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write 7 to the ControlMode attribute to DUT Error: %@", err); + [cluster readAttributePowerWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the optional attribute: Power Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("power", "", "uint24")); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsTheAttributeEffectiveControlMode_14() + CHIP_ERROR TestReadTheOptionalAttributeLifetimeEnergyConsumed_29() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEffectiveControlModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the attribute: EffectiveControlMode Error: %@", err); + [cluster readAttributeLifetimeEnergyConsumedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the optional attribute: LifetimeEnergyConsumed Error: %@", err); + + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("EffectiveControlMode", actualValue, 7)); + VerifyOrReturn(CheckValueNonNull("LifetimeEnergyConsumed", actualValue)); + VerifyOrReturn(CheckValue("LifetimeEnergyConsumed", actualValue, 0UL)); } NextTest(); @@ -34785,353 +41215,294 @@ class Test_TC_PCC_2_3 : public TestCommandBridge { return CHIP_NO_ERROR; } -}; -class Test_TC_PCC_2_4 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_PCC_2_4() - : TestCommandBridge("Test_TC_PCC_2_4") - , mTestIndex(0) + CHIP_ERROR TestReadTheOptionalAttributeLifetimeEnergyConsumed_30() { - 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) + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - ~Test_TC_PCC_2_4() {} + [cluster readAttributeLifetimeEnergyConsumedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the optional attribute: LifetimeEnergyConsumed Error: %@", err); - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_PCC_2_4\n"); - } + VerifyOrReturn(CheckValue("status", err, 0)); - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PCC_2_4\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + VerifyOrReturn(CheckConstraintType("lifetimeEnergyConsumed", "", "uint32")); + 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 1 to the LifetimeRunningHours attribute to DUT\n"); - err = TestWrite1ToTheLifetimeRunningHoursAttributeToDut_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Reads the attribute: LifetimeRunningHours\n"); - err = TestReadsTheAttributeLifetimeRunningHours_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Write 2 to the LifetimeRunningHours attribute to DUT\n"); - err = TestWrite2ToTheLifetimeRunningHoursAttributeToDut_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Reads the attribute: LifetimeRunningHours\n"); - err = TestReadsTheAttributeLifetimeRunningHours_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Write 3 to the LifetimeRunningHours attribute to DUT\n"); - err = TestWrite3ToTheLifetimeRunningHoursAttributeToDut_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Reads the attribute: LifetimeRunningHours\n"); - err = TestReadsTheAttributeLifetimeRunningHours_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Write 1 to the LifetimeEnergyConsumed attribute to DUT\n"); - err = TestWrite1ToTheLifetimeEnergyConsumedAttributeToDut_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Reads the attribute: LifetimeEnergyConsumed\n"); - err = TestReadsTheAttributeLifetimeEnergyConsumed_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Write 2 to the LifetimeEnergyConsumed attribute to DUT\n"); - err = TestWrite2ToTheLifetimeEnergyConsumedAttributeToDut_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Reads the attribute: LifetimeEnergyConsumed\n"); - err = TestReadsTheAttributeLifetimeEnergyConsumed_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Write 3 to the LifetimeEnergyConsumed attribute to DUT\n"); - err = TestWrite3ToTheLifetimeEnergyConsumedAttributeToDut_11(); - break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Reads the attribute: LifetimeEnergyConsumed\n"); - err = TestReadsTheAttributeLifetimeEnergyConsumed_12(); - 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 = 13; - - 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 TestWrite1ToTheLifetimeRunningHoursAttributeToDut_1() + CHIP_ERROR TestWriteToTheOptionalAttributeLifetimeEnergyConsumed_31() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id lifetimeRunningHoursArgument; - lifetimeRunningHoursArgument = [NSNumber numberWithUnsignedInt:1UL]; - [cluster writeAttributeLifetimeRunningHoursWithValue:lifetimeRunningHoursArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write 1 to the LifetimeRunningHours attribute to DUT Error: %@", err); + id lifetimeEnergyConsumedArgument; + lifetimeEnergyConsumedArgument = [NSNumber numberWithUnsignedInt:0UL]; + [cluster writeAttributeLifetimeEnergyConsumedWithValue:lifetimeEnergyConsumedArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"write to the optional attribute: LifetimeEnergyConsumed Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsTheAttributeLifetimeRunningHours_2() + CHIP_ERROR TestReadTheOptionalAttributeMinConstPressure_32() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeLifetimeRunningHoursWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the attribute: LifetimeRunningHours Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + [cluster readAttributeMinConstPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the optional attribute: MinConstPressure Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("LifetimeRunningHours", actualValue)); - VerifyOrReturn(CheckValue("LifetimeRunningHours", actualValue, 1UL)); + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; } + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("minConstPressure", "", "int16")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWrite2ToTheLifetimeRunningHoursAttributeToDut_3() + CHIP_ERROR TestReadTheOptionalAttributeMaxConstPressure_33() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id lifetimeRunningHoursArgument; - lifetimeRunningHoursArgument = [NSNumber numberWithUnsignedInt:2UL]; - [cluster writeAttributeLifetimeRunningHoursWithValue:lifetimeRunningHoursArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write 2 to the LifetimeRunningHours attribute to DUT Error: %@", err); + [cluster readAttributeMaxConstPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the optional attribute: MaxConstPressure Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("maxConstPressure", "", "int16")); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsTheAttributeLifetimeRunningHours_4() + CHIP_ERROR TestReadTheOptionalAttributeMinCompPressure_34() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeLifetimeRunningHoursWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the attribute: LifetimeRunningHours Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + [cluster readAttributeMinCompPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the optional attribute: MinCompPressure Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("LifetimeRunningHours", actualValue)); - VerifyOrReturn(CheckValue("LifetimeRunningHours", actualValue, 2UL)); + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; } + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("minCompPressure", "", "int16")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWrite3ToTheLifetimeRunningHoursAttributeToDut_5() + CHIP_ERROR TestReadTheOptionalAttributeMaxCompPressure_35() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id lifetimeRunningHoursArgument; - lifetimeRunningHoursArgument = [NSNumber numberWithUnsignedInt:3UL]; - [cluster writeAttributeLifetimeRunningHoursWithValue:lifetimeRunningHoursArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write 3 to the LifetimeRunningHours attribute to DUT Error: %@", err); + [cluster readAttributeMaxCompPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the optional attribute: MaxCompPressure Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("maxCompPressure", "", "int16")); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsTheAttributeLifetimeRunningHours_6() + CHIP_ERROR TestReadTheOptionalAttributeMinConstSpeed_36() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeLifetimeRunningHoursWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the attribute: LifetimeRunningHours Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + [cluster readAttributeMinConstSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the optional attribute: MinConstSpeed Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("LifetimeRunningHours", actualValue)); - VerifyOrReturn(CheckValue("LifetimeRunningHours", actualValue, 3UL)); + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; } + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("minConstSpeed", "", "uint16")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWrite1ToTheLifetimeEnergyConsumedAttributeToDut_7() + CHIP_ERROR TestReadTheOptionalAttributeMaxConstSpeed_37() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id lifetimeEnergyConsumedArgument; - lifetimeEnergyConsumedArgument = [NSNumber numberWithUnsignedInt:1UL]; - [cluster writeAttributeLifetimeEnergyConsumedWithValue:lifetimeEnergyConsumedArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write 1 to the LifetimeEnergyConsumed attribute to DUT Error: %@", err); + [cluster readAttributeMaxConstSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the optional attribute: MaxConstSpeed Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("maxConstSpeed", "", "uint16")); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsTheAttributeLifetimeEnergyConsumed_8() + CHIP_ERROR TestReadTheOptionalAttributeMinConstFlow_38() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeLifetimeEnergyConsumedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the attribute: LifetimeEnergyConsumed Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + [cluster readAttributeMinConstFlowWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the optional attribute: MinConstFlow Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("LifetimeEnergyConsumed", actualValue)); - VerifyOrReturn(CheckValue("LifetimeEnergyConsumed", actualValue, 1UL)); + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; } + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("minConstFlow", "", "uint16")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWrite2ToTheLifetimeEnergyConsumedAttributeToDut_9() + CHIP_ERROR TestReadTheOptionalAttributeMaxConstFlow_39() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id lifetimeEnergyConsumedArgument; - lifetimeEnergyConsumedArgument = [NSNumber numberWithUnsignedInt:2UL]; - [cluster writeAttributeLifetimeEnergyConsumedWithValue:lifetimeEnergyConsumedArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write 2 to the LifetimeEnergyConsumed attribute to DUT Error: %@", err); + [cluster readAttributeMaxConstFlowWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the optional attribute: MaxConstFlow Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("maxConstFlow", "", "uint16")); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsTheAttributeLifetimeEnergyConsumed_10() + CHIP_ERROR TestReadTheOptionalAttributeMinConstTemp_40() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeLifetimeEnergyConsumedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the attribute: LifetimeEnergyConsumed Error: %@", err); + [cluster readAttributeMinConstTempWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the optional attribute: MinConstTemp Error: %@", err); + + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("LifetimeEnergyConsumed", actualValue)); - VerifyOrReturn(CheckValue("LifetimeEnergyConsumed", actualValue, 2UL)); + VerifyOrReturn(CheckConstraintType("minConstTemp", "", "int16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("minConstTemp", [value shortValue], -27315)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("minConstTemp", [value shortValue], 32767)); } NextTest(); @@ -35140,45 +41511,61 @@ class Test_TC_PCC_2_4 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWrite3ToTheLifetimeEnergyConsumedAttributeToDut_11() + CHIP_ERROR TestReadTheOptionalAttributeMaxConstTemp_41() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id lifetimeEnergyConsumedArgument; - lifetimeEnergyConsumedArgument = [NSNumber numberWithUnsignedInt:3UL]; - [cluster writeAttributeLifetimeEnergyConsumedWithValue:lifetimeEnergyConsumedArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write 3 to the LifetimeEnergyConsumed attribute to DUT Error: %@", err); + [cluster readAttributeMaxConstTempWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the optional attribute: MaxConstTemp Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("maxConstTemp", "", "int16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("maxConstTemp", [value shortValue], -27315)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("maxConstTemp", [value shortValue], 32767)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsTheAttributeLifetimeEnergyConsumed_12() + CHIP_ERROR TestReadTheOptionalAttributePumpStatus_42() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeLifetimeEnergyConsumedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the attribute: LifetimeEnergyConsumed Error: %@", err); + [cluster readAttributePumpStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the optional attribute: PumpStatus Error: %@", err); + + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("LifetimeEnergyConsumed", actualValue)); - VerifyOrReturn(CheckValue("LifetimeEnergyConsumed", actualValue, 3UL)); + VerifyOrReturn(CheckValue("PumpStatus", actualValue, 0U)); } NextTest(); @@ -35186,110 +41573,77 @@ class Test_TC_PCC_2_4 : public TestCommandBridge { return CHIP_NO_ERROR; } -}; - -class Test_TC_PSCFG_1_1 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_PSCFG_1_1() - : TestCommandBridge("Test_TC_PSCFG_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_PSCFG_1_1() {} - /////////// TestCommand Interface ///////// - void NextTest() override + CHIP_ERROR TestReadTheOptionalAttributePumpStatus_43() { - CHIP_ERROR err = CHIP_NO_ERROR; + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_PSCFG_1_1\n"); - } + [cluster readAttributePumpStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the optional attribute: PumpStatus Error: %@", err); - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PSCFG_1_1\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } - 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 : Commission DUT to TH\n"); - err = TestCommissionDutToTh_0(); - break; - case 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 : TH reads the AttributeList attribute from the DUT\n"); - err = TestThReadsTheAttributeListAttributeFromTheDut_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads the AcceptedCommandList attribute from the DUT\n"); - err = TestThReadsTheAcceptedCommandListAttributeFromTheDut_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads the GeneratedCommandList attribute from the DUT\n"); - err = TestThReadsTheGeneratedCommandListAttributeFromTheDut_4(); - break; - } + VerifyOrReturn(CheckConstraintType("pumpStatus", "", "map16")); + 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 TestReadTheOptionalAttributeSpeed_44() { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 5; + [cluster readAttributeSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the optional attribute: Speed Error: %@", err); - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("speed", "", "uint16")); + NextTest(); + }]; - CHIP_ERROR TestCommissionDutToTh_0() - { - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsTheClusterRevisionAttributeFromTheDut_1() + CHIP_ERROR TestReadTheOptionalAttributeLifetimeRunningHours_45() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestPowerSourceConfiguration * cluster = [[CHIPTestPowerSourceConfiguration alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl 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); + [cluster readAttributeLifetimeRunningHoursWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the optional attribute: LifetimeRunningHours Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + VerifyOrReturn(CheckValueNonNull("LifetimeRunningHours", actualValue)); + VerifyOrReturn(CheckValue("LifetimeRunningHours", actualValue, 0UL)); } NextTest(); @@ -35298,72 +41652,121 @@ class Test_TC_PSCFG_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsTheAttributeListAttributeFromTheDut_2() + CHIP_ERROR TestReadTheOptionalAttributeLifetimeRunningHours_46() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestPowerSourceConfiguration * cluster = [[CHIPTestPowerSourceConfiguration alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the AttributeList attribute from the DUT Error: %@", err); + [cluster readAttributeLifetimeRunningHoursWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the optional attribute: LifetimeRunningHours Error: %@", err); + + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); + VerifyOrReturn(CheckConstraintType("lifetimeRunningHours", "", "uint24")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsTheAcceptedCommandListAttributeFromTheDut_3() + CHIP_ERROR TestReadTheOptionalAttributePower_47() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestPowerSourceConfiguration * cluster = [[CHIPTestPowerSourceConfiguration alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the AcceptedCommandList attribute from the DUT Error: %@", err); + [cluster readAttributePowerWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the optional attribute: Power Error: %@", err); + + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); + VerifyOrReturn(CheckConstraintType("power", "", "uint24")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsTheGeneratedCommandListAttributeFromTheDut_4() + CHIP_ERROR TestReadTheOptionalAttributeLifetimeEnergyConsumed_48() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestPowerSourceConfiguration * cluster = [[CHIPTestPowerSourceConfiguration alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the GeneratedCommandList attribute from the DUT Error: %@", err); + [cluster readAttributeLifetimeEnergyConsumedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the optional attribute: LifetimeEnergyConsumed Error: %@", err); + + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("LifetimeEnergyConsumed", actualValue)); + VerifyOrReturn(CheckValue("LifetimeEnergyConsumed", actualValue, 0UL)); + } + NextTest(); }]; return CHIP_NO_ERROR; } -}; -class Test_TC_RH_1_1 : public TestCommandBridge { + CHIP_ERROR TestReadTheOptionalAttributeLifetimeEnergyConsumed_49() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeLifetimeEnergyConsumedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the optional attribute: LifetimeEnergyConsumed Error: %@", err); + + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("lifetimeEnergyConsumed", "", "uint32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_PCC_2_2 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_RH_1_1() - : TestCommandBridge("Test_TC_RH_1_1") + Test_TC_PCC_2_2() + : TestCommandBridge("Test_TC_PCC_2_2") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -35373,7 +41776,7 @@ class Test_TC_RH_1_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_RH_1_1() {} + ~Test_TC_PCC_2_2() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -35381,11 +41784,11 @@ class Test_TC_RH_1_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_RH_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_PCC_2_2\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_RH_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PCC_2_2\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -35402,49 +41805,52 @@ class Test_TC_RH_1_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, - " ***** Test Step 1 : Read ClusterRevision attribute from the DUT and Verify that the DUT response indicates " - "ClusterRevision attribute has the value 3\n"); - if (ShouldSkip("PICS_USER_PROMPT")) { + ChipLogProgress(chipTool, " ***** Test Step 1 : Write 1 to the OperationMode attribute to DUT: OperationMode\n"); + if (ShouldSkip("A_OPERATIONMODE")) { NextTest(); return; } - err = TestReadClusterRevisionAttributeFromTheDutAndVerifyThatTheDutResponseIndicatesClusterRevisionAttributeHasTheValue3_1(); + err = TestWrite1ToTheOperationModeAttributeToDutOperationMode_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: AttributeList\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + ChipLogProgress(chipTool, " ***** Test Step 2 : Reads the attribute: EffectiveOperationMode\n"); + if (ShouldSkip("A_EFFECTIVEOPERATIONMODE")) { NextTest(); return; } - err = TestReadTheGlobalAttributeAttributeList_2(); + err = TestReadsTheAttributeEffectiveOperationMode_2(); break; case 3: - ChipLogProgress(chipTool, - " ***** Test Step 3 : Read EventList attribute from the DUT and Verify that the DUT response provides a list of " - "supported events.\n"); - if (ShouldSkip("PICS_USER_PROMPT")) { + ChipLogProgress(chipTool, " ***** Test Step 3 : Write 2 to the OperationMode attribute to DUT: OperationMode\n"); + if (ShouldSkip("A_OPERATIONMODE")) { NextTest(); return; } - err = TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_3(); + err = TestWrite2ToTheOperationModeAttributeToDutOperationMode_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read the global attribute: AcceptedCommandList\n"); - err = TestReadTheGlobalAttributeAcceptedCommandList_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Reads the attribute: EffectiveOperationMode\n"); + if (ShouldSkip("A_EFFECTIVEOPERATIONMODE")) { + NextTest(); + return; + } + err = TestReadsTheAttributeEffectiveOperationMode_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: GeneratedCommandList\n"); - err = TestReadTheGlobalAttributeGeneratedCommandList_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Write 3 to the OperationMode attribute to DUT: OperationMode\n"); + if (ShouldSkip("A_OPERATIONMODE")) { + NextTest(); + return; + } + err = TestWrite3ToTheOperationModeAttributeToDutOperationMode_5(); break; case 6: - ChipLogProgress( - chipTool, " ***** Test Step 6 : Read FeatureMap attribute from the DUT and Verify that the DUT response\n"); - if (ShouldSkip("PICS_USER_PROMPT")) { + ChipLogProgress(chipTool, " ***** Test Step 6 : Reads the attribute: EffectiveOperationMode\n"); + if (ShouldSkip("A_EFFECTIVEOPERATIONMODE")) { NextTest(); return; } - err = TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponse_6(); + err = TestReadsTheAttributeEffectiveOperationMode_6(); break; } @@ -35454,6 +41860,36 @@ class Test_TC_RH_1_1 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -35470,113 +41906,161 @@ class Test_TC_RH_1_1 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR - TestReadClusterRevisionAttributeFromTheDutAndVerifyThatTheDutResponseIndicatesClusterRevisionAttributeHasTheValue3_1() + CHIP_ERROR TestWrite1ToTheOperationModeAttributeToDutOperationMode_1() { - UserPrompt(@"Enter the Value", @"3"); + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id operationModeArgument; + operationModeArgument = [NSNumber numberWithUnsignedChar:1]; + [cluster writeAttributeOperationModeWithValue:operationModeArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write 1 to the OperationMode attribute to DUT: OperationMode Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAttributeList_2() + CHIP_ERROR TestReadsTheAttributeEffectiveOperationMode_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestRelativeHumidityMeasurement * cluster = [[CHIPTestRelativeHumidityMeasurement alloc] initWithDevice:device + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl 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); + [cluster readAttributeEffectiveOperationModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the attribute: EffectiveOperationMode Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("AttributeList", [actualValue count], static_cast(3))); - VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); - VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); - VerifyOrReturn(CheckValue("", actualValue[2], 2UL)); + VerifyOrReturn(CheckValue("EffectiveOperationMode", actualValue, 1)); } - VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_3() + CHIP_ERROR TestWrite2ToTheOperationModeAttributeToDutOperationMode_3() { - UserPrompt(@"Please enter 'y' for success", @"y"); + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id operationModeArgument; + operationModeArgument = [NSNumber numberWithUnsignedChar:2]; + [cluster writeAttributeOperationModeWithValue:operationModeArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write 2 to the OperationMode attribute to DUT: OperationMode Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_4() + CHIP_ERROR TestReadsTheAttributeEffectiveOperationMode_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestRelativeHumidityMeasurement * cluster = [[CHIPTestRelativeHumidityMeasurement alloc] initWithDevice:device + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl 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); + [cluster readAttributeEffectiveOperationModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the attribute: EffectiveOperationMode Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); + VerifyOrReturn(CheckValue("EffectiveOperationMode", actualValue, 2)); } - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_5() + CHIP_ERROR TestWrite3ToTheOperationModeAttributeToDutOperationMode_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestRelativeHumidityMeasurement * cluster = [[CHIPTestRelativeHumidityMeasurement alloc] initWithDevice:device + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl 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); + id operationModeArgument; + operationModeArgument = [NSNumber numberWithUnsignedChar:3]; + [cluster writeAttributeOperationModeWithValue:operationModeArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write 3 to the OperationMode attribute to DUT: OperationMode Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadsTheAttributeEffectiveOperationMode_6() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEffectiveOperationModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the attribute: EffectiveOperationMode Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + VerifyOrReturn(CheckValue("EffectiveOperationMode", actualValue, 3)); } - VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - - CHIP_ERROR TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponse_6() - { - UserPrompt(@"Please enter FeatureMap attribute value", @"0"); - return CHIP_NO_ERROR; - } }; -class Test_TC_RH_2_1 : public TestCommandBridge { +class Test_TC_PCC_2_3 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_RH_2_1() - : TestCommandBridge("Test_TC_RH_2_1") + Test_TC_PCC_2_3() + : TestCommandBridge("Test_TC_PCC_2_3") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -35586,7 +42070,7 @@ class Test_TC_RH_2_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_RH_2_1() {} + ~Test_TC_PCC_2_3() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -35594,11 +42078,11 @@ class Test_TC_RH_2_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_RH_2_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_PCC_2_3\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_RH_2_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PCC_2_3\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -35615,24 +42099,116 @@ class Test_TC_RH_2_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Reads constraints of attribute: MeasuredValue\n"); - err = TestReadsConstraintsOfAttributeMeasuredValue_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Write 0 to the OperationMode attribute to DUT\n"); + if (ShouldSkip("A_OPERATIONMODE")) { + NextTest(); + return; + } + err = TestWrite0ToTheOperationModeAttributeToDut_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Reads constraints of attribute: MinMeasuredValue\n"); - err = TestReadsConstraintsOfAttributeMinMeasuredValue_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Reads the attribute: EffectiveOperationMode\n"); + if (ShouldSkip("A_EFFECTIVEOPERATIONMODE")) { + NextTest(); + return; + } + err = TestReadsTheAttributeEffectiveOperationMode_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Reads constraints of attribute: MaxMeasuredValue\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + ChipLogProgress(chipTool, " ***** Test Step 3 : Write 0 to the ControlMode attribute to DUT\n"); + if (ShouldSkip("A_CONTROLMODE")) { NextTest(); return; } - err = TestReadsConstraintsOfAttributeMaxMeasuredValue_3(); + err = TestWrite0ToTheControlModeAttributeToDut_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Reads constraints of attribute: Tolerance\n"); - err = TestReadsConstraintsOfAttributeTolerance_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Reads the attribute: EffectiveControlMode\n"); + if (ShouldSkip("A_EFFECTIVECONTROLMODE")) { + NextTest(); + return; + } + err = TestReadsTheAttributeEffectiveControlMode_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Write 1 to the ControlMode attribute to DUT\n"); + if (ShouldSkip("A_CONTROLMODE")) { + NextTest(); + return; + } + err = TestWrite1ToTheControlModeAttributeToDut_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Reads the attribute: EffectiveControlMode\n"); + if (ShouldSkip("A_EFFECTIVECONTROLMODE")) { + NextTest(); + return; + } + err = TestReadsTheAttributeEffectiveControlMode_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Write 2 to the ControlMode attribute to DUT\n"); + if (ShouldSkip("A_CONTROLMODE")) { + NextTest(); + return; + } + err = TestWrite2ToTheControlModeAttributeToDut_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Reads the attribute: EffectiveControlMode\n"); + if (ShouldSkip("A_EFFECTIVECONTROLMODE")) { + NextTest(); + return; + } + err = TestReadsTheAttributeEffectiveControlMode_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Write 3 to the ControlMode attribute to DUT\n"); + if (ShouldSkip("A_CONTROLMODE")) { + NextTest(); + return; + } + err = TestWrite3ToTheControlModeAttributeToDut_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Reads the attribute: EffectiveControlMode\n"); + if (ShouldSkip("A_EFFECTIVECONTROLMODE")) { + NextTest(); + return; + } + err = TestReadsTheAttributeEffectiveControlMode_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Write 5 to the ControlMode attribute to DUT\n"); + if (ShouldSkip("A_CONTROLMODE")) { + NextTest(); + return; + } + err = TestWrite5ToTheControlModeAttributeToDut_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Reads the attribute: EffectiveControlMode\n"); + if (ShouldSkip("A_EFFECTIVECONTROLMODE")) { + NextTest(); + return; + } + err = TestReadsTheAttributeEffectiveControlMode_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : Write 7 to the ControlMode attribute to DUT\n"); + if (ShouldSkip("A_CONTROLMODE")) { + NextTest(); + return; + } + err = TestWrite7ToTheControlModeAttributeToDut_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Reads the attribute: EffectiveControlMode\n"); + if (ShouldSkip("A_EFFECTIVECONTROLMODE")) { + NextTest(); + return; + } + err = TestReadsTheAttributeEffectiveControlMode_14(); break; } @@ -35642,6 +42218,60 @@ class Test_TC_RH_2_1 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -35649,7 +42279,7 @@ class Test_TC_RH_2_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 5; + const uint16_t mTestCount = 15; chip::Optional mNodeId; chip::Optional mCluster; @@ -35658,56 +42288,51 @@ class Test_TC_RH_2_1 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsConstraintsOfAttributeMeasuredValue_1() + CHIP_ERROR TestWrite0ToTheOperationModeAttributeToDut_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestRelativeHumidityMeasurement * cluster = [[CHIPTestRelativeHumidityMeasurement alloc] initWithDevice:device + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads constraints of attribute: MeasuredValue Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id operationModeArgument; + operationModeArgument = [NSNumber numberWithUnsignedChar:0]; + [cluster writeAttributeOperationModeWithValue:operationModeArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write 0 to the OperationMode attribute to DUT Error: %@", err); - VerifyOrReturn(CheckConstraintType("measuredValue", "", "int16")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("measuredValue", [value unsignedShortValue], 0U)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("measuredValue", [value unsignedShortValue], 10000U)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsConstraintsOfAttributeMinMeasuredValue_2() + CHIP_ERROR TestReadsTheAttributeEffectiveOperationMode_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestRelativeHumidityMeasurement * cluster = [[CHIPTestRelativeHumidityMeasurement alloc] initWithDevice:device + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMinMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads constraints of attribute: MinMeasuredValue Error: %@", err); + [cluster readAttributeEffectiveOperationModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the attribute: EffectiveOperationMode Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("minMeasuredValue", "", "int16")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("minMeasuredValue", [value unsignedShortValue], 0U)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("minMeasuredValue", [value unsignedShortValue], 9999U)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("EffectiveOperationMode", actualValue, 0)); } NextTest(); @@ -35716,57 +42341,46 @@ class Test_TC_RH_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsConstraintsOfAttributeMaxMeasuredValue_3() + CHIP_ERROR TestWrite0ToTheControlModeAttributeToDut_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestRelativeHumidityMeasurement * cluster = [[CHIPTestRelativeHumidityMeasurement alloc] initWithDevice:device + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMaxMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads constraints of attribute: MaxMeasuredValue Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id controlModeArgument; + controlModeArgument = [NSNumber numberWithUnsignedChar:0]; + [cluster writeAttributeControlModeWithValue:controlModeArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write 0 to the ControlMode attribute to DUT Error: %@", err); - VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "", "int16")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value unsignedShortValue], 1U)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("maxMeasuredValue", [value unsignedShortValue], 10000U)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsConstraintsOfAttributeTolerance_4() + CHIP_ERROR TestReadsTheAttributeEffectiveControlMode_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestRelativeHumidityMeasurement * cluster = [[CHIPTestRelativeHumidityMeasurement alloc] initWithDevice:device + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeToleranceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads constraints of attribute: Tolerance Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + [cluster readAttributeEffectiveControlModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the attribute: EffectiveControlMode 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)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("EffectiveControlMode", actualValue, 0)); } NextTest(); @@ -35774,117 +42388,143 @@ class Test_TC_RH_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } -}; -class Test_TC_RH_2_2 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_RH_2_2() - : TestCommandBridge("Test_TC_RH_2_2") - , mTestIndex(0) + CHIP_ERROR TestWrite1ToTheControlModeAttributeToDut_5() { - 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) + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - ~Test_TC_RH_2_2() {} + id controlModeArgument; + controlModeArgument = [NSNumber numberWithUnsignedChar:1]; + [cluster writeAttributeControlModeWithValue:controlModeArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write 1 to the ControlMode attribute to DUT Error: %@", err); - /////////// TestCommand Interface ///////// - void NextTest() override + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadsTheAttributeEffectiveControlMode_6() { - CHIP_ERROR err = CHIP_NO_ERROR; + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_RH_2_2\n"); - } + [cluster readAttributeEffectiveControlModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the attribute: EffectiveControlMode Error: %@", err); - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_RH_2_2\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + VerifyOrReturn(CheckValue("status", err, 0)); - Wait(); + { + id actualValue = value; + VerifyOrReturn(CheckValue("EffectiveControlMode", actualValue, 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 : Reads constraints of attribute: MinMeasuredValue\n"); - err = TestReadsConstraintsOfAttributeMinMeasuredValue_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Reads MeasuredValue attribute from DUT\n"); - if (ShouldSkip("A_RELATIVEHUMIDITY")) { - NextTest(); - return; - } - err = TestReadsMeasuredValueAttributeFromDut_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read the mandatory attribute: MeasuredValue\n"); - if (ShouldSkip("A_RELATIVEHUMIDITY")) { - NextTest(); - return; - } - err = TestReadTheMandatoryAttributeMeasuredValue_3(); - 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 TestWrite2ToTheControlModeAttributeToDut_7() { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id controlModeArgument; + controlModeArgument = [NSNumber numberWithUnsignedChar:2]; + [cluster writeAttributeControlModeWithValue:controlModeArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write 2 to the ControlMode attribute to DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 4; + CHIP_ERROR TestReadsTheAttributeEffectiveControlMode_8() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl 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 readAttributeEffectiveControlModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the attribute: EffectiveControlMode Error: %@", err); - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("EffectiveControlMode", actualValue, 2)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWrite3ToTheControlModeAttributeToDut_9() { - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id controlModeArgument; + controlModeArgument = [NSNumber numberWithUnsignedChar:3]; + [cluster writeAttributeControlModeWithValue:controlModeArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write 3 to the ControlMode attribute to DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsConstraintsOfAttributeMinMeasuredValue_1() + CHIP_ERROR TestReadsTheAttributeEffectiveControlMode_10() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestRelativeHumidityMeasurement * cluster = [[CHIPTestRelativeHumidityMeasurement alloc] initWithDevice:device + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMinMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads constraints of attribute: MinMeasuredValue Error: %@", err); + [cluster readAttributeEffectiveControlModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the attribute: EffectiveControlMode Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("minMeasuredValue", "", "int16")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("minMeasuredValue", [value unsignedShortValue], 0U)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("minMeasuredValue", [value unsignedShortValue], 9999U)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("EffectiveControlMode", actualValue, 3)); } NextTest(); @@ -35893,25 +42533,46 @@ class Test_TC_RH_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsMeasuredValueAttributeFromDut_2() + CHIP_ERROR TestWrite5ToTheControlModeAttributeToDut_11() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestRelativeHumidityMeasurement * cluster = [[CHIPTestRelativeHumidityMeasurement alloc] initWithDevice:device + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads MeasuredValue attribute from DUT Error: %@", err); + id controlModeArgument; + controlModeArgument = [NSNumber numberWithUnsignedChar:5]; + [cluster writeAttributeControlModeWithValue:controlModeArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write 5 to the ControlMode attribute to DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadsTheAttributeEffectiveControlMode_12() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEffectiveControlModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the attribute: EffectiveControlMode Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("measuredValue", "", "int16")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("measuredValue", [value unsignedShortValue], 0U)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("measuredValue", [value unsignedShortValue], 10000U)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("EffectiveControlMode", actualValue, 5)); } NextTest(); @@ -35920,20 +42581,48 @@ class Test_TC_RH_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheMandatoryAttributeMeasuredValue_3() + CHIP_ERROR TestWrite7ToTheControlModeAttributeToDut_13() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestRelativeHumidityMeasurement * cluster = [[CHIPTestRelativeHumidityMeasurement alloc] initWithDevice:device + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute: MeasuredValue Error: %@", err); + id controlModeArgument; + controlModeArgument = [NSNumber numberWithUnsignedChar:7]; + [cluster writeAttributeControlModeWithValue:controlModeArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write 7 to the ControlMode attribute to DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadsTheAttributeEffectiveControlMode_14() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEffectiveControlModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the attribute: EffectiveControlMode Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("measuredValue", "", "uint16")); + { + id actualValue = value; + VerifyOrReturn(CheckValue("EffectiveControlMode", actualValue, 7)); + } + NextTest(); }]; @@ -35941,11 +42630,11 @@ class Test_TC_RH_2_2 : public TestCommandBridge { } }; -class Test_TC_SWTCH_2_1 : public TestCommandBridge { +class Test_TC_PCC_2_4 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_SWTCH_2_1() - : TestCommandBridge("Test_TC_SWTCH_2_1") + Test_TC_PCC_2_4() + : TestCommandBridge("Test_TC_PCC_2_4") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -35955,7 +42644,7 @@ class Test_TC_SWTCH_2_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_SWTCH_2_1() {} + ~Test_TC_PCC_2_4() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -35963,11 +42652,11 @@ class Test_TC_SWTCH_2_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_SWTCH_2_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_PCC_2_4\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_SWTCH_2_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PCC_2_4\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -35984,28 +42673,52 @@ class Test_TC_SWTCH_2_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read NumberOfPositions attribute\n"); - err = TestReadNumberOfPositionsAttribute_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Write 1 to the LifetimeRunningHours attribute to DUT\n"); + err = TestWrite1ToTheLifetimeRunningHoursAttributeToDut_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read NumberOfPositions attribute\n"); - err = TestReadNumberOfPositionsAttribute_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Reads the attribute: LifetimeRunningHours\n"); + err = TestReadsTheAttributeLifetimeRunningHours_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read CurrentPosition attribute\n"); - err = TestReadCurrentPositionAttribute_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Write 2 to the LifetimeRunningHours attribute to DUT\n"); + err = TestWrite2ToTheLifetimeRunningHoursAttributeToDut_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read CurrentPosition attribute\n"); - err = TestReadCurrentPositionAttribute_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Reads the attribute: LifetimeRunningHours\n"); + err = TestReadsTheAttributeLifetimeRunningHours_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read MultiPressMax attribute\n"); - err = TestReadMultiPressMaxAttribute_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Write 3 to the LifetimeRunningHours attribute to DUT\n"); + err = TestWrite3ToTheLifetimeRunningHoursAttributeToDut_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Read MultiPressMax attribute\n"); - err = TestReadMultiPressMaxAttribute_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : Reads the attribute: LifetimeRunningHours\n"); + err = TestReadsTheAttributeLifetimeRunningHours_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Write 1 to the LifetimeEnergyConsumed attribute to DUT\n"); + err = TestWrite1ToTheLifetimeEnergyConsumedAttributeToDut_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Reads the attribute: LifetimeEnergyConsumed\n"); + err = TestReadsTheAttributeLifetimeEnergyConsumed_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Write 2 to the LifetimeEnergyConsumed attribute to DUT\n"); + err = TestWrite2ToTheLifetimeEnergyConsumedAttributeToDut_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Reads the attribute: LifetimeEnergyConsumed\n"); + err = TestReadsTheAttributeLifetimeEnergyConsumed_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Write 3 to the LifetimeEnergyConsumed attribute to DUT\n"); + err = TestWrite3ToTheLifetimeEnergyConsumedAttributeToDut_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Reads the attribute: LifetimeEnergyConsumed\n"); + err = TestReadsTheAttributeLifetimeEnergyConsumed_12(); break; } @@ -36015,6 +42728,54 @@ class Test_TC_SWTCH_2_1 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -36022,7 +42783,7 @@ class Test_TC_SWTCH_2_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 7; + const uint16_t mTestCount = 13; chip::Optional mNodeId; chip::Optional mCluster; @@ -36031,24 +42792,52 @@ class Test_TC_SWTCH_2_1 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestReadNumberOfPositionsAttribute_1() + CHIP_ERROR TestWrite1ToTheLifetimeRunningHoursAttributeToDut_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestSwitch * cluster = [[CHIPTestSwitch alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNumberOfPositionsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read NumberOfPositions attribute Error: %@", err); + id lifetimeRunningHoursArgument; + lifetimeRunningHoursArgument = [NSNumber numberWithUnsignedInt:1UL]; + [cluster writeAttributeLifetimeRunningHoursWithValue:lifetimeRunningHoursArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write 1 to the LifetimeRunningHours attribute to DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadsTheAttributeLifetimeRunningHours_2() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeLifetimeRunningHoursWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the attribute: LifetimeRunningHours Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("number of positions", actualValue, 2)); + VerifyOrReturn(CheckValueNonNull("LifetimeRunningHours", actualValue)); + VerifyOrReturn(CheckValue("LifetimeRunningHours", actualValue, 1UL)); } NextTest(); @@ -36057,42 +42846,47 @@ class Test_TC_SWTCH_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadNumberOfPositionsAttribute_2() + CHIP_ERROR TestWrite2ToTheLifetimeRunningHoursAttributeToDut_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestSwitch * cluster = [[CHIPTestSwitch alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNumberOfPositionsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read NumberOfPositions attribute Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id lifetimeRunningHoursArgument; + lifetimeRunningHoursArgument = [NSNumber numberWithUnsignedInt:2UL]; + [cluster writeAttributeLifetimeRunningHoursWithValue:lifetimeRunningHoursArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write 2 to the LifetimeRunningHours attribute to DUT Error: %@", err); - VerifyOrReturn(CheckConstraintType("numberOfPositions", "", "uint8")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("numberOfPositions", [value unsignedCharValue], 2)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadCurrentPositionAttribute_3() + CHIP_ERROR TestReadsTheAttributeLifetimeRunningHours_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestSwitch * cluster = [[CHIPTestSwitch alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentPositionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read CurrentPosition attribute Error: %@", err); + [cluster readAttributeLifetimeRunningHoursWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the attribute: LifetimeRunningHours Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("current position", actualValue, 0)); + VerifyOrReturn(CheckValueNonNull("LifetimeRunningHours", actualValue)); + VerifyOrReturn(CheckValue("LifetimeRunningHours", actualValue, 2UL)); } NextTest(); @@ -36101,20 +42895,47 @@ class Test_TC_SWTCH_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadCurrentPositionAttribute_4() + CHIP_ERROR TestWrite3ToTheLifetimeRunningHoursAttributeToDut_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestSwitch * cluster = [[CHIPTestSwitch alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentPositionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read CurrentPosition attribute Error: %@", err); + id lifetimeRunningHoursArgument; + lifetimeRunningHoursArgument = [NSNumber numberWithUnsignedInt:3UL]; + [cluster writeAttributeLifetimeRunningHoursWithValue:lifetimeRunningHoursArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write 3 to the LifetimeRunningHours attribute to DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadsTheAttributeLifetimeRunningHours_6() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeLifetimeRunningHoursWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the attribute: LifetimeRunningHours Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("currentPosition", "", "uint8")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("currentPosition", [value unsignedCharValue], 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("LifetimeRunningHours", actualValue)); + VerifyOrReturn(CheckValue("LifetimeRunningHours", actualValue, 3UL)); } NextTest(); @@ -36123,20 +42944,47 @@ class Test_TC_SWTCH_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadMultiPressMaxAttribute_5() + CHIP_ERROR TestWrite1ToTheLifetimeEnergyConsumedAttributeToDut_7() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestSwitch * cluster = [[CHIPTestSwitch alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMultiPressMaxWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read MultiPressMax attribute Error: %@", err); + id lifetimeEnergyConsumedArgument; + lifetimeEnergyConsumedArgument = [NSNumber numberWithUnsignedInt:1UL]; + [cluster writeAttributeLifetimeEnergyConsumedWithValue:lifetimeEnergyConsumedArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write 1 to the LifetimeEnergyConsumed attribute to DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadsTheAttributeLifetimeEnergyConsumed_8() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeLifetimeEnergyConsumedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the attribute: LifetimeEnergyConsumed Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("multi press max", actualValue, 2)); + VerifyOrReturn(CheckValueNonNull("LifetimeEnergyConsumed", actualValue)); + VerifyOrReturn(CheckValue("LifetimeEnergyConsumed", actualValue, 1UL)); } NextTest(); @@ -36145,20 +42993,47 @@ class Test_TC_SWTCH_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadMultiPressMaxAttribute_6() + CHIP_ERROR TestWrite2ToTheLifetimeEnergyConsumedAttributeToDut_9() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestSwitch * cluster = [[CHIPTestSwitch alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMultiPressMaxWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read MultiPressMax attribute Error: %@", err); + id lifetimeEnergyConsumedArgument; + lifetimeEnergyConsumedArgument = [NSNumber numberWithUnsignedInt:2UL]; + [cluster writeAttributeLifetimeEnergyConsumedWithValue:lifetimeEnergyConsumedArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write 2 to the LifetimeEnergyConsumed attribute to DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadsTheAttributeLifetimeEnergyConsumed_10() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeLifetimeEnergyConsumedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the attribute: LifetimeEnergyConsumed Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("multiPressMax", "", "uint8")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("multiPressMax", [value unsignedCharValue], 2)); + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("LifetimeEnergyConsumed", actualValue)); + VerifyOrReturn(CheckValue("LifetimeEnergyConsumed", actualValue, 2UL)); } NextTest(); @@ -36166,35 +43041,84 @@ class Test_TC_SWTCH_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } -}; -class Test_TC_SWTCH_2_2 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_SWTCH_2_2() - : TestCommandBridge("Test_TC_SWTCH_2_2") - , mTestIndex(0) + CHIP_ERROR TestWrite3ToTheLifetimeEnergyConsumedAttributeToDut_11() { - 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) + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - ~Test_TC_SWTCH_2_2() {} + id lifetimeEnergyConsumedArgument; + lifetimeEnergyConsumedArgument = [NSNumber numberWithUnsignedInt:3UL]; + [cluster writeAttributeLifetimeEnergyConsumedWithValue:lifetimeEnergyConsumedArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write 3 to the LifetimeEnergyConsumed attribute to DUT 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_SWTCH_2_2\n"); - } + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadsTheAttributeLifetimeEnergyConsumed_12() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeLifetimeEnergyConsumedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the attribute: LifetimeEnergyConsumed Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("LifetimeEnergyConsumed", actualValue)); + VerifyOrReturn(CheckValue("LifetimeEnergyConsumed", actualValue, 3UL)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_PSCFG_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_PSCFG_1_1() + : TestCommandBridge("Test_TC_PSCFG_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_PSCFG_1_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_PSCFG_1_1\n"); + } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_SWTCH_2_2\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PSCFG_1_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -36207,163 +43131,55 @@ class Test_TC_SWTCH_2_2 : 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 : Commission DUT to TH\n"); + err = TestCommissionDutToTh_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : User interaction needed\n"); - err = TestUserInteractionNeeded_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 : User interaction needed\n"); - err = TestUserInteractionNeeded_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads the AttributeList attribute from the DUT\n"); + err = TestThReadsTheAttributeListAttributeFromTheDut_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read CurrentPosition attribute\n"); - err = TestReadCurrentPositionAttribute_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads the AcceptedCommandList attribute from the DUT\n"); + err = TestThReadsTheAcceptedCommandListAttributeFromTheDut_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : User interaction needed\n"); - err = TestUserInteractionNeeded_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : User interaction needed\n"); - err = TestUserInteractionNeeded_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : User interaction needed\n"); - err = TestUserInteractionNeeded_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Read CurrentPosition attribute\n"); - err = TestReadCurrentPositionAttribute_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : User interaction needed\n"); - err = TestUserInteractionNeeded_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : User interaction needed\n"); - err = TestUserInteractionNeeded_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : User interaction needed\n"); - err = TestUserInteractionNeeded_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : User interaction needed\n"); - err = TestUserInteractionNeeded_11(); - break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : User interaction needed\n"); - err = TestUserInteractionNeeded_12(); - break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : User interaction needed\n"); - err = TestUserInteractionNeeded_13(); - break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : User interaction needed\n"); - err = TestUserInteractionNeeded_14(); - break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Wait 3000ms\n"); - err = TestWait3000ms_15(); - break; - case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : User interaction needed\n"); - err = TestUserInteractionNeeded_16(); - break; - case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : User interaction needed\n"); - err = TestUserInteractionNeeded_17(); - break; - case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : User interaction needed\n"); - err = TestUserInteractionNeeded_18(); - break; - case 19: - ChipLogProgress(chipTool, " ***** Test Step 19 : User interaction needed\n"); - err = TestUserInteractionNeeded_19(); - break; - case 20: - ChipLogProgress(chipTool, " ***** Test Step 20 : User interaction needed\n"); - err = TestUserInteractionNeeded_20(); - break; - case 21: - ChipLogProgress(chipTool, " ***** Test Step 21 : User interaction needed\n"); - err = TestUserInteractionNeeded_21(); - break; - case 22: - ChipLogProgress(chipTool, " ***** Test Step 22 : Wait 3000ms\n"); - err = TestWait3000ms_22(); - break; - case 23: - ChipLogProgress(chipTool, " ***** Test Step 23 : User interaction needed\n"); - err = TestUserInteractionNeeded_23(); - break; - case 24: - ChipLogProgress(chipTool, " ***** Test Step 24 : User interaction needed\n"); - err = TestUserInteractionNeeded_24(); - break; - case 25: - ChipLogProgress(chipTool, " ***** Test Step 25 : User interaction needed\n"); - err = TestUserInteractionNeeded_25(); - break; - case 26: - ChipLogProgress(chipTool, " ***** Test Step 26 : User interaction needed\n"); - err = TestUserInteractionNeeded_26(); - break; - case 27: - ChipLogProgress(chipTool, " ***** Test Step 27 : User interaction needed\n"); - err = TestUserInteractionNeeded_27(); - break; - case 28: - ChipLogProgress(chipTool, " ***** Test Step 28 : User interaction needed\n"); - err = TestUserInteractionNeeded_28(); - break; - case 29: - ChipLogProgress(chipTool, " ***** Test Step 29 : User interaction needed\n"); - err = TestUserInteractionNeeded_29(); - break; - case 30: - ChipLogProgress(chipTool, " ***** Test Step 30 : User interaction needed\n"); - err = TestUserInteractionNeeded_30(); - break; - case 31: - ChipLogProgress(chipTool, " ***** Test Step 31 : User interaction needed\n"); - err = TestUserInteractionNeeded_31(); - break; - case 32: - ChipLogProgress(chipTool, " ***** Test Step 32 : User interaction needed\n"); - err = TestUserInteractionNeeded_32(); + ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads the GeneratedCommandList attribute from the DUT\n"); + err = TestThReadsTheGeneratedCommandListAttributeFromTheDut_4(); break; - case 33: - ChipLogProgress(chipTool, " ***** Test Step 33 : User interaction needed\n"); - err = TestUserInteractionNeeded_33(); + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 34: - ChipLogProgress(chipTool, " ***** Test Step 34 : User interaction needed\n"); - err = TestUserInteractionNeeded_34(); + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 35: - ChipLogProgress(chipTool, " ***** Test Step 35 : User interaction needed\n"); - err = TestUserInteractionNeeded_35(); + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 36: - ChipLogProgress(chipTool, " ***** Test Step 36 : User interaction needed\n"); - err = TestUserInteractionNeeded_36(); + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 37: - ChipLogProgress(chipTool, " ***** Test Step 37 : User interaction needed\n"); - err = TestUserInteractionNeeded_37(); + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; } - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + // Go on to the next test. + WaitForMs(0); } chip::System::Clock::Timeout GetWaitDuration() const override @@ -36373,45 +43189,37 @@ class Test_TC_SWTCH_2_2 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 38; + const uint16_t mTestCount = 5; chip::Optional mNodeId; chip::Optional mCluster; chip::Optional mEndpoint; chip::Optional mTimeout; - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + CHIP_ERROR TestCommissionDutToTh_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestUserInteractionNeeded_1() - { - UserPrompt(@"Set up subscription to SwitchLatched event"); - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestUserInteractionNeeded_2() - { - UserPrompt(@"Operator sets switch to first position"); - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadCurrentPositionAttribute_3() + CHIP_ERROR TestThReadsTheClusterRevisionAttributeFromTheDut_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestSwitch * cluster = [[CHIPTestSwitch alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestPowerSourceConfiguration * cluster = [[CHIPTestPowerSourceConfiguration alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentPositionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read CurrentPosition attribute Error: %@", err); + [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("current position", actualValue, 0)); + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); } NextTest(); @@ -36420,232 +43228,75 @@ class Test_TC_SWTCH_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestUserInteractionNeeded_4() - { - UserPrompt(@"Operator sets switch to second position"); - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestUserInteractionNeeded_5() - { - UserPrompt(@"Set up subscription to InitialPress event"); - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestUserInteractionNeeded_6() - { - UserPrompt(@"Operator does not operate switch"); - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadCurrentPositionAttribute_7() + CHIP_ERROR TestThReadsTheAttributeListAttributeFromTheDut_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestSwitch * cluster = [[CHIPTestSwitch alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestPowerSourceConfiguration * cluster = [[CHIPTestPowerSourceConfiguration alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentPositionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read CurrentPosition attribute Error: %@", err); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the AttributeList attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("current position", actualValue, 0)); - } - + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestUserInteractionNeeded_8() - { - UserPrompt(@"Operator sets switch to second position"); - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestUserInteractionNeeded_9() - { - UserPrompt(@"Operator does not operate switch (release switch)"); - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestUserInteractionNeeded_10() - { - UserPrompt(@"Set up subscription to InitialPress and ShortRelease events"); - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestUserInteractionNeeded_11() - { - UserPrompt(@"Operator does not operate switch"); - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestUserInteractionNeeded_12() - { - UserPrompt(@"Operator operates switch (press briefly)"); - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestUserInteractionNeeded_13() - { - UserPrompt(@"Operator releases switch"); - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestUserInteractionNeeded_14() - { - UserPrompt(@"Operator operates switch for 5 seconds"); - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestWait3000ms_15() - { - WaitForMs(3000); - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestUserInteractionNeeded_16() - { - UserPrompt(@"Operator releases switch"); - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestUserInteractionNeeded_17() - { - UserPrompt(@"Set up subscription to InitialPress, LongPress, ShortRelease, LongRelease events"); - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestUserInteractionNeeded_18() - { - UserPrompt(@"Operator does not operate switch"); - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestUserInteractionNeeded_19() - { - UserPrompt(@"Operator operates switch (press briefly)"); - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestUserInteractionNeeded_20() - { - UserPrompt(@"Operator releases switch"); - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestUserInteractionNeeded_21() - { - UserPrompt(@"Operator operates switch for 5 seconds"); - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestWait3000ms_22() - { - WaitForMs(3000); - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestUserInteractionNeeded_23() - { - UserPrompt(@"Operator releases switch"); - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestUserInteractionNeeded_24() - { - UserPrompt(@"Set up subscription to InitialPress, ShortRelease, MultiPressOngoing, MultiPressComplete events"); - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestUserInteractionNeeded_25() - { - UserPrompt(@"Operator does not operate switch"); - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestUserInteractionNeeded_26() - { - UserPrompt(@"Operator operates switch (press briefly)"); - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestUserInteractionNeeded_27() - { - UserPrompt(@"Operator releases switch"); - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestUserInteractionNeeded_28() + CHIP_ERROR TestThReadsTheAcceptedCommandListAttributeFromTheDut_3() { - UserPrompt(@"Operator operates switch (press briefly)"); - return CHIP_NO_ERROR; - } + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestPowerSourceConfiguration * cluster = [[CHIPTestPowerSourceConfiguration alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - CHIP_ERROR TestUserInteractionNeeded_29() - { - UserPrompt(@"Operator releases switch"); - return CHIP_NO_ERROR; - } + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the AcceptedCommandList attribute from the DUT Error: %@", err); - CHIP_ERROR TestUserInteractionNeeded_30() - { - UserPrompt(@"Operator operates switch again (press briefly)"); - return CHIP_NO_ERROR; - } + VerifyOrReturn(CheckValue("status", err, 0)); - CHIP_ERROR TestUserInteractionNeeded_31() - { - UserPrompt(@"Operator releases switch"); - return CHIP_NO_ERROR; - } + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); + NextTest(); + }]; - CHIP_ERROR TestUserInteractionNeeded_32() - { - UserPrompt(@"Operator operates switch again (press briefly)"); return CHIP_NO_ERROR; } - CHIP_ERROR TestUserInteractionNeeded_33() + CHIP_ERROR TestThReadsTheGeneratedCommandListAttributeFromTheDut_4() { - UserPrompt(@"Operator releases switch"); - return CHIP_NO_ERROR; - } + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestPowerSourceConfiguration * cluster = [[CHIPTestPowerSourceConfiguration alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - CHIP_ERROR TestUserInteractionNeeded_34() - { - UserPrompt(@"Operator operates switch again (press briefly)"); - return CHIP_NO_ERROR; - } + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the GeneratedCommandList attribute from the DUT Error: %@", err); - CHIP_ERROR TestUserInteractionNeeded_35() - { - UserPrompt(@"Operator releases switch"); - return CHIP_NO_ERROR; - } + VerifyOrReturn(CheckValue("status", err, 0)); - CHIP_ERROR TestUserInteractionNeeded_36() - { - UserPrompt(@"Operator operates switch again (press briefly)"); - return CHIP_NO_ERROR; - } + VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); + NextTest(); + }]; - CHIP_ERROR TestUserInteractionNeeded_37() - { - UserPrompt(@"Operator releases switch"); return CHIP_NO_ERROR; } }; -class Test_TC_TM_1_1 : public TestCommandBridge { +class Test_TC_RH_1_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_TM_1_1() - : TestCommandBridge("Test_TC_TM_1_1") + Test_TC_RH_1_1() + : TestCommandBridge("Test_TC_RH_1_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -36655,7 +43306,7 @@ class Test_TC_TM_1_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_TM_1_1() {} + ~Test_TC_RH_1_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -36663,11 +43314,11 @@ class Test_TC_TM_1_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_TM_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_RH_1_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TM_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_RH_1_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -36686,12 +43337,12 @@ class Test_TC_TM_1_1 : public TestCommandBridge { case 1: ChipLogProgress(chipTool, " ***** Test Step 1 : Read ClusterRevision attribute from the DUT and Verify that the DUT response indicates " - "ClusterRevision attribute has the value 4\n"); + "ClusterRevision attribute has the value 3\n"); if (ShouldSkip("PICS_USER_PROMPT")) { NextTest(); return; } - err = TestReadClusterRevisionAttributeFromTheDutAndVerifyThatTheDutResponseIndicatesClusterRevisionAttributeHasTheValue4_1(); + err = TestReadClusterRevisionAttributeFromTheDutAndVerifyThatTheDutResponseIndicatesClusterRevisionAttributeHasTheValue3_1(); break; case 2: ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: AttributeList\n"); @@ -36712,24 +43363,21 @@ class Test_TC_TM_1_1 : public TestCommandBridge { err = TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_3(); break; case 4: - ChipLogProgress(chipTool, - " ***** Test Step 4 : Read AcceptedCommandList attribute from the DUT and Verify that the DUT response provides a " - "list of supported commands,This list SHALL include all the mandatory commands.\n"); - if (ShouldSkip("PICS_USER_PROMPT")) { - NextTest(); - return; - } - err = TestReadAcceptedCommandListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedCommandsThisListShallIncludeAllTheMandatoryCommands_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_4(); break; case 5: - ChipLogProgress(chipTool, - " ***** Test Step 5 : Read GeneratedCommandList attribute from the DUT and Verify that the DUT response provides a " - "list of supported commands.\n"); + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_5(); + break; + case 6: + ChipLogProgress( + chipTool, " ***** Test Step 6 : Read FeatureMap attribute from the DUT and Verify that the DUT response\n"); if (ShouldSkip("PICS_USER_PROMPT")) { NextTest(); return; } - err = TestReadGeneratedCommandListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedCommands_5(); + err = TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponse_6(); break; } @@ -36739,14 +43387,44 @@ class Test_TC_TM_1_1 : public TestCommandBridge { } } - chip::System::Clock::Timeout GetWaitDuration() const override + void OnStatusUpdate(const chip::app::StatusIB & status) override { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } - + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + + 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; + const uint16_t mTestCount = 7; chip::Optional mNodeId; chip::Optional mCluster; @@ -36755,23 +43433,26 @@ class Test_TC_TM_1_1 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR - TestReadClusterRevisionAttributeFromTheDutAndVerifyThatTheDutResponseIndicatesClusterRevisionAttributeHasTheValue4_1() + TestReadClusterRevisionAttributeFromTheDutAndVerifyThatTheDutResponseIndicatesClusterRevisionAttributeHasTheValue3_1() { - UserPrompt(@"Please enter ClusterRevision attribute value", @"4"); + SetIdentity("alpha"); + UserPrompt(@"Enter the Value", @"3"); return CHIP_NO_ERROR; } CHIP_ERROR TestReadTheGlobalAttributeAttributeList_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestTemperatureMeasurement * cluster = [[CHIPTestTemperatureMeasurement alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestRelativeHumidityMeasurement * cluster = [[CHIPTestRelativeHumidityMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { @@ -36781,11 +43462,10 @@ class Test_TC_TM_1_1 : public TestCommandBridge { { id actualValue = value; - VerifyOrReturn(CheckValue("AttributeList", [actualValue count], static_cast(4))); + VerifyOrReturn(CheckValue("AttributeList", [actualValue count], static_cast(3))); VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); VerifyOrReturn(CheckValue("", actualValue[2], 2UL)); - VerifyOrReturn(CheckValue("", actualValue[3], 3UL)); } VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); @@ -36797,29 +43477,76 @@ class Test_TC_TM_1_1 : public TestCommandBridge { CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_3() { + SetIdentity("alpha"); UserPrompt(@"Please enter 'y' for success", @"y"); return CHIP_NO_ERROR; } - CHIP_ERROR - TestReadAcceptedCommandListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedCommandsThisListShallIncludeAllTheMandatoryCommands_4() + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_4() { - UserPrompt(@"Please enter 'y' for success", @"y"); + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestRelativeHumidityMeasurement * cluster = [[CHIPTestRelativeHumidityMeasurement 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(0))); + } + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); + NextTest(); + }]; + return CHIP_NO_ERROR; } - CHIP_ERROR TestReadGeneratedCommandListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedCommands_5() + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_5() { - UserPrompt(@"Please enter 'y' for success", @"y"); + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestRelativeHumidityMeasurement * cluster = [[CHIPTestRelativeHumidityMeasurement 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(0))); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponse_6() + { + SetIdentity("alpha"); + UserPrompt(@"Please enter FeatureMap attribute value", @"0"); return CHIP_NO_ERROR; } }; -class Test_TC_TM_2_1 : public TestCommandBridge { +class Test_TC_RH_2_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_TM_2_1() - : TestCommandBridge("Test_TC_TM_2_1") + Test_TC_RH_2_1() + : TestCommandBridge("Test_TC_RH_2_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -36829,7 +43556,7 @@ class Test_TC_TM_2_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_TM_2_1() {} + ~Test_TC_RH_2_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -36837,11 +43564,11 @@ class Test_TC_TM_2_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_TM_2_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_RH_2_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TM_2_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_RH_2_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -36858,20 +43585,24 @@ class Test_TC_TM_2_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : read the mandatory attribute: MeasuredValue\n"); - err = TestReadTheMandatoryAttributeMeasuredValue_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Reads constraints of attribute: MeasuredValue\n"); + err = TestReadsConstraintsOfAttributeMeasuredValue_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : read the mandatory attribute: MinMeasuredValue\n"); - err = TestReadTheMandatoryAttributeMinMeasuredValue_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Reads constraints of attribute: MinMeasuredValue\n"); + err = TestReadsConstraintsOfAttributeMinMeasuredValue_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : read the mandatory attribute: MaxMeasuredValue\n"); - err = TestReadTheMandatoryAttributeMaxMeasuredValue_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Reads constraints of attribute: MaxMeasuredValue\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestReadsConstraintsOfAttributeMaxMeasuredValue_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : read the optional attribute: Tolerance\n"); - err = TestReadTheOptionalAttributeTolerance_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Reads constraints of attribute: Tolerance\n"); + err = TestReadsConstraintsOfAttributeTolerance_4(); break; } @@ -36881,6 +43612,30 @@ class Test_TC_TM_2_1 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -36897,49 +43652,59 @@ class Test_TC_TM_2_1 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheMandatoryAttributeMeasuredValue_1() + CHIP_ERROR TestReadsConstraintsOfAttributeMeasuredValue_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestTemperatureMeasurement * cluster = [[CHIPTestTemperatureMeasurement alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestRelativeHumidityMeasurement * cluster = [[CHIPTestRelativeHumidityMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: MeasuredValue Error: %@", err); + NSLog(@"Reads constraints of attribute: MeasuredValue Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); VerifyOrReturn(CheckConstraintType("measuredValue", "", "int16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("measuredValue", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("measuredValue", [value unsignedShortValue], 10000U)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheMandatoryAttributeMinMeasuredValue_2() + CHIP_ERROR TestReadsConstraintsOfAttributeMinMeasuredValue_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestTemperatureMeasurement * cluster = [[CHIPTestTemperatureMeasurement alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestRelativeHumidityMeasurement * cluster = [[CHIPTestRelativeHumidityMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeMinMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: MinMeasuredValue Error: %@", err); + NSLog(@"Reads constraints of attribute: MinMeasuredValue Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); VerifyOrReturn(CheckConstraintType("minMeasuredValue", "", "int16")); if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("minMeasuredValue", [value shortValue], -27315)); + VerifyOrReturn(CheckConstraintMinValue("minMeasuredValue", [value unsignedShortValue], 0U)); } if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("minMeasuredValue", [value shortValue], 32766)); + VerifyOrReturn(CheckConstraintMaxValue("minMeasuredValue", [value unsignedShortValue], 9999U)); } NextTest(); @@ -36948,25 +43713,26 @@ class Test_TC_TM_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheMandatoryAttributeMaxMeasuredValue_3() + CHIP_ERROR TestReadsConstraintsOfAttributeMaxMeasuredValue_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestTemperatureMeasurement * cluster = [[CHIPTestTemperatureMeasurement alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestRelativeHumidityMeasurement * cluster = [[CHIPTestRelativeHumidityMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeMaxMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: MaxMeasuredValue Error: %@", err); + NSLog(@"Reads constraints of attribute: MaxMeasuredValue Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "", "int16")); if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value shortValue], -27314)); + VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value unsignedShortValue], 1U)); } if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("maxMeasuredValue", [value shortValue], 32767)); + VerifyOrReturn(CheckConstraintMaxValue("maxMeasuredValue", [value unsignedShortValue], 10000U)); } NextTest(); @@ -36975,16 +43741,17 @@ class Test_TC_TM_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeTolerance_4() + CHIP_ERROR TestReadsConstraintsOfAttributeTolerance_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestTemperatureMeasurement * cluster = [[CHIPTestTemperatureMeasurement alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestRelativeHumidityMeasurement * cluster = [[CHIPTestRelativeHumidityMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeToleranceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: Tolerance Error: %@", err); + NSLog(@"Reads constraints of attribute: Tolerance Error: %@", err); if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { NextTest(); @@ -37008,11 +43775,11 @@ class Test_TC_TM_2_1 : public TestCommandBridge { } }; -class Test_TC_TM_2_2 : public TestCommandBridge { +class Test_TC_RH_2_2 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_TM_2_2() - : TestCommandBridge("Test_TC_TM_2_2") + Test_TC_RH_2_2() + : TestCommandBridge("Test_TC_RH_2_2") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -37022,7 +43789,7 @@ class Test_TC_TM_2_2 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_TM_2_2() {} + ~Test_TC_RH_2_2() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -37030,11 +43797,11 @@ class Test_TC_TM_2_2 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_TM_2_2\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_RH_2_2\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TM_2_2\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_RH_2_2\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -37051,28 +43818,24 @@ class Test_TC_TM_2_2 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : read the mandatory attribute: MinMeasuredValue\n"); - err = TestReadTheMandatoryAttributeMinMeasuredValue_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Reads constraints of attribute: MinMeasuredValue\n"); + err = TestReadsConstraintsOfAttributeMinMeasuredValue_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : read the mandatory attribute: MaxMeasuredValue\n"); - err = TestReadTheMandatoryAttributeMaxMeasuredValue_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Reads MeasuredValue attribute from DUT\n"); - if (ShouldSkip("A_TEMPERATURE")) { + ChipLogProgress(chipTool, " ***** Test Step 2 : Reads MeasuredValue attribute from DUT\n"); + if (ShouldSkip("A_RELATIVEHUMIDITY")) { NextTest(); return; } - err = TestReadsMeasuredValueAttributeFromDut_3(); + err = TestReadsMeasuredValueAttributeFromDut_2(); break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read the mandatory attribute: MeasuredValue\n"); - if (ShouldSkip("A_TEMPERATURE")) { + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Read the mandatory attribute: MeasuredValue\n"); + if (ShouldSkip("A_RELATIVEHUMIDITY")) { NextTest(); return; } - err = TestReadTheMandatoryAttributeMeasuredValue_4(); + err = TestReadTheMandatoryAttributeMeasuredValue_3(); break; } @@ -37082,6 +43845,27 @@ class Test_TC_TM_2_2 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -37089,7 +43873,7 @@ class Test_TC_TM_2_2 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 5; + const uint16_t mTestCount = 4; chip::Optional mNodeId; chip::Optional mCluster; @@ -37098,29 +43882,31 @@ class Test_TC_TM_2_2 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheMandatoryAttributeMinMeasuredValue_1() + CHIP_ERROR TestReadsConstraintsOfAttributeMinMeasuredValue_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestTemperatureMeasurement * cluster = [[CHIPTestTemperatureMeasurement alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestRelativeHumidityMeasurement * cluster = [[CHIPTestRelativeHumidityMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeMinMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: MinMeasuredValue Error: %@", err); + NSLog(@"Reads constraints of attribute: MinMeasuredValue Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); VerifyOrReturn(CheckConstraintType("minMeasuredValue", "", "int16")); if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("minMeasuredValue", [value shortValue], -27315)); + VerifyOrReturn(CheckConstraintMinValue("minMeasuredValue", [value unsignedShortValue], 0U)); } if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("minMeasuredValue", [value shortValue], 32766)); + VerifyOrReturn(CheckConstraintMaxValue("minMeasuredValue", [value unsignedShortValue], 9999U)); } NextTest(); @@ -37129,25 +43915,26 @@ class Test_TC_TM_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheMandatoryAttributeMaxMeasuredValue_2() + CHIP_ERROR TestReadsMeasuredValueAttributeFromDut_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestTemperatureMeasurement * cluster = [[CHIPTestTemperatureMeasurement alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestRelativeHumidityMeasurement * cluster = [[CHIPTestRelativeHumidityMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMaxMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: MaxMeasuredValue Error: %@", err); + [cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads MeasuredValue attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "", "int16")); + VerifyOrReturn(CheckConstraintType("measuredValue", "", "int16")); if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value shortValue], -27314)); + VerifyOrReturn(CheckConstraintMinValue("measuredValue", [value unsignedShortValue], 0U)); } if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("maxMeasuredValue", [value shortValue], 32767)); + VerifyOrReturn(CheckConstraintMaxValue("measuredValue", [value unsignedShortValue], 10000U)); } NextTest(); @@ -37156,32 +43943,13 @@ class Test_TC_TM_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsMeasuredValueAttributeFromDut_3() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTemperatureMeasurement * cluster = [[CHIPTestTemperatureMeasurement alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads MeasuredValue attribute from DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("measuredValue", "", "uint16")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheMandatoryAttributeMeasuredValue_4() + CHIP_ERROR TestReadTheMandatoryAttributeMeasuredValue_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestTemperatureMeasurement * cluster = [[CHIPTestTemperatureMeasurement alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestRelativeHumidityMeasurement * cluster = [[CHIPTestRelativeHumidityMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { @@ -37197,11 +43965,11 @@ class Test_TC_TM_2_2 : public TestCommandBridge { } }; -class Test_TC_TSTAT_1_1 : public TestCommandBridge { +class Test_TC_SWTCH_2_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_TSTAT_1_1() - : TestCommandBridge("Test_TC_TSTAT_1_1") + Test_TC_SWTCH_2_1() + : TestCommandBridge("Test_TC_SWTCH_2_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -37211,7 +43979,7 @@ class Test_TC_TSTAT_1_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_TSTAT_1_1() {} + ~Test_TC_SWTCH_2_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -37219,11 +43987,11 @@ class Test_TC_TSTAT_1_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_TSTAT_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_SWTCH_2_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TSTAT_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_SWTCH_2_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -37240,16 +44008,28 @@ class Test_TC_TSTAT_1_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute constraints: ClusterRevision\n"); - err = TestReadTheGlobalAttributeConstraintsClusterRevision_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Read NumberOfPositions attribute\n"); + err = TestReadNumberOfPositionsAttribute_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: AttributeList\n"); - err = TestReadTheGlobalAttributeAttributeList_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Read NumberOfPositions attribute\n"); + err = TestReadNumberOfPositionsAttribute_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read the optional global attribute constraints: FeatureMap\n"); - err = TestReadTheOptionalGlobalAttributeConstraintsFeatureMap_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Read CurrentPosition attribute\n"); + err = TestReadCurrentPositionAttribute_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Read CurrentPosition attribute\n"); + err = TestReadCurrentPositionAttribute_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read MultiPressMax attribute\n"); + err = TestReadMultiPressMaxAttribute_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Read MultiPressMax attribute\n"); + err = TestReadMultiPressMaxAttribute_6(); break; } @@ -37259,6 +44039,36 @@ class Test_TC_TSTAT_1_1 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -37266,7 +44076,7 @@ class Test_TC_TSTAT_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 4; + const uint16_t mTestCount = 7; chip::Optional mNodeId; chip::Optional mCluster; @@ -37275,58 +44085,143 @@ class Test_TC_TSTAT_1_1 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_1() + CHIP_ERROR TestReadNumberOfPositionsAttribute_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestSwitch * cluster = [[CHIPTestSwitch 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); + [cluster readAttributeNumberOfPositionsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read NumberOfPositions attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); + { + id actualValue = value; + VerifyOrReturn(CheckValue("number of positions", actualValue, 2)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAttributeList_2() + CHIP_ERROR TestReadNumberOfPositionsAttribute_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestSwitch * cluster = [[CHIPTestSwitch 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); + [cluster readAttributeNumberOfPositionsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read NumberOfPositions attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); + VerifyOrReturn(CheckConstraintType("numberOfPositions", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("numberOfPositions", [value unsignedCharValue], 2)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalGlobalAttributeConstraintsFeatureMap_3() + CHIP_ERROR TestReadCurrentPositionAttribute_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestSwitch * cluster = [[CHIPTestSwitch 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 constraints: FeatureMap Error: %@", err); + [cluster readAttributeCurrentPositionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read CurrentPosition attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("featureMap", "", "map32")); + { + id actualValue = value; + VerifyOrReturn(CheckValue("current position", actualValue, 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadCurrentPositionAttribute_4() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestSwitch * cluster = [[CHIPTestSwitch alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentPositionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read CurrentPosition attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentPosition", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentPosition", [value unsignedCharValue], 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadMultiPressMaxAttribute_5() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestSwitch * cluster = [[CHIPTestSwitch alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMultiPressMaxWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read MultiPressMax attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("multi press max", actualValue, 2)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadMultiPressMaxAttribute_6() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestSwitch * cluster = [[CHIPTestSwitch alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMultiPressMaxWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read MultiPressMax attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("multiPressMax", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("multiPressMax", [value unsignedCharValue], 2)); + } + NextTest(); }]; @@ -37334,11 +44229,11 @@ class Test_TC_TSTAT_1_1 : public TestCommandBridge { } }; -class Test_TC_TSTAT_2_1 : public TestCommandBridge { +class Test_TC_SWTCH_2_2 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_TSTAT_2_1() - : TestCommandBridge("Test_TC_TSTAT_2_1") + Test_TC_SWTCH_2_2() + : TestCommandBridge("Test_TC_SWTCH_2_2") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -37348,7 +44243,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_TSTAT_2_1() {} + ~Test_TC_SWTCH_2_2() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -37356,11 +44251,11 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_TSTAT_2_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_SWTCH_2_2\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TSTAT_2_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_SWTCH_2_2\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -37377,87 +44272,152 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress( - chipTool, " ***** Test Step 1 : Reads constraints of mandatory attributes from DUT: LocalTemperature\n"); - err = TestReadsConstraintsOfMandatoryAttributesFromDutLocalTemperature_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : User interaction needed\n"); + err = TestUserInteractionNeeded_1(); break; case 2: - ChipLogProgress( - chipTool, " ***** Test Step 2 : Reads constraints of mandatory attributes from DUT: AbsMinHeatSetpointLimit\n"); - err = TestReadsConstraintsOfMandatoryAttributesFromDutAbsMinHeatSetpointLimit_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : User interaction needed\n"); + err = TestUserInteractionNeeded_2(); break; case 3: - ChipLogProgress( - chipTool, " ***** Test Step 3 : Reads constraints of mandatory attributes from DUT: AbsMaxHeatSetpointLimit\n"); - err = TestReadsConstraintsOfMandatoryAttributesFromDutAbsMaxHeatSetpointLimit_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Read CurrentPosition attribute\n"); + err = TestReadCurrentPositionAttribute_3(); break; case 4: - ChipLogProgress( - chipTool, " ***** Test Step 4 : Reads constraints of optional attributes from DUT: AbsMinCoolSetpointLimit\n"); - err = TestReadsConstraintsOfOptionalAttributesFromDutAbsMinCoolSetpointLimit_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : User interaction needed\n"); + err = TestUserInteractionNeeded_4(); break; case 5: - ChipLogProgress( - chipTool, " ***** Test Step 5 : Reads constraints of optional attributes from DUT: AbsMaxCoolSetpointLimit\n"); - err = TestReadsConstraintsOfOptionalAttributesFromDutAbsMaxCoolSetpointLimit_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : User interaction needed\n"); + err = TestUserInteractionNeeded_5(); break; case 6: - ChipLogProgress( - chipTool, " ***** Test Step 6 : Reads constraints of optional attributes from DUT: OccupiedCoolingSetpoint\n"); - err = TestReadsConstraintsOfOptionalAttributesFromDutOccupiedCoolingSetpoint_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : User interaction needed\n"); + err = TestUserInteractionNeeded_6(); break; case 7: - ChipLogProgress( - chipTool, " ***** Test Step 7 : Reads constraints of mandatory attributes from DUT: OccupiedHeatingSetpoint\n"); - err = TestReadsConstraintsOfMandatoryAttributesFromDutOccupiedHeatingSetpoint_7(); + ChipLogProgress(chipTool, " ***** Test Step 7 : Read CurrentPosition attribute\n"); + err = TestReadCurrentPositionAttribute_7(); break; case 8: - ChipLogProgress( - chipTool, " ***** Test Step 8 : Reads constraints of mandatory attributes from DUT: MinHeatSetpointLimit\n"); - err = TestReadsConstraintsOfMandatoryAttributesFromDutMinHeatSetpointLimit_8(); + ChipLogProgress(chipTool, " ***** Test Step 8 : User interaction needed\n"); + err = TestUserInteractionNeeded_8(); break; case 9: - ChipLogProgress( - chipTool, " ***** Test Step 9 : Reads constraints of mandatory attributes from DUT: MaxHeatSetpointLimit\n"); - err = TestReadsConstraintsOfMandatoryAttributesFromDutMaxHeatSetpointLimit_9(); + ChipLogProgress(chipTool, " ***** Test Step 9 : User interaction needed\n"); + err = TestUserInteractionNeeded_9(); break; case 10: - ChipLogProgress( - chipTool, " ***** Test Step 10 : Reads constraints of optional attributes from DUT: MinCoolSetpointLimit\n"); - err = TestReadsConstraintsOfOptionalAttributesFromDutMinCoolSetpointLimit_10(); + ChipLogProgress(chipTool, " ***** Test Step 10 : User interaction needed\n"); + err = TestUserInteractionNeeded_10(); break; case 11: - ChipLogProgress( - chipTool, " ***** Test Step 11 : Reads constraints of optional attributes from DUT: MaxCoolSetpointLimit\n"); - err = TestReadsConstraintsOfOptionalAttributesFromDutMaxCoolSetpointLimit_11(); + ChipLogProgress(chipTool, " ***** Test Step 11 : User interaction needed\n"); + err = TestUserInteractionNeeded_11(); break; case 12: - ChipLogProgress( - chipTool, " ***** Test Step 12 : Reads constraints of mandatory attributes from DUT: ControlSequenceOfOperation\n"); - err = TestReadsConstraintsOfMandatoryAttributesFromDutControlSequenceOfOperation_12(); + ChipLogProgress(chipTool, " ***** Test Step 12 : User interaction needed\n"); + err = TestUserInteractionNeeded_12(); break; case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Reads constraints of mandatory attributes from DUT: SystemMode\n"); - err = TestReadsConstraintsOfMandatoryAttributesFromDutSystemMode_13(); + ChipLogProgress(chipTool, " ***** Test Step 13 : User interaction needed\n"); + err = TestUserInteractionNeeded_13(); break; case 14: - ChipLogProgress( - chipTool, " ***** Test Step 14 : Reads constraints of optional attributes from DUT: MinSetpointDeadBand\n"); - err = TestReadsConstraintsOfOptionalAttributesFromDutMinSetpointDeadBand_14(); + ChipLogProgress(chipTool, " ***** Test Step 14 : User interaction needed\n"); + err = TestUserInteractionNeeded_14(); break; case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Reads constraints of optional attributes from DUT: StartOfWeek\n"); - err = TestReadsConstraintsOfOptionalAttributesFromDutStartOfWeek_15(); + ChipLogProgress(chipTool, " ***** Test Step 15 : Wait 3000ms\n"); + err = TestWait3000ms_15(); break; case 16: - ChipLogProgress( - chipTool, " ***** Test Step 16 : Reads constraints of optional attributes from DUT: NumberOfWeeklyTransitions\n"); - err = TestReadsConstraintsOfOptionalAttributesFromDutNumberOfWeeklyTransitions_16(); + ChipLogProgress(chipTool, " ***** Test Step 16 : User interaction needed\n"); + err = TestUserInteractionNeeded_16(); break; case 17: - ChipLogProgress( - chipTool, " ***** Test Step 17 : Reads constraints of optional attributes from DUT: NumberOfDailyTransitions\n"); - err = TestReadsConstraintsOfOptionalAttributesFromDutNumberOfDailyTransitions_17(); + ChipLogProgress(chipTool, " ***** Test Step 17 : User interaction needed\n"); + err = TestUserInteractionNeeded_17(); + break; + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : User interaction needed\n"); + err = TestUserInteractionNeeded_18(); + break; + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : User interaction needed\n"); + err = TestUserInteractionNeeded_19(); + break; + case 20: + ChipLogProgress(chipTool, " ***** Test Step 20 : User interaction needed\n"); + err = TestUserInteractionNeeded_20(); + break; + case 21: + ChipLogProgress(chipTool, " ***** Test Step 21 : User interaction needed\n"); + err = TestUserInteractionNeeded_21(); + break; + case 22: + ChipLogProgress(chipTool, " ***** Test Step 22 : Wait 3000ms\n"); + err = TestWait3000ms_22(); + break; + case 23: + ChipLogProgress(chipTool, " ***** Test Step 23 : User interaction needed\n"); + err = TestUserInteractionNeeded_23(); + break; + case 24: + ChipLogProgress(chipTool, " ***** Test Step 24 : User interaction needed\n"); + err = TestUserInteractionNeeded_24(); + break; + case 25: + ChipLogProgress(chipTool, " ***** Test Step 25 : User interaction needed\n"); + err = TestUserInteractionNeeded_25(); + break; + case 26: + ChipLogProgress(chipTool, " ***** Test Step 26 : User interaction needed\n"); + err = TestUserInteractionNeeded_26(); + break; + case 27: + ChipLogProgress(chipTool, " ***** Test Step 27 : User interaction needed\n"); + err = TestUserInteractionNeeded_27(); + break; + case 28: + ChipLogProgress(chipTool, " ***** Test Step 28 : User interaction needed\n"); + err = TestUserInteractionNeeded_28(); + break; + case 29: + ChipLogProgress(chipTool, " ***** Test Step 29 : User interaction needed\n"); + err = TestUserInteractionNeeded_29(); + break; + case 30: + ChipLogProgress(chipTool, " ***** Test Step 30 : User interaction needed\n"); + err = TestUserInteractionNeeded_30(); + break; + case 31: + ChipLogProgress(chipTool, " ***** Test Step 31 : User interaction needed\n"); + err = TestUserInteractionNeeded_31(); + break; + case 32: + ChipLogProgress(chipTool, " ***** Test Step 32 : User interaction needed\n"); + err = TestUserInteractionNeeded_32(); + break; + case 33: + ChipLogProgress(chipTool, " ***** Test Step 33 : User interaction needed\n"); + err = TestUserInteractionNeeded_33(); + break; + case 34: + ChipLogProgress(chipTool, " ***** Test Step 34 : User interaction needed\n"); + err = TestUserInteractionNeeded_34(); + break; + case 35: + ChipLogProgress(chipTool, " ***** Test Step 35 : User interaction needed\n"); + err = TestUserInteractionNeeded_35(); + break; + case 36: + ChipLogProgress(chipTool, " ***** Test Step 36 : User interaction needed\n"); + err = TestUserInteractionNeeded_36(); + break; + case 37: + ChipLogProgress(chipTool, " ***** Test Step 37 : User interaction needed\n"); + err = TestUserInteractionNeeded_37(); break; } @@ -37467,6 +44427,129 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 34: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 35: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 36: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 37: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -37474,7 +44557,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 18; + const uint16_t mTestCount = 38; chip::Optional mNodeId; chip::Optional mCluster; @@ -37483,70 +44566,40 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutLocalTemperature_1() + CHIP_ERROR TestUserInteractionNeeded_1() { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeLocalTemperatureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads constraints of mandatory attributes from DUT: LocalTemperature Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("localTemperature", "", "int16")); - NextTest(); - }]; - + SetIdentity("alpha"); + UserPrompt(@"Set up subscription to SwitchLatched event"); return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutAbsMinHeatSetpointLimit_2() + CHIP_ERROR TestUserInteractionNeeded_2() { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeAbsMinHeatSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads constraints of mandatory attributes from DUT: AbsMinHeatSetpointLimit Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("absMinHeatSetpointLimit", "", "int16")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("absMinHeatSetpointLimit", [value shortValue], 700)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("absMinHeatSetpointLimit", [value shortValue], 3000)); - } - - NextTest(); - }]; - + SetIdentity("alpha"); + UserPrompt(@"Operator sets switch to first position"); return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutAbsMaxHeatSetpointLimit_3() + CHIP_ERROR TestReadCurrentPositionAttribute_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestSwitch * cluster = [[CHIPTestSwitch alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAbsMaxHeatSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads constraints of mandatory attributes from DUT: AbsMaxHeatSetpointLimit Error: %@", err); + [cluster readAttributeCurrentPositionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read CurrentPosition attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("absMaxHeatSetpointLimit", "", "int16")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("absMaxHeatSetpointLimit", [value shortValue], 700)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("absMaxHeatSetpointLimit", [value shortValue], 3000)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("current position", actualValue, 0)); } NextTest(); @@ -37555,58 +44608,42 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsConstraintsOfOptionalAttributesFromDutAbsMinCoolSetpointLimit_4() + CHIP_ERROR TestUserInteractionNeeded_4() { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeAbsMinCoolSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads constraints of optional attributes from DUT: AbsMinCoolSetpointLimit Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("absMinCoolSetpointLimit", "", "int16")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("absMinCoolSetpointLimit", [value shortValue], 1600)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("absMinCoolSetpointLimit", [value shortValue], 3200)); - } + SetIdentity("alpha"); + UserPrompt(@"Operator sets switch to second position"); + return CHIP_NO_ERROR; + } - NextTest(); - }]; + CHIP_ERROR TestUserInteractionNeeded_5() + { + SetIdentity("alpha"); + UserPrompt(@"Set up subscription to InitialPress event"); + return CHIP_NO_ERROR; + } + CHIP_ERROR TestUserInteractionNeeded_6() + { + SetIdentity("alpha"); + UserPrompt(@"Operator does not operate switch"); return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsConstraintsOfOptionalAttributesFromDutAbsMaxCoolSetpointLimit_5() + CHIP_ERROR TestReadCurrentPositionAttribute_7() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestSwitch * cluster = [[CHIPTestSwitch alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAbsMaxCoolSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads constraints of optional attributes from DUT: AbsMaxCoolSetpointLimit Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + [cluster readAttributeCurrentPositionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read CurrentPosition attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("absMaxCoolSetpointLimit", "", "int16")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("absMaxCoolSetpointLimit", [value shortValue], 1600)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("absMaxCoolSetpointLimit", [value shortValue], 3200)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("current position", actualValue, 0)); } NextTest(); @@ -37615,274 +44652,576 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsConstraintsOfOptionalAttributesFromDutOccupiedCoolingSetpoint_6() + CHIP_ERROR TestUserInteractionNeeded_8() { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeOccupiedCoolingSetpointWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads constraints of optional attributes from DUT: OccupiedCoolingSetpoint Error: %@", err); + SetIdentity("alpha"); + UserPrompt(@"Operator sets switch to second position"); + return CHIP_NO_ERROR; + } - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + CHIP_ERROR TestUserInteractionNeeded_9() + { + SetIdentity("alpha"); + UserPrompt(@"Operator does not operate switch (release switch)"); + return CHIP_NO_ERROR; + } - VerifyOrReturn(CheckValue("status", err, 0)); + CHIP_ERROR TestUserInteractionNeeded_10() + { + SetIdentity("alpha"); + UserPrompt(@"Set up subscription to InitialPress and ShortRelease events"); + return CHIP_NO_ERROR; + } - VerifyOrReturn(CheckConstraintType("occupiedCoolingSetpoint", "", "int16")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("occupiedCoolingSetpoint", [value shortValue], 1600)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("occupiedCoolingSetpoint", [value shortValue], 2600)); - } + CHIP_ERROR TestUserInteractionNeeded_11() + { + SetIdentity("alpha"); + UserPrompt(@"Operator does not operate switch"); + return CHIP_NO_ERROR; + } - NextTest(); - }]; + CHIP_ERROR TestUserInteractionNeeded_12() + { + SetIdentity("alpha"); + UserPrompt(@"Operator operates switch (press briefly)"); + return CHIP_NO_ERROR; + } + CHIP_ERROR TestUserInteractionNeeded_13() + { + SetIdentity("alpha"); + UserPrompt(@"Operator releases switch"); return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutOccupiedHeatingSetpoint_7() + CHIP_ERROR TestUserInteractionNeeded_14() { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + SetIdentity("alpha"); + UserPrompt(@"Operator operates switch for 5 seconds"); + return CHIP_NO_ERROR; + } - [cluster readAttributeOccupiedHeatingSetpointWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads constraints of mandatory attributes from DUT: OccupiedHeatingSetpoint Error: %@", err); + CHIP_ERROR TestWait3000ms_15() + { + SetIdentity("alpha"); + WaitForMs(3000); + return CHIP_NO_ERROR; + } - VerifyOrReturn(CheckValue("status", err, 0)); + CHIP_ERROR TestUserInteractionNeeded_16() + { + SetIdentity("alpha"); + UserPrompt(@"Operator releases switch"); + return CHIP_NO_ERROR; + } - VerifyOrReturn(CheckConstraintType("occupiedHeatingSetpoint", "", "int16")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("occupiedHeatingSetpoint", [value shortValue], 700)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("occupiedHeatingSetpoint", [value shortValue], 2600)); - } + CHIP_ERROR TestUserInteractionNeeded_17() + { + SetIdentity("alpha"); + UserPrompt(@"Set up subscription to InitialPress, LongPress, ShortRelease, LongRelease events"); + return CHIP_NO_ERROR; + } - NextTest(); - }]; + CHIP_ERROR TestUserInteractionNeeded_18() + { + SetIdentity("alpha"); + UserPrompt(@"Operator does not operate switch"); + return CHIP_NO_ERROR; + } + CHIP_ERROR TestUserInteractionNeeded_19() + { + SetIdentity("alpha"); + UserPrompt(@"Operator operates switch (press briefly)"); return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutMinHeatSetpointLimit_8() + CHIP_ERROR TestUserInteractionNeeded_20() { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + SetIdentity("alpha"); + UserPrompt(@"Operator releases switch"); + return CHIP_NO_ERROR; + } - [cluster readAttributeMinHeatSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads constraints of mandatory attributes from DUT: MinHeatSetpointLimit Error: %@", err); + CHIP_ERROR TestUserInteractionNeeded_21() + { + SetIdentity("alpha"); + UserPrompt(@"Operator operates switch for 5 seconds"); + return CHIP_NO_ERROR; + } - VerifyOrReturn(CheckValue("status", err, 0)); + CHIP_ERROR TestWait3000ms_22() + { + SetIdentity("alpha"); + WaitForMs(3000); + return CHIP_NO_ERROR; + } - VerifyOrReturn(CheckConstraintType("minHeatSetpointLimit", "", "int16")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("minHeatSetpointLimit", [value shortValue], 700)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("minHeatSetpointLimit", [value shortValue], 3000)); - } + CHIP_ERROR TestUserInteractionNeeded_23() + { + SetIdentity("alpha"); + UserPrompt(@"Operator releases switch"); + return CHIP_NO_ERROR; + } - NextTest(); - }]; + CHIP_ERROR TestUserInteractionNeeded_24() + { + SetIdentity("alpha"); + UserPrompt(@"Set up subscription to InitialPress, ShortRelease, MultiPressOngoing, MultiPressComplete events"); + return CHIP_NO_ERROR; + } + CHIP_ERROR TestUserInteractionNeeded_25() + { + SetIdentity("alpha"); + UserPrompt(@"Operator does not operate switch"); return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutMaxHeatSetpointLimit_9() + CHIP_ERROR TestUserInteractionNeeded_26() { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + SetIdentity("alpha"); + UserPrompt(@"Operator operates switch (press briefly)"); + return CHIP_NO_ERROR; + } - [cluster readAttributeMaxHeatSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads constraints of mandatory attributes from DUT: MaxHeatSetpointLimit Error: %@", err); + CHIP_ERROR TestUserInteractionNeeded_27() + { + SetIdentity("alpha"); + UserPrompt(@"Operator releases switch"); + return CHIP_NO_ERROR; + } - VerifyOrReturn(CheckValue("status", err, 0)); + CHIP_ERROR TestUserInteractionNeeded_28() + { + SetIdentity("alpha"); + UserPrompt(@"Operator operates switch (press briefly)"); + return CHIP_NO_ERROR; + } - VerifyOrReturn(CheckConstraintType("maxHeatSetpointLimit", "", "int16")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("maxHeatSetpointLimit", [value shortValue], 700)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("maxHeatSetpointLimit", [value shortValue], 3000)); - } + CHIP_ERROR TestUserInteractionNeeded_29() + { + SetIdentity("alpha"); + UserPrompt(@"Operator releases switch"); + return CHIP_NO_ERROR; + } - NextTest(); - }]; + CHIP_ERROR TestUserInteractionNeeded_30() + { + SetIdentity("alpha"); + UserPrompt(@"Operator operates switch again (press briefly)"); + return CHIP_NO_ERROR; + } + CHIP_ERROR TestUserInteractionNeeded_31() + { + SetIdentity("alpha"); + UserPrompt(@"Operator releases switch"); return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsConstraintsOfOptionalAttributesFromDutMinCoolSetpointLimit_10() + CHIP_ERROR TestUserInteractionNeeded_32() { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + SetIdentity("alpha"); + UserPrompt(@"Operator operates switch again (press briefly)"); + return CHIP_NO_ERROR; + } - [cluster readAttributeMinCoolSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads constraints of optional attributes from DUT: MinCoolSetpointLimit Error: %@", err); + CHIP_ERROR TestUserInteractionNeeded_33() + { + SetIdentity("alpha"); + UserPrompt(@"Operator releases switch"); + return CHIP_NO_ERROR; + } - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + CHIP_ERROR TestUserInteractionNeeded_34() + { + SetIdentity("alpha"); + UserPrompt(@"Operator operates switch again (press briefly)"); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestUserInteractionNeeded_35() + { + SetIdentity("alpha"); + UserPrompt(@"Operator releases switch"); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestUserInteractionNeeded_36() + { + SetIdentity("alpha"); + UserPrompt(@"Operator operates switch again (press briefly)"); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestUserInteractionNeeded_37() + { + SetIdentity("alpha"); + UserPrompt(@"Operator releases switch"); + return CHIP_NO_ERROR; + } +}; + +class Test_TC_TM_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_TM_1_1() + : TestCommandBridge("Test_TC_TM_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_TM_1_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_TM_1_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TM_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 ClusterRevision attribute from the DUT and Verify that the DUT response indicates " + "ClusterRevision attribute has the value 4\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { NextTest(); return; } - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("minCoolSetpointLimit", "", "int16")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("minCoolSetpointLimit", [value shortValue], 1600)); + err = TestReadClusterRevisionAttributeFromTheDutAndVerifyThatTheDutResponseIndicatesClusterRevisionAttributeHasTheValue4_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: AttributeList\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("minCoolSetpointLimit", [value shortValue], 3200)); + err = TestReadTheGlobalAttributeAttributeList_2(); + break; + case 3: + ChipLogProgress(chipTool, + " ***** Test Step 3 : 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_3(); + break; + case 4: + ChipLogProgress(chipTool, + " ***** Test Step 4 : Read AcceptedCommandList attribute from the DUT and Verify that the DUT response provides a " + "list of supported commands,This list SHALL include all the mandatory commands.\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadAcceptedCommandListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedCommandsThisListShallIncludeAllTheMandatoryCommands_4(); + break; + case 5: + ChipLogProgress(chipTool, + " ***** Test Step 5 : Read GeneratedCommandList attribute from the DUT and Verify that the DUT response provides a " + "list of supported commands.\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; } + err = TestReadGeneratedCommandListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedCommands_5(); + break; + } - NextTest(); - }]; + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + + 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() + { + SetIdentity("alpha"); + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsConstraintsOfOptionalAttributesFromDutMaxCoolSetpointLimit_11() + CHIP_ERROR + TestReadClusterRevisionAttributeFromTheDutAndVerifyThatTheDutResponseIndicatesClusterRevisionAttributeHasTheValue4_1() + { + SetIdentity("alpha"); + UserPrompt(@"Please enter ClusterRevision attribute value", @"4"); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestTemperatureMeasurement * cluster = [[CHIPTestTemperatureMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMaxCoolSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads constraints of optional attributes from DUT: MaxCoolSetpointLimit Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("maxCoolSetpointLimit", "", "int16")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("maxCoolSetpointLimit", [value shortValue], 1600)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("maxCoolSetpointLimit", [value shortValue], 3200)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("AttributeList", [actualValue count], static_cast(4))); + VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); + VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); + VerifyOrReturn(CheckValue("", actualValue[2], 2UL)); + VerifyOrReturn(CheckValue("", actualValue[3], 3UL)); } + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutControlSequenceOfOperation_12() + CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_3() { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + SetIdentity("alpha"); + UserPrompt(@"Please enter 'y' for success", @"y"); + return CHIP_NO_ERROR; + } - [cluster - readAttributeControlSequenceOfOperationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads constraints of mandatory attributes from DUT: ControlSequenceOfOperation Error: %@", err); + CHIP_ERROR + TestReadAcceptedCommandListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedCommandsThisListShallIncludeAllTheMandatoryCommands_4() + { + SetIdentity("alpha"); + UserPrompt(@"Please enter 'y' for success", @"y"); + return CHIP_NO_ERROR; + } - VerifyOrReturn(CheckValue("status", err, 0)); + CHIP_ERROR TestReadGeneratedCommandListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedCommands_5() + { + SetIdentity("alpha"); + UserPrompt(@"Please enter 'y' for success", @"y"); + return CHIP_NO_ERROR; + } +}; - VerifyOrReturn(CheckConstraintType("controlSequenceOfOperation", "", "enum8")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("controlSequenceOfOperation", [value unsignedCharValue], 0)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("controlSequenceOfOperation", [value unsignedCharValue], 5)); - } +class Test_TC_TM_2_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_TM_2_1() + : TestCommandBridge("Test_TC_TM_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) - NextTest(); - }]; + ~Test_TC_TM_2_1() {} - return CHIP_NO_ERROR; + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_TM_2_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TM_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 : read the mandatory attribute: MeasuredValue\n"); + err = TestReadTheMandatoryAttributeMeasuredValue_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : read the mandatory attribute: MinMeasuredValue\n"); + err = TestReadTheMandatoryAttributeMinMeasuredValue_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : read the mandatory attribute: MaxMeasuredValue\n"); + err = TestReadTheMandatoryAttributeMaxMeasuredValue_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : read the optional attribute: Tolerance\n"); + err = TestReadTheOptionalAttributeTolerance_4(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutSystemMode_13() + void OnStatusUpdate(const chip::app::StatusIB & status) override { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } - [cluster readAttributeSystemModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads constraints of mandatory attributes from DUT: SystemMode Error: %@", err); + // Go on to the next test. + WaitForMs(0); + } - VerifyOrReturn(CheckValue("status", err, 0)); + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } - VerifyOrReturn(CheckConstraintType("systemMode", "", "enum8")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("systemMode", [value unsignedCharValue], 0)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("systemMode", [value unsignedCharValue], 9)); - } +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() + { + SetIdentity("alpha"); + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsConstraintsOfOptionalAttributesFromDutMinSetpointDeadBand_14() + CHIP_ERROR TestReadTheMandatoryAttributeMeasuredValue_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestTemperatureMeasurement * cluster = [[CHIPTestTemperatureMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMinSetpointDeadBandWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads constraints of optional attributes from DUT: MinSetpointDeadBand Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + [cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the mandatory attribute: MeasuredValue Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("minSetpointDeadBand", "", "int8")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("minSetpointDeadBand", [value charValue], 0)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("minSetpointDeadBand", [value charValue], 25)); - } - + VerifyOrReturn(CheckConstraintType("measuredValue", "", "int16")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsConstraintsOfOptionalAttributesFromDutStartOfWeek_15() + CHIP_ERROR TestReadTheMandatoryAttributeMinMeasuredValue_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestTemperatureMeasurement * cluster = [[CHIPTestTemperatureMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeStartOfWeekWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads constraints of optional attributes from DUT: StartOfWeek Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + [cluster readAttributeMinMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the mandatory attribute: MinMeasuredValue Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("startOfWeek", "", "enum8")); + VerifyOrReturn(CheckConstraintType("minMeasuredValue", "", "int16")); if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("startOfWeek", [value unsignedCharValue], 0)); + VerifyOrReturn(CheckConstraintMinValue("minMeasuredValue", [value shortValue], -27315)); } if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("startOfWeek", [value unsignedCharValue], 6)); + VerifyOrReturn(CheckConstraintMaxValue("minMeasuredValue", [value shortValue], 32766)); } NextTest(); @@ -37891,38 +45230,45 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsConstraintsOfOptionalAttributesFromDutNumberOfWeeklyTransitions_16() + CHIP_ERROR TestReadTheMandatoryAttributeMaxMeasuredValue_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestTemperatureMeasurement * cluster = [[CHIPTestTemperatureMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeNumberOfWeeklyTransitionsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads constraints of optional attributes from DUT: NumberOfWeeklyTransitions Error: %@", err); + [cluster readAttributeMaxMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the mandatory attribute: MaxMeasuredValue Error: %@", err); - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "", "int16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value shortValue], -27314)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("maxMeasuredValue", [value shortValue], 32767)); + } - VerifyOrReturn(CheckConstraintType("numberOfWeeklyTransitions", "", "uint8")); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsConstraintsOfOptionalAttributesFromDutNumberOfDailyTransitions_17() + CHIP_ERROR TestReadTheOptionalAttributeTolerance_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestTemperatureMeasurement * cluster = [[CHIPTestTemperatureMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNumberOfDailyTransitionsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads constraints of optional attributes from DUT: NumberOfDailyTransitions Error: %@", err); + [cluster readAttributeToleranceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the optional attribute: Tolerance Error: %@", err); if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { NextTest(); @@ -37931,7 +45277,14 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("numberOfDailyTransitions", "", "uint8")); + VerifyOrReturn(CheckConstraintType("tolerance", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("tolerance", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("tolerance", [value unsignedShortValue], 2048U)); + } + NextTest(); }]; @@ -37939,11 +45292,11 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { } }; -class Test_TC_TSTAT_2_2 : public TestCommandBridge { +class Test_TC_TM_2_2 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_TSTAT_2_2() - : TestCommandBridge("Test_TC_TSTAT_2_2") + Test_TC_TM_2_2() + : TestCommandBridge("Test_TC_TM_2_2") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -37953,7 +45306,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_TSTAT_2_2() {} + ~Test_TC_TM_2_2() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -37961,11 +45314,11 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_TSTAT_2_2\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_TM_2_2\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TSTAT_2_2\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TM_2_2\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -37982,449 +45335,59 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, - " ***** Test Step 1 : Reads OccupiedCoolingSetpoint attribute from Server DUT and verifies that the value is " - "within range\n"); - if (ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT")) { - NextTest(); - return; - } - err = TestReadsOccupiedCoolingSetpointAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : read the mandatory attribute: MinMeasuredValue\n"); + err = TestReadTheMandatoryAttributeMinMeasuredValue_1(); break; case 2: - ChipLogProgress(chipTool, - " ***** Test Step 2 : Writes a value back that is different but valid for OccupiedCoolingSetpoint attribute\n"); - if (ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT")) { - NextTest(); - return; - } - err = TestWritesAValueBackThatIsDifferentButValidForOccupiedCoolingSetpointAttribute_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : read the mandatory attribute: MaxMeasuredValue\n"); + err = TestReadTheMandatoryAttributeMaxMeasuredValue_2(); break; case 3: - ChipLogProgress(chipTool, - " ***** Test Step 3 : Reads it back again to confirm the successful write of OccupiedCoolingSetpoint attribute\n"); - if (ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT")) { + ChipLogProgress(chipTool, " ***** Test Step 3 : Reads MeasuredValue attribute from DUT\n"); + if (ShouldSkip("A_TEMPERATURE")) { NextTest(); return; } - err = TestReadsItBackAgainToConfirmTheSuccessfulWriteOfOccupiedCoolingSetpointAttribute_3(); + err = TestReadsMeasuredValueAttributeFromDut_3(); break; case 4: - ChipLogProgress( - chipTool, " ***** Test Step 4 : Writes the limit of MinCoolSetpointLimit to OccupiedCoolingSetpoint attribute\n"); - if (ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT")) { + ChipLogProgress(chipTool, " ***** Test Step 4 : Read the mandatory attribute: MeasuredValue\n"); + if (ShouldSkip("A_TEMPERATURE")) { NextTest(); return; } - err = TestWritesTheLimitOfMinCoolSetpointLimitToOccupiedCoolingSetpointAttribute_4(); + err = TestReadTheMandatoryAttributeMeasuredValue_4(); break; - case 5: - ChipLogProgress( - chipTool, " ***** Test Step 5 : Writes the limit of MaxCoolSetpointLimit to OccupiedCoolingSetpoint attribute\n"); - if (ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT")) { - NextTest(); - return; - } - err = TestWritesTheLimitOfMaxCoolSetpointLimitToOccupiedCoolingSetpointAttribute_5(); + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 6: - ChipLogProgress(chipTool, - " ***** Test Step 6 : Reads OccupiedHeatingSetpoint attribute from Server DUT and verifies that the value is " - "within range\n"); - if (ShouldSkip("A_OCCUPIEDHEATINGSETPOINT")) { - NextTest(); - return; - } - err = TestReadsOccupiedHeatingSetpointAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_6(); + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 7: - ChipLogProgress(chipTool, - " ***** Test Step 7 : Writes a value back that is different but valid for OccupiedHeatingSetpoint attribute\n"); - if (ShouldSkip("A_OCCUPIEDHEATINGSETPOINT")) { - NextTest(); - return; - } - err = TestWritesAValueBackThatIsDifferentButValidForOccupiedHeatingSetpointAttribute_7(); - break; - case 8: - ChipLogProgress(chipTool, - " ***** Test Step 8 : Reads it back again to confirm the successful write of OccupiedHeatingSetpoint attribute\n"); - if (ShouldSkip("A_OCCUPIEDHEATINGSETPOINT")) { - NextTest(); - return; - } - err = TestReadsItBackAgainToConfirmTheSuccessfulWriteOfOccupiedHeatingSetpointAttribute_8(); - break; - case 9: - ChipLogProgress( - chipTool, " ***** Test Step 9 : Writes the limit of MinHeatSetpointLimit to OccupiedHeatingSetpoint attribute\n"); - if (ShouldSkip("A_OCCUPIEDHEATINGSETPOINT")) { - NextTest(); - return; - } - err = TestWritesTheLimitOfMinHeatSetpointLimitToOccupiedHeatingSetpointAttribute_9(); - break; - case 10: - ChipLogProgress( - chipTool, " ***** Test Step 10 : Writes the limit of MaxHeatSetpointLimit to OccupiedHeatingSetpoint attribute\n"); - if (ShouldSkip("A_OCCUPIEDHEATINGSETPOINT")) { - NextTest(); - return; - } - err = TestWritesTheLimitOfMaxHeatSetpointLimitToOccupiedHeatingSetpointAttribute_10(); - break; - case 11: - ChipLogProgress(chipTool, - " ***** Test Step 11 : Reads MinHeatSetpointLimit attribute from Server DUT and verifies that the value is within " - "range\n"); - if (ShouldSkip("A_MINHEATSETPOINTLIMIT")) { - NextTest(); - return; - } - err = TestReadsMinHeatSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_11(); - break; - case 12: - ChipLogProgress(chipTool, - " ***** Test Step 12 : Writes a value back that is different but valid for MinHeatSetpointLimit attribute\n"); - if (ShouldSkip("A_MINHEATSETPOINTLIMIT")) { - NextTest(); - return; - } - err = TestWritesAValueBackThatIsDifferentButValidForMinHeatSetpointLimitAttribute_12(); - break; - case 13: - ChipLogProgress(chipTool, - " ***** Test Step 13 : Reads it back again to confirm the successful write of MinHeatSetpointLimit attribute\n"); - if (ShouldSkip("A_MINHEATSETPOINTLIMIT")) { - NextTest(); - return; - } - err = TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMinHeatSetpointLimitAttribute_13(); - break; - case 14: - ChipLogProgress( - chipTool, " ***** Test Step 14 : Writes the limit of AbsMinHeatSetpointLimit to MinHeatSetpointLimit attribute\n"); - if (ShouldSkip("A_MINHEATSETPOINTLIMIT")) { - NextTest(); - return; - } - err = TestWritesTheLimitOfAbsMinHeatSetpointLimitToMinHeatSetpointLimitAttribute_14(); - break; - case 15: - ChipLogProgress( - chipTool, " ***** Test Step 15 : Writes the limit of AbsMaxHeatSetpointLimit to MinHeatSetpointLimit attribute\n"); - if (ShouldSkip("A_MINHEATSETPOINTLIMIT")) { - NextTest(); - return; - } - err = TestWritesTheLimitOfAbsMaxHeatSetpointLimitToMinHeatSetpointLimitAttribute_15(); - break; - case 16: - ChipLogProgress(chipTool, - " ***** Test Step 16 : Reads MaxHeatSetpointLimit attribute from Server DUT and verifies that the value is within " - "range\n"); - if (ShouldSkip("A_MAXHEATSETPOINTLIMIT")) { - NextTest(); - return; - } - err = TestReadsMaxHeatSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_16(); - break; - case 17: - ChipLogProgress(chipTool, - " ***** Test Step 17 : Writes a value back that is different but valid for MaxHeatSetpointLimit attribute\n"); - if (ShouldSkip("A_MAXHEATSETPOINTLIMIT")) { - NextTest(); - return; - } - err = TestWritesAValueBackThatIsDifferentButValidForMaxHeatSetpointLimitAttribute_17(); - break; - case 18: - ChipLogProgress(chipTool, - " ***** Test Step 18 : Reads it back again to confirm the successful write of MaxHeatSetpointLimit attribute\n"); - if (ShouldSkip("A_MAXHEATSETPOINTLIMIT")) { - NextTest(); - return; - } - err = TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMaxHeatSetpointLimitAttribute_18(); - break; - case 19: - ChipLogProgress( - chipTool, " ***** Test Step 19 : Writes the limit of AbsMinHeatSetpointLimit to MaxHeatSetpointLimit attribute\n"); - if (ShouldSkip("A_MAXHEATSETPOINTLIMIT")) { - NextTest(); - return; - } - err = TestWritesTheLimitOfAbsMinHeatSetpointLimitToMaxHeatSetpointLimitAttribute_19(); - break; - case 20: - ChipLogProgress( - chipTool, " ***** Test Step 20 : Writes the limit of AbsMaxHeatSetpointLimit to MaxHeatSetpointLimit attribute\n"); - if (ShouldSkip("A_MAXHEATSETPOINTLIMIT")) { - NextTest(); - return; - } - err = TestWritesTheLimitOfAbsMaxHeatSetpointLimitToMaxHeatSetpointLimitAttribute_20(); - break; - case 21: - ChipLogProgress(chipTool, - " ***** Test Step 21 : Reads MinCoolSetpointLimit attribute from Server DUT and verifies that the value is within " - "range\n"); - if (ShouldSkip("A_MINCOOLSETPOINTLIMIT")) { - NextTest(); - return; - } - err = TestReadsMinCoolSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_21(); - break; - case 22: - ChipLogProgress(chipTool, - " ***** Test Step 22 : Writes a value back that is different but valid for MinCoolSetpointLimit attribute\n"); - if (ShouldSkip("A_MINCOOLSETPOINTLIMIT")) { - NextTest(); - return; - } - err = TestWritesAValueBackThatIsDifferentButValidForMinCoolSetpointLimitAttribute_22(); - break; - case 23: - ChipLogProgress(chipTool, - " ***** Test Step 23 : Reads it back again to confirm the successful write of MinCoolSetpointLimit attribute\n"); - if (ShouldSkip("A_MINCOOLSETPOINTLIMIT")) { - NextTest(); - return; - } - err = TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMinCoolSetpointLimitAttribute_23(); - break; - case 24: - ChipLogProgress( - chipTool, " ***** Test Step 24 : Writes the limit of AbsMinCoolSetpointLimit to MinCoolSetpointLimit attribute\n"); - if (ShouldSkip("A_MINCOOLSETPOINTLIMIT")) { - NextTest(); - return; - } - err = TestWritesTheLimitOfAbsMinCoolSetpointLimitToMinCoolSetpointLimitAttribute_24(); - break; - case 25: - ChipLogProgress( - chipTool, " ***** Test Step 25 : Writes the limit of MaxCoolSetpointLimit to MinCoolSetpointLimit attribute\n"); - if (ShouldSkip("A_MINCOOLSETPOINTLIMIT")) { - NextTest(); - return; - } - err = TestWritesTheLimitOfMaxCoolSetpointLimitToMinCoolSetpointLimitAttribute_25(); - break; - case 26: - ChipLogProgress(chipTool, - " ***** Test Step 26 : Reads MaxCoolSetpointLimit attribute from Server DUT and verifies that the value is within " - "range\n"); - if (ShouldSkip("A_MAXCOOLSETPOINTLIMIT")) { - NextTest(); - return; - } - err = TestReadsMaxCoolSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_26(); - break; - case 27: - ChipLogProgress(chipTool, - " ***** Test Step 27 : Writes a value back that is different but valid for MaxCoolSetpointLimit attribute\n"); - if (ShouldSkip("A_MAXCOOLSETPOINTLIMIT")) { - NextTest(); - return; - } - err = TestWritesAValueBackThatIsDifferentButValidForMaxCoolSetpointLimitAttribute_27(); - break; - case 28: - ChipLogProgress(chipTool, - " ***** Test Step 28 : Reads it back again to confirm the successful write of MaxCoolSetpointLimit attribute\n"); - if (ShouldSkip("A_MAXCOOLSETPOINTLIMIT")) { - NextTest(); - return; - } - err = TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMaxCoolSetpointLimitAttribute_28(); - break; - case 29: - ChipLogProgress( - chipTool, " ***** Test Step 29 : Writes the limit of AbsMinCoolSetpointLimit to MaxCoolSetpointLimit attribute\n"); - if (ShouldSkip("A_MAXCOOLSETPOINTLIMIT")) { - NextTest(); - return; - } - err = TestWritesTheLimitOfAbsMinCoolSetpointLimitToMaxCoolSetpointLimitAttribute_29(); - break; - case 30: - ChipLogProgress( - chipTool, " ***** Test Step 30 : Writes the limit of MaxCoolSetpointLimit to MaxCoolSetpointLimit attribute\n"); - if (ShouldSkip("A_MAXCOOLSETPOINTLIMIT")) { - NextTest(); - return; - } - err = TestWritesTheLimitOfMaxCoolSetpointLimitToMaxCoolSetpointLimitAttribute_30(); - break; - case 31: - ChipLogProgress(chipTool, - " ***** Test Step 31 : Writes (sets back) the limit of MinHeatSetpointLimit to MinHeatSetpointLimit attribute\n"); - if (ShouldSkip("A_MINHEATSETPOINTLIMIT")) { - NextTest(); - return; - } - err = TestWritesSetsBackTheLimitOfMinHeatSetpointLimitToMinHeatSetpointLimitAttribute_31(); - break; - case 32: - ChipLogProgress(chipTool, - " ***** Test Step 32 : Writes (sets back) the limit of MaxHeatSetpointLimit to MinHeatSetpointLimit attribute\n"); - if (ShouldSkip("A_MINHEATSETPOINTLIMIT")) { - NextTest(); - return; - } - err = TestWritesSetsBackTheLimitOfMaxHeatSetpointLimitToMinHeatSetpointLimitAttribute_32(); - break; - case 33: - ChipLogProgress(chipTool, - " ***** Test Step 33 : Writes (sets back) the limit of MinHeatSetpointLimit to MaxHeatSetpointLimit attribute\n"); - if (ShouldSkip("A_MINHEATSETPOINTLIMIT")) { - NextTest(); - return; - } - err = TestWritesSetsBackTheLimitOfMinHeatSetpointLimitToMaxHeatSetpointLimitAttribute_33(); - break; - case 34: - ChipLogProgress(chipTool, - " ***** Test Step 34 : Writes (sets back) the limit of MaxHeatSetpointLimit to MaxHeatSetpointLimit attribute\n"); - if (ShouldSkip("A_MINHEATSETPOINTLIMIT")) { - NextTest(); - return; - } - err = TestWritesSetsBackTheLimitOfMaxHeatSetpointLimitToMaxHeatSetpointLimitAttribute_34(); - break; - case 35: - ChipLogProgress(chipTool, - " ***** Test Step 35 : Writes (sets back) the limit of MinCoolSetpointLimit to MinCoolSetpointLimit attribute\n"); - if (ShouldSkip("A_MINCOOLSETPOINTLIMIT")) { - NextTest(); - return; - } - err = TestWritesSetsBackTheLimitOfMinCoolSetpointLimitToMinCoolSetpointLimitAttribute_35(); - break; - case 36: - ChipLogProgress(chipTool, - " ***** Test Step 36 : Writes (sets back) the limit of MaxCoolSetpointLimit to MinCoolSetpointLimit attribute\n"); - if (ShouldSkip("A_MINCOOLSETPOINTLIMIT")) { - NextTest(); - return; - } - err = TestWritesSetsBackTheLimitOfMaxCoolSetpointLimitToMinCoolSetpointLimitAttribute_36(); - break; - case 37: - ChipLogProgress(chipTool, - " ***** Test Step 37 : Writes (sets back) the limit of MinCoolSetpointLimit to MaxCoolSetpointLimit attribute\n"); - if (ShouldSkip("A_MAXCOOLSETPOINTLIMIT")) { - NextTest(); - return; - } - err = TestWritesSetsBackTheLimitOfMinCoolSetpointLimitToMaxCoolSetpointLimitAttribute_37(); - break; - case 38: - ChipLogProgress(chipTool, - " ***** Test Step 38 : Writes (sets back) the limit of MaxCoolSetpointLimit to MaxCoolSetpointLimit attribute\n"); - if (ShouldSkip("A_MAXCOOLSETPOINTLIMIT")) { - NextTest(); - return; - } - err = TestWritesSetsBackTheLimitOfMaxCoolSetpointLimitToMaxCoolSetpointLimitAttribute_38(); - break; - case 39: - ChipLogProgress(chipTool, - " ***** Test Step 39 : Reads ControlSequenceOfOperation from Server DUT and verifies that the value is valid\n"); - if (ShouldSkip("A_CONTROLSEQUENCEOFOPERATION")) { - NextTest(); - return; - } - err = TestReadsControlSequenceOfOperationFromServerDutAndVerifiesThatTheValueIsValid_39(); - break; - case 40: - ChipLogProgress( - chipTool, " ***** Test Step 40 : Write Attribute command for ControlSequenceOfOperation with a new valid value\n"); - if (ShouldSkip("A_CONTROLSEQUENCEOFOPERATION")) { - NextTest(); - return; - } - err = TestWriteAttributeCommandForControlSequenceOfOperationWithANewValidValue_40(); - break; - case 41: - ChipLogProgress(chipTool, " ***** Test Step 41 : Read it back again to confirm the successful write\n"); - if (ShouldSkip("A_CONTROLSEQUENCEOFOPERATION")) { - NextTest(); - return; - } - err = TestReadItBackAgainToConfirmTheSuccessfulWrite_41(); - break; - case 42: - ChipLogProgress(chipTool, " ***** Test Step 42 : Sets OccupiedHeatingSetpoint to default value\n"); - if (ShouldSkip("A_OCCUPIEDHEATINGSETPOINT")) { - NextTest(); - return; - } - err = TestSetsOccupiedHeatingSetpointToDefaultValue_42(); - break; - case 43: - ChipLogProgress(chipTool, " ***** Test Step 43 : Sets OccupiedHeatingSetpoint to default value\n"); - if (ShouldSkip("A_OCCUPIEDHEATINGSETPOINT")) { - NextTest(); - return; - } - err = TestSetsOccupiedHeatingSetpointToDefaultValue_43(); - break; - case 44: - ChipLogProgress(chipTool, " ***** Test Step 44 : Sets OccupiedCoolingSetpoint to default value\n"); - if (ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT")) { - NextTest(); - return; - } - err = TestSetsOccupiedCoolingSetpointToDefaultValue_44(); - break; - case 45: - ChipLogProgress(chipTool, " ***** Test Step 45 : Sets OccupiedCoolingSetpoint to default value\n"); - if (ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT")) { - NextTest(); - return; - } - err = TestSetsOccupiedCoolingSetpointToDefaultValue_45(); - break; - case 46: - ChipLogProgress(chipTool, " ***** Test Step 46 : Sets OccupiedCoolingSetpoint to default value\n"); - if (ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT")) { - NextTest(); - return; - } - err = TestSetsOccupiedCoolingSetpointToDefaultValue_46(); - break; - case 47: - ChipLogProgress(chipTool, " ***** Test Step 47 : Sets OccupiedHeatingSetpoint to default value\n"); - if (ShouldSkip("A_OCCUPIEDHEATINGSETPOINT")) { - NextTest(); - return; - } - err = TestSetsOccupiedHeatingSetpointToDefaultValue_47(); + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 48: - ChipLogProgress(chipTool, " ***** Test Step 48 : Sets OccupiedCoolingSetpoint to default value\n"); - if (ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT")) { - NextTest(); - return; - } - err = TestSetsOccupiedCoolingSetpointToDefaultValue_48(); + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 49: - ChipLogProgress(chipTool, " ***** Test Step 49 : Sets OccupiedHeatingSetpoint to default value\n"); - if (ShouldSkip("A_OCCUPIEDHEATINGSETPOINT")) { - NextTest(); - return; - } - err = TestSetsOccupiedHeatingSetpointToDefaultValue_49(); + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; } - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + // Go on to the next test. + WaitForMs(0); } chip::System::Clock::Timeout GetWaitDuration() const override @@ -38434,7 +45397,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 50; + const uint16_t mTestCount = 5; chip::Optional mNodeId; chip::Optional mCluster; @@ -38443,38 +45406,31 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsOccupiedCoolingSetpointAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_1() + CHIP_ERROR TestReadTheMandatoryAttributeMinMeasuredValue_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestTemperatureMeasurement * cluster = [[CHIPTestTemperatureMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOccupiedCoolingSetpointWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads OccupiedCoolingSetpoint attribute from Server DUT and verifies that the value is within range Error: %@", - err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + [cluster readAttributeMinMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the mandatory attribute: MinMeasuredValue Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("occupied cooling setpoint", actualValue, 2600)); - } - - VerifyOrReturn(CheckConstraintType("occupiedCoolingSetpoint", "", "int16")); + VerifyOrReturn(CheckConstraintType("minMeasuredValue", "", "int16")); if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("occupiedCoolingSetpoint", [value shortValue], 1600)); + VerifyOrReturn(CheckConstraintMinValue("minMeasuredValue", [value shortValue], -27315)); } if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("occupiedCoolingSetpoint", [value shortValue], 2600)); + VerifyOrReturn(CheckConstraintMaxValue("minMeasuredValue", [value shortValue], 32766)); } NextTest(); @@ -38483,256 +45439,493 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesAValueBackThatIsDifferentButValidForOccupiedCoolingSetpointAttribute_2() + CHIP_ERROR TestReadTheMandatoryAttributeMaxMeasuredValue_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestTemperatureMeasurement * cluster = [[CHIPTestTemperatureMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id occupiedCoolingSetpointArgument; - occupiedCoolingSetpointArgument = [NSNumber numberWithShort:2000]; - [cluster writeAttributeOccupiedCoolingSetpointWithValue:occupiedCoolingSetpointArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes a value back that is different but valid for " - @"OccupiedCoolingSetpoint attribute Error: %@", - err); + [cluster readAttributeMaxMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the mandatory attribute: MaxMeasuredValue Error: %@", err); - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "", "int16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value shortValue], -27314)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("maxMeasuredValue", [value shortValue], 32767)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsItBackAgainToConfirmTheSuccessfulWriteOfOccupiedCoolingSetpointAttribute_3() + CHIP_ERROR TestReadsMeasuredValueAttributeFromDut_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestTemperatureMeasurement * cluster = [[CHIPTestTemperatureMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOccupiedCoolingSetpointWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads it back again to confirm the successful write of OccupiedCoolingSetpoint attribute Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + [cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads MeasuredValue attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("occupied cooling setpoint", actualValue, 2000)); - } - + VerifyOrReturn(CheckConstraintType("measuredValue", "", "uint16")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesTheLimitOfMinCoolSetpointLimitToOccupiedCoolingSetpointAttribute_4() + CHIP_ERROR TestReadTheMandatoryAttributeMeasuredValue_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestTemperatureMeasurement * cluster = [[CHIPTestTemperatureMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id occupiedCoolingSetpointArgument; - occupiedCoolingSetpointArgument = [NSNumber numberWithShort:1600]; - [cluster writeAttributeOccupiedCoolingSetpointWithValue:occupiedCoolingSetpointArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes the limit of MinCoolSetpointLimit to OccupiedCoolingSetpoint " - @"attribute Error: %@", - err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + [cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the mandatory attribute: MeasuredValue Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("measuredValue", "", "uint16")); + NextTest(); + }]; return CHIP_NO_ERROR; } +}; - CHIP_ERROR TestWritesTheLimitOfMaxCoolSetpointLimitToOccupiedCoolingSetpointAttribute_5() +class Test_TC_TSTAT_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_TSTAT_1_1() + : TestCommandBridge("Test_TC_TSTAT_1_1") + , mTestIndex(0) { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat 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 occupiedCoolingSetpointArgument; - occupiedCoolingSetpointArgument = [NSNumber numberWithShort:2600]; - [cluster writeAttributeOccupiedCoolingSetpointWithValue:occupiedCoolingSetpointArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes the limit of MaxCoolSetpointLimit to OccupiedCoolingSetpoint " - @"attribute Error: %@", - err); + ~Test_TC_TSTAT_1_1() {} - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + /////////// 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_TSTAT_1_1\n"); + } - NextTest(); - }]; + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TSTAT_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 constraints: ClusterRevision\n"); + err = TestReadTheGlobalAttributeConstraintsClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Read the optional global attribute constraints: FeatureMap\n"); + err = TestReadTheOptionalGlobalAttributeConstraintsFeatureMap_3(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + + 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() + { + SetIdentity("alpha"); + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsOccupiedHeatingSetpointAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_6() + CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOccupiedHeatingSetpointWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads OccupiedHeatingSetpoint attribute from Server DUT and verifies that the value is within range Error: %@", - err); + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("occupied heating setpoint", actualValue, 2000)); - } - - VerifyOrReturn(CheckConstraintType("occupiedHeatingSetpoint", "", "int16")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("occupiedHeatingSetpoint", [value shortValue], 700)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("occupiedHeatingSetpoint", [value shortValue], 3000)); - } - + VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesAValueBackThatIsDifferentButValidForOccupiedHeatingSetpointAttribute_7() + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id occupiedHeatingSetpointArgument; - occupiedHeatingSetpointArgument = [NSNumber numberWithShort:2100]; - [cluster writeAttributeOccupiedHeatingSetpointWithValue:occupiedHeatingSetpointArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes a value back that is different but valid for " - @"OccupiedHeatingSetpoint attribute Error: %@", - err); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsItBackAgainToConfirmTheSuccessfulWriteOfOccupiedHeatingSetpointAttribute_8() + CHIP_ERROR TestReadTheOptionalGlobalAttributeConstraintsFeatureMap_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOccupiedHeatingSetpointWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads it back again to confirm the successful write of OccupiedHeatingSetpoint attribute Error: %@", err); + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional global attribute constraints: FeatureMap Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("occupied heating setpoint", actualValue, 2100)); - } - + VerifyOrReturn(CheckConstraintType("featureMap", "", "map32")); NextTest(); }]; return CHIP_NO_ERROR; } +}; - CHIP_ERROR TestWritesTheLimitOfMinHeatSetpointLimitToOccupiedHeatingSetpointAttribute_9() +class Test_TC_TSTAT_2_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_TSTAT_2_1() + : TestCommandBridge("Test_TC_TSTAT_2_1") + , mTestIndex(0) { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat 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 occupiedHeatingSetpointArgument; - occupiedHeatingSetpointArgument = [NSNumber numberWithShort:700]; - [cluster writeAttributeOccupiedHeatingSetpointWithValue:occupiedHeatingSetpointArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes the limit of MinHeatSetpointLimit to OccupiedHeatingSetpoint " - @"attribute Error: %@", - err); + ~Test_TC_TSTAT_2_1() {} - VerifyOrReturn(CheckValue("status", err, 0)); + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; - NextTest(); - }]; + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_TSTAT_2_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TSTAT_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 : Reads constraints of mandatory attributes from DUT: LocalTemperature\n"); + err = TestReadsConstraintsOfMandatoryAttributesFromDutLocalTemperature_1(); + break; + case 2: + ChipLogProgress( + chipTool, " ***** Test Step 2 : Reads constraints of mandatory attributes from DUT: AbsMinHeatSetpointLimit\n"); + err = TestReadsConstraintsOfMandatoryAttributesFromDutAbsMinHeatSetpointLimit_2(); + break; + case 3: + ChipLogProgress( + chipTool, " ***** Test Step 3 : Reads constraints of mandatory attributes from DUT: AbsMaxHeatSetpointLimit\n"); + err = TestReadsConstraintsOfMandatoryAttributesFromDutAbsMaxHeatSetpointLimit_3(); + break; + case 4: + ChipLogProgress( + chipTool, " ***** Test Step 4 : Reads constraints of optional attributes from DUT: AbsMinCoolSetpointLimit\n"); + err = TestReadsConstraintsOfOptionalAttributesFromDutAbsMinCoolSetpointLimit_4(); + break; + case 5: + ChipLogProgress( + chipTool, " ***** Test Step 5 : Reads constraints of optional attributes from DUT: AbsMaxCoolSetpointLimit\n"); + err = TestReadsConstraintsOfOptionalAttributesFromDutAbsMaxCoolSetpointLimit_5(); + break; + case 6: + ChipLogProgress( + chipTool, " ***** Test Step 6 : Reads constraints of optional attributes from DUT: OccupiedCoolingSetpoint\n"); + err = TestReadsConstraintsOfOptionalAttributesFromDutOccupiedCoolingSetpoint_6(); + break; + case 7: + ChipLogProgress( + chipTool, " ***** Test Step 7 : Reads constraints of mandatory attributes from DUT: OccupiedHeatingSetpoint\n"); + err = TestReadsConstraintsOfMandatoryAttributesFromDutOccupiedHeatingSetpoint_7(); + break; + case 8: + ChipLogProgress( + chipTool, " ***** Test Step 8 : Reads constraints of mandatory attributes from DUT: MinHeatSetpointLimit\n"); + err = TestReadsConstraintsOfMandatoryAttributesFromDutMinHeatSetpointLimit_8(); + break; + case 9: + ChipLogProgress( + chipTool, " ***** Test Step 9 : Reads constraints of mandatory attributes from DUT: MaxHeatSetpointLimit\n"); + err = TestReadsConstraintsOfMandatoryAttributesFromDutMaxHeatSetpointLimit_9(); + break; + case 10: + ChipLogProgress( + chipTool, " ***** Test Step 10 : Reads constraints of optional attributes from DUT: MinCoolSetpointLimit\n"); + err = TestReadsConstraintsOfOptionalAttributesFromDutMinCoolSetpointLimit_10(); + break; + case 11: + ChipLogProgress( + chipTool, " ***** Test Step 11 : Reads constraints of optional attributes from DUT: MaxCoolSetpointLimit\n"); + err = TestReadsConstraintsOfOptionalAttributesFromDutMaxCoolSetpointLimit_11(); + break; + case 12: + ChipLogProgress( + chipTool, " ***** Test Step 12 : Reads constraints of mandatory attributes from DUT: ControlSequenceOfOperation\n"); + err = TestReadsConstraintsOfMandatoryAttributesFromDutControlSequenceOfOperation_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : Reads constraints of mandatory attributes from DUT: SystemMode\n"); + err = TestReadsConstraintsOfMandatoryAttributesFromDutSystemMode_13(); + break; + case 14: + ChipLogProgress( + chipTool, " ***** Test Step 14 : Reads constraints of optional attributes from DUT: MinSetpointDeadBand\n"); + err = TestReadsConstraintsOfOptionalAttributesFromDutMinSetpointDeadBand_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Reads constraints of optional attributes from DUT: StartOfWeek\n"); + err = TestReadsConstraintsOfOptionalAttributesFromDutStartOfWeek_15(); + break; + case 16: + ChipLogProgress( + chipTool, " ***** Test Step 16 : Reads constraints of optional attributes from DUT: NumberOfWeeklyTransitions\n"); + err = TestReadsConstraintsOfOptionalAttributesFromDutNumberOfWeeklyTransitions_16(); + break; + case 17: + ChipLogProgress( + chipTool, " ***** Test Step 17 : Reads constraints of optional attributes from DUT: NumberOfDailyTransitions\n"); + err = TestReadsConstraintsOfOptionalAttributesFromDutNumberOfDailyTransitions_17(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + + 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 = 18; + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity("alpha"); + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesTheLimitOfMaxHeatSetpointLimitToOccupiedHeatingSetpointAttribute_10() + CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutLocalTemperature_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id occupiedHeatingSetpointArgument; - occupiedHeatingSetpointArgument = [NSNumber numberWithShort:3000]; - [cluster writeAttributeOccupiedHeatingSetpointWithValue:occupiedHeatingSetpointArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes the limit of MaxHeatSetpointLimit to OccupiedHeatingSetpoint " - @"attribute Error: %@", - err); + [cluster readAttributeLocalTemperatureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads constraints of mandatory attributes from DUT: LocalTemperature Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("localTemperature", "", "int16")); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsMinHeatSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_11() + CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutAbsMinHeatSetpointLimit_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMinHeatSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog( - @"Reads MinHeatSetpointLimit attribute from Server DUT and verifies that the value is within range Error: %@", err); + [cluster readAttributeAbsMinHeatSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads constraints of mandatory attributes from DUT: AbsMinHeatSetpointLimit Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("min heat setpoint limit", actualValue, 700)); - } - - VerifyOrReturn(CheckConstraintType("minHeatSetpointLimit", "", "int16")); + VerifyOrReturn(CheckConstraintType("absMinHeatSetpointLimit", "", "int16")); if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("minHeatSetpointLimit", [value shortValue], 700)); + VerifyOrReturn(CheckConstraintMinValue("absMinHeatSetpointLimit", [value shortValue], 700)); } if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("minHeatSetpointLimit", [value shortValue], 3000)); + VerifyOrReturn(CheckConstraintMaxValue("absMinHeatSetpointLimit", [value shortValue], 3000)); } NextTest(); @@ -38741,42 +45934,55 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesAValueBackThatIsDifferentButValidForMinHeatSetpointLimitAttribute_12() + CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutAbsMaxHeatSetpointLimit_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id minHeatSetpointLimitArgument; - minHeatSetpointLimitArgument = [NSNumber numberWithShort:2000]; - [cluster writeAttributeMinHeatSetpointLimitWithValue:minHeatSetpointLimitArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes a value back that is different but valid for MinHeatSetpointLimit " - @"attribute Error: %@", - err); + [cluster readAttributeAbsMaxHeatSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads constraints of mandatory attributes from DUT: AbsMaxHeatSetpointLimit Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("absMaxHeatSetpointLimit", "", "int16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("absMaxHeatSetpointLimit", [value shortValue], 700)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("absMaxHeatSetpointLimit", [value shortValue], 3000)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMinHeatSetpointLimitAttribute_13() + CHIP_ERROR TestReadsConstraintsOfOptionalAttributesFromDutAbsMinCoolSetpointLimit_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMinHeatSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads it back again to confirm the successful write of MinHeatSetpointLimit attribute Error: %@", err); + [cluster readAttributeAbsMinCoolSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads constraints of optional attributes from DUT: AbsMinCoolSetpointLimit Error: %@", err); + + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("min heat setpoint limit", actualValue, 2000)); + VerifyOrReturn(CheckConstraintType("absMinCoolSetpointLimit", "", "int16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("absMinCoolSetpointLimit", [value shortValue], 1600)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("absMinCoolSetpointLimit", [value shortValue], 3200)); } NextTest(); @@ -38785,73 +45991,86 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesTheLimitOfAbsMinHeatSetpointLimitToMinHeatSetpointLimitAttribute_14() + CHIP_ERROR TestReadsConstraintsOfOptionalAttributesFromDutAbsMaxCoolSetpointLimit_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id minHeatSetpointLimitArgument; - minHeatSetpointLimitArgument = [NSNumber numberWithShort:700]; - [cluster writeAttributeMinHeatSetpointLimitWithValue:minHeatSetpointLimitArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes the limit of AbsMinHeatSetpointLimit to MinHeatSetpointLimit " - @"attribute Error: %@", - err); + [cluster readAttributeAbsMaxCoolSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads constraints of optional attributes from DUT: AbsMaxCoolSetpointLimit Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("absMaxCoolSetpointLimit", "", "int16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("absMaxCoolSetpointLimit", [value shortValue], 1600)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("absMaxCoolSetpointLimit", [value shortValue], 3200)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesTheLimitOfAbsMaxHeatSetpointLimitToMinHeatSetpointLimitAttribute_15() + CHIP_ERROR TestReadsConstraintsOfOptionalAttributesFromDutOccupiedCoolingSetpoint_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id minHeatSetpointLimitArgument; - minHeatSetpointLimitArgument = [NSNumber numberWithShort:3000]; - [cluster writeAttributeMinHeatSetpointLimitWithValue:minHeatSetpointLimitArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes the limit of AbsMaxHeatSetpointLimit to MinHeatSetpointLimit " - @"attribute Error: %@", - err); + [cluster readAttributeOccupiedCoolingSetpointWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads constraints of optional attributes from DUT: OccupiedCoolingSetpoint Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("occupiedCoolingSetpoint", "", "int16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("occupiedCoolingSetpoint", [value shortValue], 1600)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("occupiedCoolingSetpoint", [value shortValue], 2600)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsMaxHeatSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_16() + CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutOccupiedHeatingSetpoint_7() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMaxHeatSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog( - @"Reads MaxHeatSetpointLimit attribute from Server DUT and verifies that the value is within range Error: %@", err); + [cluster readAttributeOccupiedHeatingSetpointWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads constraints of mandatory attributes from DUT: OccupiedHeatingSetpoint Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("max heat setpoint limit", actualValue, 3000)); - } - - VerifyOrReturn(CheckConstraintType("maxHeatSetpointLimit", "", "int16")); + VerifyOrReturn(CheckConstraintType("occupiedHeatingSetpoint", "", "int16")); if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("maxHeatSetpointLimit", [value shortValue], 700)); + VerifyOrReturn(CheckConstraintMinValue("occupiedHeatingSetpoint", [value shortValue], 700)); } if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("maxHeatSetpointLimit", [value shortValue], 3000)); + VerifyOrReturn(CheckConstraintMaxValue("occupiedHeatingSetpoint", [value shortValue], 2600)); } NextTest(); @@ -38860,42 +46079,24 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesAValueBackThatIsDifferentButValidForMaxHeatSetpointLimitAttribute_17() + CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutMinHeatSetpointLimit_8() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id maxHeatSetpointLimitArgument; - maxHeatSetpointLimitArgument = [NSNumber numberWithShort:2000]; - [cluster writeAttributeMaxHeatSetpointLimitWithValue:maxHeatSetpointLimitArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes a value back that is different but valid for MaxHeatSetpointLimit " - @"attribute Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err, 0)); + [cluster readAttributeMinHeatSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads constraints of mandatory attributes from DUT: MinHeatSetpointLimit Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMaxHeatSetpointLimitAttribute_18() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeMaxHeatSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads it back again to confirm the successful write of MaxHeatSetpointLimit attribute Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("max heat setpoint limit", actualValue, 2000)); + VerifyOrReturn(CheckConstraintType("minHeatSetpointLimit", "", "int16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("minHeatSetpointLimit", [value shortValue], 700)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("minHeatSetpointLimit", [value shortValue], 3000)); } NextTest(); @@ -38904,59 +46105,41 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesTheLimitOfAbsMinHeatSetpointLimitToMaxHeatSetpointLimitAttribute_19() + CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutMaxHeatSetpointLimit_9() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id maxHeatSetpointLimitArgument; - maxHeatSetpointLimitArgument = [NSNumber numberWithShort:700]; - [cluster writeAttributeMaxHeatSetpointLimitWithValue:maxHeatSetpointLimitArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes the limit of AbsMinHeatSetpointLimit to MaxHeatSetpointLimit " - @"attribute Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestWritesTheLimitOfAbsMaxHeatSetpointLimitToMaxHeatSetpointLimitAttribute_20() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + [cluster readAttributeMaxHeatSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads constraints of mandatory attributes from DUT: MaxHeatSetpointLimit Error: %@", err); - id maxHeatSetpointLimitArgument; - maxHeatSetpointLimitArgument = [NSNumber numberWithShort:3000]; - [cluster writeAttributeMaxHeatSetpointLimitWithValue:maxHeatSetpointLimitArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes the limit of AbsMaxHeatSetpointLimit to MaxHeatSetpointLimit " - @"attribute Error: %@", - err); + VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckConstraintType("maxHeatSetpointLimit", "", "int16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("maxHeatSetpointLimit", [value shortValue], 700)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("maxHeatSetpointLimit", [value shortValue], 3000)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsMinCoolSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_21() + CHIP_ERROR TestReadsConstraintsOfOptionalAttributesFromDutMinCoolSetpointLimit_10() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeMinCoolSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog( - @"Reads MinCoolSetpointLimit attribute from Server DUT and verifies that the value is within range Error: %@", err); + NSLog(@"Reads constraints of optional attributes from DUT: MinCoolSetpointLimit Error: %@", err); if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { NextTest(); @@ -38965,11 +46148,6 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("min cool setpoint limit", actualValue, 1600)); - } - VerifyOrReturn(CheckConstraintType("minCoolSetpointLimit", "", "int16")); if (value != nil) { VerifyOrReturn(CheckConstraintMinValue("minCoolSetpointLimit", [value shortValue], 1600)); @@ -38984,41 +46162,15 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesAValueBackThatIsDifferentButValidForMinCoolSetpointLimitAttribute_22() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id minCoolSetpointLimitArgument; - minCoolSetpointLimitArgument = [NSNumber numberWithShort:2000]; - [cluster writeAttributeMinCoolSetpointLimitWithValue:minCoolSetpointLimitArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes a value back that is different but valid for MinCoolSetpointLimit " - @"attribute Error: %@", - err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMinCoolSetpointLimitAttribute_23() + CHIP_ERROR TestReadsConstraintsOfOptionalAttributesFromDutMaxCoolSetpointLimit_11() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMinCoolSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads it back again to confirm the successful write of MinCoolSetpointLimit attribute Error: %@", err); + [cluster readAttributeMaxCoolSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads constraints of optional attributes from DUT: MaxCoolSetpointLimit Error: %@", err); if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { NextTest(); @@ -39027,9 +46179,12 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("min cool setpoint limit", actualValue, 2000)); + VerifyOrReturn(CheckConstraintType("maxCoolSetpointLimit", "", "int16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("maxCoolSetpointLimit", [value shortValue], 1600)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("maxCoolSetpointLimit", [value shortValue], 3200)); } NextTest(); @@ -39038,69 +46193,68 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesTheLimitOfAbsMinCoolSetpointLimitToMinCoolSetpointLimitAttribute_24() + CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutControlSequenceOfOperation_12() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id minCoolSetpointLimitArgument; - minCoolSetpointLimitArgument = [NSNumber numberWithShort:1600]; - [cluster writeAttributeMinCoolSetpointLimitWithValue:minCoolSetpointLimitArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes the limit of AbsMinCoolSetpointLimit to MinCoolSetpointLimit " - @"attribute Error: %@", - err); + [cluster + readAttributeControlSequenceOfOperationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads constraints of mandatory attributes from DUT: ControlSequenceOfOperation Error: %@", err); - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckConstraintType("controlSequenceOfOperation", "", "enum8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("controlSequenceOfOperation", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("controlSequenceOfOperation", [value unsignedCharValue], 5)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesTheLimitOfMaxCoolSetpointLimitToMinCoolSetpointLimitAttribute_25() + CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutSystemMode_13() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id minCoolSetpointLimitArgument; - minCoolSetpointLimitArgument = [NSNumber numberWithShort:3200]; - [cluster writeAttributeMinCoolSetpointLimitWithValue:minCoolSetpointLimitArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes the limit of MaxCoolSetpointLimit to MinCoolSetpointLimit attribute " - @"Error: %@", - err); + [cluster readAttributeSystemModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads constraints of mandatory attributes from DUT: SystemMode Error: %@", err); - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckConstraintType("systemMode", "", "enum8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("systemMode", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("systemMode", [value unsignedCharValue], 9)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsMaxCoolSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_26() + CHIP_ERROR TestReadsConstraintsOfOptionalAttributesFromDutMinSetpointDeadBand_14() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMaxCoolSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog( - @"Reads MaxCoolSetpointLimit attribute from Server DUT and verifies that the value is within range Error: %@", err); + [cluster readAttributeMinSetpointDeadBandWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads constraints of optional attributes from DUT: MinSetpointDeadBand Error: %@", err); if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { NextTest(); @@ -39109,17 +46263,12 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("max cool setpoint limit", actualValue, 3200)); - } - - VerifyOrReturn(CheckConstraintType("maxCoolSetpointLimit", "", "int16")); + VerifyOrReturn(CheckConstraintType("minSetpointDeadBand", "", "int8")); if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("maxCoolSetpointLimit", [value shortValue], 1600)); + VerifyOrReturn(CheckConstraintMinValue("minSetpointDeadBand", [value charValue], 0)); } if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("maxCoolSetpointLimit", [value shortValue], 3200)); + VerifyOrReturn(CheckConstraintMaxValue("minSetpointDeadBand", [value charValue], 25)); } NextTest(); @@ -39128,41 +46277,15 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesAValueBackThatIsDifferentButValidForMaxCoolSetpointLimitAttribute_27() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id maxCoolSetpointLimitArgument; - maxCoolSetpointLimitArgument = [NSNumber numberWithShort:2000]; - [cluster writeAttributeMaxCoolSetpointLimitWithValue:maxCoolSetpointLimitArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes a value back that is different but valid for MaxCoolSetpointLimit " - @"attribute Error: %@", - err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMaxCoolSetpointLimitAttribute_28() + CHIP_ERROR TestReadsConstraintsOfOptionalAttributesFromDutStartOfWeek_15() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMaxCoolSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads it back again to confirm the successful write of MaxCoolSetpointLimit attribute Error: %@", err); + [cluster readAttributeStartOfWeekWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads constraints of optional attributes from DUT: StartOfWeek Error: %@", err); if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { NextTest(); @@ -39171,9 +46294,12 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("max cool setpoint limit", actualValue, 2000)); + VerifyOrReturn(CheckConstraintType("startOfWeek", "", "enum8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("startOfWeek", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("startOfWeek", [value unsignedCharValue], 6)); } NextTest(); @@ -39182,545 +46308,88 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesTheLimitOfAbsMinCoolSetpointLimitToMaxCoolSetpointLimitAttribute_29() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id maxCoolSetpointLimitArgument; - maxCoolSetpointLimitArgument = [NSNumber numberWithShort:1600]; - [cluster writeAttributeMaxCoolSetpointLimitWithValue:maxCoolSetpointLimitArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes the limit of AbsMinCoolSetpointLimit to MaxCoolSetpointLimit " - @"attribute Error: %@", - err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestWritesTheLimitOfMaxCoolSetpointLimitToMaxCoolSetpointLimitAttribute_30() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id maxCoolSetpointLimitArgument; - maxCoolSetpointLimitArgument = [NSNumber numberWithShort:3200]; - [cluster writeAttributeMaxCoolSetpointLimitWithValue:maxCoolSetpointLimitArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes the limit of MaxCoolSetpointLimit to MaxCoolSetpointLimit attribute " - @"Error: %@", - err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestWritesSetsBackTheLimitOfMinHeatSetpointLimitToMinHeatSetpointLimitAttribute_31() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id minHeatSetpointLimitArgument; - minHeatSetpointLimitArgument = [NSNumber numberWithShort:700]; - [cluster writeAttributeMinHeatSetpointLimitWithValue:minHeatSetpointLimitArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes (sets back) the limit of MinHeatSetpointLimit to " - @"MinHeatSetpointLimit attribute Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestWritesSetsBackTheLimitOfMaxHeatSetpointLimitToMinHeatSetpointLimitAttribute_32() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id minHeatSetpointLimitArgument; - minHeatSetpointLimitArgument = [NSNumber numberWithShort:3000]; - [cluster writeAttributeMinHeatSetpointLimitWithValue:minHeatSetpointLimitArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes (sets back) the limit of MaxHeatSetpointLimit to " - @"MinHeatSetpointLimit attribute Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestWritesSetsBackTheLimitOfMinHeatSetpointLimitToMaxHeatSetpointLimitAttribute_33() + CHIP_ERROR TestReadsConstraintsOfOptionalAttributesFromDutNumberOfWeeklyTransitions_16() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id maxHeatSetpointLimitArgument; - maxHeatSetpointLimitArgument = [NSNumber numberWithShort:700]; - [cluster writeAttributeMaxHeatSetpointLimitWithValue:maxHeatSetpointLimitArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes (sets back) the limit of MinHeatSetpointLimit to " - @"MaxHeatSetpointLimit attribute Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestWritesSetsBackTheLimitOfMaxHeatSetpointLimitToMaxHeatSetpointLimitAttribute_34() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + [cluster + readAttributeNumberOfWeeklyTransitionsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads constraints of optional attributes from DUT: NumberOfWeeklyTransitions Error: %@", err); - id maxHeatSetpointLimitArgument; - maxHeatSetpointLimitArgument = [NSNumber numberWithShort:3000]; - [cluster writeAttributeMaxHeatSetpointLimitWithValue:maxHeatSetpointLimitArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes (sets back) the limit of MaxHeatSetpointLimit to " - @"MaxHeatSetpointLimit attribute Error: %@", - err); + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("numberOfWeeklyTransitions", "", "uint8")); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesSetsBackTheLimitOfMinCoolSetpointLimitToMinCoolSetpointLimitAttribute_35() + CHIP_ERROR TestReadsConstraintsOfOptionalAttributesFromDutNumberOfDailyTransitions_17() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id minCoolSetpointLimitArgument; - minCoolSetpointLimitArgument = [NSNumber numberWithShort:1600]; - [cluster writeAttributeMinCoolSetpointLimitWithValue:minCoolSetpointLimitArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes (sets back) the limit of MinCoolSetpointLimit to " - @"MinCoolSetpointLimit attribute Error: %@", - err); + [cluster readAttributeNumberOfDailyTransitionsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads constraints of optional attributes from DUT: NumberOfDailyTransitions Error: %@", err); - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("numberOfDailyTransitions", "", "uint8")); + NextTest(); + }]; return CHIP_NO_ERROR; } +}; - CHIP_ERROR TestWritesSetsBackTheLimitOfMaxCoolSetpointLimitToMinCoolSetpointLimitAttribute_36() +class Test_TC_TSTAT_2_2 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_TSTAT_2_2() + : TestCommandBridge("Test_TC_TSTAT_2_2") + , mTestIndex(0) { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id minCoolSetpointLimitArgument; - minCoolSetpointLimitArgument = [NSNumber numberWithShort:3200]; - [cluster writeAttributeMinCoolSetpointLimitWithValue:minCoolSetpointLimitArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes (sets back) the limit of MaxCoolSetpointLimit to " - @"MinCoolSetpointLimit attribute Error: %@", - err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - - 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 TestWritesSetsBackTheLimitOfMinCoolSetpointLimitToMaxCoolSetpointLimitAttribute_37() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id maxCoolSetpointLimitArgument; - maxCoolSetpointLimitArgument = [NSNumber numberWithShort:1600]; - [cluster writeAttributeMaxCoolSetpointLimitWithValue:maxCoolSetpointLimitArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes (sets back) the limit of MinCoolSetpointLimit to " - @"MaxCoolSetpointLimit attribute Error: %@", - err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } + ~Test_TC_TSTAT_2_2() {} - CHIP_ERROR TestWritesSetsBackTheLimitOfMaxCoolSetpointLimitToMaxCoolSetpointLimitAttribute_38() + /////////// TestCommand Interface ///////// + void NextTest() override { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id maxCoolSetpointLimitArgument; - maxCoolSetpointLimitArgument = [NSNumber numberWithShort:3200]; - [cluster writeAttributeMaxCoolSetpointLimitWithValue:maxCoolSetpointLimitArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes (sets back) the limit of MaxCoolSetpointLimit to " - @"MaxCoolSetpointLimit attribute Error: %@", - err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; + CHIP_ERROR err = CHIP_NO_ERROR; - return CHIP_NO_ERROR; - } + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_TSTAT_2_2\n"); + } - CHIP_ERROR TestReadsControlSequenceOfOperationFromServerDutAndVerifiesThatTheValueIsValid_39() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TSTAT_2_2\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } - [cluster - readAttributeControlSequenceOfOperationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads ControlSequenceOfOperation from Server DUT and verifies that the value is valid Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("control sequence of operation", actualValue, 4)); - } - - VerifyOrReturn(CheckConstraintType("controlSequenceOfOperation", "", "enum8")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("controlSequenceOfOperation", [value unsignedCharValue], 0)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("controlSequenceOfOperation", [value unsignedCharValue], 5)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestWriteAttributeCommandForControlSequenceOfOperationWithANewValidValue_40() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id controlSequenceOfOperationArgument; - controlSequenceOfOperationArgument = [NSNumber numberWithUnsignedChar:2]; - [cluster writeAttributeControlSequenceOfOperationWithValue:controlSequenceOfOperationArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write Attribute command for ControlSequenceOfOperation with a new " - @"valid value Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadItBackAgainToConfirmTheSuccessfulWrite_41() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster - readAttributeControlSequenceOfOperationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read it back again to confirm the successful write Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("control sequence of operation", actualValue, 2)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestSetsOccupiedHeatingSetpointToDefaultValue_42() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id occupiedHeatingSetpointArgument; - occupiedHeatingSetpointArgument = [NSNumber numberWithShort:2000]; - [cluster writeAttributeOccupiedHeatingSetpointWithValue:occupiedHeatingSetpointArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Sets OccupiedHeatingSetpoint to default value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestSetsOccupiedHeatingSetpointToDefaultValue_43() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id occupiedHeatingSetpointArgument; - occupiedHeatingSetpointArgument = [NSNumber numberWithShort:2000]; - [cluster writeAttributeOccupiedHeatingSetpointWithValue:occupiedHeatingSetpointArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Sets OccupiedHeatingSetpoint to default value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestSetsOccupiedCoolingSetpointToDefaultValue_44() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id occupiedCoolingSetpointArgument; - occupiedCoolingSetpointArgument = [NSNumber numberWithShort:2600]; - [cluster writeAttributeOccupiedCoolingSetpointWithValue:occupiedCoolingSetpointArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Sets OccupiedCoolingSetpoint to default value Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestSetsOccupiedCoolingSetpointToDefaultValue_45() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id occupiedCoolingSetpointArgument; - occupiedCoolingSetpointArgument = [NSNumber numberWithShort:2600]; - [cluster writeAttributeOccupiedCoolingSetpointWithValue:occupiedCoolingSetpointArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Sets OccupiedCoolingSetpoint to default value Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestSetsOccupiedCoolingSetpointToDefaultValue_46() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id occupiedCoolingSetpointArgument; - occupiedCoolingSetpointArgument = [NSNumber numberWithShort:2600]; - [cluster writeAttributeOccupiedCoolingSetpointWithValue:occupiedCoolingSetpointArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Sets OccupiedCoolingSetpoint to default value Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestSetsOccupiedHeatingSetpointToDefaultValue_47() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id occupiedHeatingSetpointArgument; - occupiedHeatingSetpointArgument = [NSNumber numberWithShort:2000]; - [cluster writeAttributeOccupiedHeatingSetpointWithValue:occupiedHeatingSetpointArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Sets OccupiedHeatingSetpoint to default value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestSetsOccupiedCoolingSetpointToDefaultValue_48() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id occupiedCoolingSetpointArgument; - occupiedCoolingSetpointArgument = [NSNumber numberWithShort:2600]; - [cluster writeAttributeOccupiedCoolingSetpointWithValue:occupiedCoolingSetpointArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Sets OccupiedCoolingSetpoint to default value Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestSetsOccupiedHeatingSetpointToDefaultValue_49() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id occupiedHeatingSetpointArgument; - occupiedHeatingSetpointArgument = [NSNumber numberWithShort:2000]; - [cluster writeAttributeOccupiedHeatingSetpointWithValue:occupiedHeatingSetpointArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Sets OccupiedHeatingSetpoint to default value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } -}; - -class Test_TC_TSUIC_1_1 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_TSUIC_1_1() - : TestCommandBridge("Test_TC_TSUIC_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_TSUIC_1_1() {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_TSUIC_1_1\n"); - } - - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TSUIC_1_1\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } - - Wait(); + Wait(); // Ensure we increment mTestIndex before we start running the relevant // command. That way if we lose the timeslice after we send the message @@ -39733,974 +46402,1180 @@ class Test_TC_TSUIC_1_1 : public TestCommandBridge { break; case 1: ChipLogProgress(chipTool, - " ***** Test Step 1 : Read ClusterRevision attribute from the DUT and Verify that the DUT response indicates " - "ClusterRevision attribute has the value 2\n"); - if (ShouldSkip("PICS_USER_PROMPT")) { + " ***** Test Step 1 : Reads OccupiedCoolingSetpoint attribute from Server DUT and verifies that the value is " + "within range\n"); + if (ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT")) { NextTest(); return; } - err = TestReadClusterRevisionAttributeFromTheDutAndVerifyThatTheDutResponseIndicatesClusterRevisionAttributeHasTheValue2_1(); + err = TestReadsOccupiedCoolingSetpointAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: AttributeList\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + ChipLogProgress(chipTool, + " ***** Test Step 2 : Writes a value back that is different but valid for OccupiedCoolingSetpoint attribute\n"); + if (ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT")) { NextTest(); return; } - err = TestReadTheGlobalAttributeAttributeList_2(); + err = TestWritesAValueBackThatIsDifferentButValidForOccupiedCoolingSetpointAttribute_2(); break; case 3: ChipLogProgress(chipTool, - " ***** Test Step 3 : Read EventList attribute from the DUT and Verify that the DUT response provides a list of " - "supported events.\n"); - if (ShouldSkip("PICS_USER_PROMPT")) { + " ***** Test Step 3 : Reads it back again to confirm the successful write of OccupiedCoolingSetpoint attribute\n"); + if (ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT")) { NextTest(); return; } - err = TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_3(); + err = TestReadsItBackAgainToConfirmTheSuccessfulWriteOfOccupiedCoolingSetpointAttribute_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read the global attribute: AcceptedCommandList\n"); - err = TestReadTheGlobalAttributeAcceptedCommandList_4(); + ChipLogProgress( + chipTool, " ***** Test Step 4 : Writes the limit of MinCoolSetpointLimit to OccupiedCoolingSetpoint attribute\n"); + if (ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT")) { + NextTest(); + return; + } + err = TestWritesTheLimitOfMinCoolSetpointLimitToOccupiedCoolingSetpointAttribute_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: GeneratedCommandList\n"); - err = TestReadTheGlobalAttributeGeneratedCommandList_5(); + ChipLogProgress( + chipTool, " ***** Test Step 5 : Writes the limit of MaxCoolSetpointLimit to OccupiedCoolingSetpoint attribute\n"); + if (ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT")) { + NextTest(); + return; + } + err = TestWritesTheLimitOfMaxCoolSetpointLimitToOccupiedCoolingSetpointAttribute_5(); 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 = 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 - TestReadClusterRevisionAttributeFromTheDutAndVerifyThatTheDutResponseIndicatesClusterRevisionAttributeHasTheValue2_1() - { - UserPrompt(@"Please enter ClusterRevision attribute value", @"2"); - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheGlobalAttributeAttributeList_2() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostatUserInterfaceConfiguration * cluster = - [[CHIPTestThermostatUserInterfaceConfiguration 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(3))); - VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); - VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); - VerifyOrReturn(CheckValue("", actualValue[2], 2UL)); + case 6: + ChipLogProgress(chipTool, + " ***** Test Step 6 : Reads OccupiedHeatingSetpoint attribute from Server DUT and verifies that the value is " + "within range\n"); + if (ShouldSkip("A_OCCUPIEDHEATINGSETPOINT")) { + NextTest(); + return; } - - VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_3() - { - UserPrompt(@"Please enter 'y' for success", @"y"); - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_4() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostatUserInterfaceConfiguration * cluster = - [[CHIPTestThermostatUserInterfaceConfiguration 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(0))); + err = TestReadsOccupiedHeatingSetpointAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_6(); + break; + case 7: + ChipLogProgress(chipTool, + " ***** Test Step 7 : Writes a value back that is different but valid for OccupiedHeatingSetpoint attribute\n"); + if (ShouldSkip("A_OCCUPIEDHEATINGSETPOINT")) { + NextTest(); + return; } - - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_5() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostatUserInterfaceConfiguration * cluster = - [[CHIPTestThermostatUserInterfaceConfiguration 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(0))); + err = TestWritesAValueBackThatIsDifferentButValidForOccupiedHeatingSetpointAttribute_7(); + break; + case 8: + ChipLogProgress(chipTool, + " ***** Test Step 8 : Reads it back again to confirm the successful write of OccupiedHeatingSetpoint attribute\n"); + if (ShouldSkip("A_OCCUPIEDHEATINGSETPOINT")) { + NextTest(); + return; } - - VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } -}; - -class Test_TC_TSUIC_2_1 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_TSUIC_2_1() - : TestCommandBridge("Test_TC_TSUIC_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_TSUIC_2_1() {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_TSUIC_2_1\n"); - } - - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TSUIC_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(); + err = TestReadsItBackAgainToConfirmTheSuccessfulWriteOfOccupiedHeatingSetpointAttribute_8(); break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : read the mandatory attribute: TemperatureDisplayMode\n"); - err = TestReadTheMandatoryAttributeTemperatureDisplayMode_1(); + case 9: + ChipLogProgress( + chipTool, " ***** Test Step 9 : Writes the limit of MinHeatSetpointLimit to OccupiedHeatingSetpoint attribute\n"); + if (ShouldSkip("A_OCCUPIEDHEATINGSETPOINT")) { + NextTest(); + return; + } + err = TestWritesTheLimitOfMinHeatSetpointLimitToOccupiedHeatingSetpointAttribute_9(); break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : read the mandatory attribute: TemperatureDisplayMode\n"); - err = TestReadTheMandatoryAttributeTemperatureDisplayMode_2(); + case 10: + ChipLogProgress( + chipTool, " ***** Test Step 10 : Writes the limit of MaxHeatSetpointLimit to OccupiedHeatingSetpoint attribute\n"); + if (ShouldSkip("A_OCCUPIEDHEATINGSETPOINT")) { + NextTest(); + return; + } + err = TestWritesTheLimitOfMaxHeatSetpointLimitToOccupiedHeatingSetpointAttribute_10(); break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : read the mandatory attribute: KeypadLockout\n"); - err = TestReadTheMandatoryAttributeKeypadLockout_3(); + case 11: + ChipLogProgress(chipTool, + " ***** Test Step 11 : Reads MinHeatSetpointLimit attribute from Server DUT and verifies that the value is within " + "range\n"); + if (ShouldSkip("A_MINHEATSETPOINTLIMIT")) { + NextTest(); + return; + } + err = TestReadsMinHeatSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_11(); break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : read the mandatory attribute: KeypadLockout\n"); - err = TestReadTheMandatoryAttributeKeypadLockout_4(); + case 12: + ChipLogProgress(chipTool, + " ***** Test Step 12 : Writes a value back that is different but valid for MinHeatSetpointLimit attribute\n"); + if (ShouldSkip("A_MINHEATSETPOINTLIMIT")) { + NextTest(); + return; + } + err = TestWritesAValueBackThatIsDifferentButValidForMinHeatSetpointLimitAttribute_12(); break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : read the optional attribute: ScheduleProgrammingVisibility\n"); - err = TestReadTheOptionalAttributeScheduleProgrammingVisibility_5(); + case 13: + ChipLogProgress(chipTool, + " ***** Test Step 13 : Reads it back again to confirm the successful write of MinHeatSetpointLimit attribute\n"); + if (ShouldSkip("A_MINHEATSETPOINTLIMIT")) { + NextTest(); + return; + } + err = TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMinHeatSetpointLimitAttribute_13(); break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : read the optional attribute: ScheduleProgrammingVisibility\n"); - err = TestReadTheOptionalAttributeScheduleProgrammingVisibility_6(); + case 14: + ChipLogProgress( + chipTool, " ***** Test Step 14 : Writes the limit of AbsMinHeatSetpointLimit to MinHeatSetpointLimit attribute\n"); + if (ShouldSkip("A_MINHEATSETPOINTLIMIT")) { + NextTest(); + return; + } + err = TestWritesTheLimitOfAbsMinHeatSetpointLimitToMinHeatSetpointLimitAttribute_14(); 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 TestReadTheMandatoryAttributeTemperatureDisplayMode_1() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostatUserInterfaceConfiguration * cluster = - [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeTemperatureDisplayModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: TemperatureDisplayMode Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("temperature display mode", actualValue, 0)); + case 15: + ChipLogProgress( + chipTool, " ***** Test Step 15 : Writes the limit of AbsMaxHeatSetpointLimit to MinHeatSetpointLimit attribute\n"); + if (ShouldSkip("A_MINHEATSETPOINTLIMIT")) { + NextTest(); + return; } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheMandatoryAttributeTemperatureDisplayMode_2() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostatUserInterfaceConfiguration * cluster = - [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeTemperatureDisplayModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: TemperatureDisplayMode Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("temperatureDisplayMode", "", "enum8")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("temperatureDisplayMode", [value unsignedCharValue], 0)); + err = TestWritesTheLimitOfAbsMaxHeatSetpointLimitToMinHeatSetpointLimitAttribute_15(); + break; + case 16: + ChipLogProgress(chipTool, + " ***** Test Step 16 : Reads MaxHeatSetpointLimit attribute from Server DUT and verifies that the value is within " + "range\n"); + if (ShouldSkip("A_MAXHEATSETPOINTLIMIT")) { + NextTest(); + return; } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("temperatureDisplayMode", [value unsignedCharValue], 1)); + err = TestReadsMaxHeatSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_16(); + break; + case 17: + ChipLogProgress(chipTool, + " ***** Test Step 17 : Writes a value back that is different but valid for MaxHeatSetpointLimit attribute\n"); + if (ShouldSkip("A_MAXHEATSETPOINTLIMIT")) { + NextTest(); + return; } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheMandatoryAttributeKeypadLockout_3() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostatUserInterfaceConfiguration * cluster = - [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeKeypadLockoutWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: KeypadLockout Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("keypad lockout", actualValue, 0)); + err = TestWritesAValueBackThatIsDifferentButValidForMaxHeatSetpointLimitAttribute_17(); + break; + case 18: + ChipLogProgress(chipTool, + " ***** Test Step 18 : Reads it back again to confirm the successful write of MaxHeatSetpointLimit attribute\n"); + if (ShouldSkip("A_MAXHEATSETPOINTLIMIT")) { + NextTest(); + return; } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheMandatoryAttributeKeypadLockout_4() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostatUserInterfaceConfiguration * cluster = - [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeKeypadLockoutWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: KeypadLockout Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("keypadLockout", "", "enum8")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("keypadLockout", [value unsignedCharValue], 0)); + err = TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMaxHeatSetpointLimitAttribute_18(); + break; + case 19: + ChipLogProgress( + chipTool, " ***** Test Step 19 : Writes the limit of AbsMinHeatSetpointLimit to MaxHeatSetpointLimit attribute\n"); + if (ShouldSkip("A_MAXHEATSETPOINTLIMIT")) { + NextTest(); + return; } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("keypadLockout", [value unsignedCharValue], 5)); + err = TestWritesTheLimitOfAbsMinHeatSetpointLimitToMaxHeatSetpointLimitAttribute_19(); + break; + case 20: + ChipLogProgress( + chipTool, " ***** Test Step 20 : Writes the limit of AbsMaxHeatSetpointLimit to MaxHeatSetpointLimit attribute\n"); + if (ShouldSkip("A_MAXHEATSETPOINTLIMIT")) { + NextTest(); + return; } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheOptionalAttributeScheduleProgrammingVisibility_5() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostatUserInterfaceConfiguration * cluster = - [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster - readAttributeScheduleProgrammingVisibilityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: ScheduleProgrammingVisibility Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("schedule programming visibility", actualValue, 0)); - } - + err = TestWritesTheLimitOfAbsMaxHeatSetpointLimitToMaxHeatSetpointLimitAttribute_20(); + break; + case 21: + ChipLogProgress(chipTool, + " ***** Test Step 21 : Reads MinCoolSetpointLimit attribute from Server DUT and verifies that the value is within " + "range\n"); + if (ShouldSkip("A_MINCOOLSETPOINTLIMIT")) { NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheOptionalAttributeScheduleProgrammingVisibility_6() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostatUserInterfaceConfiguration * cluster = - [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster - readAttributeScheduleProgrammingVisibilityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: ScheduleProgrammingVisibility Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("scheduleProgrammingVisibility", "", "enum8")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("scheduleProgrammingVisibility", [value unsignedCharValue], 0)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("scheduleProgrammingVisibility", [value unsignedCharValue], 1)); - } - + return; + } + err = TestReadsMinCoolSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_21(); + break; + case 22: + ChipLogProgress(chipTool, + " ***** Test Step 22 : Writes a value back that is different but valid for MinCoolSetpointLimit attribute\n"); + if (ShouldSkip("A_MINCOOLSETPOINTLIMIT")) { NextTest(); - }]; - - return CHIP_NO_ERROR; - } -}; - -class Test_TC_TSUIC_2_2 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_TSUIC_2_2() - : TestCommandBridge("Test_TC_TSUIC_2_2") - , 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_TSUIC_2_2() {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_TSUIC_2_2\n"); - } - - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TSUIC_2_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 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + return; + } + err = TestWritesAValueBackThatIsDifferentButValidForMinCoolSetpointLimitAttribute_22(); break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Writes a value of 0 to TemperatureDisplayMode attribute of DUT\n"); - if (ShouldSkip("A_TEMPERATURE_DISPLAY_MODE")) { + case 23: + ChipLogProgress(chipTool, + " ***** Test Step 23 : Reads it back again to confirm the successful write of MinCoolSetpointLimit attribute\n"); + if (ShouldSkip("A_MINCOOLSETPOINTLIMIT")) { NextTest(); return; } - err = TestWritesAValueOf0ToTemperatureDisplayModeAttributeOfDut_1(); + err = TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMinCoolSetpointLimitAttribute_23(); break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Writes a value of 1 to TemperatureDisplayMode attribute of DUT\n"); - if (ShouldSkip("A_TEMPERATURE_DISPLAY_MODE")) { + case 24: + ChipLogProgress( + chipTool, " ***** Test Step 24 : Writes the limit of AbsMinCoolSetpointLimit to MinCoolSetpointLimit attribute\n"); + if (ShouldSkip("A_MINCOOLSETPOINTLIMIT")) { NextTest(); return; } - err = TestWritesAValueOf1ToTemperatureDisplayModeAttributeOfDut_2(); + err = TestWritesTheLimitOfAbsMinCoolSetpointLimitToMinCoolSetpointLimitAttribute_24(); break; - case 3: + case 25: ChipLogProgress( - chipTool, " ***** Test Step 3 : Writes a value of greater than 1 to TemperatureDisplayMode attribute of DUT\n"); - if (ShouldSkip("A_TEMPERATURE_DISPLAY_MODE")) { + chipTool, " ***** Test Step 25 : Writes the limit of MaxCoolSetpointLimit to MinCoolSetpointLimit attribute\n"); + if (ShouldSkip("A_MINCOOLSETPOINTLIMIT")) { NextTest(); return; } - err = TestWritesAValueOfGreaterThan1ToTemperatureDisplayModeAttributeOfDut_3(); + err = TestWritesTheLimitOfMaxCoolSetpointLimitToMinCoolSetpointLimitAttribute_25(); break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Writes a value of 0 to KeypadLockout attribute of DUT\n"); - if (ShouldSkip("A_KEYPAD_LOCKOUT")) { + case 26: + ChipLogProgress(chipTool, + " ***** Test Step 26 : Reads MaxCoolSetpointLimit attribute from Server DUT and verifies that the value is within " + "range\n"); + if (ShouldSkip("A_MAXCOOLSETPOINTLIMIT")) { NextTest(); return; } - err = TestWritesAValueOf0ToKeypadLockoutAttributeOfDut_4(); + err = TestReadsMaxCoolSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_26(); break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Writes a value of 1 to KeypadLockout attribute of DUT\n"); - if (ShouldSkip("A_KEYPAD_LOCKOUT")) { + case 27: + ChipLogProgress(chipTool, + " ***** Test Step 27 : Writes a value back that is different but valid for MaxCoolSetpointLimit attribute\n"); + if (ShouldSkip("A_MAXCOOLSETPOINTLIMIT")) { NextTest(); return; } - err = TestWritesAValueOf1ToKeypadLockoutAttributeOfDut_5(); + err = TestWritesAValueBackThatIsDifferentButValidForMaxCoolSetpointLimitAttribute_27(); break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Writes a value of 2 to KeypadLockout attribute of DUT\n"); - if (ShouldSkip("A_KEYPAD_LOCKOUT")) { + case 28: + ChipLogProgress(chipTool, + " ***** Test Step 28 : Reads it back again to confirm the successful write of MaxCoolSetpointLimit attribute\n"); + if (ShouldSkip("A_MAXCOOLSETPOINTLIMIT")) { NextTest(); return; } - err = TestWritesAValueOf2ToKeypadLockoutAttributeOfDut_6(); + err = TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMaxCoolSetpointLimitAttribute_28(); break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Writes a value of 3 to KeypadLockout attribute of DUT\n"); - if (ShouldSkip("A_KEYPAD_LOCKOUT")) { + case 29: + ChipLogProgress( + chipTool, " ***** Test Step 29 : Writes the limit of AbsMinCoolSetpointLimit to MaxCoolSetpointLimit attribute\n"); + if (ShouldSkip("A_MAXCOOLSETPOINTLIMIT")) { NextTest(); return; } - err = TestWritesAValueOf3ToKeypadLockoutAttributeOfDut_7(); + err = TestWritesTheLimitOfAbsMinCoolSetpointLimitToMaxCoolSetpointLimitAttribute_29(); break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Writes a value of 4 to KeypadLockout attribute of DUT\n"); - if (ShouldSkip("A_KEYPAD_LOCKOUT")) { + case 30: + ChipLogProgress( + chipTool, " ***** Test Step 30 : Writes the limit of MaxCoolSetpointLimit to MaxCoolSetpointLimit attribute\n"); + if (ShouldSkip("A_MAXCOOLSETPOINTLIMIT")) { NextTest(); return; } - err = TestWritesAValueOf4ToKeypadLockoutAttributeOfDut_8(); + err = TestWritesTheLimitOfMaxCoolSetpointLimitToMaxCoolSetpointLimitAttribute_30(); break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Writes a value of 5 to KeypadLockout attribute of DUT\n"); - if (ShouldSkip("A_KEYPAD_LOCKOUT")) { + case 31: + ChipLogProgress(chipTool, + " ***** Test Step 31 : Writes (sets back) the limit of MinHeatSetpointLimit to MinHeatSetpointLimit attribute\n"); + if (ShouldSkip("A_MINHEATSETPOINTLIMIT")) { NextTest(); return; } - err = TestWritesAValueOf5ToKeypadLockoutAttributeOfDut_9(); + err = TestWritesSetsBackTheLimitOfMinHeatSetpointLimitToMinHeatSetpointLimitAttribute_31(); break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Writes a value of greater than 5 to KeypadLockout attribute of DUT\n"); - if (ShouldSkip("A_KEYPAD_LOCKOUT")) { + case 32: + ChipLogProgress(chipTool, + " ***** Test Step 32 : Writes (sets back) the limit of MaxHeatSetpointLimit to MinHeatSetpointLimit attribute\n"); + if (ShouldSkip("A_MINHEATSETPOINTLIMIT")) { NextTest(); return; } - err = TestWritesAValueOfGreaterThan5ToKeypadLockoutAttributeOfDut_10(); + err = TestWritesSetsBackTheLimitOfMaxHeatSetpointLimitToMinHeatSetpointLimitAttribute_32(); break; - case 11: - ChipLogProgress( - chipTool, " ***** Test Step 11 : Writes a value of 0 to ScheduleProgrammingVisibility attribute of DUT\n"); - if (ShouldSkip("A_SCHEDULE_PROGRAMMING_VISIBILITY")) { + case 33: + ChipLogProgress(chipTool, + " ***** Test Step 33 : Writes (sets back) the limit of MinHeatSetpointLimit to MaxHeatSetpointLimit attribute\n"); + if (ShouldSkip("A_MINHEATSETPOINTLIMIT")) { NextTest(); return; } - err = TestWritesAValueOf0ToScheduleProgrammingVisibilityAttributeOfDut_11(); + err = TestWritesSetsBackTheLimitOfMinHeatSetpointLimitToMaxHeatSetpointLimitAttribute_33(); break; - case 12: - ChipLogProgress( - chipTool, " ***** Test Step 12 : Writes a value of 1 to ScheduleProgrammingVisibility attribute of DUT\n"); - if (ShouldSkip("A_SCHEDULE_PROGRAMMING_VISIBILITY")) { + case 34: + ChipLogProgress(chipTool, + " ***** Test Step 34 : Writes (sets back) the limit of MaxHeatSetpointLimit to MaxHeatSetpointLimit attribute\n"); + if (ShouldSkip("A_MINHEATSETPOINTLIMIT")) { NextTest(); return; } - err = TestWritesAValueOf1ToScheduleProgrammingVisibilityAttributeOfDut_12(); + err = TestWritesSetsBackTheLimitOfMaxHeatSetpointLimitToMaxHeatSetpointLimitAttribute_34(); break; - case 13: + case 35: ChipLogProgress(chipTool, - " ***** Test Step 13 : Writes a value of greater than 1 to ScheduleProgrammingVisibility attribute of DUT\n"); - if (ShouldSkip("A_SCHEDULE_PROGRAMMING_VISIBILITY")) { + " ***** Test Step 35 : Writes (sets back) the limit of MinCoolSetpointLimit to MinCoolSetpointLimit attribute\n"); + if (ShouldSkip("A_MINCOOLSETPOINTLIMIT")) { NextTest(); return; } - err = TestWritesAValueOfGreaterThan1ToScheduleProgrammingVisibilityAttributeOfDut_13(); + err = TestWritesSetsBackTheLimitOfMinCoolSetpointLimitToMinCoolSetpointLimitAttribute_35(); 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 = 14; - - 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 TestWritesAValueOf0ToTemperatureDisplayModeAttributeOfDut_1() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostatUserInterfaceConfiguration * cluster = - [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id temperatureDisplayModeArgument; - temperatureDisplayModeArgument = [NSNumber numberWithUnsignedChar:0]; - [cluster - writeAttributeTemperatureDisplayModeWithValue:temperatureDisplayModeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes a value of 0 to TemperatureDisplayMode attribute of DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestWritesAValueOf1ToTemperatureDisplayModeAttributeOfDut_2() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostatUserInterfaceConfiguration * cluster = - [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id temperatureDisplayModeArgument; - temperatureDisplayModeArgument = [NSNumber numberWithUnsignedChar:1]; - [cluster - writeAttributeTemperatureDisplayModeWithValue:temperatureDisplayModeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes a value of 1 to TemperatureDisplayMode attribute of DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + case 36: + ChipLogProgress(chipTool, + " ***** Test Step 36 : Writes (sets back) the limit of MaxCoolSetpointLimit to MinCoolSetpointLimit attribute\n"); + if (ShouldSkip("A_MINCOOLSETPOINTLIMIT")) { + NextTest(); + return; + } + err = TestWritesSetsBackTheLimitOfMaxCoolSetpointLimitToMinCoolSetpointLimitAttribute_36(); + break; + case 37: + ChipLogProgress(chipTool, + " ***** Test Step 37 : Writes (sets back) the limit of MinCoolSetpointLimit to MaxCoolSetpointLimit attribute\n"); + if (ShouldSkip("A_MAXCOOLSETPOINTLIMIT")) { + NextTest(); + return; + } + err = TestWritesSetsBackTheLimitOfMinCoolSetpointLimitToMaxCoolSetpointLimitAttribute_37(); + break; + case 38: + ChipLogProgress(chipTool, + " ***** Test Step 38 : Writes (sets back) the limit of MaxCoolSetpointLimit to MaxCoolSetpointLimit attribute\n"); + if (ShouldSkip("A_MAXCOOLSETPOINTLIMIT")) { + NextTest(); + return; + } + err = TestWritesSetsBackTheLimitOfMaxCoolSetpointLimitToMaxCoolSetpointLimitAttribute_38(); + break; + case 39: + ChipLogProgress(chipTool, + " ***** Test Step 39 : Reads ControlSequenceOfOperation from Server DUT and verifies that the value is valid\n"); + if (ShouldSkip("A_CONTROLSEQUENCEOFOPERATION")) { + NextTest(); + return; + } + err = TestReadsControlSequenceOfOperationFromServerDutAndVerifiesThatTheValueIsValid_39(); + break; + case 40: + ChipLogProgress( + chipTool, " ***** Test Step 40 : Write Attribute command for ControlSequenceOfOperation with a new valid value\n"); + if (ShouldSkip("A_CONTROLSEQUENCEOFOPERATION")) { + NextTest(); + return; + } + err = TestWriteAttributeCommandForControlSequenceOfOperationWithANewValidValue_40(); + break; + case 41: + ChipLogProgress(chipTool, " ***** Test Step 41 : Read it back again to confirm the successful write\n"); + if (ShouldSkip("A_CONTROLSEQUENCEOFOPERATION")) { + NextTest(); + return; + } + err = TestReadItBackAgainToConfirmTheSuccessfulWrite_41(); + break; + case 42: + ChipLogProgress(chipTool, " ***** Test Step 42 : Sets OccupiedHeatingSetpoint to default value\n"); + if (ShouldSkip("A_OCCUPIEDHEATINGSETPOINT")) { + NextTest(); + return; + } + err = TestSetsOccupiedHeatingSetpointToDefaultValue_42(); + break; + case 43: + ChipLogProgress(chipTool, " ***** Test Step 43 : Sets OccupiedHeatingSetpoint to default value\n"); + if (ShouldSkip("A_OCCUPIEDHEATINGSETPOINT")) { + NextTest(); + return; + } + err = TestSetsOccupiedHeatingSetpointToDefaultValue_43(); + break; + case 44: + ChipLogProgress(chipTool, " ***** Test Step 44 : Sets OccupiedCoolingSetpoint to default value\n"); + if (ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT")) { + NextTest(); + return; + } + err = TestSetsOccupiedCoolingSetpointToDefaultValue_44(); + break; + case 45: + ChipLogProgress(chipTool, " ***** Test Step 45 : Sets OccupiedCoolingSetpoint to default value\n"); + if (ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT")) { + NextTest(); + return; + } + err = TestSetsOccupiedCoolingSetpointToDefaultValue_45(); + break; + case 46: + ChipLogProgress(chipTool, " ***** Test Step 46 : Sets OccupiedCoolingSetpoint to default value\n"); + if (ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT")) { + NextTest(); + return; + } + err = TestSetsOccupiedCoolingSetpointToDefaultValue_46(); + break; + case 47: + ChipLogProgress(chipTool, " ***** Test Step 47 : Sets OccupiedHeatingSetpoint to default value\n"); + if (ShouldSkip("A_OCCUPIEDHEATINGSETPOINT")) { + NextTest(); + return; + } + err = TestSetsOccupiedHeatingSetpointToDefaultValue_47(); + break; + case 48: + ChipLogProgress(chipTool, " ***** Test Step 48 : Sets OccupiedCoolingSetpoint to default value\n"); + if (ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT")) { + NextTest(); + return; + } + err = TestSetsOccupiedCoolingSetpointToDefaultValue_48(); + break; + case 49: + ChipLogProgress(chipTool, " ***** Test Step 49 : Sets OccupiedHeatingSetpoint to default value\n"); + if (ShouldSkip("A_OCCUPIEDHEATINGSETPOINT")) { + NextTest(); + return; + } + err = TestSetsOccupiedHeatingSetpointToDefaultValue_49(); + break; + } - NextTest(); - }]; + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } - return CHIP_NO_ERROR; + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 34: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 35: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 36: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 37: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 38: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 39: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 40: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 41: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 42: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 43: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 44: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 45: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 46: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 47: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 48: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 49: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); } - CHIP_ERROR TestWritesAValueOfGreaterThan1ToTemperatureDisplayModeAttributeOfDut_3() + chip::System::Clock::Timeout GetWaitDuration() const override { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostatUserInterfaceConfiguration * cluster = - [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } - id temperatureDisplayModeArgument; - temperatureDisplayModeArgument = [NSNumber numberWithUnsignedChar:2]; - [cluster writeAttributeTemperatureDisplayModeWithValue:temperatureDisplayModeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes a value of greater than 1 to TemperatureDisplayMode attribute of " - @"DUT Error: %@", - err); +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 50; - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity("alpha"); + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesAValueOf0ToKeypadLockoutAttributeOfDut_4() + CHIP_ERROR TestReadsOccupiedCoolingSetpointAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostatUserInterfaceConfiguration * cluster = - [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id keypadLockoutArgument; - keypadLockoutArgument = [NSNumber numberWithUnsignedChar:0]; - [cluster writeAttributeKeypadLockoutWithValue:keypadLockoutArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes a value of 0 to KeypadLockout attribute of DUT Error: %@", err); + [cluster readAttributeOccupiedCoolingSetpointWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads OccupiedCoolingSetpoint attribute from Server DUT and verifies that the value is within range Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, 0)); + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("occupied cooling setpoint", actualValue, 2600)); + } + + VerifyOrReturn(CheckConstraintType("occupiedCoolingSetpoint", "", "int16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("occupiedCoolingSetpoint", [value shortValue], 1600)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("occupiedCoolingSetpoint", [value shortValue], 2600)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesAValueOf1ToKeypadLockoutAttributeOfDut_5() + CHIP_ERROR TestWritesAValueBackThatIsDifferentButValidForOccupiedCoolingSetpointAttribute_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostatUserInterfaceConfiguration * cluster = - [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id keypadLockoutArgument; - keypadLockoutArgument = [NSNumber numberWithUnsignedChar:1]; - [cluster writeAttributeKeypadLockoutWithValue:keypadLockoutArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes a value of 1 to KeypadLockout attribute of DUT Error: %@", err); + id occupiedCoolingSetpointArgument; + occupiedCoolingSetpointArgument = [NSNumber numberWithShort:2000]; + [cluster writeAttributeOccupiedCoolingSetpointWithValue:occupiedCoolingSetpointArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes a value back that is different but valid for " + @"OccupiedCoolingSetpoint attribute Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, 0)); + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesAValueOf2ToKeypadLockoutAttributeOfDut_6() + CHIP_ERROR TestReadsItBackAgainToConfirmTheSuccessfulWriteOfOccupiedCoolingSetpointAttribute_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostatUserInterfaceConfiguration * cluster = - [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id keypadLockoutArgument; - keypadLockoutArgument = [NSNumber numberWithUnsignedChar:2]; - [cluster writeAttributeKeypadLockoutWithValue:keypadLockoutArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes a value of 2 to KeypadLockout attribute of DUT Error: %@", err); + [cluster readAttributeOccupiedCoolingSetpointWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads it back again to confirm the successful write of OccupiedCoolingSetpoint attribute Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("occupied cooling setpoint", actualValue, 2000)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesAValueOf3ToKeypadLockoutAttributeOfDut_7() + CHIP_ERROR TestWritesTheLimitOfMinCoolSetpointLimitToOccupiedCoolingSetpointAttribute_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostatUserInterfaceConfiguration * cluster = - [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id keypadLockoutArgument; - keypadLockoutArgument = [NSNumber numberWithUnsignedChar:3]; - [cluster writeAttributeKeypadLockoutWithValue:keypadLockoutArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes a value of 3 to KeypadLockout attribute of DUT Error: %@", err); + id occupiedCoolingSetpointArgument; + occupiedCoolingSetpointArgument = [NSNumber numberWithShort:1600]; + [cluster writeAttributeOccupiedCoolingSetpointWithValue:occupiedCoolingSetpointArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes the limit of MinCoolSetpointLimit to OccupiedCoolingSetpoint " + @"attribute Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, 0)); + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesAValueOf4ToKeypadLockoutAttributeOfDut_8() + CHIP_ERROR TestWritesTheLimitOfMaxCoolSetpointLimitToOccupiedCoolingSetpointAttribute_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostatUserInterfaceConfiguration * cluster = - [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id keypadLockoutArgument; - keypadLockoutArgument = [NSNumber numberWithUnsignedChar:4]; - [cluster writeAttributeKeypadLockoutWithValue:keypadLockoutArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes a value of 4 to KeypadLockout attribute of DUT Error: %@", err); + id occupiedCoolingSetpointArgument; + occupiedCoolingSetpointArgument = [NSNumber numberWithShort:2600]; + [cluster writeAttributeOccupiedCoolingSetpointWithValue:occupiedCoolingSetpointArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes the limit of MaxCoolSetpointLimit to OccupiedCoolingSetpoint " + @"attribute Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, 0)); + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesAValueOf5ToKeypadLockoutAttributeOfDut_9() + CHIP_ERROR TestReadsOccupiedHeatingSetpointAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostatUserInterfaceConfiguration * cluster = - [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id keypadLockoutArgument; - keypadLockoutArgument = [NSNumber numberWithUnsignedChar:5]; - [cluster writeAttributeKeypadLockoutWithValue:keypadLockoutArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes a value of 5 to KeypadLockout attribute of DUT Error: %@", err); + [cluster readAttributeOccupiedHeatingSetpointWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads OccupiedHeatingSetpoint attribute from Server DUT and verifies that the value is within range Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValue("occupied heating setpoint", actualValue, 2000)); + } + + VerifyOrReturn(CheckConstraintType("occupiedHeatingSetpoint", "", "int16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("occupiedHeatingSetpoint", [value shortValue], 700)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("occupiedHeatingSetpoint", [value shortValue], 3000)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesAValueOfGreaterThan5ToKeypadLockoutAttributeOfDut_10() + CHIP_ERROR TestWritesAValueBackThatIsDifferentButValidForOccupiedHeatingSetpointAttribute_7() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostatUserInterfaceConfiguration * cluster = - [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id keypadLockoutArgument; - keypadLockoutArgument = [NSNumber numberWithUnsignedChar:6]; - [cluster writeAttributeKeypadLockoutWithValue:keypadLockoutArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes a value of greater than 5 to KeypadLockout attribute of DUT Error: %@", err); + id occupiedHeatingSetpointArgument; + occupiedHeatingSetpointArgument = [NSNumber numberWithShort:2100]; + [cluster writeAttributeOccupiedHeatingSetpointWithValue:occupiedHeatingSetpointArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes a value back that is different but valid for " + @"OccupiedHeatingSetpoint attribute Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesAValueOf0ToScheduleProgrammingVisibilityAttributeOfDut_11() + CHIP_ERROR TestReadsItBackAgainToConfirmTheSuccessfulWriteOfOccupiedHeatingSetpointAttribute_8() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostatUserInterfaceConfiguration * cluster = - [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id scheduleProgrammingVisibilityArgument; - scheduleProgrammingVisibilityArgument = [NSNumber numberWithUnsignedChar:0]; - [cluster writeAttributeScheduleProgrammingVisibilityWithValue:scheduleProgrammingVisibilityArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes a value of 0 to ScheduleProgrammingVisibility attribute of " - @"DUT Error: %@", - err); + [cluster readAttributeOccupiedHeatingSetpointWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads it back again to confirm the successful write of OccupiedHeatingSetpoint attribute Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValue("occupied heating setpoint", actualValue, 2100)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesAValueOf1ToScheduleProgrammingVisibilityAttributeOfDut_12() + CHIP_ERROR TestWritesTheLimitOfMinHeatSetpointLimitToOccupiedHeatingSetpointAttribute_9() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostatUserInterfaceConfiguration * cluster = - [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id scheduleProgrammingVisibilityArgument; - scheduleProgrammingVisibilityArgument = [NSNumber numberWithUnsignedChar:1]; - [cluster writeAttributeScheduleProgrammingVisibilityWithValue:scheduleProgrammingVisibilityArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes a value of 1 to ScheduleProgrammingVisibility attribute of " - @"DUT Error: %@", - err); + id occupiedHeatingSetpointArgument; + occupiedHeatingSetpointArgument = [NSNumber numberWithShort:700]; + [cluster writeAttributeOccupiedHeatingSetpointWithValue:occupiedHeatingSetpointArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes the limit of MinHeatSetpointLimit to OccupiedHeatingSetpoint " + @"attribute Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesAValueOfGreaterThan1ToScheduleProgrammingVisibilityAttributeOfDut_13() + CHIP_ERROR TestWritesTheLimitOfMaxHeatSetpointLimitToOccupiedHeatingSetpointAttribute_10() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostatUserInterfaceConfiguration * cluster = - [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id scheduleProgrammingVisibilityArgument; - scheduleProgrammingVisibilityArgument = [NSNumber numberWithUnsignedChar:2]; - [cluster - writeAttributeScheduleProgrammingVisibilityWithValue:scheduleProgrammingVisibilityArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes a value of greater than 1 to ScheduleProgrammingVisibility " - @"attribute of DUT Error: %@", - err); + id occupiedHeatingSetpointArgument; + occupiedHeatingSetpointArgument = [NSNumber numberWithShort:3000]; + [cluster writeAttributeOccupiedHeatingSetpointWithValue:occupiedHeatingSetpointArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes the limit of MaxHeatSetpointLimit to OccupiedHeatingSetpoint " + @"attribute Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } -}; -class Test_TC_DIAG_TH_NW_1_1 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_DIAG_TH_NW_1_1() - : TestCommandBridge("Test_TC_DIAG_TH_NW_1_1") - , mTestIndex(0) + CHIP_ERROR TestReadsMinHeatSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_11() { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMinHeatSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog( + @"Reads MinHeatSetpointLimit attribute from Server DUT and verifies that the value is within range Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("min heat setpoint limit", actualValue, 700)); + } + + VerifyOrReturn(CheckConstraintType("minHeatSetpointLimit", "", "int16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("minHeatSetpointLimit", [value shortValue], 700)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("minHeatSetpointLimit", [value shortValue], 3000)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_DIAG_TH_NW_1_1() {} + CHIP_ERROR TestWritesAValueBackThatIsDifferentButValidForMinHeatSetpointLimitAttribute_12() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - /////////// TestCommand Interface ///////// - void NextTest() override + id minHeatSetpointLimitArgument; + minHeatSetpointLimitArgument = [NSNumber numberWithShort:2000]; + [cluster writeAttributeMinHeatSetpointLimitWithValue:minHeatSetpointLimitArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes a value back that is different but valid for MinHeatSetpointLimit " + @"attribute Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMinHeatSetpointLimitAttribute_13() { - CHIP_ERROR err = CHIP_NO_ERROR; + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_DIAG_TH_NW_1_1\n"); - } + [cluster readAttributeMinHeatSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads it back again to confirm the successful write of MinHeatSetpointLimit attribute Error: %@", err); - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DIAG_TH_NW_1_1\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + VerifyOrReturn(CheckValue("status", err, 0)); - Wait(); + { + id actualValue = value; + VerifyOrReturn(CheckValue("min heat setpoint limit", actualValue, 2000)); + } - // 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 ResetCounts command\n"); - err = TestSendsResetCountsCommand_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read the Overruncount attribute\n"); - err = TestReadTheOverruncountAttribute_2(); - 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 TestWritesTheLimitOfAbsMinHeatSetpointLimitToMinHeatSetpointLimitAttribute_14() { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id minHeatSetpointLimitArgument; + minHeatSetpointLimitArgument = [NSNumber numberWithShort:700]; + [cluster writeAttributeMinHeatSetpointLimitWithValue:minHeatSetpointLimitArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes the limit of AbsMinHeatSetpointLimit to MinHeatSetpointLimit " + @"attribute Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 3; + CHIP_ERROR TestWritesTheLimitOfAbsMaxHeatSetpointLimitToMinHeatSetpointLimitAttribute_15() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestThermostat * cluster = [[CHIPTestThermostat 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; + id minHeatSetpointLimitArgument; + minHeatSetpointLimitArgument = [NSNumber numberWithShort:3000]; + [cluster writeAttributeMinHeatSetpointLimitWithValue:minHeatSetpointLimitArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes the limit of AbsMaxHeatSetpointLimit to MinHeatSetpointLimit " + @"attribute Error: %@", + err); - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadsMaxHeatSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_16() { - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMaxHeatSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog( + @"Reads MaxHeatSetpointLimit attribute from Server DUT and verifies that the value is within range Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("max heat setpoint limit", actualValue, 3000)); + } + + VerifyOrReturn(CheckConstraintType("maxHeatSetpointLimit", "", "int16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("maxHeatSetpointLimit", [value shortValue], 700)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("maxHeatSetpointLimit", [value shortValue], 3000)); + } + + NextTest(); + }]; + return CHIP_NO_ERROR; } - CHIP_ERROR TestSendsResetCountsCommand_1() + CHIP_ERROR TestWritesAValueBackThatIsDifferentButValidForMaxHeatSetpointLimitAttribute_17() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster resetCountsWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Sends ResetCounts command Error: %@", err); + id maxHeatSetpointLimitArgument; + maxHeatSetpointLimitArgument = [NSNumber numberWithShort:2000]; + [cluster writeAttributeMaxHeatSetpointLimitWithValue:maxHeatSetpointLimitArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes a value back that is different but valid for MaxHeatSetpointLimit " + @"attribute Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMaxHeatSetpointLimitAttribute_18() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMaxHeatSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads it back again to confirm the successful write of MaxHeatSetpointLimit attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("max heat setpoint limit", actualValue, 2000)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOverruncountAttribute_2() + CHIP_ERROR TestWritesTheLimitOfAbsMinHeatSetpointLimitToMaxHeatSetpointLimitAttribute_19() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOverrunCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the Overruncount attribute Error: %@", err); + id maxHeatSetpointLimitArgument; + maxHeatSetpointLimitArgument = [NSNumber numberWithShort:700]; + [cluster writeAttributeMaxHeatSetpointLimitWithValue:maxHeatSetpointLimitArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes the limit of AbsMinHeatSetpointLimit to MaxHeatSetpointLimit " + @"attribute Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWritesTheLimitOfAbsMaxHeatSetpointLimitToMaxHeatSetpointLimitAttribute_20() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id maxHeatSetpointLimitArgument; + maxHeatSetpointLimitArgument = [NSNumber numberWithShort:3000]; + [cluster writeAttributeMaxHeatSetpointLimitWithValue:maxHeatSetpointLimitArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes the limit of AbsMaxHeatSetpointLimit to MaxHeatSetpointLimit " + @"attribute Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadsMinCoolSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_21() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMinCoolSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog( + @"Reads MinCoolSetpointLimit attribute from Server DUT and verifies that the value is within range Error: %@", err); + + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("OverrunCount", actualValue, 0ULL)); + VerifyOrReturn(CheckValue("min cool setpoint limit", actualValue, 1600)); + } + + VerifyOrReturn(CheckConstraintType("minCoolSetpointLimit", "", "int16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("minCoolSetpointLimit", [value shortValue], 1600)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("minCoolSetpointLimit", [value shortValue], 3200)); } NextTest(); @@ -40708,1306 +47583,1109 @@ class Test_TC_DIAG_TH_NW_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } -}; -class Test_TC_DIAG_TH_NW_1_2 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_DIAG_TH_NW_1_2() - : TestCommandBridge("Test_TC_DIAG_TH_NW_1_2") - , mTestIndex(0) + CHIP_ERROR TestWritesAValueBackThatIsDifferentButValidForMinCoolSetpointLimitAttribute_22() { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id minCoolSetpointLimitArgument; + minCoolSetpointLimitArgument = [NSNumber numberWithShort:2000]; + [cluster writeAttributeMinCoolSetpointLimitWithValue:minCoolSetpointLimitArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes a value back that is different but valid for MinCoolSetpointLimit " + @"attribute Error: %@", + err); + + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_DIAG_TH_NW_1_2() {} + CHIP_ERROR TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMinCoolSetpointLimitAttribute_23() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - /////////// TestCommand Interface ///////// - void NextTest() override + [cluster readAttributeMinCoolSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads it back again to confirm the successful write of MinCoolSetpointLimit attribute Error: %@", err); + + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("min cool setpoint limit", actualValue, 2000)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWritesTheLimitOfAbsMinCoolSetpointLimitToMinCoolSetpointLimitAttribute_24() { - CHIP_ERROR err = CHIP_NO_ERROR; + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_DIAG_TH_NW_1_2\n"); - } + id minCoolSetpointLimitArgument; + minCoolSetpointLimitArgument = [NSNumber numberWithShort:1600]; + [cluster writeAttributeMinCoolSetpointLimitWithValue:minCoolSetpointLimitArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes the limit of AbsMinCoolSetpointLimit to MinCoolSetpointLimit " + @"attribute Error: %@", + err); - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DIAG_TH_NW_1_2\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } - 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 : Validate constraints of attribute: Channel\n"); - err = TestValidateConstraintsOfAttributeChannel_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Validate constraints of attribute: NetworkName\n"); - err = TestValidateConstraintsOfAttributeNetworkName_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Validate constraints of attribute: PanId\n"); - err = TestValidateConstraintsOfAttributePanId_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Validate constraints of attribute: ExtendedPanId\n"); - err = TestValidateConstraintsOfAttributeExtendedPanId_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Validate constraints of attribute: OverrunCount\n"); - err = TestValidateConstraintsOfAttributeOverrunCount_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : read PartitionId attribute value\n"); - err = TestReadPartitionIdAttributeValue_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Validate constraints of attribute: PartitionId\n"); - err = TestValidateConstraintsOfAttributePartitionId_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : read Weighting attribute value\n"); - err = TestReadWeightingAttributeValue_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Validate constraints of attribute: weighting\n"); - err = TestValidateConstraintsOfAttributeWeighting_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : read DataVersion attribute value\n"); - err = TestReadDataVersionAttributeValue_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Validate constraints of attribute: DataVersion\n"); - err = TestValidateConstraintsOfAttributeDataVersion_11(); - break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : read StableDataVersion attribute value\n"); - err = TestReadStableDataVersionAttributeValue_12(); - break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Validate constraints of attribute: StableDataVersion\n"); - err = TestValidateConstraintsOfAttributeStableDataVersion_13(); - break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : read LeaderRouterId attribute value\n"); - err = TestReadLeaderRouterIdAttributeValue_14(); - break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Validate constraints of attribute: LeaderRouterId\n"); - err = TestValidateConstraintsOfAttributeLeaderRouterId_15(); - break; - case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : read DetachedRoleCount attribute value\n"); - err = TestReadDetachedRoleCountAttributeValue_16(); - break; - case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : Validate constraints of attribute: DetachedRoleCount\n"); - err = TestValidateConstraintsOfAttributeDetachedRoleCount_17(); - break; - case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : read ChildRoleCount attribute value\n"); - err = TestReadChildRoleCountAttributeValue_18(); - break; - case 19: - ChipLogProgress(chipTool, " ***** Test Step 19 : Validate constraints of attribute: ChildRoleCount\n"); - err = TestValidateConstraintsOfAttributeChildRoleCount_19(); - break; - case 20: - ChipLogProgress(chipTool, " ***** Test Step 20 : read RouterRoleCount attribute value\n"); - err = TestReadRouterRoleCountAttributeValue_20(); - break; - case 21: - ChipLogProgress(chipTool, " ***** Test Step 21 : Validate constraints of attribute: RouterRoleCount\n"); - err = TestValidateConstraintsOfAttributeRouterRoleCount_21(); - break; - case 22: - ChipLogProgress(chipTool, " ***** Test Step 22 : read LeaderRoleCount attribute value\n"); - err = TestReadLeaderRoleCountAttributeValue_22(); - break; - case 23: - ChipLogProgress(chipTool, " ***** Test Step 23 : Validate constraints of attribute: LeaderRoleCount\n"); - err = TestValidateConstraintsOfAttributeLeaderRoleCount_23(); - break; - case 24: - ChipLogProgress(chipTool, " ***** Test Step 24 : read AttachAttemptCount attribute value\n"); - err = TestReadAttachAttemptCountAttributeValue_24(); - break; - case 25: - ChipLogProgress(chipTool, " ***** Test Step 25 : Validate constraints of attribute: AttachAttemptCount\n"); - err = TestValidateConstraintsOfAttributeAttachAttemptCount_25(); - break; - case 26: - ChipLogProgress(chipTool, " ***** Test Step 26 : read PartitionIdChangeCount attribute value\n"); - err = TestReadPartitionIdChangeCountAttributeValue_26(); - break; - case 27: - ChipLogProgress(chipTool, " ***** Test Step 27 : Validate constraints of attribute: PartitionIdChangeCount\n"); - err = TestValidateConstraintsOfAttributePartitionIdChangeCount_27(); - break; - case 28: - ChipLogProgress(chipTool, " ***** Test Step 28 : read BetterPartitionAttachAttemptCount attribute value\n"); - err = TestReadBetterPartitionAttachAttemptCountAttributeValue_28(); - break; - case 29: - ChipLogProgress( - chipTool, " ***** Test Step 29 : Validate constraints of attribute: BetterPartitionAttachAttemptCount\n"); - err = TestValidateConstraintsOfAttributeBetterPartitionAttachAttemptCount_29(); - break; - case 30: - ChipLogProgress(chipTool, " ***** Test Step 30 : read ParentChangeCount attribute value\n"); - err = TestReadParentChangeCountAttributeValue_30(); - break; - case 31: - ChipLogProgress(chipTool, " ***** Test Step 31 : Validate constraints of attribute: ParentChangeCount\n"); - err = TestValidateConstraintsOfAttributeParentChangeCount_31(); - break; - case 32: - ChipLogProgress(chipTool, " ***** Test Step 32 : read TxTotalCount attribute value\n"); - err = TestReadTxTotalCountAttributeValue_32(); - break; - case 33: - ChipLogProgress(chipTool, " ***** Test Step 33 : Validate constraints of attribute: TxTotalCount\n"); - err = TestValidateConstraintsOfAttributeTxTotalCount_33(); - break; - case 34: - ChipLogProgress(chipTool, " ***** Test Step 34 : read TxUnicastCount attribute value\n"); - err = TestReadTxUnicastCountAttributeValue_34(); - break; - case 35: - ChipLogProgress(chipTool, " ***** Test Step 35 : Validate constraints of attribute: TxUnicastCount\n"); - err = TestValidateConstraintsOfAttributeTxUnicastCount_35(); - break; - case 36: - ChipLogProgress(chipTool, " ***** Test Step 36 : read TxBroadcastCount attribute value\n"); - err = TestReadTxBroadcastCountAttributeValue_36(); - break; - case 37: - ChipLogProgress(chipTool, " ***** Test Step 37 : Validate constraints of attribute: TxBroadcastCount\n"); - err = TestValidateConstraintsOfAttributeTxBroadcastCount_37(); - break; - case 38: - ChipLogProgress(chipTool, " ***** Test Step 38 : read TxNoAckRequestedCount attribute value\n"); - err = TestReadTxNoAckRequestedCountAttributeValue_38(); - break; - case 39: - ChipLogProgress(chipTool, " ***** Test Step 39 : Validate constraints of attribute: TxNoAckRequestedCount\n"); - err = TestValidateConstraintsOfAttributeTxNoAckRequestedCount_39(); - break; - case 40: - ChipLogProgress(chipTool, " ***** Test Step 40 : read TxDataCount attribute value\n"); - err = TestReadTxDataCountAttributeValue_40(); - break; - case 41: - ChipLogProgress(chipTool, " ***** Test Step 41 : Validate constraints of attribute: TxDataCount\n"); - err = TestValidateConstraintsOfAttributeTxDataCount_41(); - break; - case 42: - ChipLogProgress(chipTool, " ***** Test Step 42 : read TxDataPollCount attribute value\n"); - err = TestReadTxDataPollCountAttributeValue_42(); - break; - case 43: - ChipLogProgress(chipTool, " ***** Test Step 43 : Validate constraints of attribute: TxDataPollCount\n"); - err = TestValidateConstraintsOfAttributeTxDataPollCount_43(); - break; - case 44: - ChipLogProgress(chipTool, " ***** Test Step 44 : read TxBeaconCount attribute value\n"); - err = TestReadTxBeaconCountAttributeValue_44(); - break; - case 45: - ChipLogProgress(chipTool, " ***** Test Step 45 : Validate constraints of attribute: TxBeaconCount\n"); - err = TestValidateConstraintsOfAttributeTxBeaconCount_45(); - break; - case 46: - ChipLogProgress(chipTool, " ***** Test Step 46 : read TxBeaconRequestCount attribute value\n"); - err = TestReadTxBeaconRequestCountAttributeValue_46(); - break; - case 47: - ChipLogProgress(chipTool, " ***** Test Step 47 : Validate constraints of attribute: TxBeaconRequestCount\n"); - err = TestValidateConstraintsOfAttributeTxBeaconRequestCount_47(); - break; - case 48: - ChipLogProgress(chipTool, " ***** Test Step 48 : read TxOtherCount attribute value\n"); - err = TestReadTxOtherCountAttributeValue_48(); - break; - case 49: - ChipLogProgress(chipTool, " ***** Test Step 49 : Validate constraints of attribute: TxOtherCount\n"); - err = TestValidateConstraintsOfAttributeTxOtherCount_49(); - break; - case 50: - ChipLogProgress(chipTool, " ***** Test Step 50 : read TxRetryCount attribute value\n"); - err = TestReadTxRetryCountAttributeValue_50(); - break; - case 51: - ChipLogProgress(chipTool, " ***** Test Step 51 : Validate constraints of attribute: TxRetryCount\n"); - err = TestValidateConstraintsOfAttributeTxRetryCount_51(); - break; - case 52: - ChipLogProgress(chipTool, " ***** Test Step 52 : read TxDirectMaxRetryExpiryCount attribute value\n"); - err = TestReadTxDirectMaxRetryExpiryCountAttributeValue_52(); - break; - case 53: - ChipLogProgress(chipTool, " ***** Test Step 53 : Validate constraints of attribute: TxDirectMaxRetryExpiryCount\n"); - err = TestValidateConstraintsOfAttributeTxDirectMaxRetryExpiryCount_53(); - break; - case 54: - ChipLogProgress(chipTool, " ***** Test Step 54 : read TxIndirectMaxRetryExpiryCount attribute value\n"); - err = TestReadTxIndirectMaxRetryExpiryCountAttributeValue_54(); - break; - case 55: - ChipLogProgress(chipTool, " ***** Test Step 55 : Validate constraints of attribute: TxIndirectMaxRetryExpiryCount\n"); - err = TestValidateConstraintsOfAttributeTxIndirectMaxRetryExpiryCount_55(); - break; - case 56: - ChipLogProgress(chipTool, " ***** Test Step 56 : read TxErrCcaCount attribute value\n"); - err = TestReadTxErrCcaCountAttributeValue_56(); - break; - case 57: - ChipLogProgress(chipTool, " ***** Test Step 57 : Validate constraints of attribute: TxErrCcaCount\n"); - err = TestValidateConstraintsOfAttributeTxErrCcaCount_57(); - break; - case 58: - ChipLogProgress(chipTool, " ***** Test Step 58 : read TxErrAbortCount attribute value\n"); - err = TestReadTxErrAbortCountAttributeValue_58(); - break; - case 59: - ChipLogProgress(chipTool, " ***** Test Step 59 : Validate constraints of attribute: TxErrAbortCount\n"); - err = TestValidateConstraintsOfAttributeTxErrAbortCount_59(); - break; - case 60: - ChipLogProgress(chipTool, " ***** Test Step 60 : read TxErrBusyChannelCount attribute value\n"); - err = TestReadTxErrBusyChannelCountAttributeValue_60(); - break; - case 61: - ChipLogProgress(chipTool, " ***** Test Step 61 : Validate constraints of attribute: TxErrBusyChannelCount\n"); - err = TestValidateConstraintsOfAttributeTxErrBusyChannelCount_61(); - break; - case 62: - ChipLogProgress(chipTool, " ***** Test Step 62 : read RxTotalCount attribute value\n"); - err = TestReadRxTotalCountAttributeValue_62(); - break; - case 63: - ChipLogProgress(chipTool, " ***** Test Step 63 : Validate constraints of attribute: RxTotalCount\n"); - err = TestValidateConstraintsOfAttributeRxTotalCount_63(); - break; - case 64: - ChipLogProgress(chipTool, " ***** Test Step 64 : read RxUnicastCount attribute value\n"); - err = TestReadRxUnicastCountAttributeValue_64(); - break; - case 65: - ChipLogProgress(chipTool, " ***** Test Step 65 : Validate constraints of attribute: RxUnicastCount\n"); - err = TestValidateConstraintsOfAttributeRxUnicastCount_65(); - break; - case 66: - ChipLogProgress(chipTool, " ***** Test Step 66 : read RxBroadcastCount attribute value\n"); - err = TestReadRxBroadcastCountAttributeValue_66(); - break; - case 67: - ChipLogProgress(chipTool, " ***** Test Step 67 : Validate constraints of attribute: RxBroadcastCount\n"); - err = TestValidateConstraintsOfAttributeRxBroadcastCount_67(); - break; - case 68: - ChipLogProgress(chipTool, " ***** Test Step 68 : read RxDataCount attribute value\n"); - err = TestReadRxDataCountAttributeValue_68(); - break; - case 69: - ChipLogProgress(chipTool, " ***** Test Step 69 : Validate constraints of attribute: RxDataCount\n"); - err = TestValidateConstraintsOfAttributeRxDataCount_69(); - break; - case 70: - ChipLogProgress(chipTool, " ***** Test Step 70 : read RxDataPollCount attribute value\n"); - err = TestReadRxDataPollCountAttributeValue_70(); - break; - case 71: - ChipLogProgress(chipTool, " ***** Test Step 71 : Validate constraints of attribute: RxDataPollCount\n"); - err = TestValidateConstraintsOfAttributeRxDataPollCount_71(); - break; - case 72: - ChipLogProgress(chipTool, " ***** Test Step 72 : read RxBeaconCount attribute value\n"); - err = TestReadRxBeaconCountAttributeValue_72(); - break; - case 73: - ChipLogProgress(chipTool, " ***** Test Step 73 : Validate constraints of attribute: RxBeaconCount\n"); - err = TestValidateConstraintsOfAttributeRxBeaconCount_73(); - break; - case 74: - ChipLogProgress(chipTool, " ***** Test Step 74 : read RxBeaconRequestCount attribute value\n"); - err = TestReadRxBeaconRequestCountAttributeValue_74(); - break; - case 75: - ChipLogProgress(chipTool, " ***** Test Step 75 : Validate constraints of attribute: RxBeaconRequestCount\n"); - err = TestValidateConstraintsOfAttributeRxBeaconRequestCount_75(); - break; - case 76: - ChipLogProgress(chipTool, " ***** Test Step 76 : read RxOtherCount attribute value\n"); - err = TestReadRxOtherCountAttributeValue_76(); - break; - case 77: - ChipLogProgress(chipTool, " ***** Test Step 77 : Validate constraints of attribute: RxOtherCount\n"); - err = TestValidateConstraintsOfAttributeRxOtherCount_77(); - break; - case 78: - ChipLogProgress(chipTool, " ***** Test Step 78 : read RxAddressFilteredCount attribute value\n"); - err = TestReadRxAddressFilteredCountAttributeValue_78(); - break; - case 79: - ChipLogProgress(chipTool, " ***** Test Step 79 : Validate constraints of attribute: RxAddressFilteredCount\n"); - err = TestValidateConstraintsOfAttributeRxAddressFilteredCount_79(); - break; - case 80: - ChipLogProgress(chipTool, " ***** Test Step 80 : read RxDestAddrFilteredCount attribute value\n"); - err = TestReadRxDestAddrFilteredCountAttributeValue_80(); - break; - case 81: - ChipLogProgress(chipTool, " ***** Test Step 81 : Validate constraints of attribute: RxDestAddrFilteredCount\n"); - err = TestValidateConstraintsOfAttributeRxDestAddrFilteredCount_81(); - break; - case 82: - ChipLogProgress(chipTool, " ***** Test Step 82 : read RxDuplicatedCount attribute value\n"); - err = TestReadRxDuplicatedCountAttributeValue_82(); - break; - case 83: - ChipLogProgress(chipTool, " ***** Test Step 83 : Validate constraints of attribute: RxDuplicatedCount\n"); - err = TestValidateConstraintsOfAttributeRxDuplicatedCount_83(); - break; - case 84: - ChipLogProgress(chipTool, " ***** Test Step 84 : read RxErrNoFrameCount attribute value\n"); - err = TestReadRxErrNoFrameCountAttributeValue_84(); - break; - case 85: - ChipLogProgress(chipTool, " ***** Test Step 85 : Validate constraints of attribute: RxErrNoFrameCount\n"); - err = TestValidateConstraintsOfAttributeRxErrNoFrameCount_85(); - break; - case 86: - ChipLogProgress(chipTool, " ***** Test Step 86 : read RxErrUnknownNeighborCount attribute value\n"); - err = TestReadRxErrUnknownNeighborCountAttributeValue_86(); - break; - case 87: - ChipLogProgress(chipTool, " ***** Test Step 87 : Validate constraints of attribute: RxErrUnknownNeighborCount\n"); - err = TestValidateConstraintsOfAttributeRxErrUnknownNeighborCount_87(); - break; - case 88: - ChipLogProgress(chipTool, " ***** Test Step 88 : read RxErrInvalidScrAddrCount attribute value\n"); - err = TestReadRxErrInvalidScrAddrCountAttributeValue_88(); - break; - case 89: - ChipLogProgress(chipTool, " ***** Test Step 89 : Validate constraints of attribute: RxErrInvalidSrcAddrCount\n"); - err = TestValidateConstraintsOfAttributeRxErrInvalidSrcAddrCount_89(); - break; - case 90: - ChipLogProgress(chipTool, " ***** Test Step 90 : read RxErrSecCount attribute value\n"); - err = TestReadRxErrSecCountAttributeValue_90(); - break; - case 91: - ChipLogProgress(chipTool, " ***** Test Step 91 : Validate constraints of attribute: RxErrInvalidSrcAddrCount\n"); - err = TestValidateConstraintsOfAttributeRxErrInvalidSrcAddrCount_91(); - break; - case 92: - ChipLogProgress(chipTool, " ***** Test Step 92 : read RxErrFcsCount attribute value\n"); - err = TestReadRxErrFcsCountAttributeValue_92(); - break; - case 93: - ChipLogProgress(chipTool, " ***** Test Step 93 : Validate constraints of attribute: RxErrFcsCount\n"); - err = TestValidateConstraintsOfAttributeRxErrFcsCount_93(); - break; - case 94: - ChipLogProgress(chipTool, " ***** Test Step 94 : read RxErrOtherCount attribute value\n"); - err = TestReadRxErrOtherCountAttributeValue_94(); - break; - case 95: - ChipLogProgress(chipTool, " ***** Test Step 95 : Validate constraints of attribute: RxErrOtherCount\n"); - err = TestValidateConstraintsOfAttributeRxErrOtherCount_95(); - break; - case 96: - ChipLogProgress(chipTool, " ***** Test Step 96 : read ActiveTimestamp attribute value\n"); - err = TestReadActiveTimestampAttributeValue_96(); - break; - case 97: - ChipLogProgress(chipTool, " ***** Test Step 97 : Validate constraints of attribute: ActiveTimestamp\n"); - err = TestValidateConstraintsOfAttributeActiveTimestamp_97(); - break; - case 98: - ChipLogProgress(chipTool, " ***** Test Step 98 : read PendingTimestamp attribute value\n"); - err = TestReadPendingTimestampAttributeValue_98(); - break; - case 99: - ChipLogProgress(chipTool, " ***** Test Step 99 : Validate constraints of attribute: PendingTimestamp\n"); - err = TestValidateConstraintsOfAttributePendingTimestamp_99(); - break; - case 100: - ChipLogProgress(chipTool, " ***** Test Step 100 : read Delay attribute value\n"); - err = TestReadDelayAttributeValue_100(); - break; - case 101: - ChipLogProgress(chipTool, " ***** Test Step 101 : Validate constraints of attribute: delay\n"); - err = TestValidateConstraintsOfAttributeDelay_101(); - 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 = 102; - - 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 TestValidateConstraintsOfAttributeChannel_1() + CHIP_ERROR TestWritesTheLimitOfMaxCoolSetpointLimitToMinCoolSetpointLimitAttribute_25() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeChannelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: Channel Error: %@", err); + id minCoolSetpointLimitArgument; + minCoolSetpointLimitArgument = [NSNumber numberWithShort:3200]; + [cluster writeAttributeMinCoolSetpointLimitWithValue:minCoolSetpointLimitArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes the limit of MaxCoolSetpointLimit to MinCoolSetpointLimit attribute " + @"Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, 0)); + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } - VerifyOrReturn(CheckConstraintType("channel", "", "uint16")); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestValidateConstraintsOfAttributeNetworkName_2() + CHIP_ERROR TestReadsMaxCoolSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_26() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNetworkNameWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: NetworkName Error: %@", err); + [cluster readAttributeMaxCoolSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog( + @"Reads MaxCoolSetpointLimit attribute from Server DUT and verifies that the value is within range Error: %@", err); + + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("networkName", "", "string")); - VerifyOrReturn(CheckConstraintMaxLength("networkName", [value length], 16)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("max cool setpoint limit", actualValue, 3200)); + } + + VerifyOrReturn(CheckConstraintType("maxCoolSetpointLimit", "", "int16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("maxCoolSetpointLimit", [value shortValue], 1600)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("maxCoolSetpointLimit", [value shortValue], 3200)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestValidateConstraintsOfAttributePanId_3() + CHIP_ERROR TestWritesAValueBackThatIsDifferentButValidForMaxCoolSetpointLimitAttribute_27() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributePanIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: PanId Error: %@", err); + id maxCoolSetpointLimitArgument; + maxCoolSetpointLimitArgument = [NSNumber numberWithShort:2000]; + [cluster writeAttributeMaxCoolSetpointLimitWithValue:maxCoolSetpointLimitArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes a value back that is different but valid for MaxCoolSetpointLimit " + @"attribute Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, 0)); + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } - VerifyOrReturn(CheckConstraintType("panId", "", "uint16")); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestValidateConstraintsOfAttributeExtendedPanId_4() + CHIP_ERROR TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMaxCoolSetpointLimitAttribute_28() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeExtendedPanIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: ExtendedPanId Error: %@", err); + [cluster readAttributeMaxCoolSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads it back again to confirm the successful write of MaxCoolSetpointLimit attribute Error: %@", err); + + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("extendedPanId", "", "uint64")); + { + id actualValue = value; + VerifyOrReturn(CheckValue("max cool setpoint limit", actualValue, 2000)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestValidateConstraintsOfAttributeOverrunCount_5() + CHIP_ERROR TestWritesTheLimitOfAbsMinCoolSetpointLimitToMaxCoolSetpointLimitAttribute_29() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOverrunCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: OverrunCount Error: %@", err); + id maxCoolSetpointLimitArgument; + maxCoolSetpointLimitArgument = [NSNumber numberWithShort:1600]; + [cluster writeAttributeMaxCoolSetpointLimitWithValue:maxCoolSetpointLimitArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes the limit of AbsMinCoolSetpointLimit to MaxCoolSetpointLimit " + @"attribute Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, 0)); + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } - VerifyOrReturn(CheckConstraintType("overrunCount", "", "uint64")); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadPartitionIdAttributeValue_6() + CHIP_ERROR TestWritesTheLimitOfMaxCoolSetpointLimitToMaxCoolSetpointLimitAttribute_30() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributePartitionIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read PartitionId attribute value Error: %@", err); + id maxCoolSetpointLimitArgument; + maxCoolSetpointLimitArgument = [NSNumber numberWithShort:3200]; + [cluster writeAttributeMaxCoolSetpointLimitWithValue:maxCoolSetpointLimitArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes the limit of MaxCoolSetpointLimit to MaxCoolSetpointLimit attribute " + @"Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, 0)); + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } - { - id actualValue = value; - VerifyOrReturn(CheckValue("PartitionId", actualValue, 0UL)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestValidateConstraintsOfAttributePartitionId_7() + CHIP_ERROR TestWritesSetsBackTheLimitOfMinHeatSetpointLimitToMinHeatSetpointLimitAttribute_31() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributePartitionIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: PartitionId Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id minHeatSetpointLimitArgument; + minHeatSetpointLimitArgument = [NSNumber numberWithShort:700]; + [cluster writeAttributeMinHeatSetpointLimitWithValue:minHeatSetpointLimitArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes (sets back) the limit of MinHeatSetpointLimit to " + @"MinHeatSetpointLimit attribute Error: %@", + err); - VerifyOrReturn(CheckConstraintType("partitionId", "", "uint32")); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadWeightingAttributeValue_8() + CHIP_ERROR TestWritesSetsBackTheLimitOfMaxHeatSetpointLimitToMinHeatSetpointLimitAttribute_32() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeWeightingWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read Weighting attribute value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id minHeatSetpointLimitArgument; + minHeatSetpointLimitArgument = [NSNumber numberWithShort:3000]; + [cluster writeAttributeMinHeatSetpointLimitWithValue:minHeatSetpointLimitArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes (sets back) the limit of MaxHeatSetpointLimit to " + @"MinHeatSetpointLimit attribute Error: %@", + err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("weighting", actualValue, 0)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestValidateConstraintsOfAttributeWeighting_9() + CHIP_ERROR TestWritesSetsBackTheLimitOfMinHeatSetpointLimitToMaxHeatSetpointLimitAttribute_33() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeWeightingWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: weighting Error: %@", err); + id maxHeatSetpointLimitArgument; + maxHeatSetpointLimitArgument = [NSNumber numberWithShort:700]; + [cluster writeAttributeMaxHeatSetpointLimitWithValue:maxHeatSetpointLimitArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes (sets back) the limit of MinHeatSetpointLimit to " + @"MaxHeatSetpointLimit attribute Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("weighting", "", "uint8")); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadDataVersionAttributeValue_10() + CHIP_ERROR TestWritesSetsBackTheLimitOfMaxHeatSetpointLimitToMaxHeatSetpointLimitAttribute_34() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeDataVersionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read DataVersion attribute value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id maxHeatSetpointLimitArgument; + maxHeatSetpointLimitArgument = [NSNumber numberWithShort:3000]; + [cluster writeAttributeMaxHeatSetpointLimitWithValue:maxHeatSetpointLimitArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes (sets back) the limit of MaxHeatSetpointLimit to " + @"MaxHeatSetpointLimit attribute Error: %@", + err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("DataVersion", actualValue, 0)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestValidateConstraintsOfAttributeDataVersion_11() + CHIP_ERROR TestWritesSetsBackTheLimitOfMinCoolSetpointLimitToMinCoolSetpointLimitAttribute_35() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeDataVersionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: DataVersion Error: %@", err); + id minCoolSetpointLimitArgument; + minCoolSetpointLimitArgument = [NSNumber numberWithShort:1600]; + [cluster writeAttributeMinCoolSetpointLimitWithValue:minCoolSetpointLimitArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes (sets back) the limit of MinCoolSetpointLimit to " + @"MinCoolSetpointLimit attribute Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, 0)); + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } - VerifyOrReturn(CheckConstraintType("dataVersion", "", "uint8")); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadStableDataVersionAttributeValue_12() + CHIP_ERROR TestWritesSetsBackTheLimitOfMaxCoolSetpointLimitToMinCoolSetpointLimitAttribute_36() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeStableDataVersionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read StableDataVersion attribute value Error: %@", err); + id minCoolSetpointLimitArgument; + minCoolSetpointLimitArgument = [NSNumber numberWithShort:3200]; + [cluster writeAttributeMinCoolSetpointLimitWithValue:minCoolSetpointLimitArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes (sets back) the limit of MaxCoolSetpointLimit to " + @"MinCoolSetpointLimit attribute Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, 0)); + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } - { - id actualValue = value; - VerifyOrReturn(CheckValue("StableDataVersion", actualValue, 0)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestValidateConstraintsOfAttributeStableDataVersion_13() + CHIP_ERROR TestWritesSetsBackTheLimitOfMinCoolSetpointLimitToMaxCoolSetpointLimitAttribute_37() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeStableDataVersionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: StableDataVersion Error: %@", err); + id maxCoolSetpointLimitArgument; + maxCoolSetpointLimitArgument = [NSNumber numberWithShort:1600]; + [cluster writeAttributeMaxCoolSetpointLimitWithValue:maxCoolSetpointLimitArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes (sets back) the limit of MinCoolSetpointLimit to " + @"MaxCoolSetpointLimit attribute Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, 0)); + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } - VerifyOrReturn(CheckConstraintType("stableDataVersion", "", "uint8")); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadLeaderRouterIdAttributeValue_14() + CHIP_ERROR TestWritesSetsBackTheLimitOfMaxCoolSetpointLimitToMaxCoolSetpointLimitAttribute_38() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeLeaderRouterIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read LeaderRouterId attribute value Error: %@", err); + id maxCoolSetpointLimitArgument; + maxCoolSetpointLimitArgument = [NSNumber numberWithShort:3200]; + [cluster writeAttributeMaxCoolSetpointLimitWithValue:maxCoolSetpointLimitArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes (sets back) the limit of MaxCoolSetpointLimit to " + @"MaxCoolSetpointLimit attribute Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, 0)); + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } - { - id actualValue = value; - VerifyOrReturn(CheckValue("LeaderRouterId", actualValue, 0)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestValidateConstraintsOfAttributeLeaderRouterId_15() + CHIP_ERROR TestReadsControlSequenceOfOperationFromServerDutAndVerifiesThatTheValueIsValid_39() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeLeaderRouterIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: LeaderRouterId Error: %@", err); + [cluster + readAttributeControlSequenceOfOperationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads ControlSequenceOfOperation from Server DUT and verifies that the value is valid Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("leaderRouterId", "", "uint8")); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValue("control sequence of operation", actualValue, 4)); + } + + VerifyOrReturn(CheckConstraintType("controlSequenceOfOperation", "", "enum8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("controlSequenceOfOperation", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("controlSequenceOfOperation", [value unsignedCharValue], 5)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadDetachedRoleCountAttributeValue_16() + CHIP_ERROR TestWriteAttributeCommandForControlSequenceOfOperationWithANewValidValue_40() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeDetachedRoleCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read DetachedRoleCount attribute value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id controlSequenceOfOperationArgument; + controlSequenceOfOperationArgument = [NSNumber numberWithUnsignedChar:2]; + [cluster writeAttributeControlSequenceOfOperationWithValue:controlSequenceOfOperationArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write Attribute command for ControlSequenceOfOperation with a new " + @"valid value Error: %@", + err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("DetachedRoleCount", actualValue, 0U)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestValidateConstraintsOfAttributeDetachedRoleCount_17() + CHIP_ERROR TestReadItBackAgainToConfirmTheSuccessfulWrite_41() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeDetachedRoleCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: DetachedRoleCount Error: %@", err); + [cluster + readAttributeControlSequenceOfOperationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read it back again to confirm the successful write Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("detachedRoleCount", "", "uint16")); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValue("control sequence of operation", actualValue, 2)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadChildRoleCountAttributeValue_18() + CHIP_ERROR TestSetsOccupiedHeatingSetpointToDefaultValue_42() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeChildRoleCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read ChildRoleCount attribute value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id occupiedHeatingSetpointArgument; + occupiedHeatingSetpointArgument = [NSNumber numberWithShort:2000]; + [cluster writeAttributeOccupiedHeatingSetpointWithValue:occupiedHeatingSetpointArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Sets OccupiedHeatingSetpoint to default value Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("ChildRoleCount", actualValue, 0U)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestValidateConstraintsOfAttributeChildRoleCount_19() + CHIP_ERROR TestSetsOccupiedHeatingSetpointToDefaultValue_43() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeChildRoleCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: ChildRoleCount Error: %@", err); + id occupiedHeatingSetpointArgument; + occupiedHeatingSetpointArgument = [NSNumber numberWithShort:2000]; + [cluster writeAttributeOccupiedHeatingSetpointWithValue:occupiedHeatingSetpointArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Sets OccupiedHeatingSetpoint to default value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("childRoleCount", "", "uint16")); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadRouterRoleCountAttributeValue_20() + CHIP_ERROR TestSetsOccupiedCoolingSetpointToDefaultValue_44() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeRouterRoleCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read RouterRoleCount attribute value Error: %@", err); + id occupiedCoolingSetpointArgument; + occupiedCoolingSetpointArgument = [NSNumber numberWithShort:2600]; + [cluster writeAttributeOccupiedCoolingSetpointWithValue:occupiedCoolingSetpointArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Sets OccupiedCoolingSetpoint to default value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } - { - id actualValue = value; - VerifyOrReturn(CheckValue("RouterRoleCount", actualValue, 0U)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestValidateConstraintsOfAttributeRouterRoleCount_21() + CHIP_ERROR TestSetsOccupiedCoolingSetpointToDefaultValue_45() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeRouterRoleCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: RouterRoleCount Error: %@", err); + id occupiedCoolingSetpointArgument; + occupiedCoolingSetpointArgument = [NSNumber numberWithShort:2600]; + [cluster writeAttributeOccupiedCoolingSetpointWithValue:occupiedCoolingSetpointArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Sets OccupiedCoolingSetpoint to default value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } - VerifyOrReturn(CheckConstraintType("routerRoleCount", "", "uint16")); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadLeaderRoleCountAttributeValue_22() + CHIP_ERROR TestSetsOccupiedCoolingSetpointToDefaultValue_46() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeLeaderRoleCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read LeaderRoleCount attribute value Error: %@", err); + id occupiedCoolingSetpointArgument; + occupiedCoolingSetpointArgument = [NSNumber numberWithShort:2600]; + [cluster writeAttributeOccupiedCoolingSetpointWithValue:occupiedCoolingSetpointArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Sets OccupiedCoolingSetpoint to default value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } - { - id actualValue = value; - VerifyOrReturn(CheckValue("LeaderRoleCount", actualValue, 0U)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestValidateConstraintsOfAttributeLeaderRoleCount_23() + CHIP_ERROR TestSetsOccupiedHeatingSetpointToDefaultValue_47() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeLeaderRoleCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: LeaderRoleCount Error: %@", err); + id occupiedHeatingSetpointArgument; + occupiedHeatingSetpointArgument = [NSNumber numberWithShort:2000]; + [cluster writeAttributeOccupiedHeatingSetpointWithValue:occupiedHeatingSetpointArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Sets OccupiedHeatingSetpoint to default value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("leaderRoleCount", "", "uint16")); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttachAttemptCountAttributeValue_24() + CHIP_ERROR TestSetsOccupiedCoolingSetpointToDefaultValue_48() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAttachAttemptCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read AttachAttemptCount attribute value Error: %@", err); + id occupiedCoolingSetpointArgument; + occupiedCoolingSetpointArgument = [NSNumber numberWithShort:2600]; + [cluster writeAttributeOccupiedCoolingSetpointWithValue:occupiedCoolingSetpointArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Sets OccupiedCoolingSetpoint to default value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } - { - id actualValue = value; - VerifyOrReturn(CheckValue("AttachAttemptCount", actualValue, 0U)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestValidateConstraintsOfAttributeAttachAttemptCount_25() + CHIP_ERROR TestSetsOccupiedHeatingSetpointToDefaultValue_49() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAttachAttemptCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: AttachAttemptCount Error: %@", err); + id occupiedHeatingSetpointArgument; + occupiedHeatingSetpointArgument = [NSNumber numberWithShort:2000]; + [cluster writeAttributeOccupiedHeatingSetpointWithValue:occupiedHeatingSetpointArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Sets OccupiedHeatingSetpoint to default value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("attachAttemptCount", "", "uint16")); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } +}; - CHIP_ERROR TestReadPartitionIdChangeCountAttributeValue_26() +class Test_TC_TSUIC_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_TSUIC_1_1() + : TestCommandBridge("Test_TC_TSUIC_1_1") + , mTestIndex(0) { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - 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 readAttributePartitionIdChangeCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read PartitionIdChangeCount attribute value Error: %@", err); + ~Test_TC_TSUIC_1_1() {} - VerifyOrReturn(CheckValue("status", err, 0)); + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; - { - id actualValue = value; - VerifyOrReturn(CheckValue("PartitionIdChangeCount", actualValue, 0U)); - } + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_TSUIC_1_1\n"); + } - NextTest(); - }]; + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TSUIC_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestValidateConstraintsOfAttributePartitionIdChangeCount_27() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributePartitionIdChangeCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: PartitionIdChangeCount Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + Wait(); - VerifyOrReturn(CheckConstraintType("partitionIdChangeCount", "", "uint16")); - 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 : Read ClusterRevision attribute from the DUT and Verify that the DUT response indicates " + "ClusterRevision attribute has the value 2\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadClusterRevisionAttributeFromTheDutAndVerifyThatTheDutResponseIndicatesClusterRevisionAttributeHasTheValue2_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: AttributeList\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeAttributeList_2(); + break; + case 3: + ChipLogProgress(chipTool, + " ***** Test Step 3 : 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_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; + } - return CHIP_NO_ERROR; + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - CHIP_ERROR TestReadBetterPartitionAttachAttemptCountAttributeValue_28() + void OnStatusUpdate(const chip::app::StatusIB & status) override { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } - [cluster readAttributeBetterPartitionAttachAttemptCountWithCompletionHandler:^( - NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read BetterPartitionAttachAttemptCount attribute value Error: %@", err); + // Go on to the next test. + WaitForMs(0); + } - VerifyOrReturn(CheckValue("status", err, 0)); + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } - { - id actualValue = value; - VerifyOrReturn(CheckValue("BetterPartitionAttachAttemptCount", actualValue, 0U)); - } +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 6; - NextTest(); - }]; + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity("alpha"); + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestValidateConstraintsOfAttributeBetterPartitionAttachAttemptCount_29() + CHIP_ERROR + TestReadClusterRevisionAttributeFromTheDutAndVerifyThatTheDutResponseIndicatesClusterRevisionAttributeHasTheValue2_1() { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeBetterPartitionAttachAttemptCountWithCompletionHandler:^( - NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: BetterPartitionAttachAttemptCount Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("betterPartitionAttachAttemptCount", "", "uint16")); - NextTest(); - }]; - + SetIdentity("alpha"); + UserPrompt(@"Please enter ClusterRevision attribute value", @"2"); return CHIP_NO_ERROR; } - CHIP_ERROR TestReadParentChangeCountAttributeValue_30() + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeParentChangeCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read ParentChangeCount attribute value Error: %@", err); + [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("ParentChangeCount", actualValue, 0U)); + VerifyOrReturn(CheckValue("AttributeList", [actualValue count], static_cast(3))); + VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); + VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); + VerifyOrReturn(CheckValue("", actualValue[2], 2UL)); } + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestValidateConstraintsOfAttributeParentChangeCount_31() + CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_3() { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeParentChangeCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: ParentChangeCount Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("parentChangeCount", "", "uint16")); - NextTest(); - }]; - + SetIdentity("alpha"); + UserPrompt(@"Please enter 'y' for success", @"y"); return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTxTotalCountAttributeValue_32() + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeTxTotalCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read TxTotalCount attribute value Error: %@", err); + [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("TxTotalCount", actualValue, 0UL)); + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); } + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestValidateConstraintsOfAttributeTxTotalCount_33() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeTxTotalCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: TxTotalCount Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("txTotalCount", "", "uint32")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTxUnicastCountAttributeValue_34() + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeTxUnicastCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read TxUnicastCount attribute value 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("TxUnicastCount", actualValue, 0UL)); + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); } + VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } +}; - CHIP_ERROR TestValidateConstraintsOfAttributeTxUnicastCount_35() +class Test_TC_TSUIC_2_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_TSUIC_2_1() + : TestCommandBridge("Test_TC_TSUIC_2_1") + , mTestIndex(0) { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeTxUnicastCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: TxUnicastCount Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("txUnicastCount", "", "uint32")); - 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 TestReadTxBroadcastCountAttributeValue_36() + ~Test_TC_TSUIC_2_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + CHIP_ERROR err = CHIP_NO_ERROR; - [cluster readAttributeTxBroadcastCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read TxBroadcastCount attribute value Error: %@", err); + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_TSUIC_2_1\n"); + } - VerifyOrReturn(CheckValue("status", err, 0)); + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TSUIC_2_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } - { - id actualValue = value; - VerifyOrReturn(CheckValue("TxBroadcastCount", actualValue, 0UL)); - } + 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 : read the mandatory attribute: TemperatureDisplayMode\n"); + err = TestReadTheMandatoryAttributeTemperatureDisplayMode_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : read the mandatory attribute: TemperatureDisplayMode\n"); + err = TestReadTheMandatoryAttributeTemperatureDisplayMode_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : read the mandatory attribute: KeypadLockout\n"); + err = TestReadTheMandatoryAttributeKeypadLockout_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : read the mandatory attribute: KeypadLockout\n"); + err = TestReadTheMandatoryAttributeKeypadLockout_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : read the optional attribute: ScheduleProgrammingVisibility\n"); + err = TestReadTheOptionalAttributeScheduleProgrammingVisibility_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : read the optional attribute: ScheduleProgrammingVisibility\n"); + err = TestReadTheOptionalAttributeScheduleProgrammingVisibility_6(); + break; + } - return CHIP_NO_ERROR; + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - CHIP_ERROR TestValidateConstraintsOfAttributeTxBroadcastCount_37() + void OnStatusUpdate(const chip::app::StatusIB & status) override { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } - [cluster readAttributeTxBroadcastCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: TxBroadcastCount Error: %@", err); + // Go on to the next test. + WaitForMs(0); + } - VerifyOrReturn(CheckValue("status", err, 0)); + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } - VerifyOrReturn(CheckConstraintType("txBroadcastCount", "", "uint32")); - NextTest(); - }]; +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() + { + SetIdentity("alpha"); + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTxNoAckRequestedCountAttributeValue_38() + CHIP_ERROR TestReadTheMandatoryAttributeTemperatureDisplayMode_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeTxNoAckRequestedCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read TxNoAckRequestedCount attribute value Error: %@", err); + [cluster readAttributeTemperatureDisplayModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the mandatory attribute: TemperatureDisplayMode Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("TxNoAckRequestedCount", actualValue, 0UL)); + VerifyOrReturn(CheckValue("temperature display mode", actualValue, 0)); } NextTest(); @@ -42016,42 +48694,49 @@ class Test_TC_DIAG_TH_NW_1_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestValidateConstraintsOfAttributeTxNoAckRequestedCount_39() + CHIP_ERROR TestReadTheMandatoryAttributeTemperatureDisplayMode_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeTxNoAckRequestedCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: TxNoAckRequestedCount Error: %@", err); + [cluster readAttributeTemperatureDisplayModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the mandatory attribute: TemperatureDisplayMode Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("txNoAckRequestedCount", "", "uint32")); + VerifyOrReturn(CheckConstraintType("temperatureDisplayMode", "", "enum8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("temperatureDisplayMode", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("temperatureDisplayMode", [value unsignedCharValue], 1)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTxDataCountAttributeValue_40() + CHIP_ERROR TestReadTheMandatoryAttributeKeypadLockout_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeTxDataCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read TxDataCount attribute value Error: %@", err); + [cluster readAttributeKeypadLockoutWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the mandatory attribute: KeypadLockout Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("TxDataCount", actualValue, 0UL)); + VerifyOrReturn(CheckValue("keypad lockout", actualValue, 0)); } NextTest(); @@ -42060,794 +48745,746 @@ class Test_TC_DIAG_TH_NW_1_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestValidateConstraintsOfAttributeTxDataCount_41() + CHIP_ERROR TestReadTheMandatoryAttributeKeypadLockout_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeTxDataCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: TxDataCount Error: %@", err); + [cluster readAttributeKeypadLockoutWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the mandatory attribute: KeypadLockout Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("txDataCount", "", "uint32")); + VerifyOrReturn(CheckConstraintType("keypadLockout", "", "enum8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("keypadLockout", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("keypadLockout", [value unsignedCharValue], 5)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTxDataPollCountAttributeValue_42() + CHIP_ERROR TestReadTheOptionalAttributeScheduleProgrammingVisibility_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeTxDataPollCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read TxDataPollCount attribute value Error: %@", err); + [cluster + readAttributeScheduleProgrammingVisibilityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the optional attribute: ScheduleProgrammingVisibility Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("TxDataPollCount", actualValue, 0UL)); - } + { + id actualValue = value; + VerifyOrReturn(CheckValue("schedule programming visibility", actualValue, 0)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestValidateConstraintsOfAttributeTxDataPollCount_43() + CHIP_ERROR TestReadTheOptionalAttributeScheduleProgrammingVisibility_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeTxDataPollCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: TxDataPollCount Error: %@", err); + [cluster + readAttributeScheduleProgrammingVisibilityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the optional attribute: ScheduleProgrammingVisibility Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("txDataPollCount", "", "uint32")); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("scheduleProgrammingVisibility", "", "enum8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("scheduleProgrammingVisibility", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("scheduleProgrammingVisibility", [value unsignedCharValue], 1)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } +}; - CHIP_ERROR TestReadTxBeaconCountAttributeValue_44() +class Test_TC_TSUIC_2_2 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_TSUIC_2_2() + : TestCommandBridge("Test_TC_TSUIC_2_2") + , mTestIndex(0) { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeTxBeaconCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read TxBeaconCount attribute value Error: %@", err); + 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) - VerifyOrReturn(CheckValue("status", err, 0)); + ~Test_TC_TSUIC_2_2() {} - { - id actualValue = value; - VerifyOrReturn(CheckValue("TxBeaconCount", actualValue, 0UL)); - } + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; - NextTest(); - }]; + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_TSUIC_2_2\n"); + } - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestValidateConstraintsOfAttributeTxBeaconCount_45() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeTxBeaconCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: TxBeaconCount Error: %@", err); + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TSUIC_2_2\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } - VerifyOrReturn(CheckValue("status", err, 0)); + Wait(); - VerifyOrReturn(CheckConstraintType("txBeaconCount", "", "uint32")); - 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 : Writes a value of 0 to TemperatureDisplayMode attribute of DUT\n"); + if (ShouldSkip("A_TEMPERATURE_DISPLAY_MODE")) { + NextTest(); + return; + } + err = TestWritesAValueOf0ToTemperatureDisplayModeAttributeOfDut_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Writes a value of 1 to TemperatureDisplayMode attribute of DUT\n"); + if (ShouldSkip("A_TEMPERATURE_DISPLAY_MODE")) { + NextTest(); + return; + } + err = TestWritesAValueOf1ToTemperatureDisplayModeAttributeOfDut_2(); + break; + case 3: + ChipLogProgress( + chipTool, " ***** Test Step 3 : Writes a value of greater than 1 to TemperatureDisplayMode attribute of DUT\n"); + if (ShouldSkip("A_TEMPERATURE_DISPLAY_MODE")) { + NextTest(); + return; + } + err = TestWritesAValueOfGreaterThan1ToTemperatureDisplayModeAttributeOfDut_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Writes a value of 0 to KeypadLockout attribute of DUT\n"); + if (ShouldSkip("A_KEYPAD_LOCKOUT")) { + NextTest(); + return; + } + err = TestWritesAValueOf0ToKeypadLockoutAttributeOfDut_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Writes a value of 1 to KeypadLockout attribute of DUT\n"); + if (ShouldSkip("A_KEYPAD_LOCKOUT")) { + NextTest(); + return; + } + err = TestWritesAValueOf1ToKeypadLockoutAttributeOfDut_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Writes a value of 2 to KeypadLockout attribute of DUT\n"); + if (ShouldSkip("A_KEYPAD_LOCKOUT")) { + NextTest(); + return; + } + err = TestWritesAValueOf2ToKeypadLockoutAttributeOfDut_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Writes a value of 3 to KeypadLockout attribute of DUT\n"); + if (ShouldSkip("A_KEYPAD_LOCKOUT")) { + NextTest(); + return; + } + err = TestWritesAValueOf3ToKeypadLockoutAttributeOfDut_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Writes a value of 4 to KeypadLockout attribute of DUT\n"); + if (ShouldSkip("A_KEYPAD_LOCKOUT")) { + NextTest(); + return; + } + err = TestWritesAValueOf4ToKeypadLockoutAttributeOfDut_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Writes a value of 5 to KeypadLockout attribute of DUT\n"); + if (ShouldSkip("A_KEYPAD_LOCKOUT")) { + NextTest(); + return; + } + err = TestWritesAValueOf5ToKeypadLockoutAttributeOfDut_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Writes a value of greater than 5 to KeypadLockout attribute of DUT\n"); + if (ShouldSkip("A_KEYPAD_LOCKOUT")) { + NextTest(); + return; + } + err = TestWritesAValueOfGreaterThan5ToKeypadLockoutAttributeOfDut_10(); + break; + case 11: + ChipLogProgress( + chipTool, " ***** Test Step 11 : Writes a value of 0 to ScheduleProgrammingVisibility attribute of DUT\n"); + if (ShouldSkip("A_SCHEDULE_PROGRAMMING_VISIBILITY")) { + NextTest(); + return; + } + err = TestWritesAValueOf0ToScheduleProgrammingVisibilityAttributeOfDut_11(); + break; + case 12: + ChipLogProgress( + chipTool, " ***** Test Step 12 : Writes a value of 1 to ScheduleProgrammingVisibility attribute of DUT\n"); + if (ShouldSkip("A_SCHEDULE_PROGRAMMING_VISIBILITY")) { + NextTest(); + return; + } + err = TestWritesAValueOf1ToScheduleProgrammingVisibilityAttributeOfDut_12(); + break; + case 13: + ChipLogProgress(chipTool, + " ***** Test Step 13 : Writes a value of greater than 1 to ScheduleProgrammingVisibility attribute of DUT\n"); + if (ShouldSkip("A_SCHEDULE_PROGRAMMING_VISIBILITY")) { + NextTest(); + return; + } + err = TestWritesAValueOfGreaterThan1ToScheduleProgrammingVisibilityAttributeOfDut_13(); + break; + } - return CHIP_NO_ERROR; + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - CHIP_ERROR TestReadTxBeaconRequestCountAttributeValue_46() + void OnStatusUpdate(const chip::app::StatusIB & status) override { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + } - [cluster readAttributeTxBeaconRequestCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read TxBeaconRequestCount attribute value Error: %@", err); + // Go on to the next test. + WaitForMs(0); + } - VerifyOrReturn(CheckValue("status", err, 0)); + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } - { - id actualValue = value; - VerifyOrReturn(CheckValue("TxBeaconRequestCount", actualValue, 0UL)); - } +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 14; - NextTest(); - }]; + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity("alpha"); + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestValidateConstraintsOfAttributeTxBeaconRequestCount_47() + CHIP_ERROR TestWritesAValueOf0ToTemperatureDisplayModeAttributeOfDut_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeTxBeaconRequestCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: TxBeaconRequestCount Error: %@", err); + id temperatureDisplayModeArgument; + temperatureDisplayModeArgument = [NSNumber numberWithUnsignedChar:0]; + [cluster + writeAttributeTemperatureDisplayModeWithValue:temperatureDisplayModeArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes a value of 0 to TemperatureDisplayMode attribute of DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("txBeaconRequestCount", "", "uint32")); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTxOtherCountAttributeValue_48() + CHIP_ERROR TestWritesAValueOf1ToTemperatureDisplayModeAttributeOfDut_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeTxOtherCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read TxOtherCount attribute value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id temperatureDisplayModeArgument; + temperatureDisplayModeArgument = [NSNumber numberWithUnsignedChar:1]; + [cluster + writeAttributeTemperatureDisplayModeWithValue:temperatureDisplayModeArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes a value of 1 to TemperatureDisplayMode attribute of DUT Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("TxOtherCount", actualValue, 0UL)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestValidateConstraintsOfAttributeTxOtherCount_49() + CHIP_ERROR TestWritesAValueOfGreaterThan1ToTemperatureDisplayModeAttributeOfDut_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeTxOtherCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: TxOtherCount Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id temperatureDisplayModeArgument; + temperatureDisplayModeArgument = [NSNumber numberWithUnsignedChar:2]; + [cluster writeAttributeTemperatureDisplayModeWithValue:temperatureDisplayModeArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes a value of greater than 1 to TemperatureDisplayMode attribute of " + @"DUT Error: %@", + err); - VerifyOrReturn(CheckConstraintType("txOtherCount", "", "uint32")); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTxRetryCountAttributeValue_50() + CHIP_ERROR TestWritesAValueOf0ToKeypadLockoutAttributeOfDut_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeTxRetryCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read TxRetryCount attribute value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id keypadLockoutArgument; + keypadLockoutArgument = [NSNumber numberWithUnsignedChar:0]; + [cluster writeAttributeKeypadLockoutWithValue:keypadLockoutArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes a value of 0 to KeypadLockout attribute of DUT Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("TxRetryCount", actualValue, 0UL)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestValidateConstraintsOfAttributeTxRetryCount_51() + CHIP_ERROR TestWritesAValueOf1ToKeypadLockoutAttributeOfDut_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeTxRetryCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: TxRetryCount Error: %@", err); + id keypadLockoutArgument; + keypadLockoutArgument = [NSNumber numberWithUnsignedChar:1]; + [cluster writeAttributeKeypadLockoutWithValue:keypadLockoutArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes a value of 1 to KeypadLockout attribute of DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("txRetryCount", "", "uint32")); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTxDirectMaxRetryExpiryCountAttributeValue_52() + CHIP_ERROR TestWritesAValueOf2ToKeypadLockoutAttributeOfDut_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeTxDirectMaxRetryExpiryCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read TxDirectMaxRetryExpiryCount attribute value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id keypadLockoutArgument; + keypadLockoutArgument = [NSNumber numberWithUnsignedChar:2]; + [cluster writeAttributeKeypadLockoutWithValue:keypadLockoutArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes a value of 2 to KeypadLockout attribute of DUT Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("TxDirectMaxRetryExpiryCount", actualValue, 0UL)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestValidateConstraintsOfAttributeTxDirectMaxRetryExpiryCount_53() + CHIP_ERROR TestWritesAValueOf3ToKeypadLockoutAttributeOfDut_7() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeTxDirectMaxRetryExpiryCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: TxDirectMaxRetryExpiryCount Error: %@", err); + id keypadLockoutArgument; + keypadLockoutArgument = [NSNumber numberWithUnsignedChar:3]; + [cluster writeAttributeKeypadLockoutWithValue:keypadLockoutArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes a value of 3 to KeypadLockout attribute of DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("txDirectMaxRetryExpiryCount", "", "uint32")); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTxIndirectMaxRetryExpiryCountAttributeValue_54() + CHIP_ERROR TestWritesAValueOf4ToKeypadLockoutAttributeOfDut_8() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeTxIndirectMaxRetryExpiryCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read TxIndirectMaxRetryExpiryCount attribute value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id keypadLockoutArgument; + keypadLockoutArgument = [NSNumber numberWithUnsignedChar:4]; + [cluster writeAttributeKeypadLockoutWithValue:keypadLockoutArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes a value of 4 to KeypadLockout attribute of DUT Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("TxIndirectMaxRetryExpiryCount", actualValue, 0UL)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestValidateConstraintsOfAttributeTxIndirectMaxRetryExpiryCount_55() + CHIP_ERROR TestWritesAValueOf5ToKeypadLockoutAttributeOfDut_9() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeTxIndirectMaxRetryExpiryCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: TxIndirectMaxRetryExpiryCount Error: %@", err); + id keypadLockoutArgument; + keypadLockoutArgument = [NSNumber numberWithUnsignedChar:5]; + [cluster writeAttributeKeypadLockoutWithValue:keypadLockoutArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes a value of 5 to KeypadLockout attribute of DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("txIndirectMaxRetryExpiryCount", "", "uint32")); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTxErrCcaCountAttributeValue_56() + CHIP_ERROR TestWritesAValueOfGreaterThan5ToKeypadLockoutAttributeOfDut_10() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeTxErrCcaCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read TxErrCcaCount attribute value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("TxErrCcaCount", actualValue, 0UL)); - } + id keypadLockoutArgument; + keypadLockoutArgument = [NSNumber numberWithUnsignedChar:6]; + [cluster writeAttributeKeypadLockoutWithValue:keypadLockoutArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes a value of greater than 5 to KeypadLockout attribute of DUT Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestValidateConstraintsOfAttributeTxErrCcaCount_57() + CHIP_ERROR TestWritesAValueOf0ToScheduleProgrammingVisibilityAttributeOfDut_11() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeTxErrCcaCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: TxErrCcaCount Error: %@", err); + id scheduleProgrammingVisibilityArgument; + scheduleProgrammingVisibilityArgument = [NSNumber numberWithUnsignedChar:0]; + [cluster writeAttributeScheduleProgrammingVisibilityWithValue:scheduleProgrammingVisibilityArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes a value of 0 to ScheduleProgrammingVisibility attribute of " + @"DUT Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("txErrCcaCount", "", "uint32")); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTxErrAbortCountAttributeValue_58() + CHIP_ERROR TestWritesAValueOf1ToScheduleProgrammingVisibilityAttributeOfDut_12() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeTxErrAbortCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read TxErrAbortCount attribute value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id scheduleProgrammingVisibilityArgument; + scheduleProgrammingVisibilityArgument = [NSNumber numberWithUnsignedChar:1]; + [cluster writeAttributeScheduleProgrammingVisibilityWithValue:scheduleProgrammingVisibilityArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes a value of 1 to ScheduleProgrammingVisibility attribute of " + @"DUT Error: %@", + err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("TxErrAbortCount", actualValue, 0UL)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestValidateConstraintsOfAttributeTxErrAbortCount_59() + CHIP_ERROR TestWritesAValueOfGreaterThan1ToScheduleProgrammingVisibilityAttributeOfDut_13() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeTxErrAbortCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: TxErrAbortCount Error: %@", err); + id scheduleProgrammingVisibilityArgument; + scheduleProgrammingVisibilityArgument = [NSNumber numberWithUnsignedChar:2]; + [cluster + writeAttributeScheduleProgrammingVisibilityWithValue:scheduleProgrammingVisibilityArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes a value of greater than 1 to ScheduleProgrammingVisibility " + @"attribute of DUT Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("txErrAbortCount", "", "uint32")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTxErrBusyChannelCountAttributeValue_60() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeTxErrBusyChannelCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read TxErrBusyChannelCount attribute value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("TxErrBusyChannelCount", actualValue, 0UL)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestValidateConstraintsOfAttributeTxErrBusyChannelCount_61() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeTxErrBusyChannelCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: TxErrBusyChannelCount Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("txErrBusyChannelCount", "", "uint32")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadRxTotalCountAttributeValue_62() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeRxTotalCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read RxTotalCount attribute value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("RxTotalCount", actualValue, 0UL)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestValidateConstraintsOfAttributeRxTotalCount_63() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeRxTotalCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: RxTotalCount Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("rxTotalCount", "", "uint32")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadRxUnicastCountAttributeValue_64() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeRxUnicastCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read RxUnicastCount attribute value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("RxUnicastCount", actualValue, 0UL)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestValidateConstraintsOfAttributeRxUnicastCount_65() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeRxUnicastCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: RxUnicastCount Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("rxUnicastCount", "", "uint32")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadRxBroadcastCountAttributeValue_66() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeRxBroadcastCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read RxBroadcastCount attribute value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("RxBroadcastCount", actualValue, 0UL)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestValidateConstraintsOfAttributeRxBroadcastCount_67() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeRxBroadcastCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: RxBroadcastCount Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("rxBroadcastCount", "", "uint32")); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } +}; - CHIP_ERROR TestReadRxDataCountAttributeValue_68() +class Test_TC_DIAG_TH_NW_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_DIAG_TH_NW_1_1() + : TestCommandBridge("Test_TC_DIAG_TH_NW_1_1") + , mTestIndex(0) { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeRxDataCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read RxDataCount attribute value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("RxDataCount", actualValue, 0UL)); - } - - 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 TestValidateConstraintsOfAttributeRxDataCount_69() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeRxDataCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: RxDataCount Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("rxDataCount", "", "uint32")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } + ~Test_TC_DIAG_TH_NW_1_1() {} - CHIP_ERROR TestReadRxDataPollCountAttributeValue_70() + /////////// TestCommand Interface ///////// + void NextTest() override { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + CHIP_ERROR err = CHIP_NO_ERROR; - [cluster readAttributeRxDataPollCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read RxDataPollCount attribute value Error: %@", err); + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_DIAG_TH_NW_1_1\n"); + } - VerifyOrReturn(CheckValue("status", err, 0)); + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DIAG_TH_NW_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } - { - id actualValue = value; - VerifyOrReturn(CheckValue("RxDataPollCount", actualValue, 0UL)); - } + 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 : Sends ResetCounts command\n"); + err = TestSendsResetCountsCommand_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the Overruncount attribute\n"); + err = TestReadTheOverruncountAttribute_2(); + break; + } - return CHIP_NO_ERROR; + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - CHIP_ERROR TestValidateConstraintsOfAttributeRxDataPollCount_71() + void OnStatusUpdate(const chip::app::StatusIB & status) override { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeRxDataPollCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: RxDataPollCount Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("rxDataPollCount", "", "uint32")); - NextTest(); - }]; + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } - return CHIP_NO_ERROR; + // Go on to the next test. + WaitForMs(0); } - CHIP_ERROR TestReadRxBeaconCountAttributeValue_72() + chip::System::Clock::Timeout GetWaitDuration() const override { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeRxBeaconCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read RxBeaconCount attribute value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("RxBeaconCount", actualValue, 0UL)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); } - CHIP_ERROR TestValidateConstraintsOfAttributeRxBeaconCount_73() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeRxBeaconCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: RxBeaconCount Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("rxBeaconCount", "", "uint32")); - NextTest(); - }]; +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 3; - return CHIP_NO_ERROR; - } + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; - CHIP_ERROR TestReadRxBeaconRequestCountAttributeValue_74() + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeRxBeaconRequestCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read RxBeaconRequestCount attribute value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("RxBeaconRequestCount", actualValue, 0UL)); - } - - NextTest(); - }]; - + SetIdentity("alpha"); + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestValidateConstraintsOfAttributeRxBeaconRequestCount_75() + CHIP_ERROR TestSendsResetCountsCommand_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeRxBeaconRequestCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: RxBeaconRequestCount Error: %@", err); + [cluster resetCountsWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Sends ResetCounts command Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("rxBeaconRequestCount", "", "uint32")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadRxOtherCountAttributeValue_76() + CHIP_ERROR TestReadTheOverruncountAttribute_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeRxOtherCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read RxOtherCount attribute value Error: %@", err); + [cluster readAttributeOverrunCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the Overruncount attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("RxOtherCount", actualValue, 0UL)); + VerifyOrReturn(CheckValue("OverrunCount", actualValue, 0ULL)); } NextTest(); @@ -42855,590 +49492,40 @@ class Test_TC_DIAG_TH_NW_1_2 : public TestCommandBridge { return CHIP_NO_ERROR; } +}; - CHIP_ERROR TestValidateConstraintsOfAttributeRxOtherCount_77() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeRxOtherCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: RxOtherCount Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("rxOtherCount", "", "uint32")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadRxAddressFilteredCountAttributeValue_78() +class Test_TC_DIAG_TH_NW_1_2 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_DIAG_TH_NW_1_2() + : TestCommandBridge("Test_TC_DIAG_TH_NW_1_2") + , mTestIndex(0) { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeRxAddressFilteredCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read RxAddressFilteredCount attribute value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("RxAddressFilteredCount", actualValue, 0UL)); - } - - 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 TestValidateConstraintsOfAttributeRxAddressFilteredCount_79() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeRxAddressFilteredCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: RxAddressFilteredCount Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("rxAddressFilteredCount", "", "uint32")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } + ~Test_TC_DIAG_TH_NW_1_2() {} - CHIP_ERROR TestReadRxDestAddrFilteredCountAttributeValue_80() + /////////// TestCommand Interface ///////// + void NextTest() override { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeRxDestAddrFilteredCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read RxDestAddrFilteredCount attribute value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("RxDestAddrFilteredCount", actualValue, 0UL)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } + CHIP_ERROR err = CHIP_NO_ERROR; - CHIP_ERROR TestValidateConstraintsOfAttributeRxDestAddrFilteredCount_81() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_DIAG_TH_NW_1_2\n"); + } - [cluster readAttributeRxDestAddrFilteredCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: RxDestAddrFilteredCount Error: %@", err); + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DIAG_TH_NW_1_2\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("rxDestAddrFilteredCount", "", "uint32")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadRxDuplicatedCountAttributeValue_82() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeRxDuplicatedCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read RxDuplicatedCount attribute value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("RxDuplicatedCount", actualValue, 0UL)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestValidateConstraintsOfAttributeRxDuplicatedCount_83() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeRxDuplicatedCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: RxDuplicatedCount Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("rxDuplicatedCount", "", "uint32")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadRxErrNoFrameCountAttributeValue_84() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeRxErrNoFrameCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read RxErrNoFrameCount attribute value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("RxErrNoFrameCount", actualValue, 0UL)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestValidateConstraintsOfAttributeRxErrNoFrameCount_85() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeRxErrNoFrameCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: RxErrNoFrameCount Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("rxErrNoFrameCount", "", "uint32")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadRxErrUnknownNeighborCountAttributeValue_86() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster - readAttributeRxErrUnknownNeighborCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read RxErrUnknownNeighborCount attribute value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("RxErrUnknownNeighborCount", actualValue, 0UL)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestValidateConstraintsOfAttributeRxErrUnknownNeighborCount_87() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster - readAttributeRxErrUnknownNeighborCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: RxErrUnknownNeighborCount Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("rxErrUnknownNeighborCount", "", "uint32")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadRxErrInvalidScrAddrCountAttributeValue_88() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeRxErrInvalidSrcAddrCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read RxErrInvalidScrAddrCount attribute value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("RxErrInvalidSrcAddrCount", actualValue, 0UL)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestValidateConstraintsOfAttributeRxErrInvalidSrcAddrCount_89() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeRxErrInvalidSrcAddrCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: RxErrInvalidSrcAddrCount Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("rxErrInvalidSrcAddrCount", "", "uint32")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadRxErrSecCountAttributeValue_90() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeRxErrSecCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read RxErrSecCount attribute value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("RxErrSecCount", actualValue, 0UL)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestValidateConstraintsOfAttributeRxErrInvalidSrcAddrCount_91() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeRxErrSecCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: RxErrInvalidSrcAddrCount Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("rxErrSecCount", "", "uint32")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadRxErrFcsCountAttributeValue_92() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeRxErrFcsCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read RxErrFcsCount attribute value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("RxErrFcsCount", actualValue, 0UL)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestValidateConstraintsOfAttributeRxErrFcsCount_93() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeRxErrFcsCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: RxErrFcsCount Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("rxErrFcsCount", "", "uint32")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadRxErrOtherCountAttributeValue_94() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeRxErrOtherCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read RxErrOtherCount attribute value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("RxErrOtherCount", actualValue, 0UL)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestValidateConstraintsOfAttributeRxErrOtherCount_95() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeRxErrOtherCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: RxErrOtherCount Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("rxErrOtherCount", "", "uint32")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadActiveTimestampAttributeValue_96() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeActiveTimestampWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read ActiveTimestamp attribute value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("ActiveTimestamp", actualValue, 0ULL)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestValidateConstraintsOfAttributeActiveTimestamp_97() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeActiveTimestampWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: ActiveTimestamp Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("activeTimestamp", "", "uint64")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadPendingTimestampAttributeValue_98() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributePendingTimestampWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read PendingTimestamp attribute value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("PendingTimestamp", actualValue, 0ULL)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestValidateConstraintsOfAttributePendingTimestamp_99() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributePendingTimestampWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: PendingTimestamp Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("pendingTimestamp", "", "uint64")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadDelayAttributeValue_100() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeDelayWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read Delay attribute value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("delay", actualValue, 0UL)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestValidateConstraintsOfAttributeDelay_101() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeDelayWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: delay Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("delay", "", "uint32")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } -}; - -class Test_TC_LC_1_2 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_LC_1_2() - : TestCommandBridge("Test_TC_LC_1_2") - , 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_LC_1_2() {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_LC_1_2\n"); - } - - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_LC_1_2\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } - - Wait(); + Wait(); // Ensure we increment mTestIndex before we start running the relevant // command. That way if we lose the timeslice after we send the message @@ -43450,896 +49537,409 @@ class Test_TC_LC_1_2 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : TH1 reads LabelList attribute from the DUT\n"); - err = TestTh1ReadsLabelListAttributeFromTheDut_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 TestTh1ReadsLabelListAttributeFromTheDut_1() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestUserLabel * cluster = [[CHIPTestUserLabel alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeLabelListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH1 reads LabelList attribute from the DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } -}; - -class Test_TC_WIFIDIAG_1_1 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_WIFIDIAG_1_1() - : TestCommandBridge("Test_TC_WIFIDIAG_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_WIFIDIAG_1_1() {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_WIFIDIAG_1_1\n"); - } - - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WIFIDIAG_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 : Reads NetworkInterface structure attribute from DUT\n"); - err = TestReadsNetworkInterfaceStructureAttributeFromDut_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Validate constraints of attribute: Channel\n"); + err = TestValidateConstraintsOfAttributeChannel_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Reads SecurityType attribute from DUT\n"); - err = TestReadsSecurityTypeAttributeFromDut_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Validate constraints of attribute: NetworkName\n"); + err = TestValidateConstraintsOfAttributeNetworkName_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Reads SecurityType attribute constraints\n"); - err = TestReadsSecurityTypeAttributeConstraints_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Validate constraints of attribute: PanId\n"); + err = TestValidateConstraintsOfAttributePanId_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Reads WiFiVersion attribute constraints\n"); - err = TestReadsWiFiVersionAttributeConstraints_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Validate constraints of attribute: ExtendedPanId\n"); + err = TestValidateConstraintsOfAttributeExtendedPanId_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Reads ChannelNumber attribute constraints\n"); - err = TestReadsChannelNumberAttributeConstraints_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Validate constraints of attribute: OverrunCount\n"); + err = TestValidateConstraintsOfAttributeOverrunCount_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Reads RSSI attribute constraints\n"); - err = TestReadsRssiAttributeConstraints_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : read PartitionId attribute value\n"); + err = TestReadPartitionIdAttributeValue_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 TestReadsNetworkInterfaceStructureAttributeFromDut_1() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestGeneralDiagnostics * cluster = [[CHIPTestGeneralDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeNetworkInterfacesWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads NetworkInterface structure attribute from DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("networkInterfaces", "", "list")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadsSecurityTypeAttributeFromDut_2() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestWiFiNetworkDiagnostics * cluster = [[CHIPTestWiFiNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeSecurityTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads SecurityType attribute from DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValueNull("SecurityType", actualValue)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadsSecurityTypeAttributeConstraints_3() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestWiFiNetworkDiagnostics * cluster = [[CHIPTestWiFiNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeSecurityTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads SecurityType attribute constraints Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("securityType", "", "enum")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadsWiFiVersionAttributeConstraints_4() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestWiFiNetworkDiagnostics * cluster = [[CHIPTestWiFiNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeWiFiVersionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads WiFiVersion attribute constraints Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("wiFiVersion", "", "enum")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("wiFiVersion", [value unsignedCharValue], 0)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("wiFiVersion", [value unsignedCharValue], 5)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadsChannelNumberAttributeConstraints_5() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestWiFiNetworkDiagnostics * cluster = [[CHIPTestWiFiNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeChannelNumberWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads ChannelNumber attribute constraints Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("channelNumber", "", "uint16")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadsRssiAttributeConstraints_6() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestWiFiNetworkDiagnostics * cluster = [[CHIPTestWiFiNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeRssiWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads RSSI attribute constraints Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("rssi", "", "int8")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("rssi", [value charValue], -120)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("rssi", [value charValue], 0)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } -}; - -class Test_TC_WIFIDIAG_3_1 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_WIFIDIAG_3_1() - : TestCommandBridge("Test_TC_WIFIDIAG_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); - } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - - ~Test_TC_WIFIDIAG_3_1() {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_WIFIDIAG_3_1\n"); - } - - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WIFIDIAG_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(); + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Validate constraints of attribute: PartitionId\n"); + err = TestValidateConstraintsOfAttributePartitionId_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 = 1; - - 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; - } -}; - -class Test_TC_WNCV_1_1 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_WNCV_1_1() - : TestCommandBridge("Test_TC_WNCV_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_WNCV_1_1() {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_1_1\n"); - } - - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_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(); + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : read Weighting attribute value\n"); + err = TestReadWeightingAttributeValue_8(); break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : 2: read the global attribute: ClusterRevision\n"); - err = Test2ReadTheGlobalAttributeClusterRevision_1(); + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Validate constraints of attribute: weighting\n"); + err = TestValidateConstraintsOfAttributeWeighting_9(); break; - case 2: - ChipLogProgress( - chipTool, " ***** Test Step 2 : 3a: write a value into the RO mandatory global attribute: ClusterRevision\n"); - err = Test3aWriteAValueIntoTheRoMandatoryGlobalAttributeClusterRevision_2(); + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : read DataVersion attribute value\n"); + err = TestReadDataVersionAttributeValue_10(); break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : 3b: reads back global attribute: ClusterRevision\n"); - err = Test3bReadsBackGlobalAttributeClusterRevision_3(); + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Validate constraints of attribute: DataVersion\n"); + err = TestValidateConstraintsOfAttributeDataVersion_11(); break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read the global attribute: AttributeList\n"); - err = TestReadTheGlobalAttributeAttributeList_4(); + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : read StableDataVersion attribute value\n"); + err = TestReadStableDataVersionAttributeValue_12(); break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : 2: read the global attribute: FeatureMap\n"); - err = Test2ReadTheGlobalAttributeFeatureMap_5(); + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : Validate constraints of attribute: StableDataVersion\n"); + err = TestValidateConstraintsOfAttributeStableDataVersion_13(); break; - case 6: + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : read LeaderRouterId attribute value\n"); + err = TestReadLeaderRouterIdAttributeValue_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Validate constraints of attribute: LeaderRouterId\n"); + err = TestValidateConstraintsOfAttributeLeaderRouterId_15(); + break; + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : read DetachedRoleCount attribute value\n"); + err = TestReadDetachedRoleCountAttributeValue_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : Validate constraints of attribute: DetachedRoleCount\n"); + err = TestValidateConstraintsOfAttributeDetachedRoleCount_17(); + break; + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : read ChildRoleCount attribute value\n"); + err = TestReadChildRoleCountAttributeValue_18(); + break; + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : Validate constraints of attribute: ChildRoleCount\n"); + err = TestValidateConstraintsOfAttributeChildRoleCount_19(); + break; + case 20: + ChipLogProgress(chipTool, " ***** Test Step 20 : read RouterRoleCount attribute value\n"); + err = TestReadRouterRoleCountAttributeValue_20(); + break; + case 21: + ChipLogProgress(chipTool, " ***** Test Step 21 : Validate constraints of attribute: RouterRoleCount\n"); + err = TestValidateConstraintsOfAttributeRouterRoleCount_21(); + break; + case 22: + ChipLogProgress(chipTool, " ***** Test Step 22 : read LeaderRoleCount attribute value\n"); + err = TestReadLeaderRoleCountAttributeValue_22(); + break; + case 23: + ChipLogProgress(chipTool, " ***** Test Step 23 : Validate constraints of attribute: LeaderRoleCount\n"); + err = TestValidateConstraintsOfAttributeLeaderRoleCount_23(); + break; + case 24: + ChipLogProgress(chipTool, " ***** Test Step 24 : read AttachAttemptCount attribute value\n"); + err = TestReadAttachAttemptCountAttributeValue_24(); + break; + case 25: + ChipLogProgress(chipTool, " ***** Test Step 25 : Validate constraints of attribute: AttachAttemptCount\n"); + err = TestValidateConstraintsOfAttributeAttachAttemptCount_25(); + break; + case 26: + ChipLogProgress(chipTool, " ***** Test Step 26 : read PartitionIdChangeCount attribute value\n"); + err = TestReadPartitionIdChangeCountAttributeValue_26(); + break; + case 27: + ChipLogProgress(chipTool, " ***** Test Step 27 : Validate constraints of attribute: PartitionIdChangeCount\n"); + err = TestValidateConstraintsOfAttributePartitionIdChangeCount_27(); + break; + case 28: + ChipLogProgress(chipTool, " ***** Test Step 28 : read BetterPartitionAttachAttemptCount attribute value\n"); + err = TestReadBetterPartitionAttachAttemptCountAttributeValue_28(); + break; + case 29: ChipLogProgress( - chipTool, " ***** Test Step 6 : 3a: write the default value to optional global attribute: FeatureMap\n"); - err = Test3aWriteTheDefaultValueToOptionalGlobalAttributeFeatureMap_6(); + chipTool, " ***** Test Step 29 : Validate constraints of attribute: BetterPartitionAttachAttemptCount\n"); + err = TestValidateConstraintsOfAttributeBetterPartitionAttachAttemptCount_29(); break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : 3b: reads back global attribute: FeatureMap\n"); - err = Test3bReadsBackGlobalAttributeFeatureMap_7(); + case 30: + ChipLogProgress(chipTool, " ***** Test Step 30 : read ParentChangeCount attribute value\n"); + err = TestReadParentChangeCountAttributeValue_30(); 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 Test2ReadTheGlobalAttributeClusterRevision_1() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"2: read the global attribute: ClusterRevision Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("clusterRevision", [value unsignedShortValue], 5U)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("clusterRevision", [value unsignedShortValue], 200U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR Test3aWriteAValueIntoTheRoMandatoryGlobalAttributeClusterRevision_2() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id clusterRevisionArgument; - clusterRevisionArgument = [NSNumber numberWithUnsignedShort:201U]; - [cluster - writeAttributeClusterRevisionWithValue:clusterRevisionArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"3a: write a value into the RO mandatory global attribute: ClusterRevision Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR Test3bReadsBackGlobalAttributeClusterRevision_3() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3b: reads back global attribute: ClusterRevision Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); - if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("clusterRevision", value, 201U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheGlobalAttributeAttributeList_4() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering 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)); - - VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR Test2ReadTheGlobalAttributeFeatureMap_5() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"2: read the global attribute: FeatureMap Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("featureMap", "", "uint32")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("featureMap", [value unsignedIntValue], 0UL)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("featureMap", [value unsignedIntValue], 32768UL)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR Test3aWriteTheDefaultValueToOptionalGlobalAttributeFeatureMap_6() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id featureMapArgument; - featureMapArgument = [NSNumber numberWithUnsignedInt:32769UL]; - [cluster writeAttributeFeatureMapWithValue:featureMapArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"3a: write the default value to optional global attribute: FeatureMap Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR Test3bReadsBackGlobalAttributeFeatureMap_7() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3b: reads back global attribute: FeatureMap Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("featureMap", "", "uint32")); - if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("featureMap", value, 32769UL)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } -}; - -class Test_TC_WNCV_2_1 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_WNCV_2_1() - : TestCommandBridge("Test_TC_WNCV_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_WNCV_2_1() {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_2_1\n"); - } - - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_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(); + case 31: + ChipLogProgress(chipTool, " ***** Test Step 31 : Validate constraints of attribute: ParentChangeCount\n"); + err = TestValidateConstraintsOfAttributeParentChangeCount_31(); break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : 2: read the RO mandatory attribute default: Type\n"); - err = Test2ReadTheRoMandatoryAttributeDefaultType_1(); + case 32: + ChipLogProgress(chipTool, " ***** Test Step 32 : read TxTotalCount attribute value\n"); + err = TestReadTxTotalCountAttributeValue_32(); break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : 3a: write a value into the RO mandatory attribute: Type\n"); - err = Test3aWriteAValueIntoTheRoMandatoryAttributeType_2(); + case 33: + ChipLogProgress(chipTool, " ***** Test Step 33 : Validate constraints of attribute: TxTotalCount\n"); + err = TestValidateConstraintsOfAttributeTxTotalCount_33(); break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : 3b: reads back the RO mandatory attribute: Type\n"); - err = Test3bReadsBackTheRoMandatoryAttributeType_3(); + case 34: + ChipLogProgress(chipTool, " ***** Test Step 34 : read TxUnicastCount attribute value\n"); + err = TestReadTxUnicastCountAttributeValue_34(); break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : 2: read the RO mandatory attribute default: ConfigStatus\n"); - err = Test2ReadTheRoMandatoryAttributeDefaultConfigStatus_4(); + case 35: + ChipLogProgress(chipTool, " ***** Test Step 35 : Validate constraints of attribute: TxUnicastCount\n"); + err = TestValidateConstraintsOfAttributeTxUnicastCount_35(); break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : 3a: write a value into the RO mandatory attribute: ConfigStatus\n"); - err = Test3aWriteAValueIntoTheRoMandatoryAttributeConfigStatus_5(); + case 36: + ChipLogProgress(chipTool, " ***** Test Step 36 : read TxBroadcastCount attribute value\n"); + err = TestReadTxBroadcastCountAttributeValue_36(); break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : 3b: reads back the RO mandatory attribute: ConfigStatus\n"); - err = Test3bReadsBackTheRoMandatoryAttributeConfigStatus_6(); + case 37: + ChipLogProgress(chipTool, " ***** Test Step 37 : Validate constraints of attribute: TxBroadcastCount\n"); + err = TestValidateConstraintsOfAttributeTxBroadcastCount_37(); break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : 2: read the RO mandatory attribute default: OperationalStatus\n"); - err = Test2ReadTheRoMandatoryAttributeDefaultOperationalStatus_7(); + case 38: + ChipLogProgress(chipTool, " ***** Test Step 38 : read TxNoAckRequestedCount attribute value\n"); + err = TestReadTxNoAckRequestedCountAttributeValue_38(); break; - case 8: - ChipLogProgress( - chipTool, " ***** Test Step 8 : 3a: write a value into the RO mandatory attribute: OperationalStatus\n"); - err = Test3aWriteAValueIntoTheRoMandatoryAttributeOperationalStatus_8(); + case 39: + ChipLogProgress(chipTool, " ***** Test Step 39 : Validate constraints of attribute: TxNoAckRequestedCount\n"); + err = TestValidateConstraintsOfAttributeTxNoAckRequestedCount_39(); break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : 3b: reads back the RO mandatory attribute: OperationalStatus\n"); - err = Test3bReadsBackTheRoMandatoryAttributeOperationalStatus_9(); + case 40: + ChipLogProgress(chipTool, " ***** Test Step 40 : read TxDataCount attribute value\n"); + err = TestReadTxDataCountAttributeValue_40(); break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : 2: read the RO mandatory attribute default: EndProductType\n"); - err = Test2ReadTheRoMandatoryAttributeDefaultEndProductType_10(); + case 41: + ChipLogProgress(chipTool, " ***** Test Step 41 : Validate constraints of attribute: TxDataCount\n"); + err = TestValidateConstraintsOfAttributeTxDataCount_41(); break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : 3a: write a value into the RO mandatory attribute: EndProductType\n"); - err = Test3aWriteAValueIntoTheRoMandatoryAttributeEndProductType_11(); + case 42: + ChipLogProgress(chipTool, " ***** Test Step 42 : read TxDataPollCount attribute value\n"); + err = TestReadTxDataPollCountAttributeValue_42(); break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : 3b: reads back the RO mandatory attribute: EndProductType\n"); - err = Test3bReadsBackTheRoMandatoryAttributeEndProductType_12(); + case 43: + ChipLogProgress(chipTool, " ***** Test Step 43 : Validate constraints of attribute: TxDataPollCount\n"); + err = TestValidateConstraintsOfAttributeTxDataPollCount_43(); break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : 2: read the RW mandatory attribute default: Mode\n"); - err = Test2ReadTheRwMandatoryAttributeDefaultMode_13(); + case 44: + ChipLogProgress(chipTool, " ***** Test Step 44 : read TxBeaconCount attribute value\n"); + err = TestReadTxBeaconCountAttributeValue_44(); break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : 3a: write a value into the RW mandatory attribute:: Mode\n"); - err = Test3aWriteAValueIntoTheRwMandatoryAttributeMode_14(); + case 45: + ChipLogProgress(chipTool, " ***** Test Step 45 : Validate constraints of attribute: TxBeaconCount\n"); + err = TestValidateConstraintsOfAttributeTxBeaconCount_45(); break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : 3b: reads back the RW mandatory attribute: Mode\n"); - err = Test3bReadsBackTheRwMandatoryAttributeMode_15(); + case 46: + ChipLogProgress(chipTool, " ***** Test Step 46 : read TxBeaconRequestCount attribute value\n"); + err = TestReadTxBeaconRequestCountAttributeValue_46(); break; - case 16: - ChipLogProgress( - chipTool, " ***** Test Step 16 : 2: read the RO optional attribute default: TargetPositionLiftPercent100ths\n"); - err = Test2ReadTheRoOptionalAttributeDefaultTargetPositionLiftPercent100ths_16(); + case 47: + ChipLogProgress(chipTool, " ***** Test Step 47 : Validate constraints of attribute: TxBeaconRequestCount\n"); + err = TestValidateConstraintsOfAttributeTxBeaconRequestCount_47(); break; - case 17: - ChipLogProgress(chipTool, - " ***** Test Step 17 : 3a: write a value into the RO optional attribute: TargetPositionLiftPercent100ths\n"); - err = Test3aWriteAValueIntoTheRoOptionalAttributeTargetPositionLiftPercent100ths_17(); + case 48: + ChipLogProgress(chipTool, " ***** Test Step 48 : read TxOtherCount attribute value\n"); + err = TestReadTxOtherCountAttributeValue_48(); break; - case 18: - ChipLogProgress( - chipTool, " ***** Test Step 18 : 3b: reads back the RO optional attribute: TargetPositionLiftPercent100ths\n"); - err = Test3bReadsBackTheRoOptionalAttributeTargetPositionLiftPercent100ths_18(); + case 49: + ChipLogProgress(chipTool, " ***** Test Step 49 : Validate constraints of attribute: TxOtherCount\n"); + err = TestValidateConstraintsOfAttributeTxOtherCount_49(); break; - case 19: - ChipLogProgress( - chipTool, " ***** Test Step 19 : 2: read the RO optional attribute default: TargetPositionTiltPercent100ths\n"); - err = Test2ReadTheRoOptionalAttributeDefaultTargetPositionTiltPercent100ths_19(); + case 50: + ChipLogProgress(chipTool, " ***** Test Step 50 : read TxRetryCount attribute value\n"); + err = TestReadTxRetryCountAttributeValue_50(); break; - case 20: - ChipLogProgress(chipTool, - " ***** Test Step 20 : 3a: write a value into the RO optional attribute: TargetPositionTiltPercent100ths\n"); - err = Test3aWriteAValueIntoTheRoOptionalAttributeTargetPositionTiltPercent100ths_20(); + case 51: + ChipLogProgress(chipTool, " ***** Test Step 51 : Validate constraints of attribute: TxRetryCount\n"); + err = TestValidateConstraintsOfAttributeTxRetryCount_51(); break; - case 21: - ChipLogProgress( - chipTool, " ***** Test Step 21 : 3b: reads back the RO optional attribute: TargetPositionTiltPercent100ths\n"); - err = Test3bReadsBackTheRoOptionalAttributeTargetPositionTiltPercent100ths_21(); + case 52: + ChipLogProgress(chipTool, " ***** Test Step 52 : read TxDirectMaxRetryExpiryCount attribute value\n"); + err = TestReadTxDirectMaxRetryExpiryCountAttributeValue_52(); break; - case 22: - ChipLogProgress( - chipTool, " ***** Test Step 22 : 2: read the RO optional attribute default: CurrentPositionLiftPercent100ths\n"); - err = Test2ReadTheRoOptionalAttributeDefaultCurrentPositionLiftPercent100ths_22(); + case 53: + ChipLogProgress(chipTool, " ***** Test Step 53 : Validate constraints of attribute: TxDirectMaxRetryExpiryCount\n"); + err = TestValidateConstraintsOfAttributeTxDirectMaxRetryExpiryCount_53(); break; - case 23: - ChipLogProgress(chipTool, - " ***** Test Step 23 : 3a: write a value into the RO optional attribute: CurrentPositionLiftPercent100ths\n"); - err = Test3aWriteAValueIntoTheRoOptionalAttributeCurrentPositionLiftPercent100ths_23(); + case 54: + ChipLogProgress(chipTool, " ***** Test Step 54 : read TxIndirectMaxRetryExpiryCount attribute value\n"); + err = TestReadTxIndirectMaxRetryExpiryCountAttributeValue_54(); break; - case 24: - ChipLogProgress( - chipTool, " ***** Test Step 24 : 3b: reads back the RO optional attribute: CurrentPositionLiftPercent100ths\n"); - err = Test3bReadsBackTheRoOptionalAttributeCurrentPositionLiftPercent100ths_24(); + case 55: + ChipLogProgress(chipTool, " ***** Test Step 55 : Validate constraints of attribute: TxIndirectMaxRetryExpiryCount\n"); + err = TestValidateConstraintsOfAttributeTxIndirectMaxRetryExpiryCount_55(); break; - case 25: - ChipLogProgress( - chipTool, " ***** Test Step 25 : 2: read the RO optional attribute default: CurrentPositionTiltPercent100ths\n"); - err = Test2ReadTheRoOptionalAttributeDefaultCurrentPositionTiltPercent100ths_25(); + case 56: + ChipLogProgress(chipTool, " ***** Test Step 56 : read TxErrCcaCount attribute value\n"); + err = TestReadTxErrCcaCountAttributeValue_56(); break; - case 26: - ChipLogProgress(chipTool, - " ***** Test Step 26 : 3a: write a value into the RO optional attribute: CurrentPositionTiltPercent100ths\n"); - err = Test3aWriteAValueIntoTheRoOptionalAttributeCurrentPositionTiltPercent100ths_26(); + case 57: + ChipLogProgress(chipTool, " ***** Test Step 57 : Validate constraints of attribute: TxErrCcaCount\n"); + err = TestValidateConstraintsOfAttributeTxErrCcaCount_57(); break; - case 27: - ChipLogProgress( - chipTool, " ***** Test Step 27 : 3b: reads back the RO optional attribute: CurrentPositionTiltPercent100ths\n"); - err = Test3bReadsBackTheRoOptionalAttributeCurrentPositionTiltPercent100ths_27(); + case 58: + ChipLogProgress(chipTool, " ***** Test Step 58 : read TxErrAbortCount attribute value\n"); + err = TestReadTxErrAbortCountAttributeValue_58(); break; - case 28: - ChipLogProgress(chipTool, " ***** Test Step 28 : 2: read the RO optional attribute default: InstalledOpenLimitLift\n"); - err = Test2ReadTheRoOptionalAttributeDefaultInstalledOpenLimitLift_28(); + case 59: + ChipLogProgress(chipTool, " ***** Test Step 59 : Validate constraints of attribute: TxErrAbortCount\n"); + err = TestValidateConstraintsOfAttributeTxErrAbortCount_59(); break; - case 29: - ChipLogProgress( - chipTool, " ***** Test Step 29 : 3a: write a value into the RO optional attribute: InstalledOpenLimitLift\n"); - err = Test3aWriteAValueIntoTheRoOptionalAttributeInstalledOpenLimitLift_29(); + case 60: + ChipLogProgress(chipTool, " ***** Test Step 60 : read TxErrBusyChannelCount attribute value\n"); + err = TestReadTxErrBusyChannelCountAttributeValue_60(); break; - case 30: - ChipLogProgress(chipTool, " ***** Test Step 30 : 3b: reads back the RO optional attribute: InstalledOpenLimitLift\n"); - err = Test3bReadsBackTheRoOptionalAttributeInstalledOpenLimitLift_30(); + case 61: + ChipLogProgress(chipTool, " ***** Test Step 61 : Validate constraints of attribute: TxErrBusyChannelCount\n"); + err = TestValidateConstraintsOfAttributeTxErrBusyChannelCount_61(); break; - case 31: - ChipLogProgress( - chipTool, " ***** Test Step 31 : 2: read the RO optional attribute default: InstalledClosedLimitLift\n"); - err = Test2ReadTheRoOptionalAttributeDefaultInstalledClosedLimitLift_31(); + case 62: + ChipLogProgress(chipTool, " ***** Test Step 62 : read RxTotalCount attribute value\n"); + err = TestReadRxTotalCountAttributeValue_62(); break; - case 32: - ChipLogProgress( - chipTool, " ***** Test Step 32 : 3a: write a value into the RO optional attribute: InstalledClosedLimitLift\n"); - err = Test3aWriteAValueIntoTheRoOptionalAttributeInstalledClosedLimitLift_32(); + case 63: + ChipLogProgress(chipTool, " ***** Test Step 63 : Validate constraints of attribute: RxTotalCount\n"); + err = TestValidateConstraintsOfAttributeRxTotalCount_63(); break; - case 33: - ChipLogProgress(chipTool, " ***** Test Step 33 : 3b: reads back the RO optional attribute: InstalledClosedLimitLift\n"); - err = Test3bReadsBackTheRoOptionalAttributeInstalledClosedLimitLift_33(); + case 64: + ChipLogProgress(chipTool, " ***** Test Step 64 : read RxUnicastCount attribute value\n"); + err = TestReadRxUnicastCountAttributeValue_64(); break; - case 34: - ChipLogProgress(chipTool, " ***** Test Step 34 : 2: read the RO optional attribute default: InstalledOpenLimitTilt\n"); - err = Test2ReadTheRoOptionalAttributeDefaultInstalledOpenLimitTilt_34(); + case 65: + ChipLogProgress(chipTool, " ***** Test Step 65 : Validate constraints of attribute: RxUnicastCount\n"); + err = TestValidateConstraintsOfAttributeRxUnicastCount_65(); break; - case 35: - ChipLogProgress( - chipTool, " ***** Test Step 35 : 3a: write a value into the RO optional attribute: InstalledOpenLimitTilt\n"); - err = Test3aWriteAValueIntoTheRoOptionalAttributeInstalledOpenLimitTilt_35(); + case 66: + ChipLogProgress(chipTool, " ***** Test Step 66 : read RxBroadcastCount attribute value\n"); + err = TestReadRxBroadcastCountAttributeValue_66(); break; - case 36: - ChipLogProgress(chipTool, " ***** Test Step 36 : 3b: reads back the RO optional attribute: InstalledOpenLimitTilt\n"); - err = Test3bReadsBackTheRoOptionalAttributeInstalledOpenLimitTilt_36(); + case 67: + ChipLogProgress(chipTool, " ***** Test Step 67 : Validate constraints of attribute: RxBroadcastCount\n"); + err = TestValidateConstraintsOfAttributeRxBroadcastCount_67(); break; - case 37: - ChipLogProgress( - chipTool, " ***** Test Step 37 : 2: read the RO optional attribute default: InstalledClosedLimitTilt\n"); - err = Test2ReadTheRoOptionalAttributeDefaultInstalledClosedLimitTilt_37(); + case 68: + ChipLogProgress(chipTool, " ***** Test Step 68 : read RxDataCount attribute value\n"); + err = TestReadRxDataCountAttributeValue_68(); break; - case 38: - ChipLogProgress( - chipTool, " ***** Test Step 38 : 3a: write a value into the RO optional attribute: InstalledClosedLimitTilt\n"); - err = Test3aWriteAValueIntoTheRoOptionalAttributeInstalledClosedLimitTilt_38(); + case 69: + ChipLogProgress(chipTool, " ***** Test Step 69 : Validate constraints of attribute: RxDataCount\n"); + err = TestValidateConstraintsOfAttributeRxDataCount_69(); break; - case 39: - ChipLogProgress(chipTool, " ***** Test Step 39 : 3b: reads back the RO optional attribute: InstalledClosedLimitTilt\n"); - err = Test3bReadsBackTheRoOptionalAttributeInstalledClosedLimitTilt_39(); + case 70: + ChipLogProgress(chipTool, " ***** Test Step 70 : read RxDataPollCount attribute value\n"); + err = TestReadRxDataPollCountAttributeValue_70(); break; - case 40: - ChipLogProgress(chipTool, " ***** Test Step 40 : 4: read the RO mandatory attribute default: SafetyStatus\n"); - err = Test4ReadTheRoMandatoryAttributeDefaultSafetyStatus_40(); + case 71: + ChipLogProgress(chipTool, " ***** Test Step 71 : Validate constraints of attribute: RxDataPollCount\n"); + err = TestValidateConstraintsOfAttributeRxDataPollCount_71(); break; - case 41: - ChipLogProgress(chipTool, " ***** Test Step 41 : 5a: write a value into the RO mandatory attribute: SafetyStatus\n"); - err = Test5aWriteAValueIntoTheRoMandatoryAttributeSafetyStatus_41(); + case 72: + ChipLogProgress(chipTool, " ***** Test Step 72 : read RxBeaconCount attribute value\n"); + err = TestReadRxBeaconCountAttributeValue_72(); break; - case 42: - ChipLogProgress(chipTool, " ***** Test Step 42 : 5b: reads back the RO mandatory attribute: SafetyStatus\n"); - err = Test5bReadsBackTheRoMandatoryAttributeSafetyStatus_42(); + case 73: + ChipLogProgress(chipTool, " ***** Test Step 73 : Validate constraints of attribute: RxBeaconCount\n"); + err = TestValidateConstraintsOfAttributeRxBeaconCount_73(); break; - case 43: - ChipLogProgress(chipTool, " ***** Test Step 43 : 4: read the RO optional attribute default: CurrentPositionLift\n"); - err = Test4ReadTheRoOptionalAttributeDefaultCurrentPositionLift_43(); + case 74: + ChipLogProgress(chipTool, " ***** Test Step 74 : read RxBeaconRequestCount attribute value\n"); + err = TestReadRxBeaconRequestCountAttributeValue_74(); break; - case 44: - ChipLogProgress( - chipTool, " ***** Test Step 44 : 5a: write a value into the RO optional attribute: CurrentPositionLift\n"); - err = Test5aWriteAValueIntoTheRoOptionalAttributeCurrentPositionLift_44(); + case 75: + ChipLogProgress(chipTool, " ***** Test Step 75 : Validate constraints of attribute: RxBeaconRequestCount\n"); + err = TestValidateConstraintsOfAttributeRxBeaconRequestCount_75(); break; - case 45: - ChipLogProgress(chipTool, " ***** Test Step 45 : 5b: reads back the RO optional attribute: CurrentPositionLift\n"); - err = Test5bReadsBackTheRoOptionalAttributeCurrentPositionLift_45(); + case 76: + ChipLogProgress(chipTool, " ***** Test Step 76 : read RxOtherCount attribute value\n"); + err = TestReadRxOtherCountAttributeValue_76(); break; - case 46: - ChipLogProgress(chipTool, " ***** Test Step 46 : 4: read the RO optional attribute default: CurrentPositionTilt\n"); - err = Test4ReadTheRoOptionalAttributeDefaultCurrentPositionTilt_46(); + case 77: + ChipLogProgress(chipTool, " ***** Test Step 77 : Validate constraints of attribute: RxOtherCount\n"); + err = TestValidateConstraintsOfAttributeRxOtherCount_77(); break; - case 47: - ChipLogProgress( - chipTool, " ***** Test Step 47 : 5a: write a value into the RO optional attribute: CurrentPositionTilt\n"); - err = Test5aWriteAValueIntoTheRoOptionalAttributeCurrentPositionTilt_47(); + case 78: + ChipLogProgress(chipTool, " ***** Test Step 78 : read RxAddressFilteredCount attribute value\n"); + err = TestReadRxAddressFilteredCountAttributeValue_78(); break; - case 48: - ChipLogProgress(chipTool, " ***** Test Step 48 : 5b: reads back the RO optional attribute: CurrentPositionTilt\n"); - err = Test5bReadsBackTheRoOptionalAttributeCurrentPositionTilt_48(); + case 79: + ChipLogProgress(chipTool, " ***** Test Step 79 : Validate constraints of attribute: RxAddressFilteredCount\n"); + err = TestValidateConstraintsOfAttributeRxAddressFilteredCount_79(); break; - case 49: - ChipLogProgress( - chipTool, " ***** Test Step 49 : 4: read the RO optional attribute default: CurrentPositionLiftPercentage\n"); - err = Test4ReadTheRoOptionalAttributeDefaultCurrentPositionLiftPercentage_49(); + case 80: + ChipLogProgress(chipTool, " ***** Test Step 80 : read RxDestAddrFilteredCount attribute value\n"); + err = TestReadRxDestAddrFilteredCountAttributeValue_80(); break; - case 50: - ChipLogProgress(chipTool, - " ***** Test Step 50 : 5a: write a value into the RO optional attribute: CurrentPositionLiftPercentage\n"); - err = Test5aWriteAValueIntoTheRoOptionalAttributeCurrentPositionLiftPercentage_50(); + case 81: + ChipLogProgress(chipTool, " ***** Test Step 81 : Validate constraints of attribute: RxDestAddrFilteredCount\n"); + err = TestValidateConstraintsOfAttributeRxDestAddrFilteredCount_81(); break; - case 51: - ChipLogProgress( - chipTool, " ***** Test Step 51 : 5b: reads back the RO optional attribute: CurrentPositionLiftPercentage\n"); - err = Test5bReadsBackTheRoOptionalAttributeCurrentPositionLiftPercentage_51(); + case 82: + ChipLogProgress(chipTool, " ***** Test Step 82 : read RxDuplicatedCount attribute value\n"); + err = TestReadRxDuplicatedCountAttributeValue_82(); break; - case 52: - ChipLogProgress( - chipTool, " ***** Test Step 52 : 4: read the RO optional attribute default: CurrentPositionTiltPercentage\n"); - err = Test4ReadTheRoOptionalAttributeDefaultCurrentPositionTiltPercentage_52(); + case 83: + ChipLogProgress(chipTool, " ***** Test Step 83 : Validate constraints of attribute: RxDuplicatedCount\n"); + err = TestValidateConstraintsOfAttributeRxDuplicatedCount_83(); break; - case 53: - ChipLogProgress(chipTool, - " ***** Test Step 53 : 5a: write a value into the RO optional attribute: CurrentPositionTiltPercentage\n"); - err = Test5aWriteAValueIntoTheRoOptionalAttributeCurrentPositionTiltPercentage_53(); + case 84: + ChipLogProgress(chipTool, " ***** Test Step 84 : read RxErrNoFrameCount attribute value\n"); + err = TestReadRxErrNoFrameCountAttributeValue_84(); break; - case 54: - ChipLogProgress( - chipTool, " ***** Test Step 54 : 5b: reads back the RO optional attribute: CurrentPositionTiltPercentage\n"); - err = Test5bReadsBackTheRoOptionalAttributeCurrentPositionTiltPercentage_54(); + case 85: + ChipLogProgress(chipTool, " ***** Test Step 85 : Validate constraints of attribute: RxErrNoFrameCount\n"); + err = TestValidateConstraintsOfAttributeRxErrNoFrameCount_85(); + break; + case 86: + ChipLogProgress(chipTool, " ***** Test Step 86 : read RxErrUnknownNeighborCount attribute value\n"); + err = TestReadRxErrUnknownNeighborCountAttributeValue_86(); + break; + case 87: + ChipLogProgress(chipTool, " ***** Test Step 87 : Validate constraints of attribute: RxErrUnknownNeighborCount\n"); + err = TestValidateConstraintsOfAttributeRxErrUnknownNeighborCount_87(); + break; + case 88: + ChipLogProgress(chipTool, " ***** Test Step 88 : read RxErrInvalidScrAddrCount attribute value\n"); + err = TestReadRxErrInvalidScrAddrCountAttributeValue_88(); + break; + case 89: + ChipLogProgress(chipTool, " ***** Test Step 89 : Validate constraints of attribute: RxErrInvalidSrcAddrCount\n"); + err = TestValidateConstraintsOfAttributeRxErrInvalidSrcAddrCount_89(); + break; + case 90: + ChipLogProgress(chipTool, " ***** Test Step 90 : read RxErrSecCount attribute value\n"); + err = TestReadRxErrSecCountAttributeValue_90(); + break; + case 91: + ChipLogProgress(chipTool, " ***** Test Step 91 : Validate constraints of attribute: RxErrInvalidSrcAddrCount\n"); + err = TestValidateConstraintsOfAttributeRxErrInvalidSrcAddrCount_91(); + break; + case 92: + ChipLogProgress(chipTool, " ***** Test Step 92 : read RxErrFcsCount attribute value\n"); + err = TestReadRxErrFcsCountAttributeValue_92(); + break; + case 93: + ChipLogProgress(chipTool, " ***** Test Step 93 : Validate constraints of attribute: RxErrFcsCount\n"); + err = TestValidateConstraintsOfAttributeRxErrFcsCount_93(); + break; + case 94: + ChipLogProgress(chipTool, " ***** Test Step 94 : read RxErrOtherCount attribute value\n"); + err = TestReadRxErrOtherCountAttributeValue_94(); + break; + case 95: + ChipLogProgress(chipTool, " ***** Test Step 95 : Validate constraints of attribute: RxErrOtherCount\n"); + err = TestValidateConstraintsOfAttributeRxErrOtherCount_95(); + break; + case 96: + ChipLogProgress(chipTool, " ***** Test Step 96 : read ActiveTimestamp attribute value\n"); + err = TestReadActiveTimestampAttributeValue_96(); + break; + case 97: + ChipLogProgress(chipTool, " ***** Test Step 97 : Validate constraints of attribute: ActiveTimestamp\n"); + err = TestValidateConstraintsOfAttributeActiveTimestamp_97(); + break; + case 98: + ChipLogProgress(chipTool, " ***** Test Step 98 : read PendingTimestamp attribute value\n"); + err = TestReadPendingTimestampAttributeValue_98(); + break; + case 99: + ChipLogProgress(chipTool, " ***** Test Step 99 : Validate constraints of attribute: PendingTimestamp\n"); + err = TestValidateConstraintsOfAttributePendingTimestamp_99(); + break; + case 100: + ChipLogProgress(chipTool, " ***** Test Step 100 : read Delay attribute value\n"); + err = TestReadDelayAttributeValue_100(); + break; + case 101: + ChipLogProgress(chipTool, " ***** Test Step 101 : Validate constraints of attribute: delay\n"); + err = TestValidateConstraintsOfAttributeDelay_101(); break; } @@ -44349,6 +49949,321 @@ class Test_TC_WNCV_2_1 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 34: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 35: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 36: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 37: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 38: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 39: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 40: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 41: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 42: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 43: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 44: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 45: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 46: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 47: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 48: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 49: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 50: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 51: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 52: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 53: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 54: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 55: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 56: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 57: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 58: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 59: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 60: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 61: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 62: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 63: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 64: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 65: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 66: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 67: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 68: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 69: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 70: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 71: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 72: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 73: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 74: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 75: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 76: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 77: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 78: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 79: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 80: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 81: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 82: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 83: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 84: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 85: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 86: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 87: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 88: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 89: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 90: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 91: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 92: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 93: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 94: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 95: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 96: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 97: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 98: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 99: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 100: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 101: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -44356,7 +50271,7 @@ class Test_TC_WNCV_2_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 55; + const uint16_t mTestCount = 102; chip::Optional mNodeId; chip::Optional mCluster; @@ -44365,134 +50280,134 @@ class Test_TC_WNCV_2_1 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR Test2ReadTheRoMandatoryAttributeDefaultType_1() + CHIP_ERROR TestValidateConstraintsOfAttributeChannel_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"2: read the RO mandatory attribute default: Type Error: %@", err); + [cluster readAttributeChannelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: Channel Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("type", "", "enum8")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("type", [value unsignedCharValue], 0)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("type", [value unsignedCharValue], 9)); - } - + VerifyOrReturn(CheckConstraintType("channel", "", "uint16")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test3aWriteAValueIntoTheRoMandatoryAttributeType_2() + CHIP_ERROR TestValidateConstraintsOfAttributeNetworkName_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id typeArgument; - typeArgument = [NSNumber numberWithUnsignedChar:250]; - [cluster writeAttributeTypeWithValue:typeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"3a: write a value into the RO mandatory attribute: Type Error: %@", err); + [cluster readAttributeNetworkNameWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: NetworkName Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("networkName", "", "string")); + VerifyOrReturn(CheckConstraintMaxLength("networkName", [value length], 16)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test3bReadsBackTheRoMandatoryAttributeType_3() + CHIP_ERROR TestValidateConstraintsOfAttributePanId_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3b: reads back the RO mandatory attribute: Type Error: %@", err); + [cluster readAttributePanIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: PanId Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("type", "", "enum8")); - if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("type", value, 250)); - } - + VerifyOrReturn(CheckConstraintType("panId", "", "uint16")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test2ReadTheRoMandatoryAttributeDefaultConfigStatus_4() + CHIP_ERROR TestValidateConstraintsOfAttributeExtendedPanId_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeConfigStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"2: read the RO mandatory attribute default: ConfigStatus Error: %@", err); + [cluster readAttributeExtendedPanIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: ExtendedPanId Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("configStatus", "", "map8")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("configStatus", [value unsignedCharValue], 0)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("configStatus", [value unsignedCharValue], 63)); - } - + VerifyOrReturn(CheckConstraintType("extendedPanId", "", "uint64")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test3aWriteAValueIntoTheRoMandatoryAttributeConfigStatus_5() + CHIP_ERROR TestValidateConstraintsOfAttributeOverrunCount_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id configStatusArgument; - configStatusArgument = [NSNumber numberWithUnsignedChar:128]; - [cluster writeAttributeConfigStatusWithValue:configStatusArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"3a: write a value into the RO mandatory attribute: ConfigStatus Error: %@", err); + [cluster readAttributeOverrunCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: OverrunCount Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("overrunCount", "", "uint64")); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test3bReadsBackTheRoMandatoryAttributeConfigStatus_6() + CHIP_ERROR TestReadPartitionIdAttributeValue_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeConfigStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3b: reads back the RO mandatory attribute: ConfigStatus Error: %@", err); + [cluster readAttributePartitionIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read PartitionId attribute value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("configStatus", "", "map8")); - if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("configStatus", value, 128)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("PartitionId", actualValue, 0UL)); } NextTest(); @@ -44501,90 +50416,90 @@ class Test_TC_WNCV_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR Test2ReadTheRoMandatoryAttributeDefaultOperationalStatus_7() + CHIP_ERROR TestValidateConstraintsOfAttributePartitionId_7() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOperationalStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"2: read the RO mandatory attribute default: OperationalStatus Error: %@", err); + [cluster readAttributePartitionIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: PartitionId Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("operationalStatus", "", "map8")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("operationalStatus", [value unsignedCharValue], 0)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("operationalStatus", [value unsignedCharValue], 63)); - } - + VerifyOrReturn(CheckConstraintType("partitionId", "", "uint32")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test3aWriteAValueIntoTheRoMandatoryAttributeOperationalStatus_8() + CHIP_ERROR TestReadWeightingAttributeValue_8() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id operationalStatusArgument; - operationalStatusArgument = [NSNumber numberWithUnsignedChar:128]; - [cluster writeAttributeOperationalStatusWithValue:operationalStatusArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"3a: write a value into the RO mandatory attribute: OperationalStatus Error: %@", - err); + [cluster readAttributeWeightingWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read Weighting attribute value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("weighting", actualValue, 0)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test3bReadsBackTheRoMandatoryAttributeOperationalStatus_9() + CHIP_ERROR TestValidateConstraintsOfAttributeWeighting_9() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOperationalStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3b: reads back the RO mandatory attribute: OperationalStatus Error: %@", err); + [cluster readAttributeWeightingWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: weighting Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("operationalStatus", "", "map8")); - if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("operationalStatus", value, 128)); - } - + VerifyOrReturn(CheckConstraintType("weighting", "", "uint8")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test2ReadTheRoMandatoryAttributeDefaultEndProductType_10() + CHIP_ERROR TestReadDataVersionAttributeValue_10() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEndProductTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"2: read the RO mandatory attribute default: EndProductType Error: %@", err); + [cluster readAttributeDataVersionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read DataVersion attribute value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("endProductType", "", "enum8")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("endProductType", [value unsignedCharValue], 0)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("endProductType", [value unsignedCharValue], 23)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("DataVersion", actualValue, 0)); } NextTest(); @@ -44593,39 +50508,44 @@ class Test_TC_WNCV_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR Test3aWriteAValueIntoTheRoMandatoryAttributeEndProductType_11() + CHIP_ERROR TestValidateConstraintsOfAttributeDataVersion_11() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id endProductTypeArgument; - endProductTypeArgument = [NSNumber numberWithUnsignedChar:250]; - [cluster writeAttributeEndProductTypeWithValue:endProductTypeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"3a: write a value into the RO mandatory attribute: EndProductType Error: %@", err); + [cluster readAttributeDataVersionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: DataVersion Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); - return CHIP_NO_ERROR; + VerifyOrReturn(CheckConstraintType("dataVersion", "", "uint8")); + NextTest(); + }]; + + return CHIP_NO_ERROR; } - CHIP_ERROR Test3bReadsBackTheRoMandatoryAttributeEndProductType_12() + CHIP_ERROR TestReadStableDataVersionAttributeValue_12() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEndProductTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3b: reads back the RO mandatory attribute: EndProductType Error: %@", err); + [cluster readAttributeStableDataVersionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read StableDataVersion attribute value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("endProductType", "", "enum8")); - if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("endProductType", value, 250)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("StableDataVersion", actualValue, 0)); } NextTest(); @@ -44634,93 +50554,90 @@ class Test_TC_WNCV_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR Test2ReadTheRwMandatoryAttributeDefaultMode_13() + CHIP_ERROR TestValidateConstraintsOfAttributeStableDataVersion_13() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"2: read the RW mandatory attribute default: Mode Error: %@", err); + [cluster readAttributeStableDataVersionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: StableDataVersion Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("mode", "", "map8")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("mode", [value unsignedCharValue], 0)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("mode", [value unsignedCharValue], 15)); - } - + VerifyOrReturn(CheckConstraintType("stableDataVersion", "", "uint8")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test3aWriteAValueIntoTheRwMandatoryAttributeMode_14() + CHIP_ERROR TestReadLeaderRouterIdAttributeValue_14() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id modeArgument; - modeArgument = [NSNumber numberWithUnsignedChar:8]; - [cluster writeAttributeModeWithValue:modeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"3a: write a value into the RW mandatory attribute:: Mode Error: %@", err); + [cluster readAttributeLeaderRouterIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read LeaderRouterId attribute value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValue("LeaderRouterId", actualValue, 0)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test3bReadsBackTheRwMandatoryAttributeMode_15() + CHIP_ERROR TestValidateConstraintsOfAttributeLeaderRouterId_15() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3b: reads back the RW mandatory attribute: Mode Error: %@", err); + [cluster readAttributeLeaderRouterIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: LeaderRouterId Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("Mode", actualValue, 8)); - } - + VerifyOrReturn(CheckConstraintType("leaderRouterId", "", "uint8")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test2ReadTheRoOptionalAttributeDefaultTargetPositionLiftPercent100ths_16() + CHIP_ERROR TestReadDetachedRoleCountAttributeValue_16() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeTargetPositionLiftPercent100thsWithCompletionHandler:^( - NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"2: read the RO optional attribute default: TargetPositionLiftPercent100ths Error: %@", err); + [cluster readAttributeDetachedRoleCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read DetachedRoleCount attribute value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("targetPositionLiftPercent100ths", "", "Percent100ths")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue( - "targetPositionLiftPercent100ths", [value unsignedShortValue], 0U)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue( - "targetPositionLiftPercent100ths", [value unsignedShortValue], 10000U)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("DetachedRoleCount", actualValue, 0U)); } NextTest(); @@ -44729,43 +50646,44 @@ class Test_TC_WNCV_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR Test3aWriteAValueIntoTheRoOptionalAttributeTargetPositionLiftPercent100ths_17() + CHIP_ERROR TestValidateConstraintsOfAttributeDetachedRoleCount_17() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id targetPositionLiftPercent100thsArgument; - targetPositionLiftPercent100thsArgument = [NSNumber numberWithUnsignedShort:20000U]; - [cluster - writeAttributeTargetPositionLiftPercent100thsWithValue:targetPositionLiftPercent100thsArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"3a: write a value into the RO optional attribute: " - @"TargetPositionLiftPercent100ths Error: %@", - err); + [cluster readAttributeDetachedRoleCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: DetachedRoleCount Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("detachedRoleCount", "", "uint16")); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test3bReadsBackTheRoOptionalAttributeTargetPositionLiftPercent100ths_18() + CHIP_ERROR TestReadChildRoleCountAttributeValue_18() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeTargetPositionLiftPercent100thsWithCompletionHandler:^( - NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3b: reads back the RO optional attribute: TargetPositionLiftPercent100ths Error: %@", err); + [cluster readAttributeChildRoleCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read ChildRoleCount attribute value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("targetPositionLiftPercent100ths", "", "Percent100ths")); - if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("targetPositionLiftPercent100ths", value, 20000U)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("ChildRoleCount", actualValue, 0U)); } NextTest(); @@ -44774,99 +50692,90 @@ class Test_TC_WNCV_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR Test2ReadTheRoOptionalAttributeDefaultTargetPositionTiltPercent100ths_19() + CHIP_ERROR TestValidateConstraintsOfAttributeChildRoleCount_19() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeTargetPositionTiltPercent100thsWithCompletionHandler:^( - NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"2: read the RO optional attribute default: TargetPositionTiltPercent100ths Error: %@", err); + [cluster readAttributeChildRoleCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: ChildRoleCount Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("targetPositionTiltPercent100ths", "", "Percent100ths")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue( - "targetPositionTiltPercent100ths", [value unsignedShortValue], 0U)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue( - "targetPositionTiltPercent100ths", [value unsignedShortValue], 10000U)); - } - + VerifyOrReturn(CheckConstraintType("childRoleCount", "", "uint16")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test3aWriteAValueIntoTheRoOptionalAttributeTargetPositionTiltPercent100ths_20() + CHIP_ERROR TestReadRouterRoleCountAttributeValue_20() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id targetPositionTiltPercent100thsArgument; - targetPositionTiltPercent100thsArgument = [NSNumber numberWithUnsignedShort:20000U]; - [cluster - writeAttributeTargetPositionTiltPercent100thsWithValue:targetPositionTiltPercent100thsArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"3a: write a value into the RO optional attribute: " - @"TargetPositionTiltPercent100ths Error: %@", - err); + [cluster readAttributeRouterRoleCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read RouterRoleCount attribute value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("RouterRoleCount", actualValue, 0U)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test3bReadsBackTheRoOptionalAttributeTargetPositionTiltPercent100ths_21() + CHIP_ERROR TestValidateConstraintsOfAttributeRouterRoleCount_21() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeTargetPositionTiltPercent100thsWithCompletionHandler:^( - NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3b: reads back the RO optional attribute: TargetPositionTiltPercent100ths Error: %@", err); + [cluster readAttributeRouterRoleCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: RouterRoleCount Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("targetPositionTiltPercent100ths", "", "Percent100ths")); - if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("targetPositionTiltPercent100ths", value, 20000U)); - } - + VerifyOrReturn(CheckConstraintType("routerRoleCount", "", "uint16")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test2ReadTheRoOptionalAttributeDefaultCurrentPositionLiftPercent100ths_22() + CHIP_ERROR TestReadLeaderRoleCountAttributeValue_22() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentPositionLiftPercent100thsWithCompletionHandler:^( - NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"2: read the RO optional attribute default: CurrentPositionLiftPercent100ths Error: %@", err); + [cluster readAttributeLeaderRoleCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read LeaderRoleCount attribute value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("currentPositionLiftPercent100ths", "", "Percent100ths")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue( - "currentPositionLiftPercent100ths", [value unsignedShortValue], 0U)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue( - "currentPositionLiftPercent100ths", [value unsignedShortValue], 10000U)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("LeaderRoleCount", actualValue, 0U)); } NextTest(); @@ -44875,43 +50784,44 @@ class Test_TC_WNCV_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR Test3aWriteAValueIntoTheRoOptionalAttributeCurrentPositionLiftPercent100ths_23() + CHIP_ERROR TestValidateConstraintsOfAttributeLeaderRoleCount_23() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id currentPositionLiftPercent100thsArgument; - currentPositionLiftPercent100thsArgument = [NSNumber numberWithUnsignedShort:20000U]; - [cluster - writeAttributeCurrentPositionLiftPercent100thsWithValue:currentPositionLiftPercent100thsArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"3a: write a value into the RO optional attribute: " - @"CurrentPositionLiftPercent100ths Error: %@", - err); + [cluster readAttributeLeaderRoleCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: LeaderRoleCount Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("leaderRoleCount", "", "uint16")); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test3bReadsBackTheRoOptionalAttributeCurrentPositionLiftPercent100ths_24() + CHIP_ERROR TestReadAttachAttemptCountAttributeValue_24() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentPositionLiftPercent100thsWithCompletionHandler:^( - NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3b: reads back the RO optional attribute: CurrentPositionLiftPercent100ths Error: %@", err); + [cluster readAttributeAttachAttemptCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read AttachAttemptCount attribute value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("currentPositionLiftPercent100ths", "", "Percent100ths")); - if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("currentPositionLiftPercent100ths", value, 20000U)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("AttachAttemptCount", actualValue, 0U)); } NextTest(); @@ -44920,96 +50830,91 @@ class Test_TC_WNCV_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR Test2ReadTheRoOptionalAttributeDefaultCurrentPositionTiltPercent100ths_25() + CHIP_ERROR TestValidateConstraintsOfAttributeAttachAttemptCount_25() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentPositionTiltPercent100thsWithCompletionHandler:^( - NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"2: read the RO optional attribute default: CurrentPositionTiltPercent100ths Error: %@", err); + [cluster readAttributeAttachAttemptCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: AttachAttemptCount Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("currentPositionTiltPercent100ths", "", "Percent100ths")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue( - "currentPositionTiltPercent100ths", [value unsignedShortValue], 0U)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue( - "currentPositionTiltPercent100ths", [value unsignedShortValue], 10000U)); - } - + VerifyOrReturn(CheckConstraintType("attachAttemptCount", "", "uint16")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test3aWriteAValueIntoTheRoOptionalAttributeCurrentPositionTiltPercent100ths_26() + CHIP_ERROR TestReadPartitionIdChangeCountAttributeValue_26() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id currentPositionTiltPercent100thsArgument; - currentPositionTiltPercent100thsArgument = [NSNumber numberWithUnsignedShort:20000U]; - [cluster - writeAttributeCurrentPositionTiltPercent100thsWithValue:currentPositionTiltPercent100thsArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"3a: write a value into the RO optional attribute: " - @"CurrentPositionTiltPercent100ths Error: %@", - err); + [cluster readAttributePartitionIdChangeCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read PartitionIdChangeCount attribute value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("PartitionIdChangeCount", actualValue, 0U)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test3bReadsBackTheRoOptionalAttributeCurrentPositionTiltPercent100ths_27() + CHIP_ERROR TestValidateConstraintsOfAttributePartitionIdChangeCount_27() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentPositionTiltPercent100thsWithCompletionHandler:^( - NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3b: reads back the RO optional attribute: CurrentPositionTiltPercent100ths Error: %@", err); + [cluster readAttributePartitionIdChangeCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: PartitionIdChangeCount Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("currentPositionTiltPercent100ths", "", "Percent100ths")); - if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("currentPositionTiltPercent100ths", value, 20000U)); - } - + VerifyOrReturn(CheckConstraintType("partitionIdChangeCount", "", "uint16")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test2ReadTheRoOptionalAttributeDefaultInstalledOpenLimitLift_28() + CHIP_ERROR TestReadBetterPartitionAttachAttemptCountAttributeValue_28() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInstalledOpenLimitLiftWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"2: read the RO optional attribute default: InstalledOpenLimitLift Error: %@", err); + [cluster readAttributeBetterPartitionAttachAttemptCountWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read BetterPartitionAttachAttemptCount attribute value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("installedOpenLimitLift", "", "uint16")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("installedOpenLimitLift", [value unsignedShortValue], 0U)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("installedOpenLimitLift", [value unsignedShortValue], 65535U)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("BetterPartitionAttachAttemptCount", actualValue, 0U)); } NextTest(); @@ -45018,44 +50923,45 @@ class Test_TC_WNCV_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR Test3aWriteAValueIntoTheRoOptionalAttributeInstalledOpenLimitLift_29() + CHIP_ERROR TestValidateConstraintsOfAttributeBetterPartitionAttachAttemptCount_29() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id installedOpenLimitLiftArgument; - installedOpenLimitLiftArgument = [NSNumber numberWithUnsignedShort:255U]; - [cluster writeAttributeInstalledOpenLimitLiftWithValue:installedOpenLimitLiftArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"3a: write a value into the RO optional attribute: InstalledOpenLimitLift " - @"Error: %@", - err); + [cluster readAttributeBetterPartitionAttachAttemptCountWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: BetterPartitionAttachAttemptCount Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("betterPartitionAttachAttemptCount", "", "uint16")); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test3bReadsBackTheRoOptionalAttributeInstalledOpenLimitLift_30() + CHIP_ERROR TestReadParentChangeCountAttributeValue_30() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInstalledOpenLimitLiftWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3b: reads back the RO optional attribute: InstalledOpenLimitLift Error: %@", err); + [cluster readAttributeParentChangeCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read ParentChangeCount attribute value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("installedOpenLimitLift", "", "uint16")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("installedOpenLimitLift", [value unsignedShortValue], 0U)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("installedOpenLimitLift", [value unsignedShortValue], 65535U)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("ParentChangeCount", actualValue, 0U)); } NextTest(); @@ -45064,94 +50970,90 @@ class Test_TC_WNCV_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR Test2ReadTheRoOptionalAttributeDefaultInstalledClosedLimitLift_31() + CHIP_ERROR TestValidateConstraintsOfAttributeParentChangeCount_31() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInstalledClosedLimitLiftWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"2: read the RO optional attribute default: InstalledClosedLimitLift Error: %@", err); + [cluster readAttributeParentChangeCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: ParentChangeCount Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("installedClosedLimitLift", "", "uint16")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("installedClosedLimitLift", [value unsignedShortValue], 0U)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("installedClosedLimitLift", [value unsignedShortValue], 65535U)); - } - + VerifyOrReturn(CheckConstraintType("parentChangeCount", "", "uint16")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test3aWriteAValueIntoTheRoOptionalAttributeInstalledClosedLimitLift_32() + CHIP_ERROR TestReadTxTotalCountAttributeValue_32() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id installedClosedLimitLiftArgument; - installedClosedLimitLiftArgument = [NSNumber numberWithUnsignedShort:255U]; - [cluster writeAttributeInstalledClosedLimitLiftWithValue:installedClosedLimitLiftArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"3a: write a value into the RO optional attribute: " - @"InstalledClosedLimitLift Error: %@", - err); + [cluster readAttributeTxTotalCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read TxTotalCount attribute value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("TxTotalCount", actualValue, 0UL)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test3bReadsBackTheRoOptionalAttributeInstalledClosedLimitLift_33() + CHIP_ERROR TestValidateConstraintsOfAttributeTxTotalCount_33() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInstalledClosedLimitLiftWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3b: reads back the RO optional attribute: InstalledClosedLimitLift Error: %@", err); + [cluster readAttributeTxTotalCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: TxTotalCount Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("installedClosedLimitLift", "", "uint16")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("installedClosedLimitLift", [value unsignedShortValue], 0U)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("installedClosedLimitLift", [value unsignedShortValue], 65535U)); - } - + VerifyOrReturn(CheckConstraintType("txTotalCount", "", "uint32")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test2ReadTheRoOptionalAttributeDefaultInstalledOpenLimitTilt_34() + CHIP_ERROR TestReadTxUnicastCountAttributeValue_34() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInstalledOpenLimitTiltWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"2: read the RO optional attribute default: InstalledOpenLimitTilt Error: %@", err); + [cluster readAttributeTxUnicastCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read TxUnicastCount attribute value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("installedOpenLimitTilt", "", "uint16")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("installedOpenLimitTilt", [value unsignedShortValue], 0U)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("installedOpenLimitTilt", [value unsignedShortValue], 65535U)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("TxUnicastCount", actualValue, 0UL)); } NextTest(); @@ -45160,44 +51062,44 @@ class Test_TC_WNCV_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR Test3aWriteAValueIntoTheRoOptionalAttributeInstalledOpenLimitTilt_35() + CHIP_ERROR TestValidateConstraintsOfAttributeTxUnicastCount_35() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id installedOpenLimitTiltArgument; - installedOpenLimitTiltArgument = [NSNumber numberWithUnsignedShort:255U]; - [cluster writeAttributeInstalledOpenLimitTiltWithValue:installedOpenLimitTiltArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"3a: write a value into the RO optional attribute: InstalledOpenLimitTilt " - @"Error: %@", - err); + [cluster readAttributeTxUnicastCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: TxUnicastCount Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("txUnicastCount", "", "uint32")); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test3bReadsBackTheRoOptionalAttributeInstalledOpenLimitTilt_36() + CHIP_ERROR TestReadTxBroadcastCountAttributeValue_36() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInstalledOpenLimitTiltWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3b: reads back the RO optional attribute: InstalledOpenLimitTilt Error: %@", err); + [cluster readAttributeTxBroadcastCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read TxBroadcastCount attribute value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("installedOpenLimitTilt", "", "uint16")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("installedOpenLimitTilt", [value unsignedShortValue], 0U)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("installedOpenLimitTilt", [value unsignedShortValue], 65535U)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("TxBroadcastCount", actualValue, 0UL)); } NextTest(); @@ -45206,94 +51108,90 @@ class Test_TC_WNCV_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR Test2ReadTheRoOptionalAttributeDefaultInstalledClosedLimitTilt_37() + CHIP_ERROR TestValidateConstraintsOfAttributeTxBroadcastCount_37() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInstalledClosedLimitTiltWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"2: read the RO optional attribute default: InstalledClosedLimitTilt Error: %@", err); + [cluster readAttributeTxBroadcastCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: TxBroadcastCount Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("installedClosedLimitTilt", "", "uint16")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("installedClosedLimitTilt", [value unsignedShortValue], 0U)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("installedClosedLimitTilt", [value unsignedShortValue], 65535U)); - } - + VerifyOrReturn(CheckConstraintType("txBroadcastCount", "", "uint32")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test3aWriteAValueIntoTheRoOptionalAttributeInstalledClosedLimitTilt_38() + CHIP_ERROR TestReadTxNoAckRequestedCountAttributeValue_38() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id installedClosedLimitTiltArgument; - installedClosedLimitTiltArgument = [NSNumber numberWithUnsignedShort:255U]; - [cluster writeAttributeInstalledClosedLimitTiltWithValue:installedClosedLimitTiltArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"3a: write a value into the RO optional attribute: " - @"InstalledClosedLimitTilt Error: %@", - err); + [cluster readAttributeTxNoAckRequestedCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read TxNoAckRequestedCount attribute value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("TxNoAckRequestedCount", actualValue, 0UL)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test3bReadsBackTheRoOptionalAttributeInstalledClosedLimitTilt_39() + CHIP_ERROR TestValidateConstraintsOfAttributeTxNoAckRequestedCount_39() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInstalledClosedLimitTiltWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3b: reads back the RO optional attribute: InstalledClosedLimitTilt Error: %@", err); + [cluster readAttributeTxNoAckRequestedCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: TxNoAckRequestedCount Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("installedClosedLimitTilt", "", "uint16")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("installedClosedLimitTilt", [value unsignedShortValue], 0U)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("installedClosedLimitTilt", [value unsignedShortValue], 65535U)); - } - + VerifyOrReturn(CheckConstraintType("txNoAckRequestedCount", "", "uint32")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test4ReadTheRoMandatoryAttributeDefaultSafetyStatus_40() + CHIP_ERROR TestReadTxDataCountAttributeValue_40() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeSafetyStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"4: read the RO mandatory attribute default: SafetyStatus Error: %@", err); + [cluster readAttributeTxDataCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read TxDataCount attribute value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("safetyStatus", "", "map16")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("safetyStatus", [value unsignedShortValue], 0U)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("safetyStatus", [value unsignedShortValue], 2047U)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("TxDataCount", actualValue, 0UL)); } NextTest(); @@ -45302,39 +51200,44 @@ class Test_TC_WNCV_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR Test5aWriteAValueIntoTheRoMandatoryAttributeSafetyStatus_41() + CHIP_ERROR TestValidateConstraintsOfAttributeTxDataCount_41() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id safetyStatusArgument; - safetyStatusArgument = [NSNumber numberWithUnsignedShort:4096U]; - [cluster writeAttributeSafetyStatusWithValue:safetyStatusArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"5a: write a value into the RO mandatory attribute: SafetyStatus Error: %@", err); + [cluster readAttributeTxDataCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: TxDataCount Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("txDataCount", "", "uint32")); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test5bReadsBackTheRoMandatoryAttributeSafetyStatus_42() + CHIP_ERROR TestReadTxDataPollCountAttributeValue_42() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeSafetyStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"5b: reads back the RO mandatory attribute: SafetyStatus Error: %@", err); + [cluster readAttributeTxDataPollCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read TxDataPollCount attribute value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("safetyStatus", "", "map16")); - if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("safetyStatus", value, 4096U)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("TxDataPollCount", actualValue, 0UL)); } NextTest(); @@ -45343,94 +51246,90 @@ class Test_TC_WNCV_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR Test4ReadTheRoOptionalAttributeDefaultCurrentPositionLift_43() + CHIP_ERROR TestValidateConstraintsOfAttributeTxDataPollCount_43() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentPositionLiftWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"4: read the RO optional attribute default: CurrentPositionLift Error: %@", err); + [cluster readAttributeTxDataPollCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: TxDataPollCount Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("currentPositionLift", "", "uint16")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("currentPositionLift", [value unsignedShortValue], 0U)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("currentPositionLift", [value unsignedShortValue], 65535U)); - } - + VerifyOrReturn(CheckConstraintType("txDataPollCount", "", "uint32")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test5aWriteAValueIntoTheRoOptionalAttributeCurrentPositionLift_44() + CHIP_ERROR TestReadTxBeaconCountAttributeValue_44() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id currentPositionLiftArgument; - currentPositionLiftArgument = [NSNumber numberWithUnsignedShort:255U]; - [cluster - writeAttributeCurrentPositionLiftWithValue:currentPositionLiftArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"5a: write a value into the RO optional attribute: CurrentPositionLift Error: %@", - err); + [cluster readAttributeTxBeaconCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read TxBeaconCount attribute value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("TxBeaconCount", actualValue, 0UL)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test5bReadsBackTheRoOptionalAttributeCurrentPositionLift_45() + CHIP_ERROR TestValidateConstraintsOfAttributeTxBeaconCount_45() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentPositionLiftWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"5b: reads back the RO optional attribute: CurrentPositionLift Error: %@", err); + [cluster readAttributeTxBeaconCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: TxBeaconCount Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("currentPositionLift", "", "uint16")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("currentPositionLift", [value unsignedShortValue], 0U)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("currentPositionLift", [value unsignedShortValue], 65535U)); - } - + VerifyOrReturn(CheckConstraintType("txBeaconCount", "", "uint32")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test4ReadTheRoOptionalAttributeDefaultCurrentPositionTilt_46() + CHIP_ERROR TestReadTxBeaconRequestCountAttributeValue_46() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentPositionTiltWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"4: read the RO optional attribute default: CurrentPositionTilt Error: %@", err); + [cluster readAttributeTxBeaconRequestCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read TxBeaconRequestCount attribute value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("currentPositionTilt", "", "uint16")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("currentPositionTilt", [value unsignedShortValue], 0U)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("currentPositionTilt", [value unsignedShortValue], 65535U)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("TxBeaconRequestCount", actualValue, 0UL)); } NextTest(); @@ -45439,44 +51338,44 @@ class Test_TC_WNCV_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR Test5aWriteAValueIntoTheRoOptionalAttributeCurrentPositionTilt_47() + CHIP_ERROR TestValidateConstraintsOfAttributeTxBeaconRequestCount_47() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id currentPositionTiltArgument; - currentPositionTiltArgument = [NSNumber numberWithUnsignedShort:255U]; - [cluster - writeAttributeCurrentPositionTiltWithValue:currentPositionTiltArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"5a: write a value into the RO optional attribute: CurrentPositionTilt Error: %@", - err); + [cluster readAttributeTxBeaconRequestCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: TxBeaconRequestCount Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("txBeaconRequestCount", "", "uint32")); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test5bReadsBackTheRoOptionalAttributeCurrentPositionTilt_48() + CHIP_ERROR TestReadTxOtherCountAttributeValue_48() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentPositionTiltWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"5b: reads back the RO optional attribute: CurrentPositionTilt Error: %@", err); + [cluster readAttributeTxOtherCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read TxOtherCount attribute value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("currentPositionTilt", "", "uint16")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("currentPositionTilt", [value unsignedShortValue], 0U)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("currentPositionTilt", [value unsignedShortValue], 65535U)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("TxOtherCount", actualValue, 0UL)); } NextTest(); @@ -45485,99 +51384,91 @@ class Test_TC_WNCV_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR Test4ReadTheRoOptionalAttributeDefaultCurrentPositionLiftPercentage_49() + CHIP_ERROR TestValidateConstraintsOfAttributeTxOtherCount_49() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeCurrentPositionLiftPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"4: read the RO optional attribute default: CurrentPositionLiftPercentage Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + [cluster readAttributeTxOtherCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: TxOtherCount Error: %@", err); - VerifyOrReturn(CheckConstraintType("currentPositionLiftPercentage", "", "Percent")); - if (value != nil) { - VerifyOrReturn( - CheckConstraintMinValue("currentPositionLiftPercentage", [value unsignedCharValue], 0)); - } - if (value != nil) { - VerifyOrReturn( - CheckConstraintMaxValue("currentPositionLiftPercentage", [value unsignedCharValue], 100)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("txOtherCount", "", "uint32")); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test5aWriteAValueIntoTheRoOptionalAttributeCurrentPositionLiftPercentage_50() + CHIP_ERROR TestReadTxRetryCountAttributeValue_50() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id currentPositionLiftPercentageArgument; - currentPositionLiftPercentageArgument = [NSNumber numberWithUnsignedChar:200]; - [cluster - writeAttributeCurrentPositionLiftPercentageWithValue:currentPositionLiftPercentageArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"5a: write a value into the RO optional attribute: " - @"CurrentPositionLiftPercentage Error: %@", - err); + [cluster readAttributeTxRetryCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read TxRetryCount attribute value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("TxRetryCount", actualValue, 0UL)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test5bReadsBackTheRoOptionalAttributeCurrentPositionLiftPercentage_51() + CHIP_ERROR TestValidateConstraintsOfAttributeTxRetryCount_51() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeCurrentPositionLiftPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"5b: reads back the RO optional attribute: CurrentPositionLiftPercentage Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + [cluster readAttributeTxRetryCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: TxRetryCount Error: %@", err); - VerifyOrReturn(CheckConstraintType("currentPositionLiftPercentage", "", "Percent")); - if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("currentPositionLiftPercentage", value, 200)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("txRetryCount", "", "uint32")); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test4ReadTheRoOptionalAttributeDefaultCurrentPositionTiltPercentage_52() + CHIP_ERROR TestReadTxDirectMaxRetryExpiryCountAttributeValue_52() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster - readAttributeCurrentPositionTiltPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"4: read the RO optional attribute default: CurrentPositionTiltPercentage Error: %@", err); + readAttributeTxDirectMaxRetryExpiryCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read TxDirectMaxRetryExpiryCount attribute value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("currentPositionTiltPercentage", "", "Percent")); - if (value != nil) { - VerifyOrReturn( - CheckConstraintMinValue("currentPositionTiltPercentage", [value unsignedCharValue], 0)); - } - if (value != nil) { - VerifyOrReturn( - CheckConstraintMaxValue("currentPositionTiltPercentage", [value unsignedCharValue], 100)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("TxDirectMaxRetryExpiryCount", actualValue, 0UL)); } NextTest(); @@ -45586,43 +51477,46 @@ class Test_TC_WNCV_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR Test5aWriteAValueIntoTheRoOptionalAttributeCurrentPositionTiltPercentage_53() + CHIP_ERROR TestValidateConstraintsOfAttributeTxDirectMaxRetryExpiryCount_53() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id currentPositionTiltPercentageArgument; - currentPositionTiltPercentageArgument = [NSNumber numberWithUnsignedChar:200]; [cluster - writeAttributeCurrentPositionTiltPercentageWithValue:currentPositionTiltPercentageArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"5a: write a value into the RO optional attribute: " - @"CurrentPositionTiltPercentage Error: %@", - err); + readAttributeTxDirectMaxRetryExpiryCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: TxDirectMaxRetryExpiryCount Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("txDirectMaxRetryExpiryCount", "", "uint32")); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test5bReadsBackTheRoOptionalAttributeCurrentPositionTiltPercentage_54() + CHIP_ERROR TestReadTxIndirectMaxRetryExpiryCountAttributeValue_54() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster - readAttributeCurrentPositionTiltPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"5b: reads back the RO optional attribute: CurrentPositionTiltPercentage Error: %@", err); + readAttributeTxIndirectMaxRetryExpiryCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read TxIndirectMaxRetryExpiryCount attribute value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("currentPositionTiltPercentage", "", "Percent")); - if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("currentPositionTiltPercentage", value, 200)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("TxIndirectMaxRetryExpiryCount", actualValue, 0UL)); } NextTest(); @@ -45630,330 +51524,138 @@ class Test_TC_WNCV_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } -}; -class Test_TC_WNCV_2_2 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_WNCV_2_2() - : TestCommandBridge("Test_TC_WNCV_2_2") - , mTestIndex(0) + CHIP_ERROR TestValidateConstraintsOfAttributeTxIndirectMaxRetryExpiryCount_55() { - 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) + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - ~Test_TC_WNCV_2_2() {} + [cluster + readAttributeTxIndirectMaxRetryExpiryCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: TxIndirectMaxRetryExpiryCount Error: %@", err); - /////////// TestCommand Interface ///////// - void NextTest() override + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("txIndirectMaxRetryExpiryCount", "", "uint32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTxErrCcaCountAttributeValue_56() { - CHIP_ERROR err = CHIP_NO_ERROR; + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_2_2\n"); - } + [cluster readAttributeTxErrCcaCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read TxErrCcaCount attribute value Error: %@", err); - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_2_2\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + VerifyOrReturn(CheckValue("status", err, 0)); - Wait(); + { + id actualValue = value; + VerifyOrReturn(CheckValue("TxErrCcaCount", actualValue, 0UL)); + } - // 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; - } + 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 TestValidateConstraintsOfAttributeTxErrCcaCount_57() { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 1; + [cluster readAttributeTxErrCcaCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: TxErrCcaCount Error: %@", err); - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("txErrCcaCount", "", "uint32")); + NextTest(); + }]; - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } -}; -class Test_TC_WNCV_2_3 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_WNCV_2_3() - : TestCommandBridge("Test_TC_WNCV_2_3") - , mTestIndex(0) + CHIP_ERROR TestReadTxErrAbortCountAttributeValue_58() { - 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_2_3() {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_2_3\n"); - } + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_2_3\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + [cluster readAttributeTxErrAbortCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read TxErrAbortCount attribute value 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 : 1a: TH set the Mode Attribute bit0 of the DUT\n"); - if (ShouldSkip("WNCV_REVERSAL")) { - NextTest(); - return; - } - err = Test1aThSetTheModeAttributeBit0OfTheDut_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : 1b: TH reads ConfigStatus attribute from DUT\n"); - if (ShouldSkip("WNCV_REVERSAL")) { - NextTest(); - return; - } - err = Test1bThReadsConfigStatusAttributeFromDut_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : 1c: TH clear the Mode Attribute bit0 of the DUT\n"); - if (ShouldSkip("WNCV_REVERSAL")) { - NextTest(); - return; - } - err = Test1cThClearTheModeAttributeBit0OfTheDut_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : 1d: TH reads ConfigStatus attribute from DUT\n"); - if (ShouldSkip("WNCV_REVERSAL")) { - NextTest(); - return; - } - err = Test1dThReadsConfigStatusAttributeFromDut_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : 2a: TH set the Mode Attribute bit1 of the DUT\n"); - if (ShouldSkip("WNCV_CALIBRATION")) { - NextTest(); - return; - } - err = Test2aThSetTheModeAttributeBit1OfTheDut_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : 2b: TH reads ConfigStatus attribute from DUT\n"); - if (ShouldSkip("WNCV_CALIBRATION")) { - NextTest(); - return; - } - err = Test2bThReadsConfigStatusAttributeFromDut_6(); - break; - case 7: - ChipLogProgress( - chipTool, " ***** Test Step 7 : 2c: If (ConfigStatus bit0 == 0) TH send DownOrClose command to the DUT\n"); - if (ShouldSkip("WNCV_CALIBRATION")) { - NextTest(); - return; - } - err = Test2cIfConfigStatusBit00ThSendDownOrCloseCommandToTheDut_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : 2d: TH clear the Mode Attribute bit1 of the DUT\n"); - if (ShouldSkip("WNCV_CALIBRATION")) { - NextTest(); - return; - } - err = Test2dThClearTheModeAttributeBit1OfTheDut_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : 2e: TH reads ConfigStatus attribute from DUT\n"); - if (ShouldSkip("WNCV_CALIBRATION")) { - NextTest(); - return; - } - err = Test2eThReadsConfigStatusAttributeFromDut_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : 2f: TH reads the Mode Attribute from the DUT\n"); - if (ShouldSkip("WNCV_CALIBRATION")) { - NextTest(); - return; - } - err = Test2fThReadsTheModeAttributeFromTheDut_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : 2g: TH send DownOrClose command to the DUT\n"); - if (ShouldSkip("WNCV_CALIBRATION")) { - NextTest(); - return; - } - err = Test2gThSendDownOrCloseCommandToTheDut_11(); - break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : 3a: TH set the Mode Attribute bit2 of the DUT\n"); - if (ShouldSkip("WNCV_MAINTENANCE")) { - NextTest(); - return; - } - err = Test3aThSetTheModeAttributeBit2OfTheDut_12(); - break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : 3c: TH reads ConfigStatus attribute from DUT\n"); - if (ShouldSkip("WNCV_MAINTENANCE")) { - NextTest(); - return; - } - err = Test3cThReadsConfigStatusAttributeFromDut_13(); - break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : 3c: TH send DownOrClose command to the DUT\n"); - if (ShouldSkip("WNCV_MAINTENANCE")) { - NextTest(); - return; - } - err = Test3cThSendDownOrCloseCommandToTheDut_14(); - break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : 3d: TH clear the Mode Attribute bit2 of the DUT\n"); - if (ShouldSkip("WNCV_MAINTENANCE")) { - NextTest(); - return; - } - err = Test3dThClearTheModeAttributeBit2OfTheDut_15(); - break; - case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : 3e: TH reads ConfigStatus attribute from DUT\n"); - if (ShouldSkip("WNCV_MAINTENANCE")) { - NextTest(); - return; - } - err = Test3eThReadsConfigStatusAttributeFromDut_16(); - break; - case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : 3f: TH reads the Mode Attribute from the DUT\n"); - if (ShouldSkip("WNCV_MAINTENANCE")) { - NextTest(); - return; - } - err = Test3fThReadsTheModeAttributeFromTheDut_17(); - break; - case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : 3g: TH send DownOrClose command to the DUT\n"); - if (ShouldSkip("WNCV_MAINTENANCE")) { - NextTest(); - return; + { + id actualValue = value; + VerifyOrReturn(CheckValue("TxErrAbortCount", actualValue, 0UL)); } - err = Test3gThSendDownOrCloseCommandToTheDut_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; + NextTest(); + }]; - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR Test1aThSetTheModeAttributeBit0OfTheDut_1() + CHIP_ERROR TestValidateConstraintsOfAttributeTxErrAbortCount_59() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id modeArgument; - modeArgument = [NSNumber numberWithUnsignedChar:1]; - [cluster writeAttributeModeWithValue:modeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"1a: TH set the Mode Attribute bit0 of the DUT Error: %@", err); + [cluster readAttributeTxErrAbortCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: TxErrAbortCount Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("txErrAbortCount", "", "uint32")); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test1bThReadsConfigStatusAttributeFromDut_2() + CHIP_ERROR TestReadTxErrBusyChannelCountAttributeValue_60() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeConfigStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"1b: TH reads ConfigStatus attribute from DUT Error: %@", err); + [cluster readAttributeTxErrBusyChannelCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read TxErrBusyChannelCount attribute value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("configStatus", [value unsignedCharValue], 4)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("configStatus", [value unsignedCharValue], 127)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("TxErrBusyChannelCount", actualValue, 0UL)); } NextTest(); @@ -45962,42 +51664,44 @@ class Test_TC_WNCV_2_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR Test1cThClearTheModeAttributeBit0OfTheDut_3() + CHIP_ERROR TestValidateConstraintsOfAttributeTxErrBusyChannelCount_61() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id modeArgument; - modeArgument = [NSNumber numberWithUnsignedChar:0]; - [cluster writeAttributeModeWithValue:modeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"1c: TH clear the Mode Attribute bit0 of the DUT Error: %@", err); + [cluster readAttributeTxErrBusyChannelCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: TxErrBusyChannelCount Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("txErrBusyChannelCount", "", "uint32")); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test1dThReadsConfigStatusAttributeFromDut_4() + CHIP_ERROR TestReadRxTotalCountAttributeValue_62() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeConfigStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"1d: TH reads ConfigStatus attribute from DUT Error: %@", err); + [cluster readAttributeRxTotalCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read RxTotalCount attribute value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("configStatus", [value unsignedCharValue], 0)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("configStatus", [value unsignedCharValue], 127)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("RxTotalCount", actualValue, 0UL)); } NextTest(); @@ -46006,46 +51710,44 @@ class Test_TC_WNCV_2_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR Test2aThSetTheModeAttributeBit1OfTheDut_5() + CHIP_ERROR TestValidateConstraintsOfAttributeRxTotalCount_63() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id modeArgument; - modeArgument = [NSNumber numberWithUnsignedChar:2]; - [cluster writeAttributeModeWithValue:modeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"2a: TH set the Mode Attribute bit1 of the DUT Error: %@", err); + [cluster readAttributeRxTotalCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: RxTotalCount Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("rxTotalCount", "", "uint32")); + NextTest(); + }]; return CHIP_NO_ERROR; } - NSNumber * _Nonnull configStatusValA; - CHIP_ERROR Test2bThReadsConfigStatusAttributeFromDut_6() + CHIP_ERROR TestReadRxUnicastCountAttributeValue_64() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeConfigStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"2b: TH reads ConfigStatus attribute from DUT Error: %@", err); + [cluster readAttributeRxUnicastCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read RxUnicastCount attribute value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("configStatus", [value unsignedCharValue], 0)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("configStatus", [value unsignedCharValue], 127)); - } { - configStatusValA = value; + id actualValue = value; + VerifyOrReturn(CheckValue("RxUnicastCount", actualValue, 0UL)); } NextTest(); @@ -46054,58 +51756,44 @@ class Test_TC_WNCV_2_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR Test2cIfConfigStatusBit00ThSendDownOrCloseCommandToTheDut_7() + CHIP_ERROR TestValidateConstraintsOfAttributeRxUnicastCount_65() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster downOrCloseWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"2c: If (ConfigStatus bit0 == 0) TH send DownOrClose command to the DUT Error: %@", err); + [cluster readAttributeRxUnicastCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: RxUnicastCount Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_FAILURE)); + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("rxUnicastCount", "", "uint32")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test2dThClearTheModeAttributeBit1OfTheDut_8() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id modeArgument; - modeArgument = [NSNumber numberWithUnsignedChar:0]; - [cluster writeAttributeModeWithValue:modeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"2d: TH clear the Mode Attribute bit1 of the DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR Test2eThReadsConfigStatusAttributeFromDut_9() + CHIP_ERROR TestReadRxBroadcastCountAttributeValue_66() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeConfigStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"2e: TH reads ConfigStatus attribute from DUT Error: %@", err); + [cluster readAttributeRxBroadcastCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read RxBroadcastCount attribute value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("configStatus", [value unsignedCharValue], 1)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("configStatus", [value unsignedCharValue], 127)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("RxBroadcastCount", actualValue, 0UL)); } NextTest(); @@ -46114,87 +51802,90 @@ class Test_TC_WNCV_2_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR Test2fThReadsTheModeAttributeFromTheDut_10() + CHIP_ERROR TestValidateConstraintsOfAttributeRxBroadcastCount_67() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"2f: TH reads the Mode Attribute from the DUT Error: %@", err); + [cluster readAttributeRxBroadcastCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: RxBroadcastCount Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("mode", [value unsignedCharValue], 0)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("mode", [value unsignedCharValue], 127)); - } - + VerifyOrReturn(CheckConstraintType("rxBroadcastCount", "", "uint32")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test2gThSendDownOrCloseCommandToTheDut_11() + CHIP_ERROR TestReadRxDataCountAttributeValue_68() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster downOrCloseWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"2g: TH send DownOrClose command to the DUT Error: %@", err); + [cluster readAttributeRxDataCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read RxDataCount attribute value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("RxDataCount", actualValue, 0UL)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test3aThSetTheModeAttributeBit2OfTheDut_12() + CHIP_ERROR TestValidateConstraintsOfAttributeRxDataCount_69() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id modeArgument; - modeArgument = [NSNumber numberWithUnsignedChar:4]; - [cluster writeAttributeModeWithValue:modeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"3a: TH set the Mode Attribute bit2 of the DUT Error: %@", err); + [cluster readAttributeRxDataCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: RxDataCount Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("rxDataCount", "", "uint32")); + NextTest(); + }]; return CHIP_NO_ERROR; } - NSNumber * _Nonnull configStatusValB; - CHIP_ERROR Test3cThReadsConfigStatusAttributeFromDut_13() + CHIP_ERROR TestReadRxDataPollCountAttributeValue_70() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeConfigStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3c: TH reads ConfigStatus attribute from DUT Error: %@", err); + [cluster readAttributeRxDataPollCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read RxDataPollCount attribute value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("configStatus", [value unsignedCharValue], 0)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("configStatus", [value unsignedCharValue], 127)); - } { - configStatusValB = value; + id actualValue = value; + VerifyOrReturn(CheckValue("RxDataPollCount", actualValue, 0UL)); } NextTest(); @@ -46203,82 +51894,90 @@ class Test_TC_WNCV_2_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR Test3cThSendDownOrCloseCommandToTheDut_14() + CHIP_ERROR TestValidateConstraintsOfAttributeRxDataPollCount_71() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster downOrCloseWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"3c: TH send DownOrClose command to the DUT Error: %@", err); + [cluster readAttributeRxDataPollCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: RxDataPollCount Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_BUSY)); + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("rxDataPollCount", "", "uint32")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test3dThClearTheModeAttributeBit2OfTheDut_15() + CHIP_ERROR TestReadRxBeaconCountAttributeValue_72() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id modeArgument; - modeArgument = [NSNumber numberWithUnsignedChar:0]; - [cluster writeAttributeModeWithValue:modeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"3d: TH clear the Mode Attribute bit2 of the DUT Error: %@", err); + [cluster readAttributeRxBeaconCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read RxBeaconCount attribute value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValue("RxBeaconCount", actualValue, 0UL)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test3eThReadsConfigStatusAttributeFromDut_16() + CHIP_ERROR TestValidateConstraintsOfAttributeRxBeaconCount_73() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeConfigStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3e: TH reads ConfigStatus attribute from DUT Error: %@", err); + [cluster readAttributeRxBeaconCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: RxBeaconCount Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("configStatus", [value unsignedCharValue], 1)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("configStatus", [value unsignedCharValue], 127)); - } - + VerifyOrReturn(CheckConstraintType("rxBeaconCount", "", "uint32")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test3fThReadsTheModeAttributeFromTheDut_17() + CHIP_ERROR TestReadRxBeaconRequestCountAttributeValue_74() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3f: TH reads the Mode Attribute from the DUT Error: %@", err); + [cluster readAttributeRxBeaconRequestCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read RxBeaconRequestCount attribute value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("mode", [value unsignedCharValue], 0)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("mode", [value unsignedCharValue], 127)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("RxBeaconRequestCount", actualValue, 0UL)); } NextTest(); @@ -46287,124 +51986,182 @@ class Test_TC_WNCV_2_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR Test3gThSendDownOrCloseCommandToTheDut_18() + CHIP_ERROR TestValidateConstraintsOfAttributeRxBeaconRequestCount_75() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster downOrCloseWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"3g: TH send DownOrClose command to the DUT Error: %@", err); + [cluster readAttributeRxBeaconRequestCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: RxBeaconRequestCount Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckConstraintType("rxBeaconRequestCount", "", "uint32")); NextTest(); }]; return CHIP_NO_ERROR; } -}; -class Test_TC_WNCV_2_4 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_WNCV_2_4() - : TestCommandBridge("Test_TC_WNCV_2_4") - , mTestIndex(0) + CHIP_ERROR TestReadRxOtherCountAttributeValue_76() { - 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) + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - ~Test_TC_WNCV_2_4() {} + [cluster readAttributeRxOtherCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read RxOtherCount attribute value Error: %@", err); - /////////// TestCommand Interface ///////// - void NextTest() override + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("RxOtherCount", actualValue, 0UL)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestValidateConstraintsOfAttributeRxOtherCount_77() { - CHIP_ERROR err = CHIP_NO_ERROR; + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_2_4\n"); - } + [cluster readAttributeRxOtherCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: RxOtherCount Error: %@", err); - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_2_4\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + VerifyOrReturn(CheckValue("status", err, 0)); - Wait(); + VerifyOrReturn(CheckConstraintType("rxOtherCount", "", "uint32")); + 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 : Reads Type attribute from DUT\n"); - if (ShouldSkip("A_TYPE")) { - NextTest(); - return; - } - err = TestReadsTypeAttributeFromDut_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Reads Type attribute constraints\n"); - if (ShouldSkip("A_TYPE")) { - NextTest(); - return; + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadRxAddressFilteredCountAttributeValue_78() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeRxAddressFilteredCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read RxAddressFilteredCount attribute value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("RxAddressFilteredCount", actualValue, 0UL)); } - err = TestReadsTypeAttributeConstraints_2(); - 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 TestValidateConstraintsOfAttributeRxAddressFilteredCount_79() { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeRxAddressFilteredCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: RxAddressFilteredCount Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("rxAddressFilteredCount", "", "uint32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 3; + CHIP_ERROR TestReadRxDestAddrFilteredCountAttributeValue_80() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; + [cluster readAttributeRxDestAddrFilteredCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read RxDestAddrFilteredCount attribute value Error: %@", err); - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("RxDestAddrFilteredCount", actualValue, 0UL)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestValidateConstraintsOfAttributeRxDestAddrFilteredCount_81() { - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeRxDestAddrFilteredCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: RxDestAddrFilteredCount Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("rxDestAddrFilteredCount", "", "uint32")); + NextTest(); + }]; + return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsTypeAttributeFromDut_1() + CHIP_ERROR TestReadRxDuplicatedCountAttributeValue_82() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads Type attribute from DUT Error: %@", err); + [cluster readAttributeRxDuplicatedCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read RxDuplicatedCount attribute value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("Type", actualValue, 0)); + VerifyOrReturn(CheckValue("RxDuplicatedCount", actualValue, 0UL)); } NextTest(); @@ -46413,23 +52170,44 @@ class Test_TC_WNCV_2_4 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsTypeAttributeConstraints_2() + CHIP_ERROR TestValidateConstraintsOfAttributeRxDuplicatedCount_83() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads Type attribute constraints Error: %@", err); + [cluster readAttributeRxDuplicatedCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: RxDuplicatedCount Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("type", "", "enum8")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("type", [value unsignedCharValue], 0)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("type", [value unsignedCharValue], 9)); + VerifyOrReturn(CheckConstraintType("rxDuplicatedCount", "", "uint32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadRxErrNoFrameCountAttributeValue_84() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeRxErrNoFrameCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read RxErrNoFrameCount attribute value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("RxErrNoFrameCount", actualValue, 0UL)); } NextTest(); @@ -46437,108 +52215,93 @@ class Test_TC_WNCV_2_4 : public TestCommandBridge { return CHIP_NO_ERROR; } -}; -class Test_TC_WNCV_2_5 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_WNCV_2_5() - : TestCommandBridge("Test_TC_WNCV_2_5") - , mTestIndex(0) + CHIP_ERROR TestValidateConstraintsOfAttributeRxErrNoFrameCount_85() { - 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) + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - ~Test_TC_WNCV_2_5() {} + [cluster readAttributeRxErrNoFrameCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: RxErrNoFrameCount Error: %@", err); - /////////// TestCommand Interface ///////// - void NextTest() override + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("rxErrNoFrameCount", "", "uint32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadRxErrUnknownNeighborCountAttributeValue_86() { - CHIP_ERROR err = CHIP_NO_ERROR; + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_2_5\n"); - } + [cluster + readAttributeRxErrUnknownNeighborCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read RxErrUnknownNeighborCount attribute value Error: %@", err); - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_2_5\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + VerifyOrReturn(CheckValue("status", err, 0)); - Wait(); + { + id actualValue = value; + VerifyOrReturn(CheckValue("RxErrUnknownNeighborCount", actualValue, 0UL)); + } - // 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 EndProductType attribute from DUT\n"); - if (ShouldSkip("A_ENDPRODUCTTYPE")) { - NextTest(); - return; - } - err = TestReadsEndProductTypeAttributeFromDut_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Reads EndProductType attribute constraints from DUT\n"); - if (ShouldSkip("A_ENDPRODUCTTYPE")) { NextTest(); - return; - } - err = TestReadsEndProductTypeAttributeConstraintsFromDut_2(); - break; - } + }]; - 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 TestValidateConstraintsOfAttributeRxErrUnknownNeighborCount_87() { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 3; + [cluster + readAttributeRxErrUnknownNeighborCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: RxErrUnknownNeighborCount Error: %@", err); - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("rxErrUnknownNeighborCount", "", "uint32")); + NextTest(); + }]; - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsEndProductTypeAttributeFromDut_1() + CHIP_ERROR TestReadRxErrInvalidScrAddrCountAttributeValue_88() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEndProductTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads EndProductType attribute from DUT Error: %@", err); + [cluster readAttributeRxErrInvalidSrcAddrCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read RxErrInvalidScrAddrCount attribute value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("EndProductType", actualValue, 0)); + VerifyOrReturn(CheckValue("RxErrInvalidSrcAddrCount", actualValue, 0UL)); } NextTest(); @@ -46547,23 +52310,44 @@ class Test_TC_WNCV_2_5 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsEndProductTypeAttributeConstraintsFromDut_2() + CHIP_ERROR TestValidateConstraintsOfAttributeRxErrInvalidSrcAddrCount_89() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEndProductTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads EndProductType attribute constraints from DUT Error: %@", err); + [cluster readAttributeRxErrInvalidSrcAddrCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: RxErrInvalidSrcAddrCount Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("endProductType", "", "enum8")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("endProductType", [value unsignedCharValue], 0)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("endProductType", [value unsignedCharValue], 23)); + VerifyOrReturn(CheckConstraintType("rxErrInvalidSrcAddrCount", "", "uint32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadRxErrSecCountAttributeValue_90() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeRxErrSecCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read RxErrSecCount attribute value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("RxErrSecCount", actualValue, 0UL)); } NextTest(); @@ -46571,653 +52355,580 @@ class Test_TC_WNCV_2_5 : public TestCommandBridge { return CHIP_NO_ERROR; } -}; -class Test_TC_WNCV_3_1 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_WNCV_3_1() - : TestCommandBridge("Test_TC_WNCV_3_1") - , mTestIndex(0) + CHIP_ERROR TestValidateConstraintsOfAttributeRxErrInvalidSrcAddrCount_91() { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeRxErrSecCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: RxErrInvalidSrcAddrCount Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("rxErrSecCount", "", "uint32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_WNCV_3_1() {} + CHIP_ERROR TestReadRxErrFcsCountAttributeValue_92() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - /////////// TestCommand Interface ///////// - void NextTest() override + [cluster readAttributeRxErrFcsCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read RxErrFcsCount attribute value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("RxErrFcsCount", actualValue, 0UL)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestValidateConstraintsOfAttributeRxErrFcsCount_93() { - CHIP_ERROR err = CHIP_NO_ERROR; + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_3_1\n"); - } + [cluster readAttributeRxErrFcsCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: RxErrFcsCount Error: %@", err); - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_3_1\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + VerifyOrReturn(CheckValue("status", err, 0)); - Wait(); + VerifyOrReturn(CheckConstraintType("rxErrFcsCount", "", "uint32")); + 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 : 0: Wait for the commissioned device to be retrieved\n"); - err = Test0WaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - 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 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 = Test1cIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_3(); - break; - 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 = Test1dIfPaLfThReadsCurrentPositionLiftPercentageOptionalAttributeFromDut_4(); - break; - 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 = Test1eIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_5(); - break; - 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 = 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 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 = 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; - } - - 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 = 25; - - 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() + CHIP_ERROR TestReadRxErrOtherCountAttributeValue_94() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + 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); + [cluster readAttributeRxErrOtherCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read RxErrOtherCount attribute value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("RxErrOtherCount", actualValue, 0UL)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test1bThWaitsFor10SecondsMovementsOnTheDevice_2() - { - WaitForMs(10000); - return CHIP_NO_ERROR; - } - - CHIP_ERROR Test1cIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_3() + CHIP_ERROR TestValidateConstraintsOfAttributeRxErrOtherCount_95() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + 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); + [cluster readAttributeRxErrOtherCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: RxErrOtherCount Error: %@", err); 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)); - } - + VerifyOrReturn(CheckConstraintType("rxErrOtherCount", "", "uint32")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test1dIfPaLfThReadsCurrentPositionLiftPercentageOptionalAttributeFromDut_4() + CHIP_ERROR TestReadActiveTimestampAttributeValue_96() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeCurrentPositionLiftPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"1d: If (PA & LF) TH reads CurrentPositionLiftPercentage optional attribute from DUT Error: %@", err); + [cluster readAttributeActiveTimestampWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read ActiveTimestamp attribute value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + 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)); - } + { + id actualValue = value; + VerifyOrReturn(CheckValue("ActiveTimestamp", actualValue, 0ULL)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test1eIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_5() + CHIP_ERROR TestValidateConstraintsOfAttributeActiveTimestamp_97() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentPositionTiltPercent100thsWithCompletionHandler:^( - NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"1e: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT Error: %@", err); + [cluster readAttributeActiveTimestampWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: ActiveTimestamp Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("currentPositionTiltPercent100ths", "", "uint16")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue( - "currentPositionTiltPercent100ths", [value unsignedShortValue], 1U)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue( - "currentPositionTiltPercent100ths", [value unsignedShortValue], 10000U)); - } - + VerifyOrReturn(CheckConstraintType("activeTimestamp", "", "uint64")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test1fIfPaTlThReadsCurrentPositionTiltPercentageOptionalAttributeFromDut_6() + CHIP_ERROR TestReadPendingTimestampAttributeValue_98() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeCurrentPositionTiltPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"1f: If (PA & TL) TH reads CurrentPositionTiltPercentage optional attribute from DUT Error: %@", err); + [cluster readAttributePendingTimestampWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read PendingTimestamp attribute value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("currentPositionTiltPercentage", "", "uint8")); - if (value != nil) { - VerifyOrReturn( - CheckConstraintMinValue("currentPositionTiltPercentage", [value unsignedCharValue], 1)); - } - if (value != nil) { - VerifyOrReturn( - CheckConstraintMaxValue("currentPositionTiltPercentage", [value unsignedCharValue], 100)); - } + { + id actualValue = value; + VerifyOrReturn(CheckValue("PendingTimestamp", actualValue, 0ULL)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - bool testSendClusterTest_TC_WNCV_3_1_7_WaitForReport_Fulfilled = false; - ResponseHandler _Nullable test_Test_TC_WNCV_3_1_OperationalStatus_Reported = nil; - CHIP_ERROR TestReport2SubscribeToDutReportsOnOperationalStatusAttribute_7() + CHIP_ERROR TestValidateConstraintsOfAttributePendingTimestamp_99() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - 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); + [cluster readAttributePendingTimestampWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: PendingTimestamp Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("operationalStatus", "", "map8")); - testSendClusterTest_TC_WNCV_3_1_7_WaitForReport_Fulfilled = true; - }; + VerifyOrReturn(CheckConstraintType("pendingTimestamp", "", "uint64")); + NextTest(); + }]; - NextTest(); return CHIP_NO_ERROR; } - CHIP_ERROR Test2SubscribeToDutReportsOnOperationalStatusAttribute_8() + CHIP_ERROR TestReadDelayAttributeValue_100() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + 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_1_7_WaitForReport_Fulfilled, SetCommandExitStatus(CHIP_ERROR_INCORRECT_STATE)); - NextTest(); + [cluster readAttributeDelayWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read Delay attribute value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("delay", actualValue, 0UL)); } - 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_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); - } - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test2aThSendsUpOrOpenCommandToDut_9() + CHIP_ERROR TestValidateConstraintsOfAttributeDelay_101() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster upOrOpenWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"2a: TH sends UpOrOpen command to DUT Error: %@", err); + [cluster readAttributeDelayWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: delay Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckConstraintType("delay", "", "uint32")); NextTest(); }]; return CHIP_NO_ERROR; } +}; - CHIP_ERROR Test2bDutUpdatesItsAttributes_10() +class Test_TC_LC_1_2 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_LC_1_2() + : TestCommandBridge("Test_TC_LC_1_2") + , mTestIndex(0) { - WaitForMs(100); - 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 Test2cIfPaLfThReadsTargetPositionLiftPercent100thsAttributeFromDut_11() + ~Test_TC_LC_1_2() {} + + /////////// TestCommand Interface ///////// + void NextTest() override { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + CHIP_ERROR err = CHIP_NO_ERROR; - [cluster readAttributeTargetPositionLiftPercent100thsWithCompletionHandler:^( - NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"2c: If (PA & LF) TH reads TargetPositionLiftPercent100ths attribute from DUT Error: %@", err); + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_LC_1_2\n"); + } - VerifyOrReturn(CheckValue("status", err, 0)); + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_LC_1_2\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("TargetPositionLiftPercent100ths", actualValue)); - VerifyOrReturn(CheckValue("TargetPositionLiftPercent100ths", actualValue, 0U)); - } + 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 : TH1 reads LabelList attribute from the DUT\n"); + err = TestTh1ReadsLabelListAttributeFromTheDut_1(); + break; + } - return CHIP_NO_ERROR; + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - CHIP_ERROR Test2eThLeaveTheDeviceMovingFor2Seconds_12() + void OnStatusUpdate(const chip::app::StatusIB & status) override { - WaitForMs(2000); - return CHIP_NO_ERROR; + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); } - CHIP_ERROR Test3a1VerifyDutReportsOperationalStatusAttributeToThAfterAUpOrOpen_13() + chip::System::Clock::Timeout GetWaitDuration() const override { - 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_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)); - } + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } - NextTest(); - }; +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 2; - return CHIP_NO_ERROR; - } + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; - CHIP_ERROR Test3a2DutUpdatesItsAttributes_14() + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { - WaitForMs(2000); + SetIdentity("alpha"); + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR Test3bIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_15() + CHIP_ERROR TestTh1ReadsLabelListAttributeFromTheDut_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestUserLabel * cluster = [[CHIPTestUserLabel alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentPositionLiftPercent100thsWithCompletionHandler:^( - NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3b: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT Error: %@", err); + [cluster readAttributeLabelListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH1 reads LabelList attribute from the 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], 9999U)); - } - NextTest(); }]; return CHIP_NO_ERROR; } +}; - CHIP_ERROR Test3cIfPaLfThReadsCurrentPositionLiftPercentageOptionalAttributeFromDut_16() +class Test_TC_WIFIDIAG_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_WIFIDIAG_1_1() + : TestCommandBridge("Test_TC_WIFIDIAG_1_1") + , mTestIndex(0) { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering 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 - readAttributeCurrentPositionLiftPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3c: If (PA & LF) TH reads CurrentPositionLiftPercentage optional attribute from DUT Error: %@", err); + ~Test_TC_WIFIDIAG_1_1() {} - VerifyOrReturn(CheckValue("status", err, 0)); + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; - VerifyOrReturn(CheckConstraintType("currentPositionLiftPercentage", "", "uint8")); - if (value != nil) { - VerifyOrReturn( - CheckConstraintMinValue("currentPositionLiftPercentage", [value unsignedCharValue], 0)); - } - if (value != nil) { - VerifyOrReturn( - CheckConstraintMaxValue("currentPositionLiftPercentage", [value unsignedCharValue], 99)); - } + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_WIFIDIAG_1_1\n"); + } - NextTest(); - }]; + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WIFIDIAG_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 : Reads NetworkInterface structure attribute from DUT\n"); + err = TestReadsNetworkInterfaceStructureAttributeFromDut_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Reads SecurityType attribute from DUT\n"); + err = TestReadsSecurityTypeAttributeFromDut_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Reads SecurityType attribute constraints\n"); + err = TestReadsSecurityTypeAttributeConstraints_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Reads WiFiVersion attribute constraints\n"); + err = TestReadsWiFiVersionAttributeConstraints_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Reads ChannelNumber attribute constraints\n"); + err = TestReadsChannelNumberAttributeConstraints_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Reads RSSI attribute constraints\n"); + err = TestReadsRssiAttributeConstraints_6(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + + 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() + { + SetIdentity("alpha"); + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR Test3dIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_17() + CHIP_ERROR TestReadsNetworkInterfaceStructureAttributeFromDut_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestGeneralDiagnostics * cluster = [[CHIPTestGeneralDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentPositionTiltPercent100thsWithCompletionHandler:^( - NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3d: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT Error: %@", err); + [cluster readAttributeNetworkInterfacesWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads NetworkInterface structure attribute from DUT Error: %@", err); 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)); - } - + VerifyOrReturn(CheckConstraintType("networkInterfaces", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test3eIfPaLfThReadsCurrentPositionTiltPercentageOptionalAttributeFromDut_18() + CHIP_ERROR TestReadsSecurityTypeAttributeFromDut_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestWiFiNetworkDiagnostics * cluster = [[CHIPTestWiFiNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeCurrentPositionTiltPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3e: If (PA & LF) TH reads CurrentPositionTiltPercentage optional attribute from DUT Error: %@", err); + [cluster readAttributeSecurityTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads SecurityType attribute from DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + 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)); - } + { + id actualValue = value; + VerifyOrReturn(CheckValueNull("SecurityType", actualValue)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test4aThSendsAStopMotionCommandToDut_19() + CHIP_ERROR TestReadsSecurityTypeAttributeConstraints_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestWiFiNetworkDiagnostics * cluster = [[CHIPTestWiFiNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + 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); + [cluster readAttributeSecurityTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads SecurityType attribute constraints Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckConstraintType("securityType", "", "enum")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test4bThWaitsFor3SecondsTheEndOfInertialMovementsOnTheDevice_20() - { - WaitForMs(3000); - return CHIP_NO_ERROR; - } - - CHIP_ERROR Test4cVerifyDutUpdateOperationalStatusAttributeToThAfterAStopMotion_21() + CHIP_ERROR TestReadsWiFiVersionAttributeConstraints_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestWiFiNetworkDiagnostics * cluster = [[CHIPTestWiFiNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + 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); + [cluster readAttributeWiFiVersionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads WiFiVersion attribute constraints Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("OperationalStatus", actualValue, 0)); + VerifyOrReturn(CheckConstraintType("wiFiVersion", "", "enum")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("wiFiVersion", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("wiFiVersion", [value unsignedCharValue], 5)); } NextTest(); @@ -47226,60 +52937,47 @@ class Test_TC_WNCV_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR Test5aThWaitsForXSecondsAttributesUpdateOnTheDevice_22() - { - WaitForMs(1000); - return CHIP_NO_ERROR; - } - - CHIP_ERROR Test5bIfPaLfThReadsTargetPositionLiftPercent100thsAttributeFromDut_23() + CHIP_ERROR TestReadsChannelNumberAttributeConstraints_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestWiFiNetworkDiagnostics * cluster = [[CHIPTestWiFiNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + 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); + [cluster readAttributeChannelNumberWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads ChannelNumber attribute constraints 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)); - } - + VerifyOrReturn(CheckConstraintType("channelNumber", "", "uint16")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test5cIfPaTlThReadsTargetPositionTiltPercent100thsAttributeFromDut_24() + CHIP_ERROR TestReadsRssiAttributeConstraints_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestWiFiNetworkDiagnostics * cluster = [[CHIPTestWiFiNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + 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); + [cluster readAttributeRssiWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads RSSI attribute constraints Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("targetPositionTiltPercent100ths", "", "uint16")); + VerifyOrReturn(CheckConstraintType("rssi", "", "int8")); if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue( - "targetPositionTiltPercent100ths", [value unsignedShortValue], 0U)); + VerifyOrReturn(CheckConstraintMinValue("rssi", [value charValue], -120)); } if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue( - "targetPositionTiltPercent100ths", [value unsignedShortValue], 9999U)); + VerifyOrReturn(CheckConstraintMaxValue("rssi", [value charValue], 0)); } NextTest(); @@ -47289,11 +52987,11 @@ class Test_TC_WNCV_3_1 : public TestCommandBridge { } }; -class Test_TC_WNCV_3_2 : public TestCommandBridge { +class Test_TC_WIFIDIAG_3_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_WNCV_3_2() - : TestCommandBridge("Test_TC_WNCV_3_2") + Test_TC_WIFIDIAG_3_1() + : TestCommandBridge("Test_TC_WIFIDIAG_3_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -47303,7 +53001,7 @@ class Test_TC_WNCV_3_2 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_WNCV_3_2() {} + ~Test_TC_WIFIDIAG_3_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -47311,11 +53009,11 @@ class Test_TC_WNCV_3_2 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_3_2\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_WIFIDIAG_3_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_3_2\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WIFIDIAG_3_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -47328,170 +53026,162 @@ class Test_TC_WNCV_3_2 : public TestCommandBridge { // 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(); + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + + 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 = 1; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity("alpha"); + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } +}; + +class Test_TC_WNCV_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_WNCV_1_1() + : TestCommandBridge("Test_TC_WNCV_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_WNCV_1_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_1_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_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 : 1a: TH sends UpOrOpen command to preposition the DUT in the opposite direction\n"); - err = Test1aThSendsUpOrOpenCommandToPrepositionTheDutInTheOppositeDirection_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : 2: read the global attribute: ClusterRevision\n"); + err = Test2ReadTheGlobalAttributeClusterRevision_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : 1b: TH Waits for 10 seconds movement(s) on the device\n"); - err = Test1bThWaitsFor10SecondsMovementsOnTheDevice_2(); + ChipLogProgress( + chipTool, " ***** Test Step 2 : 3a: write a value into the RO mandatory global attribute: ClusterRevision\n"); + err = Test3aWriteAValueIntoTheRoMandatoryGlobalAttributeClusterRevision_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 = Test1cIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : 3b: reads back global attribute: ClusterRevision\n"); + err = Test3bReadsBackGlobalAttributeClusterRevision_3(); break; 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 = Test1dIfPaLfThReadsCurrentPositionLiftPercentageOptionalAttributeFromDut_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_4(); break; 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 = Test1eIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : 2: read the global attribute: FeatureMap\n"); + err = Test2ReadTheGlobalAttributeFeatureMap_5(); break; 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 = 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 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 = 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(); + chipTool, " ***** Test Step 6 : 3a: write the default value to optional global attribute: FeatureMap\n"); + err = Test3aWriteTheDefaultValueToOptionalGlobalAttributeFeatureMap_6(); 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(); + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : 3b: reads back global attribute: FeatureMap\n"); + err = Test3bReadsBackGlobalAttributeFeatureMap_7(); 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(); + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 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(); + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 19: - ChipLogProgress(chipTool, " ***** Test Step 19 : 4a: TH sends a StopMotion command to DUT\n"); - err = Test4aThSendsAStopMotionCommandToDut_19(); + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); 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(); + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 21: - ChipLogProgress( - chipTool, " ***** Test Step 21 : 4c: Verify DUT update OperationalStatus attribute to TH after a StopMotion\n"); - err = Test4cVerifyDutUpdateOperationalStatusAttributeToThAfterAStopMotion_21(); + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 22: - ChipLogProgress(chipTool, " ***** Test Step 22 : 5a: TH waits for x seconds attributes update on the device\n"); - err = Test5aThWaitsForXSecondsAttributesUpdateOnTheDevice_22(); + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); 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(); + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); 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(); + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; } - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + // Go on to the next test. + WaitForMs(0); } chip::System::Clock::Timeout GetWaitDuration() const override @@ -47501,62 +53191,38 @@ class Test_TC_WNCV_3_2 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 25; + const uint16_t mTestCount = 8; chip::Optional mNodeId; chip::Optional mCluster; chip::Optional mEndpoint; chip::Optional mTimeout; - CHIP_ERROR Test0WaitForTheCommissionedDeviceToBeRetrieved_0() + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR Test1aThSendsUpOrOpenCommandToPrepositionTheDutInTheOppositeDirection_1() + CHIP_ERROR Test2ReadTheGlobalAttributeClusterRevision_1() { + SetIdentity("alpha"); 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 readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"2: read the global attribute: ClusterRevision 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]; - 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)); - - VerifyOrReturn(CheckConstraintType("currentPositionLiftPercent100ths", "", "uint16")); + VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue( - "currentPositionLiftPercent100ths", [value unsignedShortValue], 0U)); + VerifyOrReturn(CheckConstraintMinValue("clusterRevision", [value unsignedShortValue], 5U)); } if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue( - "currentPositionLiftPercent100ths", [value unsignedShortValue], 9999U)); + VerifyOrReturn(CheckConstraintMaxValue("clusterRevision", [value unsignedShortValue], 200U)); } NextTest(); @@ -47565,181 +53231,43 @@ class Test_TC_WNCV_3_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR Test1dIfPaLfThReadsCurrentPositionLiftPercentageOptionalAttributeFromDut_4() + CHIP_ERROR Test3aWriteAValueIntoTheRoMandatoryGlobalAttributeClusterRevision_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + id clusterRevisionArgument; + clusterRevisionArgument = [NSNumber numberWithUnsignedShort:201U]; [cluster - readAttributeCurrentPositionLiftPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable 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], 99)); - } + writeAttributeClusterRevisionWithValue:clusterRevisionArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"3a: write a value into the RO mandatory global attribute: ClusterRevision Error: %@", + err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test1eIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_5() + CHIP_ERROR Test3bReadsBackGlobalAttributeClusterRevision_3() { + SetIdentity("alpha"); 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(@"1e: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT Error: %@", err); + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3b: reads back global attribute: ClusterRevision Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("currentPositionTiltPercent100ths", "", "uint16")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue( - "currentPositionTiltPercent100ths", [value unsignedShortValue], 0U)); - } + VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue( - "currentPositionTiltPercent100ths", [value unsignedShortValue], 9999U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR Test1fIfPaTlThReadsCurrentPositionTiltPercentageOptionalAttributeFromDut_6() - { - 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(@"1f: If (PA & TL) 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)); - } - if (value != nil) { - VerifyOrReturn( - CheckConstraintMaxValue("currentPositionTiltPercentage", [value unsignedCharValue], 99)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - bool testSendClusterTest_TC_WNCV_3_2_7_WaitForReport_Fulfilled = false; - ResponseHandler _Nullable test_Test_TC_WNCV_3_2_OperationalStatus_Reported = nil; - - CHIP_ERROR TestReport2SubscribeToDutReportsOnOperationalStatusAttribute_7() - { - 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(@"Report: 2: Subscribe to DUT reports on OperationalStatus attribute Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("operationalStatus", "", "map8")); - testSendClusterTest_TC_WNCV_3_2_7_WaitForReport_Fulfilled = true; - }; - - NextTest(); - return CHIP_NO_ERROR; - } - - CHIP_ERROR Test2SubscribeToDutReportsOnOperationalStatusAttribute_8() - { - 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_7_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; - } - - CHIP_ERROR Test2aThSendsDownOrCloseCommandToDut_9() - { - 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 Test2bDutUpdatesItsAttributes_10() - { - WaitForMs(100); - return CHIP_NO_ERROR; - } - - 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 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, 10000U)); + VerifyOrReturn(CheckConstraintNotValue("clusterRevision", value, 201U)); } NextTest(); @@ -47748,192 +53276,43 @@ class Test_TC_WNCV_3_2 : public TestCommandBridge { 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)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("operationalStatus", [value unsignedCharValue], 42)); - } - - NextTest(); - }; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR Test3a2DutUpdatesItsAttributes_14() - { - WaitForMs(2000); - return CHIP_NO_ERROR; - } - - CHIP_ERROR Test3bIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_15() + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_4() { + SetIdentity("alpha"); 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(@"3b: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT Error: %@", err); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); 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)); - } - + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test3cIfPaLfThReadsCurrentPositionLiftPercentageOptionalAttributeFromDut_16() - { - 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; - } - - CHIP_ERROR Test3dIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_17() + CHIP_ERROR Test2ReadTheGlobalAttributeFeatureMap_5() { + SetIdentity("alpha"); 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(@"3d: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT Error: %@", err); + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"2: read the global attribute: FeatureMap Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("currentPositionTiltPercent100ths", "", "uint16")); + VerifyOrReturn(CheckConstraintType("featureMap", "", "uint32")); if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue( - "currentPositionTiltPercent100ths", [value unsignedShortValue], 1U)); + VerifyOrReturn(CheckConstraintMinValue("featureMap", [value unsignedIntValue], 0UL)); } if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue( - "currentPositionTiltPercent100ths", [value unsignedShortValue], 10000U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR Test3eIfPaLfThReadsCurrentPositionTiltPercentageOptionalAttributeFromDut_18() - { - 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(@"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], 1)); - } - if (value != nil) { - VerifyOrReturn( - CheckConstraintMaxValue("currentPositionTiltPercentage", [value unsignedCharValue], 100)); - } - - NextTest(); - }]; - - 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)); + VerifyOrReturn(CheckConstraintMaxValue("featureMap", [value unsignedIntValue], 32768UL)); } NextTest(); @@ -47942,60 +53321,41 @@ class Test_TC_WNCV_3_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR Test5aThWaitsForXSecondsAttributesUpdateOnTheDevice_22() - { - WaitForMs(1000); - return CHIP_NO_ERROR; - } - - CHIP_ERROR Test5bIfPaLfThReadsTargetPositionLiftPercent100thsAttributeFromDut_23() + CHIP_ERROR Test3aWriteTheDefaultValueToOptionalGlobalAttributeFeatureMap_6() { + SetIdentity("alpha"); 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], 1U)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue( - "targetPositionLiftPercent100ths", [value unsignedShortValue], 10000U)); - } + id featureMapArgument; + featureMapArgument = [NSNumber numberWithUnsignedInt:32769UL]; + [cluster writeAttributeFeatureMapWithValue:featureMapArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"3a: write the default value to optional global attribute: FeatureMap Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test5cIfPaTlThReadsTargetPositionTiltPercent100thsAttributeFromDut_24() + CHIP_ERROR Test3bReadsBackGlobalAttributeFeatureMap_7() { + SetIdentity("alpha"); 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); + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3b: reads back global attribute: FeatureMap Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("targetPositionTiltPercent100ths", "", "uint16")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue( - "targetPositionTiltPercent100ths", [value unsignedShortValue], 1U)); - } + VerifyOrReturn(CheckConstraintType("featureMap", "", "uint32")); if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue( - "targetPositionTiltPercent100ths", [value unsignedShortValue], 10000U)); + VerifyOrReturn(CheckConstraintNotValue("featureMap", value, 32769UL)); } NextTest(); @@ -48005,11 +53365,11 @@ class Test_TC_WNCV_3_2 : public TestCommandBridge { } }; -class Test_TC_WNCV_3_3 : public TestCommandBridge { +class Test_TC_WNCV_2_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_WNCV_3_3() - : TestCommandBridge("Test_TC_WNCV_3_3") + Test_TC_WNCV_2_1() + : TestCommandBridge("Test_TC_WNCV_2_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -48019,7 +53379,7 @@ class Test_TC_WNCV_3_3 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_WNCV_3_3() {} + ~Test_TC_WNCV_2_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -48027,11 +53387,11 @@ class Test_TC_WNCV_3_3 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_3_3\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_2_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_3_3\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_2_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -48044,94 +53404,251 @@ class Test_TC_WNCV_3_3 : public TestCommandBridge { // 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(); + 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 : 1a: TH sends DownOrClose command to preposition the DUT in the opposite direction\n"); - err = Test1aThSendsDownOrCloseCommandToPrepositionTheDutInTheOppositeDirection_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : 2: read the RO mandatory attribute default: Type\n"); + err = Test2ReadTheRoMandatoryAttributeDefaultType_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : 1b: TH Waits for 6-8 seconds movement(s) on the device\n"); - err = Test1bThWaitsFor68SecondsMovementsOnTheDevice_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : 3a: write a value into the RO mandatory attribute: Type\n"); + err = Test3aWriteAValueIntoTheRoMandatoryAttributeType_2(); break; case 3: - ChipLogProgress( - chipTool, " ***** Test Step 3 : 1c: TH sends UpOrOpen command to preposition the DUT in the opposite direction\n"); - err = Test1cThSendsUpOrOpenCommandToPrepositionTheDutInTheOppositeDirection_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : 3b: reads back the RO mandatory attribute: Type\n"); + err = Test3bReadsBackTheRoMandatoryAttributeType_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : 1d: TH Waits for 2 seconds movement(s) on the device\n"); - err = Test1dThWaitsFor2SecondsMovementsOnTheDevice_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : 2: read the RO mandatory attribute default: ConfigStatus\n"); + err = Test2ReadTheRoMandatoryAttributeDefaultConfigStatus_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Report: 2: Subscribe to DUT reports on OperationalStatus attribute\n"); - err = TestReport2SubscribeToDutReportsOnOperationalStatusAttribute_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : 3a: write a value into the RO mandatory attribute: ConfigStatus\n"); + err = Test3aWriteAValueIntoTheRoMandatoryAttributeConfigStatus_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : 2: Subscribe to DUT reports on OperationalStatus attribute\n"); - err = Test2SubscribeToDutReportsOnOperationalStatusAttribute_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : 3b: reads back the RO mandatory attribute: ConfigStatus\n"); + err = Test3bReadsBackTheRoMandatoryAttributeConfigStatus_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : 2a: TH sends a StopMotion command to DUT\n"); - err = Test2aThSendsAStopMotionCommandToDut_7(); + ChipLogProgress(chipTool, " ***** Test Step 7 : 2: read the RO mandatory attribute default: OperationalStatus\n"); + err = Test2ReadTheRoMandatoryAttributeDefaultOperationalStatus_7(); break; case 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(); + chipTool, " ***** Test Step 8 : 3a: write a value into the RO mandatory attribute: OperationalStatus\n"); + err = Test3aWriteAValueIntoTheRoMandatoryAttributeOperationalStatus_8(); break; case 9: - ChipLogProgress( - chipTool, " ***** Test Step 9 : 2c: Verify DUT reports OperationalStatus attribute to TH after a StopMotion\n"); - err = Test2cVerifyDutReportsOperationalStatusAttributeToThAfterAStopMotion_9(); + ChipLogProgress(chipTool, " ***** Test Step 9 : 3b: reads back the RO mandatory attribute: OperationalStatus\n"); + err = Test3bReadsBackTheRoMandatoryAttributeOperationalStatus_9(); break; case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : 2d: TH waits for 100ms - 3s attributes update on the device\n"); - err = Test2dThWaitsFor100ms3sAttributesUpdateOnTheDevice_10(); + ChipLogProgress(chipTool, " ***** Test Step 10 : 2: read the RO mandatory attribute default: EndProductType\n"); + err = Test2ReadTheRoMandatoryAttributeDefaultEndProductType_10(); break; case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : 2e: TH reads OperationalStatus attribute from DUT\n"); - err = Test2eThReadsOperationalStatusAttributeFromDut_11(); + ChipLogProgress(chipTool, " ***** Test Step 11 : 3a: write a value into the RO mandatory attribute: EndProductType\n"); + err = Test3aWriteAValueIntoTheRoMandatoryAttributeEndProductType_11(); break; case 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(); + ChipLogProgress(chipTool, " ***** Test Step 12 : 3b: reads back the RO mandatory attribute: EndProductType\n"); + err = Test3bReadsBackTheRoMandatoryAttributeEndProductType_12(); break; case 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(); + ChipLogProgress(chipTool, " ***** Test Step 13 : 2: read the RW mandatory attribute default: Mode\n"); + err = Test2ReadTheRwMandatoryAttributeDefaultMode_13(); break; case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : 3a: write a value into the RW mandatory attribute:: Mode\n"); + err = Test3aWriteAValueIntoTheRwMandatoryAttributeMode_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : 3b: reads back the RW mandatory attribute: Mode\n"); + err = Test3bReadsBackTheRwMandatoryAttributeMode_15(); + break; + case 16: 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(); + chipTool, " ***** Test Step 16 : 2: read the RO optional attribute default: TargetPositionLiftPercent100ths\n"); + err = Test2ReadTheRoOptionalAttributeDefaultTargetPositionLiftPercent100ths_16(); break; - case 15: + case 17: 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(); + " ***** Test Step 17 : 3a: write a value into the RO optional attribute: TargetPositionLiftPercent100ths\n"); + err = Test3aWriteAValueIntoTheRoOptionalAttributeTargetPositionLiftPercent100ths_17(); + break; + case 18: + ChipLogProgress( + chipTool, " ***** Test Step 18 : 3b: reads back the RO optional attribute: TargetPositionLiftPercent100ths\n"); + err = Test3bReadsBackTheRoOptionalAttributeTargetPositionLiftPercent100ths_18(); + break; + case 19: + ChipLogProgress( + chipTool, " ***** Test Step 19 : 2: read the RO optional attribute default: TargetPositionTiltPercent100ths\n"); + err = Test2ReadTheRoOptionalAttributeDefaultTargetPositionTiltPercent100ths_19(); + break; + case 20: + ChipLogProgress(chipTool, + " ***** Test Step 20 : 3a: write a value into the RO optional attribute: TargetPositionTiltPercent100ths\n"); + err = Test3aWriteAValueIntoTheRoOptionalAttributeTargetPositionTiltPercent100ths_20(); + break; + case 21: + ChipLogProgress( + chipTool, " ***** Test Step 21 : 3b: reads back the RO optional attribute: TargetPositionTiltPercent100ths\n"); + err = Test3bReadsBackTheRoOptionalAttributeTargetPositionTiltPercent100ths_21(); + break; + case 22: + ChipLogProgress( + chipTool, " ***** Test Step 22 : 2: read the RO optional attribute default: CurrentPositionLiftPercent100ths\n"); + err = Test2ReadTheRoOptionalAttributeDefaultCurrentPositionLiftPercent100ths_22(); + break; + case 23: + ChipLogProgress(chipTool, + " ***** Test Step 23 : 3a: write a value into the RO optional attribute: CurrentPositionLiftPercent100ths\n"); + err = Test3aWriteAValueIntoTheRoOptionalAttributeCurrentPositionLiftPercent100ths_23(); + break; + case 24: + ChipLogProgress( + chipTool, " ***** Test Step 24 : 3b: reads back the RO optional attribute: CurrentPositionLiftPercent100ths\n"); + err = Test3bReadsBackTheRoOptionalAttributeCurrentPositionLiftPercent100ths_24(); + break; + case 25: + ChipLogProgress( + chipTool, " ***** Test Step 25 : 2: read the RO optional attribute default: CurrentPositionTiltPercent100ths\n"); + err = Test2ReadTheRoOptionalAttributeDefaultCurrentPositionTiltPercent100ths_25(); + break; + case 26: + ChipLogProgress(chipTool, + " ***** Test Step 26 : 3a: write a value into the RO optional attribute: CurrentPositionTiltPercent100ths\n"); + err = Test3aWriteAValueIntoTheRoOptionalAttributeCurrentPositionTiltPercent100ths_26(); + break; + case 27: + ChipLogProgress( + chipTool, " ***** Test Step 27 : 3b: reads back the RO optional attribute: CurrentPositionTiltPercent100ths\n"); + err = Test3bReadsBackTheRoOptionalAttributeCurrentPositionTiltPercent100ths_27(); + break; + case 28: + ChipLogProgress(chipTool, " ***** Test Step 28 : 2: read the RO optional attribute default: InstalledOpenLimitLift\n"); + err = Test2ReadTheRoOptionalAttributeDefaultInstalledOpenLimitLift_28(); + break; + case 29: + ChipLogProgress( + chipTool, " ***** Test Step 29 : 3a: write a value into the RO optional attribute: InstalledOpenLimitLift\n"); + err = Test3aWriteAValueIntoTheRoOptionalAttributeInstalledOpenLimitLift_29(); + break; + case 30: + ChipLogProgress(chipTool, " ***** Test Step 30 : 3b: reads back the RO optional attribute: InstalledOpenLimitLift\n"); + err = Test3bReadsBackTheRoOptionalAttributeInstalledOpenLimitLift_30(); + break; + case 31: + ChipLogProgress( + chipTool, " ***** Test Step 31 : 2: read the RO optional attribute default: InstalledClosedLimitLift\n"); + err = Test2ReadTheRoOptionalAttributeDefaultInstalledClosedLimitLift_31(); + break; + case 32: + ChipLogProgress( + chipTool, " ***** Test Step 32 : 3a: write a value into the RO optional attribute: InstalledClosedLimitLift\n"); + err = Test3aWriteAValueIntoTheRoOptionalAttributeInstalledClosedLimitLift_32(); + break; + case 33: + ChipLogProgress(chipTool, " ***** Test Step 33 : 3b: reads back the RO optional attribute: InstalledClosedLimitLift\n"); + err = Test3bReadsBackTheRoOptionalAttributeInstalledClosedLimitLift_33(); + break; + case 34: + ChipLogProgress(chipTool, " ***** Test Step 34 : 2: read the RO optional attribute default: InstalledOpenLimitTilt\n"); + err = Test2ReadTheRoOptionalAttributeDefaultInstalledOpenLimitTilt_34(); + break; + case 35: + ChipLogProgress( + chipTool, " ***** Test Step 35 : 3a: write a value into the RO optional attribute: InstalledOpenLimitTilt\n"); + err = Test3aWriteAValueIntoTheRoOptionalAttributeInstalledOpenLimitTilt_35(); + break; + case 36: + ChipLogProgress(chipTool, " ***** Test Step 36 : 3b: reads back the RO optional attribute: InstalledOpenLimitTilt\n"); + err = Test3bReadsBackTheRoOptionalAttributeInstalledOpenLimitTilt_36(); + break; + case 37: + ChipLogProgress( + chipTool, " ***** Test Step 37 : 2: read the RO optional attribute default: InstalledClosedLimitTilt\n"); + err = Test2ReadTheRoOptionalAttributeDefaultInstalledClosedLimitTilt_37(); + break; + case 38: + ChipLogProgress( + chipTool, " ***** Test Step 38 : 3a: write a value into the RO optional attribute: InstalledClosedLimitTilt\n"); + err = Test3aWriteAValueIntoTheRoOptionalAttributeInstalledClosedLimitTilt_38(); + break; + case 39: + ChipLogProgress(chipTool, " ***** Test Step 39 : 3b: reads back the RO optional attribute: InstalledClosedLimitTilt\n"); + err = Test3bReadsBackTheRoOptionalAttributeInstalledClosedLimitTilt_39(); + break; + case 40: + ChipLogProgress(chipTool, " ***** Test Step 40 : 4: read the RO mandatory attribute default: SafetyStatus\n"); + err = Test4ReadTheRoMandatoryAttributeDefaultSafetyStatus_40(); + break; + case 41: + ChipLogProgress(chipTool, " ***** Test Step 41 : 5a: write a value into the RO mandatory attribute: SafetyStatus\n"); + err = Test5aWriteAValueIntoTheRoMandatoryAttributeSafetyStatus_41(); + break; + case 42: + ChipLogProgress(chipTool, " ***** Test Step 42 : 5b: reads back the RO mandatory attribute: SafetyStatus\n"); + err = Test5bReadsBackTheRoMandatoryAttributeSafetyStatus_42(); + break; + case 43: + ChipLogProgress(chipTool, " ***** Test Step 43 : 4: read the RO optional attribute default: CurrentPositionLift\n"); + err = Test4ReadTheRoOptionalAttributeDefaultCurrentPositionLift_43(); + break; + case 44: + ChipLogProgress( + chipTool, " ***** Test Step 44 : 5a: write a value into the RO optional attribute: CurrentPositionLift\n"); + err = Test5aWriteAValueIntoTheRoOptionalAttributeCurrentPositionLift_44(); + break; + case 45: + ChipLogProgress(chipTool, " ***** Test Step 45 : 5b: reads back the RO optional attribute: CurrentPositionLift\n"); + err = Test5bReadsBackTheRoOptionalAttributeCurrentPositionLift_45(); + break; + case 46: + ChipLogProgress(chipTool, " ***** Test Step 46 : 4: read the RO optional attribute default: CurrentPositionTilt\n"); + err = Test4ReadTheRoOptionalAttributeDefaultCurrentPositionTilt_46(); + break; + case 47: + ChipLogProgress( + chipTool, " ***** Test Step 47 : 5a: write a value into the RO optional attribute: CurrentPositionTilt\n"); + err = Test5aWriteAValueIntoTheRoOptionalAttributeCurrentPositionTilt_47(); + break; + case 48: + ChipLogProgress(chipTool, " ***** Test Step 48 : 5b: reads back the RO optional attribute: CurrentPositionTilt\n"); + err = Test5bReadsBackTheRoOptionalAttributeCurrentPositionTilt_48(); + break; + case 49: + ChipLogProgress( + chipTool, " ***** Test Step 49 : 4: read the RO optional attribute default: CurrentPositionLiftPercentage\n"); + err = Test4ReadTheRoOptionalAttributeDefaultCurrentPositionLiftPercentage_49(); + break; + case 50: + ChipLogProgress(chipTool, + " ***** Test Step 50 : 5a: write a value into the RO optional attribute: CurrentPositionLiftPercentage\n"); + err = Test5aWriteAValueIntoTheRoOptionalAttributeCurrentPositionLiftPercentage_50(); + break; + case 51: + ChipLogProgress( + chipTool, " ***** Test Step 51 : 5b: reads back the RO optional attribute: CurrentPositionLiftPercentage\n"); + err = Test5bReadsBackTheRoOptionalAttributeCurrentPositionLiftPercentage_51(); + break; + case 52: + ChipLogProgress( + chipTool, " ***** Test Step 52 : 4: read the RO optional attribute default: CurrentPositionTiltPercentage\n"); + err = Test4ReadTheRoOptionalAttributeDefaultCurrentPositionTiltPercentage_52(); + break; + case 53: + ChipLogProgress(chipTool, + " ***** Test Step 53 : 5a: write a value into the RO optional attribute: CurrentPositionTiltPercentage\n"); + err = Test5aWriteAValueIntoTheRoOptionalAttributeCurrentPositionTiltPercentage_53(); + break; + case 54: + ChipLogProgress( + chipTool, " ***** Test Step 54 : 5b: reads back the RO optional attribute: CurrentPositionTiltPercentage\n"); + err = Test5bReadsBackTheRoOptionalAttributeCurrentPositionTiltPercentage_54(); break; } @@ -48141,6 +53658,180 @@ class Test_TC_WNCV_3_3 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 34: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 35: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 36: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 37: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 38: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 39: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 40: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 41: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 42: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 43: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 44: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 45: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 46: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 47: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 48: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 49: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 50: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 51: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 52: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 53: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 54: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -48148,182 +53839,220 @@ class Test_TC_WNCV_3_3 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 16; + const uint16_t mTestCount = 55; chip::Optional mNodeId; chip::Optional mCluster; chip::Optional mEndpoint; chip::Optional mTimeout; - CHIP_ERROR Test0WaitForTheCommissionedDeviceToBeRetrieved_0() + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR Test1aThSendsDownOrCloseCommandToPrepositionTheDutInTheOppositeDirection_1() + CHIP_ERROR Test2ReadTheRoMandatoryAttributeDefaultType_1() { + SetIdentity("alpha"); 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); + [cluster readAttributeTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"2: read the RO mandatory attribute default: Type Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckConstraintType("type", "", "enum8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("type", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("type", [value unsignedCharValue], 9)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test1bThWaitsFor68SecondsMovementsOnTheDevice_2() + CHIP_ERROR Test3aWriteAValueIntoTheRoMandatoryAttributeType_2() { - WaitForMs(6000); + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id typeArgument; + typeArgument = [NSNumber numberWithUnsignedChar:250]; + [cluster writeAttributeTypeWithValue:typeArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"3a: write a value into the RO mandatory attribute: Type Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + NextTest(); + }]; + return CHIP_NO_ERROR; } - CHIP_ERROR Test1cThSendsUpOrOpenCommandToPrepositionTheDutInTheOppositeDirection_3() + CHIP_ERROR Test3bReadsBackTheRoMandatoryAttributeType_3() { + SetIdentity("alpha"); 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); + [cluster readAttributeTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3b: reads back the RO mandatory attribute: Type Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckConstraintType("type", "", "enum8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("type", value, 250)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test1dThWaitsFor2SecondsMovementsOnTheDevice_4() - { - WaitForMs(2000); - return CHIP_NO_ERROR; - } - bool testSendClusterTest_TC_WNCV_3_3_5_WaitForReport_Fulfilled = false; - ResponseHandler _Nullable test_Test_TC_WNCV_3_3_OperationalStatus_Reported = nil; - - CHIP_ERROR TestReport2SubscribeToDutReportsOnOperationalStatusAttribute_5() + CHIP_ERROR Test2ReadTheRoMandatoryAttributeDefaultConfigStatus_4() { + SetIdentity("alpha"); 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); + [cluster readAttributeConfigStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"2: read the RO mandatory attribute default: ConfigStatus Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("operationalStatus", "", "map8")); - testSendClusterTest_TC_WNCV_3_3_5_WaitForReport_Fulfilled = true; - }; + VerifyOrReturn(CheckConstraintType("configStatus", "", "map8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("configStatus", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("configStatus", [value unsignedCharValue], 63)); + } + + NextTest(); + }]; - NextTest(); return CHIP_NO_ERROR; } - CHIP_ERROR Test2SubscribeToDutReportsOnOperationalStatusAttribute_6() + CHIP_ERROR Test3aWriteAValueIntoTheRoMandatoryAttributeConfigStatus_5() { + SetIdentity("alpha"); 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_5_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); + id configStatusArgument; + configStatusArgument = [NSNumber numberWithUnsignedChar:128]; + [cluster writeAttributeConfigStatusWithValue:configStatusArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"3a: write a value into the RO mandatory attribute: ConfigStatus 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); - } - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test2aThSendsAStopMotionCommandToDut_7() + CHIP_ERROR Test3bReadsBackTheRoMandatoryAttributeConfigStatus_6() { + SetIdentity("alpha"); 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); + [cluster readAttributeConfigStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3b: reads back the RO mandatory attribute: ConfigStatus Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckConstraintType("configStatus", "", "map8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("configStatus", value, 128)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test2bThWaitsFor3SecondsTheEndOfInertialMovementsOnTheDevice_8() - { - WaitForMs(3000); - return CHIP_NO_ERROR; - } - - CHIP_ERROR Test2cVerifyDutReportsOperationalStatusAttributeToThAfterAStopMotion_9() + CHIP_ERROR Test2ReadTheRoMandatoryAttributeDefaultOperationalStatus_7() { + SetIdentity("alpha"); 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); + [cluster readAttributeOperationalStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"2: read the RO mandatory attribute default: OperationalStatus Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("OperationalStatus", actualValue, 0)); + VerifyOrReturn(CheckConstraintType("operationalStatus", "", "map8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("operationalStatus", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("operationalStatus", [value unsignedCharValue], 63)); } NextTest(); - }; + }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test2dThWaitsFor100ms3sAttributesUpdateOnTheDevice_10() + CHIP_ERROR Test3aWriteAValueIntoTheRoMandatoryAttributeOperationalStatus_8() { - WaitForMs(2000); + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id operationalStatusArgument; + operationalStatusArgument = [NSNumber numberWithUnsignedChar:128]; + [cluster writeAttributeOperationalStatusWithValue:operationalStatusArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"3a: write a value into the RO mandatory attribute: OperationalStatus Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + NextTest(); + }]; + return CHIP_NO_ERROR; } - CHIP_ERROR Test2eThReadsOperationalStatusAttributeFromDut_11() + CHIP_ERROR Test3bReadsBackTheRoMandatoryAttributeOperationalStatus_9() { + SetIdentity("alpha"); 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); + NSLog(@"3b: reads back the RO mandatory attribute: OperationalStatus Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("OperationalStatus", actualValue, 0)); + VerifyOrReturn(CheckConstraintType("operationalStatus", "", "map8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("operationalStatus", value, 128)); } NextTest(); @@ -48331,30 +54060,25 @@ class Test_TC_WNCV_3_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nullable attrCurrentPositionLift; - CHIP_ERROR Test3aIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_12() + CHIP_ERROR Test2ReadTheRoMandatoryAttributeDefaultEndProductType_10() { + SetIdentity("alpha"); 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); + [cluster readAttributeEndProductTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"2: read the RO mandatory attribute default: EndProductType Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckConstraintType("endProductType", "", "enum8")); if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue( - "currentPositionLiftPercent100ths", [value unsignedShortValue], 0U)); + VerifyOrReturn(CheckConstraintMinValue("endProductType", [value unsignedCharValue], 0)); } if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue( - "currentPositionLiftPercent100ths", [value unsignedShortValue], 10000U)); - } - { - attrCurrentPositionLift = value; + VerifyOrReturn(CheckConstraintMaxValue("endProductType", [value unsignedCharValue], 23)); } NextTest(); @@ -48363,60 +54087,41 @@ class Test_TC_WNCV_3_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR - Test3bIfPaLfThReadsTargetPositionLiftPercent100thsAttribute3cItMustBeEqualWithCurrentPositionLiftPercent100thsFromDut_13() + CHIP_ERROR Test3aWriteAValueIntoTheRoMandatoryAttributeEndProductType_11() { + SetIdentity("alpha"); 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); + id endProductTypeArgument; + endProductTypeArgument = [NSNumber numberWithUnsignedChar:250]; + [cluster writeAttributeEndProductTypeWithValue:endProductTypeArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"3a: write a value into the RO mandatory attribute: EndProductType 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(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + NextTest(); + }]; return CHIP_NO_ERROR; } - NSNumber * _Nullable attrCurrentPositionTilt; - CHIP_ERROR Test4aIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_14() + CHIP_ERROR Test3bReadsBackTheRoMandatoryAttributeEndProductType_12() { + SetIdentity("alpha"); 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); + [cluster readAttributeEndProductTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3b: reads back the RO mandatory attribute: EndProductType Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckConstraintType("endProductType", "", "enum8")); if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue( - "currentPositionTiltPercent100ths", [value unsignedShortValue], 0U)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue( - "currentPositionTiltPercent100ths", [value unsignedShortValue], 10000U)); - } - { - attrCurrentPositionTilt = value; + VerifyOrReturn(CheckConstraintNotValue("endProductType", value, 250)); } NextTest(); @@ -48425,29 +54130,24 @@ class Test_TC_WNCV_3_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR - Test4bIfPaTlThReadsTargetPositionTiltPercent100thsAttribute4cItMustBeEqualWithCurrentPositionTiltPercent100thsFromDut_15() + CHIP_ERROR Test2ReadTheRwMandatoryAttributeDefaultMode_13() { + SetIdentity("alpha"); 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); + [cluster readAttributeModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"2: read the RW mandatory attribute default: Mode 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)); - } + VerifyOrReturn(CheckConstraintType("mode", "", "map8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("mode", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("mode", [value unsignedCharValue], 15)); } NextTest(); @@ -48455,199 +54155,72 @@ class Test_TC_WNCV_3_3 : public TestCommandBridge { 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 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 : 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 UpOrOpen command to DUT\n"); - err = Test2aThSendsUpOrOpenCommandToDut_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")) { - NextTest(); - return; - } - err = Test3dIfPaTlThReadsCurrentPositionTiltPercentageOptionalAttributeFromDut_8(); - 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 = 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() + CHIP_ERROR Test3aWriteAValueIntoTheRwMandatoryAttributeMode_14() { + SetIdentity("alpha"); 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)); + id modeArgument; + modeArgument = [NSNumber numberWithUnsignedChar:8]; + [cluster writeAttributeModeWithValue:modeArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"3a: write a value into the RW mandatory attribute:: Mode Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); - return CHIP_NO_ERROR; - } + NextTest(); + }]; - CHIP_ERROR Test1bThWaitsForFastMotionDurationSecondsMovementsOnTheDevice_2() - { - WaitForMs(mFastMotionDuration.HasValue() ? mFastMotionDuration.Value() : 3000U); return CHIP_NO_ERROR; } - CHIP_ERROR Test2aThSendsUpOrOpenCommandToDut_3() + CHIP_ERROR Test3bReadsBackTheRwMandatoryAttributeMode_15() { + SetIdentity("alpha"); 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); + [cluster readAttributeModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3b: reads back the RW mandatory attribute: Mode Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("Mode", actualValue, 8)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test2bThWaitsForFullMotionDurationSecondsMovementsOnTheDevice_4() - { - WaitForMs(mFullMotionDuration.HasValue() ? mFullMotionDuration.Value() : 6000U); - return CHIP_NO_ERROR; - } - - CHIP_ERROR Test3aIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_5() + CHIP_ERROR Test2ReadTheRoOptionalAttributeDefaultTargetPositionLiftPercent100ths_16() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentPositionLiftPercent100thsWithCompletionHandler:^( + [cluster readAttributeTargetPositionLiftPercent100thsWithCompletionHandler:^( NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3a: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT Error: %@", err); + NSLog(@"2: read the RO optional attribute default: TargetPositionLiftPercent100ths Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("CurrentPositionLiftPercent100ths", actualValue)); - VerifyOrReturn(CheckValue("CurrentPositionLiftPercent100ths", actualValue, 0U)); + VerifyOrReturn(CheckConstraintType("targetPositionLiftPercent100ths", "", "Percent100ths")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue( + "targetPositionLiftPercent100ths", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue( + "targetPositionLiftPercent100ths", [value unsignedShortValue], 10000U)); } NextTest(); @@ -48656,46 +54229,45 @@ class Test_TC_WNCV_3_4 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR Test3bIfPaLfThReadsCurrentPositionLiftPercentageOptionalAttributeFromDut_6() + CHIP_ERROR Test3aWriteAValueIntoTheRoOptionalAttributeTargetPositionLiftPercent100ths_17() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + id targetPositionLiftPercent100thsArgument; + targetPositionLiftPercent100thsArgument = [NSNumber numberWithUnsignedShort:20000U]; [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)); - } + writeAttributeTargetPositionLiftPercent100thsWithValue:targetPositionLiftPercent100thsArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"3a: write a value into the RO optional attribute: " + @"TargetPositionLiftPercent100ths Error: %@", + err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test3cIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_7() + CHIP_ERROR Test3bReadsBackTheRoOptionalAttributeTargetPositionLiftPercent100ths_18() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentPositionTiltPercent100thsWithCompletionHandler:^( + [cluster readAttributeTargetPositionLiftPercent100thsWithCompletionHandler:^( NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3c: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT Error: %@", err); + NSLog(@"3b: reads back the RO optional attribute: TargetPositionLiftPercent100ths Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("CurrentPositionTiltPercent100ths", actualValue)); - VerifyOrReturn(CheckValue("CurrentPositionTiltPercent100ths", actualValue, 0U)); + VerifyOrReturn(CheckConstraintType("targetPositionLiftPercent100ths", "", "Percent100ths")); + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("targetPositionLiftPercent100ths", value, 20000U)); } NextTest(); @@ -48704,222 +54276,150 @@ class Test_TC_WNCV_3_4 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR Test3dIfPaTlThReadsCurrentPositionTiltPercentageOptionalAttributeFromDut_8() + CHIP_ERROR Test2ReadTheRoOptionalAttributeDefaultTargetPositionTiltPercent100ths_19() { + SetIdentity("alpha"); 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; - } + [cluster readAttributeTargetPositionTiltPercent100thsWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"2: read the RO optional attribute default: TargetPositionTiltPercent100ths 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: 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; + VerifyOrReturn(CheckConstraintType("targetPositionTiltPercent100ths", "", "Percent100ths")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue( + "targetPositionTiltPercent100ths", [value unsignedShortValue], 0U)); } - 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")) { - NextTest(); - return; + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue( + "targetPositionTiltPercent100ths", [value unsignedShortValue], 10000U)); } - err = Test3dIfPaTlThReadsCurrentPositionTiltPercentageOptionalAttributeFromDut_8(); - 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 Test3aWriteAValueIntoTheRoOptionalAttributeTargetPositionTiltPercent100ths_20() { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } + SetIdentity("alpha"); + 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; + id targetPositionTiltPercent100thsArgument; + targetPositionTiltPercent100thsArgument = [NSNumber numberWithUnsignedShort:20000U]; + [cluster + writeAttributeTargetPositionTiltPercent100thsWithValue:targetPositionTiltPercent100thsArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"3a: write a value into the RO optional attribute: " + @"TargetPositionTiltPercent100ths Error: %@", + err); - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mFastMotionDuration; - chip::Optional mFullMotionDuration; - chip::Optional mTimeout; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + NextTest(); + }]; - CHIP_ERROR Test0WaitForTheCommissionedDeviceToBeRetrieved_0() - { - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR Test1aThSendsUpOrOpenCommandToPrepositionTheDutInTheOppositeDirection_1() + CHIP_ERROR Test3bReadsBackTheRoOptionalAttributeTargetPositionTiltPercent100ths_21() { + SetIdentity("alpha"); 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 readAttributeTargetPositionTiltPercent100thsWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3b: reads back the RO optional attribute: TargetPositionTiltPercent100ths Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckConstraintType("targetPositionTiltPercent100ths", "", "Percent100ths")); + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("targetPositionTiltPercent100ths", value, 20000U)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test1bThWaitsForFastMotionDurationSecondsMovementsOnTheDevice_2() - { - WaitForMs(mFastMotionDuration.HasValue() ? mFastMotionDuration.Value() : 3000U); - return CHIP_NO_ERROR; - } - - CHIP_ERROR Test2aThSendsDownOrCloseCommandToDut_3() + CHIP_ERROR Test2ReadTheRoOptionalAttributeDefaultCurrentPositionLiftPercent100ths_22() { + SetIdentity("alpha"); 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); + [cluster readAttributeCurrentPositionLiftPercent100thsWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"2: read the RO optional attribute default: CurrentPositionLiftPercent100ths Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckConstraintType("currentPositionLiftPercent100ths", "", "Percent100ths")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue( + "currentPositionLiftPercent100ths", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue( + "currentPositionLiftPercent100ths", [value unsignedShortValue], 10000U)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test2bThWaitsForFullMotionDurationSecondsMovementsOnTheDevice_4() + CHIP_ERROR Test3aWriteAValueIntoTheRoOptionalAttributeCurrentPositionLiftPercent100ths_23() { - WaitForMs(mFullMotionDuration.HasValue() ? mFullMotionDuration.Value() : 6000U); + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id currentPositionLiftPercent100thsArgument; + currentPositionLiftPercent100thsArgument = [NSNumber numberWithUnsignedShort:20000U]; + [cluster + writeAttributeCurrentPositionLiftPercent100thsWithValue:currentPositionLiftPercent100thsArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"3a: write a value into the RO optional attribute: " + @"CurrentPositionLiftPercent100ths Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + NextTest(); + }]; + return CHIP_NO_ERROR; } - CHIP_ERROR Test3aIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_5() + CHIP_ERROR Test3bReadsBackTheRoOptionalAttributeCurrentPositionLiftPercent100ths_24() { + SetIdentity("alpha"); 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); + NSLog(@"3b: reads back the RO optional attribute: CurrentPositionLiftPercent100ths Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("CurrentPositionLiftPercent100ths", actualValue)); - VerifyOrReturn(CheckValue("CurrentPositionLiftPercent100ths", actualValue, 10000U)); + VerifyOrReturn(CheckConstraintType("currentPositionLiftPercent100ths", "", "Percent100ths")); + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("currentPositionLiftPercent100ths", value, 20000U)); } NextTest(); @@ -48928,46 +54428,74 @@ class Test_TC_WNCV_3_5 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR Test3bIfPaLfThReadsCurrentPositionLiftPercentageOptionalAttributeFromDut_6() + CHIP_ERROR Test2ReadTheRoOptionalAttributeDefaultCurrentPositionTiltPercent100ths_25() { + SetIdentity("alpha"); 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)); + [cluster readAttributeCurrentPositionTiltPercent100thsWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"2: read the RO optional attribute default: CurrentPositionTiltPercent100ths Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("CurrentPositionLiftPercentage", actualValue)); - VerifyOrReturn(CheckValue("CurrentPositionLiftPercentage", actualValue, 100)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("currentPositionTiltPercent100ths", "", "Percent100ths")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue( + "currentPositionTiltPercent100ths", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue( + "currentPositionTiltPercent100ths", [value unsignedShortValue], 10000U)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test3cIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_7() + CHIP_ERROR Test3aWriteAValueIntoTheRoOptionalAttributeCurrentPositionTiltPercent100ths_26() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id currentPositionTiltPercent100thsArgument; + currentPositionTiltPercent100thsArgument = [NSNumber numberWithUnsignedShort:20000U]; + [cluster + writeAttributeCurrentPositionTiltPercent100thsWithValue:currentPositionTiltPercent100thsArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"3a: write a value into the RO optional attribute: " + @"CurrentPositionTiltPercent100ths Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test3bReadsBackTheRoOptionalAttributeCurrentPositionTiltPercent100ths_27() { + SetIdentity("alpha"); 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); + NSLog(@"3b: reads back the RO optional attribute: CurrentPositionTiltPercent100ths Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("CurrentPositionTiltPercent100ths", actualValue)); - VerifyOrReturn(CheckValue("CurrentPositionTiltPercent100ths", actualValue, 10000U)); + VerifyOrReturn(CheckConstraintType("currentPositionTiltPercent100ths", "", "Percent100ths")); + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("currentPositionTiltPercent100ths", value, 20000U)); } NextTest(); @@ -48976,207 +54504,172 @@ class Test_TC_WNCV_3_5 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR Test3dIfPaTlThReadsCurrentPositionTiltPercentageOptionalAttributeFromDut_8() + CHIP_ERROR Test2ReadTheRoOptionalAttributeDefaultInstalledOpenLimitLift_28() { + SetIdentity("alpha"); 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); + [cluster readAttributeInstalledOpenLimitLiftWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"2: read the RO optional attribute default: InstalledOpenLimitLift Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("CurrentPositionTiltPercentage", actualValue)); - VerifyOrReturn(CheckValue("CurrentPositionTiltPercentage", actualValue, 100)); - } + VerifyOrReturn(CheckConstraintType("installedOpenLimitLift", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("installedOpenLimitLift", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("installedOpenLimitLift", [value unsignedShortValue], 65535U)); + } - NextTest(); - }]; + 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) + CHIP_ERROR Test3aWriteAValueIntoTheRoOptionalAttributeInstalledOpenLimitLift_29() { - 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) + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - ~Test_TC_WNCV_4_1() {} + id installedOpenLimitLiftArgument; + installedOpenLimitLiftArgument = [NSNumber numberWithUnsignedShort:255U]; + [cluster writeAttributeInstalledOpenLimitLiftWithValue:installedOpenLimitLiftArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"3a: write a value into the RO optional attribute: InstalledOpenLimitLift " + @"Error: %@", + err); - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + NextTest(); + }]; - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_4_1\n"); - } + return CHIP_NO_ERROR; + } - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_4_1\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + CHIP_ERROR Test3bReadsBackTheRoOptionalAttributeInstalledOpenLimitLift_30() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - Wait(); + [cluster readAttributeInstalledOpenLimitLiftWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3b: reads back the RO optional attribute: InstalledOpenLimitLift 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 : 0: Wait for the commissioned device to be retrieved\n"); - err = Test0WaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - 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 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : 1b: TH waits for x seconds movement(s) on the DUT\n"); - err = Test1bThWaitsForXSecondsMovementsOnTheDut_2(); - break; - 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; + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("installedOpenLimitLift", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("installedOpenLimitLift", [value unsignedShortValue], 0U)); } - err = Test1cIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_3(); - break; - 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; + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("installedOpenLimitLift", [value unsignedShortValue], 65535U)); } - err = Test2aThSendsGoToLiftPercentageCommandWith25PercentToDut_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : 2b: DUT updates its attributes\n"); - err = Test2bDutUpdatesItsAttributes_5(); - break; - 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; + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test2ReadTheRoOptionalAttributeDefaultInstalledClosedLimitLift_31() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeInstalledClosedLimitLiftWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"2: read the RO optional attribute default: InstalledClosedLimitLift Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("installedClosedLimitLift", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("installedClosedLimitLift", [value unsignedShortValue], 0U)); } - err = Test2cIfPaLfThReadsTargetPositionLiftPercent100thsAttributeFromDut_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : 3a: TH set a timeout of X minutes for failure\n"); - err = Test3aThSetATimeoutOfXMinutesForFailure_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : 3b: TH reads OperationalStatus attribute from DUT\n"); - err = Test3bThReadsOperationalStatusAttributeFromDut_8(); - break; - 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; + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("installedClosedLimitLift", [value unsignedShortValue], 65535U)); } - err = Test4aThSendsGoToLiftPercentageCommandWith7520PercentToDut_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : 4b: DUT updates its attributes\n"); - err = Test4bDutUpdatesItsAttributes_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : 5a: TH waits for x seconds movement(s) on the DUT\n"); - err = Test5aThWaitsForXSecondsMovementsOnTheDut_11(); - break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : 5b: TH reads OperationalStatus attribute from DUT\n"); - err = Test5bThReadsOperationalStatusAttributeFromDut_12(); - 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 Test3aWriteAValueIntoTheRoOptionalAttributeInstalledClosedLimitLift_32() { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } + SetIdentity("alpha"); + 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 = 13; + id installedClosedLimitLiftArgument; + installedClosedLimitLiftArgument = [NSNumber numberWithUnsignedShort:255U]; + [cluster writeAttributeInstalledClosedLimitLiftWithValue:installedClosedLimitLiftArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"3a: write a value into the RO optional attribute: " + @"InstalledClosedLimitLift Error: %@", + err); - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mFullMotionDuration; - chip::Optional mTimeout; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + NextTest(); + }]; - CHIP_ERROR Test0WaitForTheCommissionedDeviceToBeRetrieved_0() - { - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR Test1aThSendsDownOrCloseCommandToPrepositionTheDutInTheOppositeDirection_1() + CHIP_ERROR Test3bReadsBackTheRoOptionalAttributeInstalledClosedLimitLift_33() { + SetIdentity("alpha"); 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); + [cluster readAttributeInstalledClosedLimitLiftWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3b: reads back the RO optional attribute: InstalledClosedLimitLift Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckConstraintType("installedClosedLimitLift", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("installedClosedLimitLift", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("installedClosedLimitLift", [value unsignedShortValue], 65535U)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test1bThWaitsForXSecondsMovementsOnTheDut_2() - { - WaitForMs(mFullMotionDuration.HasValue() ? mFullMotionDuration.Value() : 6000U); - return CHIP_NO_ERROR; - } - - CHIP_ERROR Test1cIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_3() + CHIP_ERROR Test2ReadTheRoOptionalAttributeDefaultInstalledOpenLimitTilt_34() { + SetIdentity("alpha"); 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); + [cluster readAttributeInstalledOpenLimitTiltWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"2: read the RO optional attribute default: InstalledOpenLimitTilt Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckConstraintType("installedOpenLimitTilt", "", "uint16")); if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("currentPositionLiftPercent100ths", value, 0U)); + VerifyOrReturn(CheckConstraintMinValue("installedOpenLimitTilt", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("installedOpenLimitTilt", [value unsignedShortValue], 65535U)); } NextTest(); @@ -49185,49 +54678,72 @@ class Test_TC_WNCV_4_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR Test2aThSendsGoToLiftPercentageCommandWith25PercentToDut_4() + CHIP_ERROR Test3aWriteAValueIntoTheRoOptionalAttributeInstalledOpenLimitTilt_35() { + SetIdentity("alpha"); 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)); + id installedOpenLimitTiltArgument; + installedOpenLimitTiltArgument = [NSNumber numberWithUnsignedShort:255U]; + [cluster writeAttributeInstalledOpenLimitTiltWithValue:installedOpenLimitTiltArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"3a: write a value into the RO optional attribute: InstalledOpenLimitTilt " + @"Error: %@", + err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test2bDutUpdatesItsAttributes_5() + CHIP_ERROR Test3bReadsBackTheRoOptionalAttributeInstalledOpenLimitTilt_36() { - WaitForMs(100); + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeInstalledOpenLimitTiltWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3b: reads back the RO optional attribute: InstalledOpenLimitTilt Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("installedOpenLimitTilt", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("installedOpenLimitTilt", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("installedOpenLimitTilt", [value unsignedShortValue], 65535U)); + } + + NextTest(); + }]; + return CHIP_NO_ERROR; } - CHIP_ERROR Test2cIfPaLfThReadsTargetPositionLiftPercent100thsAttributeFromDut_6() + CHIP_ERROR Test2ReadTheRoOptionalAttributeDefaultInstalledClosedLimitTilt_37() { + SetIdentity("alpha"); 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); + [cluster readAttributeInstalledClosedLimitTiltWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"2: read the RO optional attribute default: InstalledClosedLimitTilt Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("TargetPositionLiftPercent100ths", actualValue)); - VerifyOrReturn(CheckValue("TargetPositionLiftPercent100ths", actualValue, 2500U)); + VerifyOrReturn(CheckConstraintType("installedClosedLimitTilt", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("installedClosedLimitTilt", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("installedClosedLimitTilt", [value unsignedShortValue], 65535U)); } NextTest(); @@ -49236,26 +54752,46 @@ class Test_TC_WNCV_4_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR Test3aThSetATimeoutOfXMinutesForFailure_7() + CHIP_ERROR Test3aWriteAValueIntoTheRoOptionalAttributeInstalledClosedLimitTilt_38() { - WaitForMs(mFullMotionDuration.HasValue() ? mFullMotionDuration.Value() : 6000U); + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id installedClosedLimitTiltArgument; + installedClosedLimitTiltArgument = [NSNumber numberWithUnsignedShort:255U]; + [cluster writeAttributeInstalledClosedLimitTiltWithValue:installedClosedLimitTiltArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"3a: write a value into the RO optional attribute: " + @"InstalledClosedLimitTilt Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + NextTest(); + }]; + return CHIP_NO_ERROR; } - CHIP_ERROR Test3bThReadsOperationalStatusAttributeFromDut_8() + CHIP_ERROR Test3bReadsBackTheRoOptionalAttributeInstalledClosedLimitTilt_39() { + SetIdentity("alpha"); 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); + [cluster readAttributeInstalledClosedLimitTiltWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3b: reads back the RO optional attribute: InstalledClosedLimitTilt Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("OperationalStatus", actualValue, 0)); + VerifyOrReturn(CheckConstraintType("installedClosedLimitTilt", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("installedClosedLimitTilt", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("installedClosedLimitTilt", [value unsignedShortValue], 65535U)); } NextTest(); @@ -49264,53 +54800,67 @@ class Test_TC_WNCV_4_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR Test4aThSendsGoToLiftPercentageCommandWith7520PercentToDut_9() + CHIP_ERROR Test4ReadTheRoMandatoryAttributeDefaultSafetyStatus_40() { + SetIdentity("alpha"); 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); + [cluster readAttributeSafetyStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"4: read the RO mandatory attribute default: SafetyStatus Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("safetyStatus", "", "map16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("safetyStatus", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("safetyStatus", [value unsignedShortValue], 2047U)); + } - return CHIP_NO_ERROR; - } + NextTest(); + }]; - CHIP_ERROR Test4bDutUpdatesItsAttributes_10() - { - WaitForMs(100); return CHIP_NO_ERROR; } - CHIP_ERROR Test5aThWaitsForXSecondsMovementsOnTheDut_11() + CHIP_ERROR Test5aWriteAValueIntoTheRoMandatoryAttributeSafetyStatus_41() { - WaitForMs(mFullMotionDuration.HasValue() ? mFullMotionDuration.Value() : 6000U); + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id safetyStatusArgument; + safetyStatusArgument = [NSNumber numberWithUnsignedShort:4096U]; + [cluster writeAttributeSafetyStatusWithValue:safetyStatusArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"5a: write a value into the RO mandatory attribute: SafetyStatus Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + NextTest(); + }]; + return CHIP_NO_ERROR; } - CHIP_ERROR Test5bThReadsOperationalStatusAttributeFromDut_12() + CHIP_ERROR Test5bReadsBackTheRoMandatoryAttributeSafetyStatus_42() { + SetIdentity("alpha"); 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); + [cluster readAttributeSafetyStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"5b: reads back the RO mandatory attribute: SafetyStatus Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("OperationalStatus", actualValue, 0)); + VerifyOrReturn(CheckConstraintType("safetyStatus", "", "map16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("safetyStatus", value, 4096U)); } NextTest(); @@ -49318,184 +54868,99 @@ class Test_TC_WNCV_4_1 : public TestCommandBridge { 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) + CHIP_ERROR Test4ReadTheRoOptionalAttributeDefaultCurrentPositionLift_43() { - 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) + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - ~Test_TC_WNCV_4_2() {} + [cluster readAttributeCurrentPositionLiftWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"4: read the RO optional attribute default: CurrentPositionLift 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_4_2\n"); - } + VerifyOrReturn(CheckConstraintType("currentPositionLift", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentPositionLift", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentPositionLift", [value unsignedShortValue], 65535U)); + } - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_4_2\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + NextTest(); + }]; - Wait(); + return CHIP_NO_ERROR; + } - // 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 DownOrClose command to preposition the DUT in the opposite direction\n"); - err = Test1aThSendsDownOrCloseCommandToPrepositionTheDutInTheOppositeDirection_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : 1b: TH waits for x seconds movement(s) on the DUT\n"); - err = Test1bThWaitsForXSecondsMovementsOnTheDut_2(); - break; - 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 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 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : 2b: DUT updates its attributes\n"); - err = Test2bDutUpdatesItsAttributes_5(); - break; - 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 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : 3a: TH set a timeout of X minutes for failure\n"); - err = Test3aThSetATimeoutOfXMinutesForFailure_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : 3b: TH reads OperationalStatus attribute from DUT\n"); - err = Test3bThReadsOperationalStatusAttributeFromDut_8(); - break; - 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 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : 4b: DUT updates its attributes\n"); - err = Test4bDutUpdatesItsAttributes_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : 5a: TH waits for x seconds movement(s) on the DUT\n"); - err = Test5aThWaitsForXSecondsMovementsOnTheDut_11(); - break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : 5b: TH reads OperationalStatus attribute from DUT\n"); - err = Test5bThReadsOperationalStatusAttributeFromDut_12(); - break; - } - - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - - chip::System::Clock::Timeout GetWaitDuration() const override + CHIP_ERROR Test5aWriteAValueIntoTheRoOptionalAttributeCurrentPositionLift_44() { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } + SetIdentity("alpha"); + 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 = 13; + id currentPositionLiftArgument; + currentPositionLiftArgument = [NSNumber numberWithUnsignedShort:255U]; + [cluster + writeAttributeCurrentPositionLiftWithValue:currentPositionLiftArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"5a: write a value into the RO optional attribute: CurrentPositionLift Error: %@", + err); - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mFullMotionDuration; - chip::Optional mTimeout; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + NextTest(); + }]; - CHIP_ERROR Test0WaitForTheCommissionedDeviceToBeRetrieved_0() - { - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR Test1aThSendsDownOrCloseCommandToPrepositionTheDutInTheOppositeDirection_1() + CHIP_ERROR Test5bReadsBackTheRoOptionalAttributeCurrentPositionLift_45() { + SetIdentity("alpha"); 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); + [cluster readAttributeCurrentPositionLiftWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"5b: reads back the RO optional attribute: CurrentPositionLift Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckConstraintType("currentPositionLift", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentPositionLift", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentPositionLift", [value unsignedShortValue], 65535U)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test1bThWaitsForXSecondsMovementsOnTheDut_2() - { - WaitForMs(mFullMotionDuration.HasValue() ? mFullMotionDuration.Value() : 6000U); - return CHIP_NO_ERROR; - } - - CHIP_ERROR Test1cIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_3() + CHIP_ERROR Test4ReadTheRoOptionalAttributeDefaultCurrentPositionTilt_46() { + SetIdentity("alpha"); 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); + [cluster readAttributeCurrentPositionTiltWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"4: read the RO optional attribute default: CurrentPositionTilt Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckConstraintType("currentPositionTilt", "", "uint16")); if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("currentPositionTiltPercent100ths", value, 0U)); + VerifyOrReturn(CheckConstraintMinValue("currentPositionTilt", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentPositionTilt", [value unsignedShortValue], 65535U)); } NextTest(); @@ -49504,49 +54969,46 @@ class Test_TC_WNCV_4_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR Test2aThSendsGoToTiltPercentageCommandWith30PercentToDut_4() + CHIP_ERROR Test5aWriteAValueIntoTheRoOptionalAttributeCurrentPositionTilt_47() { + SetIdentity("alpha"); 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(); - }]; + id currentPositionTiltArgument; + currentPositionTiltArgument = [NSNumber numberWithUnsignedShort:255U]; + [cluster + writeAttributeCurrentPositionTiltWithValue:currentPositionTiltArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"5a: write a value into the RO optional attribute: CurrentPositionTilt Error: %@", + err); - return CHIP_NO_ERROR; - } + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + NextTest(); + }]; - CHIP_ERROR Test2bDutUpdatesItsAttributes_5() - { - WaitForMs(100); return CHIP_NO_ERROR; } - CHIP_ERROR Test2cIfPaTlThReadsTargetPositionTiltPercent100thsAttributeFromDut_6() + CHIP_ERROR Test5bReadsBackTheRoOptionalAttributeCurrentPositionTilt_48() { + SetIdentity("alpha"); 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); + [cluster readAttributeCurrentPositionTiltWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"5b: reads back the RO optional attribute: CurrentPositionTilt Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("TargetPositionTiltPercent100ths", actualValue)); - VerifyOrReturn(CheckValue("TargetPositionTiltPercent100ths", actualValue, 3000U)); + VerifyOrReturn(CheckConstraintType("currentPositionTilt", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentPositionTilt", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentPositionTilt", [value unsignedShortValue], 65535U)); } NextTest(); @@ -49555,95 +55017,164 @@ class Test_TC_WNCV_4_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR Test3aThSetATimeoutOfXMinutesForFailure_7() + CHIP_ERROR Test4ReadTheRoOptionalAttributeDefaultCurrentPositionLiftPercentage_49() { - WaitForMs(mFullMotionDuration.HasValue() ? mFullMotionDuration.Value() : 6000U); + SetIdentity("alpha"); + 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(@"4: read the RO optional attribute default: CurrentPositionLiftPercentage Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentPositionLiftPercentage", "", "Percent")); + if (value != nil) { + VerifyOrReturn( + CheckConstraintMinValue("currentPositionLiftPercentage", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn( + CheckConstraintMaxValue("currentPositionLiftPercentage", [value unsignedCharValue], 100)); + } + + NextTest(); + }]; + return CHIP_NO_ERROR; } - CHIP_ERROR Test3bThReadsOperationalStatusAttributeFromDut_8() + CHIP_ERROR Test5aWriteAValueIntoTheRoOptionalAttributeCurrentPositionLiftPercentage_50() { + SetIdentity("alpha"); 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)); - } + id currentPositionLiftPercentageArgument; + currentPositionLiftPercentageArgument = [NSNumber numberWithUnsignedChar:200]; + [cluster + writeAttributeCurrentPositionLiftPercentageWithValue:currentPositionLiftPercentageArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"5a: write a value into the RO optional attribute: " + @"CurrentPositionLiftPercentage Error: %@", + err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test4aThSendsGoToTiltPercentageCommandWith6020PercentToDut_9() + CHIP_ERROR Test5bReadsBackTheRoOptionalAttributeCurrentPositionLiftPercentage_51() { + SetIdentity("alpha"); 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); + [cluster + readAttributeCurrentPositionLiftPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"5b: reads back the RO optional attribute: CurrentPositionLiftPercentage Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("currentPositionLiftPercentage", "", "Percent")); + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("currentPositionLiftPercentage", value, 200)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test4bDutUpdatesItsAttributes_10() + CHIP_ERROR Test4ReadTheRoOptionalAttributeDefaultCurrentPositionTiltPercentage_52() { - WaitForMs(100); + SetIdentity("alpha"); + 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(@"4: read the RO optional attribute default: CurrentPositionTiltPercentage Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentPositionTiltPercentage", "", "Percent")); + if (value != nil) { + VerifyOrReturn( + CheckConstraintMinValue("currentPositionTiltPercentage", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn( + CheckConstraintMaxValue("currentPositionTiltPercentage", [value unsignedCharValue], 100)); + } + + NextTest(); + }]; + return CHIP_NO_ERROR; } - CHIP_ERROR Test5aThWaitsForXSecondsMovementsOnTheDut_11() + CHIP_ERROR Test5aWriteAValueIntoTheRoOptionalAttributeCurrentPositionTiltPercentage_53() { - WaitForMs(mFullMotionDuration.HasValue() ? mFullMotionDuration.Value() : 6000U); + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id currentPositionTiltPercentageArgument; + currentPositionTiltPercentageArgument = [NSNumber numberWithUnsignedChar:200]; + [cluster + writeAttributeCurrentPositionTiltPercentageWithValue:currentPositionTiltPercentageArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"5a: write a value into the RO optional attribute: " + @"CurrentPositionTiltPercentage Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + NextTest(); + }]; + return CHIP_NO_ERROR; } - CHIP_ERROR Test5bThReadsOperationalStatusAttributeFromDut_12() + CHIP_ERROR Test5bReadsBackTheRoOptionalAttributeCurrentPositionTiltPercentage_54() { + SetIdentity("alpha"); 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); + [cluster + readAttributeCurrentPositionTiltPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"5b: reads back the RO optional attribute: CurrentPositionTiltPercentage Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("OperationalStatus", actualValue, 0)); - } + VerifyOrReturn(CheckConstraintType("currentPositionTiltPercentage", "", "Percent")); + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("currentPositionTiltPercentage", value, 200)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } }; -class Test_TC_WNCV_4_3 : public TestCommandBridge { +class Test_TC_WNCV_2_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_2_2() + : TestCommandBridge("Test_TC_WNCV_2_2") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -49653,7 +55184,7 @@ class Test_TC_WNCV_4_3 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_WNCV_4_3() {} + ~Test_TC_WNCV_2_2() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -49661,11 +55192,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_2_2\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_4_3\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_2_2\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -49678,49 +55209,8 @@ class Test_TC_WNCV_4_3 : public TestCommandBridge { // 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_LF & LF) TH reads CurrentPositionLiftPercent100ths from DUT\n"); - if (ShouldSkip("WNCV_LF && WNCV_PA_LF")) { - NextTest(); - return; - } - err = Test1aIfPaLfLfThReadsCurrentPositionLiftPercent100thsFromDut_1(); - break; - 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 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 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 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(); + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; } @@ -49730,6 +55220,18 @@ class Test_TC_WNCV_4_3 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -49737,174 +55239,53 @@ class Test_TC_WNCV_4_3 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 6; + const uint16_t mTestCount = 1; chip::Optional mNodeId; chip::Optional mCluster; chip::Optional mEndpoint; chip::Optional mTimeout; - CHIP_ERROR Test0WaitForTheCommissionedDeviceToBeRetrieved_0() + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); 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() +class Test_TC_WNCV_2_3 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_WNCV_2_3() + : TestCommandBridge("Test_TC_WNCV_2_3") + , mTestIndex(0) { - 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; + 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 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; - } + ~Test_TC_WNCV_2_3() {} - CHIP_ERROR Test3aThSendsGoToLiftPercentageCommandWith10001ToDut_4() + /////////// TestCommand Interface ///////// + void NextTest() override { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + CHIP_ERROR err = CHIP_NO_ERROR; - __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); + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_2_3\n"); + } - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_2_3\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } - 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(); + Wait(); // Ensure we increment mTestIndex before we start running the relevant // command. That way if we lose the timeslice after we send the message @@ -49912,329 +55293,153 @@ class Test_TC_WNCV_4_4 : public TestCommandBridge { // 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(); + 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 : 1a: If (PA_TL & TL) TH reads CurrentPositionTiltPercent100ths from DUT\n"); - if (ShouldSkip("WNCV_TL && WNCV_PA_TL")) { + ChipLogProgress(chipTool, " ***** Test Step 1 : 1a: TH set the Mode Attribute bit0 of the DUT\n"); + if (ShouldSkip("WNCV_REVERSAL")) { NextTest(); return; } - err = Test1aIfPaTlTlThReadsCurrentPositionTiltPercent100thsFromDut_1(); + err = Test1aThSetTheModeAttributeBit0OfTheDut_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")) { + ChipLogProgress(chipTool, " ***** Test Step 2 : 1b: TH reads ConfigStatus attribute from DUT\n"); + if (ShouldSkip("WNCV_REVERSAL")) { NextTest(); return; } - err = Test1bIfPaTlTlThReadsCurrentPositionTiltPercentageFromDut_2(); + err = Test1bThReadsConfigStatusAttributeFromDut_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")) { + ChipLogProgress(chipTool, " ***** Test Step 3 : 1c: TH clear the Mode Attribute bit0 of the DUT\n"); + if (ShouldSkip("WNCV_REVERSAL")) { NextTest(); return; } - err = Test2bThSendsGoToTiltPercentageCommandWithBadParamToDut_3(); + err = Test1cThClearTheModeAttributeBit0OfTheDut_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")) { + ChipLogProgress(chipTool, " ***** Test Step 4 : 1d: TH reads ConfigStatus attribute from DUT\n"); + if (ShouldSkip("WNCV_REVERSAL")) { NextTest(); return; } - err = Test3aThSendsGoToTiltPercentageCommandWith10001ToDut_4(); + err = Test1dThReadsConfigStatusAttributeFromDut_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")) { + ChipLogProgress(chipTool, " ***** Test Step 5 : 2a: TH set the Mode Attribute bit1 of the DUT\n"); + if (ShouldSkip("WNCV_CALIBRATION")) { NextTest(); return; } - err = Test4aThSendsGoToTiltPercentageCommandWith0xFFFFToDut_5(); - 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 = 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 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : 0b: TH sends UpOrOpen command to preposition the DUT\n"); - err = Test0bThSendsUpOrOpenCommandToPrepositionTheDut_1(); + err = Test2aThSetTheModeAttributeBit1OfTheDut_5(); break; - case 2: - ChipLogProgress( - 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")) { + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : 2b: TH reads ConfigStatus attribute from DUT\n"); + if (ShouldSkip("WNCV_CALIBRATION")) { NextTest(); return; } - err = Test1aIfPaLfLfThSendsGoToLiftPercentageCommandWith90ToDut_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : 1b: TH Waits for 100ms-1s\n"); - err = Test1bThWaitsFor100ms1s_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : 1c: TH sends StopMotion command to DUT\n"); - err = Test1cThSendsStopMotionCommandToDut_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : 1d: TH Waits for 100ms-1s\n"); - err = Test1dThWaitsFor100ms1s_5(); + err = Test2bThReadsConfigStatusAttributeFromDut_6(); break; - case 6: + case 7: ChipLogProgress( - 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")) { + chipTool, " ***** Test Step 7 : 2c: If (ConfigStatus bit0 == 0) TH send DownOrClose command to the DUT\n"); + if (ShouldSkip("WNCV_CALIBRATION")) { NextTest(); return; } - err = Test2aIfPaTlTlThSendsGoToTiltPercentageCommandWith90ToDut_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : 2b: TH Waits for 100ms-1s\n"); - err = Test2bThWaitsFor100ms1s_7(); + err = Test2cIfConfigStatusBit00ThSendDownOrCloseCommandToTheDut_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : 2c: TH sends StopMotion command to DUT\n"); - err = Test2cThSendsStopMotionCommandToDut_8(); + ChipLogProgress(chipTool, " ***** Test Step 8 : 2d: TH clear the Mode Attribute bit1 of the DUT\n"); + if (ShouldSkip("WNCV_CALIBRATION")) { + NextTest(); + return; + } + err = Test2dThClearTheModeAttributeBit1OfTheDut_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : 2d: TH Waits for 100ms-1s\n"); - err = Test2dThWaitsFor100ms1s_9(); + ChipLogProgress(chipTool, " ***** Test Step 9 : 2e: TH reads ConfigStatus attribute from DUT\n"); + if (ShouldSkip("WNCV_CALIBRATION")) { + NextTest(); + return; + } + err = Test2eThReadsConfigStatusAttributeFromDut_9(); break; case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : 3a: TH reads CurrentPositionLiftPercent100ths from DUT\n"); - if (ShouldSkip("WNCV_LF && WNCV_PA_LF")) { + ChipLogProgress(chipTool, " ***** Test Step 10 : 2f: TH reads the Mode Attribute from the DUT\n"); + if (ShouldSkip("WNCV_CALIBRATION")) { NextTest(); return; } - err = Test3aThReadsCurrentPositionLiftPercent100thsFromDut_10(); + err = Test2fThReadsTheModeAttributeFromTheDut_10(); break; case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : 3b: TH reads CurrentPositionTiltPercent100ths from DUT\n"); - if (ShouldSkip("WNCV_TL && WNCV_PA_TL")) { + ChipLogProgress(chipTool, " ***** Test Step 11 : 2g: TH send DownOrClose command to the DUT\n"); + if (ShouldSkip("WNCV_CALIBRATION")) { NextTest(); return; } - err = Test3bThReadsCurrentPositionTiltPercent100thsFromDut_11(); + err = Test2gThSendDownOrCloseCommandToTheDut_11(); break; case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : 3c: reboot/restart the DUT\n"); - err = Test3cRebootRestartTheDut_12(); + ChipLogProgress(chipTool, " ***** Test Step 12 : 3a: TH set the Mode Attribute bit2 of the DUT\n"); + if (ShouldSkip("WNCV_MAINTENANCE")) { + NextTest(); + return; + } + err = Test3aThSetTheModeAttributeBit2OfTheDut_12(); break; case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : 3d: Wait for the commissioned device to be retrieved\n"); - err = Test3dWaitForTheCommissionedDeviceToBeRetrieved_13(); + ChipLogProgress(chipTool, " ***** Test Step 13 : 3c: TH reads ConfigStatus attribute from DUT\n"); + if (ShouldSkip("WNCV_MAINTENANCE")) { + NextTest(); + return; + } + err = Test3cThReadsConfigStatusAttributeFromDut_13(); break; case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : 3e: TH reads CurrentPositionLiftPercent100ths from DUT\n"); - if (ShouldSkip("WNCV_LF && WNCV_PA_LF")) { + ChipLogProgress(chipTool, " ***** Test Step 14 : 3c: TH send DownOrClose command to the DUT\n"); + if (ShouldSkip("WNCV_MAINTENANCE")) { NextTest(); return; } - err = Test3eThReadsCurrentPositionLiftPercent100thsFromDut_14(); + err = Test3cThSendDownOrCloseCommandToTheDut_14(); break; case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : 3f: TH reads CurrentPositionTiltPercent100ths from DUT\n"); - if (ShouldSkip("WNCV_TL && WNCV_PA_TL")) { + ChipLogProgress(chipTool, " ***** Test Step 15 : 3d: TH clear the Mode Attribute bit2 of the DUT\n"); + if (ShouldSkip("WNCV_MAINTENANCE")) { NextTest(); return; } - err = Test3fThReadsCurrentPositionTiltPercent100thsFromDut_15(); + err = Test3dThClearTheModeAttributeBit2OfTheDut_15(); + break; + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : 3e: TH reads ConfigStatus attribute from DUT\n"); + if (ShouldSkip("WNCV_MAINTENANCE")) { + NextTest(); + return; + } + err = Test3eThReadsConfigStatusAttributeFromDut_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : 3f: TH reads the Mode Attribute from the DUT\n"); + if (ShouldSkip("WNCV_MAINTENANCE")) { + NextTest(); + return; + } + err = Test3fThReadsTheModeAttributeFromTheDut_17(); + break; + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : 3g: TH send DownOrClose command to the DUT\n"); + if (ShouldSkip("WNCV_MAINTENANCE")) { + NextTest(); + return; + } + err = Test3gThSendDownOrCloseCommandToTheDut_18(); break; } @@ -50244,6 +55449,72 @@ class Test_TC_WNCV_4_5 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_BUSY)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -50251,155 +55522,242 @@ class Test_TC_WNCV_4_5 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 16; + const uint16_t mTestCount = 19; chip::Optional mNodeId; chip::Optional mCluster; chip::Optional mEndpoint; - chip::Optional mDiscriminator; chip::Optional mTimeout; - CHIP_ERROR Test0aWaitForTheCommissionedDeviceToBeRetrieved_0() + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR Test0bThSendsUpOrOpenCommandToPrepositionTheDut_1() + CHIP_ERROR Test1aThSetTheModeAttributeBit0OfTheDut_1() { + SetIdentity("alpha"); 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); + id modeArgument; + modeArgument = [NSNumber numberWithUnsignedChar:1]; + [cluster writeAttributeModeWithValue:modeArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"1a: TH set the Mode Attribute bit0 of the DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test1aIfPaLfLfThSendsGoToLiftPercentageCommandWith90ToDut_2() + CHIP_ERROR Test1bThReadsConfigStatusAttributeFromDut_2() { + SetIdentity("alpha"); 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); + [cluster readAttributeConfigStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"1b: TH reads ConfigStatus attribute from DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("configStatus", [value unsignedCharValue], 4)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("configStatus", [value unsignedCharValue], 127)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test1bThWaitsFor100ms1s_3() + CHIP_ERROR Test1cThClearTheModeAttributeBit0OfTheDut_3() { - WaitForMs(500); + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id modeArgument; + modeArgument = [NSNumber numberWithUnsignedChar:0]; + [cluster writeAttributeModeWithValue:modeArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"1c: TH clear the Mode Attribute bit0 of the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + return CHIP_NO_ERROR; } - CHIP_ERROR Test1cThSendsStopMotionCommandToDut_4() + CHIP_ERROR Test1dThReadsConfigStatusAttributeFromDut_4() { + SetIdentity("alpha"); 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); + [cluster readAttributeConfigStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"1d: TH reads ConfigStatus attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("configStatus", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("configStatus", [value unsignedCharValue], 127)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test1dThWaitsFor100ms1s_5() + CHIP_ERROR Test2aThSetTheModeAttributeBit1OfTheDut_5() { - WaitForMs(500); + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id modeArgument; + modeArgument = [NSNumber numberWithUnsignedChar:2]; + [cluster writeAttributeModeWithValue:modeArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"2a: TH set the Mode Attribute bit1 of the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + return CHIP_NO_ERROR; } + NSNumber * _Nonnull configStatusValA; - CHIP_ERROR Test2aIfPaTlTlThSendsGoToTiltPercentageCommandWith90ToDut_6() + CHIP_ERROR Test2bThReadsConfigStatusAttributeFromDut_6() { + SetIdentity("alpha"); 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); + [cluster readAttributeConfigStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"2b: TH reads ConfigStatus attribute from DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("configStatus", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("configStatus", [value unsignedCharValue], 127)); + } + { + configStatusValA = value; + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test2bThWaitsFor100ms1s_7() + CHIP_ERROR Test2cIfConfigStatusBit00ThSendDownOrCloseCommandToTheDut_7() { - WaitForMs(500); + SetIdentity("alpha"); + 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(@"2c: If (ConfigStatus bit0 == 0) TH send DownOrClose command to the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_FAILURE)); + NextTest(); + }]; + return CHIP_NO_ERROR; } - CHIP_ERROR Test2cThSendsStopMotionCommandToDut_8() + CHIP_ERROR Test2dThClearTheModeAttributeBit1OfTheDut_8() { + SetIdentity("alpha"); 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); + id modeArgument; + modeArgument = [NSNumber numberWithUnsignedChar:0]; + [cluster writeAttributeModeWithValue:modeArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"2d: TH clear the Mode Attribute bit1 of the DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test2dThWaitsFor100ms1s_9() + CHIP_ERROR Test2eThReadsConfigStatusAttributeFromDut_9() { - WaitForMs(500); + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeConfigStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"2e: TH reads ConfigStatus attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("configStatus", [value unsignedCharValue], 1)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("configStatus", [value unsignedCharValue], 127)); + } + + NextTest(); + }]; + return CHIP_NO_ERROR; } - NSNumber * _Nullable attrCurrentPositionLiftPercent100ths; - CHIP_ERROR Test3aThReadsCurrentPositionLiftPercent100thsFromDut_10() + CHIP_ERROR Test2fThReadsTheModeAttributeFromTheDut_10() { + SetIdentity("alpha"); 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); + [cluster readAttributeModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"2f: TH reads the Mode Attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("currentPositionLiftPercent100ths", value, 0U)); + VerifyOrReturn(CheckConstraintMinValue("mode", [value unsignedCharValue], 0)); } - { - attrCurrentPositionLiftPercent100ths = value; + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("mode", [value unsignedCharValue], 127)); } NextTest(); @@ -50407,25 +55765,67 @@ class Test_TC_WNCV_4_5 : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nullable attrCurrentPositionTiltPercent100ths; - CHIP_ERROR Test3bThReadsCurrentPositionTiltPercent100thsFromDut_11() + CHIP_ERROR Test2gThSendDownOrCloseCommandToTheDut_11() { + SetIdentity("alpha"); 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); + [cluster downOrCloseWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"2g: TH send DownOrClose command to the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test3aThSetTheModeAttributeBit2OfTheDut_12() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id modeArgument; + modeArgument = [NSNumber numberWithUnsignedChar:4]; + [cluster writeAttributeModeWithValue:modeArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"3a: TH set the Mode Attribute bit2 of the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nonnull configStatusValB; + + CHIP_ERROR Test3cThReadsConfigStatusAttributeFromDut_13() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeConfigStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3c: TH reads ConfigStatus attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("currentPositionTiltPercent100ths", value, 0U)); + VerifyOrReturn(CheckConstraintMinValue("configStatus", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("configStatus", [value unsignedCharValue], 127)); } { - attrCurrentPositionTiltPercent100ths = value; + configStatusValB = value; } NextTest(); @@ -50434,39 +55834,61 @@ class Test_TC_WNCV_4_5 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR Test3cRebootRestartTheDut_12() + CHIP_ERROR Test3cThSendDownOrCloseCommandToTheDut_14() { - Reboot(mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U); + SetIdentity("alpha"); + 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(@"3c: TH send DownOrClose command to the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_BUSY)); + NextTest(); + }]; + return CHIP_NO_ERROR; } - CHIP_ERROR Test3dWaitForTheCommissionedDeviceToBeRetrieved_13() + CHIP_ERROR Test3dThClearTheModeAttributeBit2OfTheDut_15() { - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id modeArgument; + modeArgument = [NSNumber numberWithUnsignedChar:0]; + [cluster writeAttributeModeWithValue:modeArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"3d: TH clear the Mode Attribute bit2 of the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + return CHIP_NO_ERROR; } - CHIP_ERROR Test3eThReadsCurrentPositionLiftPercent100thsFromDut_14() + CHIP_ERROR Test3eThReadsConfigStatusAttributeFromDut_16() { + SetIdentity("alpha"); 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); + [cluster readAttributeConfigStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3e: TH reads ConfigStatus attribute 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)); - } + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("configStatus", [value unsignedCharValue], 1)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("configStatus", [value unsignedCharValue], 127)); } NextTest(); @@ -50475,27 +55897,23 @@ class Test_TC_WNCV_4_5 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR Test3fThReadsCurrentPositionTiltPercent100thsFromDut_15() + CHIP_ERROR Test3fThReadsTheModeAttributeFromTheDut_17() { + SetIdentity("alpha"); 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); + [cluster readAttributeModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3f: TH reads the Mode Attribute from the 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)); - } + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("mode", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("mode", [value unsignedCharValue], 127)); } NextTest(); @@ -50503,13 +55921,31 @@ class Test_TC_WNCV_4_5 : public TestCommandBridge { return CHIP_NO_ERROR; } + + CHIP_ERROR Test3gThSendDownOrCloseCommandToTheDut_18() + { + SetIdentity("alpha"); + 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(@"3g: TH send DownOrClose command to the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } }; -class TV_TargetNavigatorCluster : public TestCommandBridge { +class Test_TC_WNCV_2_4 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - TV_TargetNavigatorCluster() - : TestCommandBridge("TV_TargetNavigatorCluster") + Test_TC_WNCV_2_4() + : TestCommandBridge("Test_TC_WNCV_2_4") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -50519,7 +55955,7 @@ class TV_TargetNavigatorCluster : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~TV_TargetNavigatorCluster() {} + ~Test_TC_WNCV_2_4() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -50527,11 +55963,11 @@ class TV_TargetNavigatorCluster : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: TV_TargetNavigatorCluster\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_2_4\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: TV_TargetNavigatorCluster\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_2_4\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -50548,16 +55984,20 @@ class TV_TargetNavigatorCluster : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read attribute Target Navigator list\n"); - err = TestReadAttributeTargetNavigatorList_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Reads Type attribute from DUT\n"); + if (ShouldSkip("A_TYPE")) { + NextTest(); + return; + } + err = TestReadsTypeAttributeFromDut_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read attribute current navigator target\n"); - err = TestReadAttributeCurrentNavigatorTarget_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Navigate Target Request Command\n"); - err = TestNavigateTargetRequestCommand_3(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Reads Type attribute constraints\n"); + if (ShouldSkip("A_TYPE")) { + NextTest(); + return; + } + err = TestReadsTypeAttributeConstraints_2(); break; } @@ -50567,6 +56007,24 @@ class TV_TargetNavigatorCluster : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -50574,7 +56032,7 @@ class TV_TargetNavigatorCluster : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 4; + const uint16_t mTestCount = 3; chip::Optional mNodeId; chip::Optional mCluster; @@ -50583,30 +56041,26 @@ class TV_TargetNavigatorCluster : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeTargetNavigatorList_1() + CHIP_ERROR TestReadsTypeAttributeFromDut_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestTargetNavigator * cluster = [[CHIPTestTargetNavigator alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering 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); + [cluster readAttributeTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads Type attribute from DUT 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")); + VerifyOrReturn(CheckValue("Type", actualValue, 0)); } NextTest(); @@ -50615,20 +56069,24 @@ class TV_TargetNavigatorCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeCurrentNavigatorTarget_2() + CHIP_ERROR TestReadsTypeAttributeConstraints_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestTargetNavigator * cluster = [[CHIPTestTargetNavigator alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering 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); + [cluster readAttributeTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads Type attribute constraints Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("CurrentTarget", actualValue, 0)); + VerifyOrReturn(CheckConstraintType("type", "", "enum8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("type", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("type", [value unsignedCharValue], 9)); } NextTest(); @@ -50636,45 +56094,13 @@ class TV_TargetNavigatorCluster : public TestCommandBridge { 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 { +class Test_TC_WNCV_2_5 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - TV_AudioOutputCluster() - : TestCommandBridge("TV_AudioOutputCluster") + Test_TC_WNCV_2_5() + : TestCommandBridge("Test_TC_WNCV_2_5") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -50684,7 +56110,7 @@ class TV_AudioOutputCluster : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~TV_AudioOutputCluster() {} + ~Test_TC_WNCV_2_5() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -50692,11 +56118,11 @@ class TV_AudioOutputCluster : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: TV_AudioOutputCluster\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_2_5\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: TV_AudioOutputCluster\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_2_5\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -50713,24 +56139,20 @@ class TV_AudioOutputCluster : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read attribute Audio Output list\n"); - err = TestReadAttributeAudioOutputList_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Reads EndProductType attribute from DUT\n"); + if (ShouldSkip("A_ENDPRODUCTTYPE")) { + NextTest(); + return; + } + err = TestReadsEndProductTypeAttributeFromDut_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read attribute current audio output\n"); - err = TestReadAttributeCurrentAudioOutput_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Select Output Command\n"); - err = TestSelectOutputCommand_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Rename Output Command\n"); - err = TestRenameOutputCommand_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read attribute Audio Output list\n"); - err = TestReadAttributeAudioOutputList_5(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Reads EndProductType attribute constraints from DUT\n"); + if (ShouldSkip("A_ENDPRODUCTTYPE")) { + NextTest(); + return; + } + err = TestReadsEndProductTypeAttributeConstraintsFromDut_2(); break; } @@ -50740,6 +56162,24 @@ class TV_AudioOutputCluster : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -50747,7 +56187,7 @@ class TV_AudioOutputCluster : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 6; + const uint16_t mTestCount = 3; chip::Optional mNodeId; chip::Optional mCluster; @@ -50756,33 +56196,26 @@ class TV_AudioOutputCluster : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeAudioOutputList_1() + CHIP_ERROR TestReadsEndProductTypeAttributeFromDut_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestAudioOutput * cluster = [[CHIPTestAudioOutput alloc] initWithDevice:device endpoint:2 queue:mCallbackQueue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 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); + [cluster readAttributeEndProductTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads EndProductType attribute from DUT 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")); + VerifyOrReturn(CheckValue("EndProductType", actualValue, 0)); } NextTest(); @@ -50791,20 +56224,24 @@ class TV_AudioOutputCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeCurrentAudioOutput_2() + CHIP_ERROR TestReadsEndProductTypeAttributeConstraintsFromDut_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestAudioOutput * cluster = [[CHIPTestAudioOutput alloc] initWithDevice:device endpoint:2 queue:mCallbackQueue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 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); + [cluster readAttributeEndProductTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads EndProductType attribute constraints from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("CurrentOutput", actualValue, 1)); + VerifyOrReturn(CheckConstraintType("endProductType", "", "enum8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("endProductType", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("endProductType", [value unsignedCharValue], 23)); } NextTest(); @@ -50812,113 +56249,40 @@ class TV_AudioOutputCluster : public TestCommandBridge { return CHIP_NO_ERROR; } +}; - CHIP_ERROR TestSelectOutputCommand_3() +class Test_TC_WNCV_3_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_WNCV_3_1() + : TestCommandBridge("Test_TC_WNCV_3_1") + , mTestIndex(0) { - 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; + 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 TestRenameOutputCommand_4() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestAudioOutput * cluster = [[CHIPTestAudioOutput alloc] initWithDevice:device endpoint:2 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + ~Test_TC_WNCV_3_1() {} - __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); + /////////// 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_1\n"); + } - NextTest(); - }]; + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_3_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } - 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(); + Wait(); // Ensure we increment mTestIndex before we start running the relevant // command. That way if we lose the timeslice after we send the message @@ -50926,28 +56290,163 @@ class TV_ApplicationLauncherCluster : 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 : Read attribute Application Launcher list\n"); - err = TestReadAttributeApplicationLauncherList_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 : Read attribute application launcher app\n"); - err = TestReadAttributeApplicationLauncherApp_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 : Launch App Command\n"); - err = TestLaunchAppCommand_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 : Stop App Command\n"); - err = TestStopAppCommand_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 : Hide App Command\n"); - err = TestHideAppCommand_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 = Test1eIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_5(); + break; + 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 = 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 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 = 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; } @@ -50957,6 +56456,90 @@ class TV_ApplicationLauncherCluster : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -50964,62 +56547,66 @@ class TV_ApplicationLauncherCluster : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 6; + const uint16_t mTestCount = 25; chip::Optional mNodeId; chip::Optional mCluster; chip::Optional mEndpoint; chip::Optional mTimeout; - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + CHIP_ERROR Test0WaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeApplicationLauncherList_1() + CHIP_ERROR Test1aThSendsDownOrCloseCommandToPrepositionTheDutInTheOppositeDirection_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestApplicationLauncher * cluster = [[CHIPTestApplicationLauncher alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering 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); + [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)); - { - 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() + CHIP_ERROR Test1bThWaitsFor10SecondsMovementsOnTheDevice_2() + { + SetIdentity("alpha"); + WaitForMs(10000); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test1cIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestApplicationLauncher * cluster = [[CHIPTestApplicationLauncher alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering 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); + [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)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNull("CurrentApp", actualValue)); + VerifyOrReturn(CheckConstraintType("currentPositionLiftPercent100ths", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue( + "currentPositionLiftPercent100ths", [value unsignedShortValue], 1U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue( + "currentPositionLiftPercent100ths", [value unsignedShortValue], 10000U)); } NextTest(); @@ -51028,73 +56615,85 @@ class TV_ApplicationLauncherCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestLaunchAppCommand_3() + CHIP_ERROR Test1dIfPaLfThReadsCurrentPositionLiftPercentageOptionalAttributeFromDut_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestApplicationLauncher * cluster = [[CHIPTestApplicationLauncher alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering 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"; + [cluster + readAttributeCurrentPositionLiftPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"1d: If (PA & LF) TH reads CurrentPositionLiftPercentage optional attribute from DUT Error: %@", err); - 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)); - 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)); + } - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0)); - } + NextTest(); + }]; - { - id actualValue = values.data; - VerifyOrReturn(CheckValueAsString("data", actualValue, [[NSData alloc] initWithBytes:"data" length:4])); - } + return CHIP_NO_ERROR; + } - NextTest(); - }]; + CHIP_ERROR Test1eIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_5() + { + SetIdentity("alpha"); + 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(@"1e: 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], 1U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue( + "currentPositionTiltPercent100ths", [value unsignedShortValue], 10000U)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStopAppCommand_4() + CHIP_ERROR Test1fIfPaTlThReadsCurrentPositionTiltPercentageOptionalAttributeFromDut_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestApplicationLauncher * cluster = [[CHIPTestApplicationLauncher alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering 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); + 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, 0)); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0)); + VerifyOrReturn(CheckConstraintType("currentPositionTiltPercentage", "", "uint8")); + if (value != nil) { + VerifyOrReturn( + CheckConstraintMinValue("currentPositionTiltPercentage", [value unsignedCharValue], 1)); } - - { - id actualValue = values.data; - VerifyOrReturn(CheckValueAsString("data", actualValue, [[NSData alloc] initWithBytes:"data" length:4])); + if (value != nil) { + VerifyOrReturn( + CheckConstraintMaxValue("currentPositionTiltPercentage", [value unsignedCharValue], 100)); } NextTest(); @@ -51102,282 +56701,276 @@ class TV_ApplicationLauncherCluster : public TestCommandBridge { return CHIP_NO_ERROR; } + bool testSendClusterTest_TC_WNCV_3_1_7_WaitForReport_Fulfilled = false; + ResponseHandler _Nullable test_Test_TC_WNCV_3_1_OperationalStatus_Reported = nil; - CHIP_ERROR TestHideAppCommand_5() + CHIP_ERROR TestReport2SubscribeToDutReportsOnOperationalStatusAttribute_7() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestApplicationLauncher * cluster = [[CHIPTestApplicationLauncher alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering 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"; + 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); - [cluster - hideAppWithParams:params - completionHandler:^(CHIPApplicationLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Hide App Command Error: %@", err); + VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckConstraintType("operationalStatus", "", "map8")); + testSendClusterTest_TC_WNCV_3_1_7_WaitForReport_Fulfilled = true; + }; - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0)); - } + NextTest(); + return CHIP_NO_ERROR; + } - { - id actualValue = values.data; - VerifyOrReturn(CheckValueAsString("data", actualValue, [[NSData alloc] initWithBytes:"data" length:4])); - } + CHIP_ERROR Test2SubscribeToDutReportsOnOperationalStatusAttribute_8() + { + SetIdentity("alpha"); + 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_1_7_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_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; } -}; -class TV_KeypadInputCluster : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - TV_KeypadInputCluster() - : TestCommandBridge("TV_KeypadInputCluster") - , mTestIndex(0) + CHIP_ERROR Test2aThSendsUpOrOpenCommandToDut_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) + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - ~TV_KeypadInputCluster() {} + [cluster upOrOpenWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"2a: TH sends UpOrOpen command to DUT Error: %@", err); - /////////// 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(); + 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 : Send Key Command\n"); - err = TestSendKeyCommand_1(); - 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 Test2bDutUpdatesItsAttributes_10() { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + SetIdentity("alpha"); + WaitForMs(100); + return CHIP_NO_ERROR; } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 2; + CHIP_ERROR Test2cIfPaLfThReadsTargetPositionLiftPercent100thsAttributeFromDut_11() + { + SetIdentity("alpha"); + 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 readAttributeTargetPositionLiftPercent100thsWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"2c: If (PA & LF) TH reads TargetPositionLiftPercent100ths attribute from DUT Error: %@", err); - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("TargetPositionLiftPercent100ths", actualValue)); + VerifyOrReturn(CheckValue("TargetPositionLiftPercent100ths", actualValue, 0U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test2eThLeaveTheDeviceMovingFor2Seconds_12() { - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + SetIdentity("alpha"); + WaitForMs(2000); return CHIP_NO_ERROR; } - CHIP_ERROR TestSendKeyCommand_1() + CHIP_ERROR Test3a1VerifyDutReportsOperationalStatusAttributeToThAfterAUpOrOpen_13() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering 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); + 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(CheckValue("status", err, 0)); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0)); - } + VerifyOrReturn(CheckConstraintType("operationalStatus", "", "map8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("operationalStatus", [value unsignedCharValue], 5)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("operationalStatus", [value unsignedCharValue], 21)); + } - NextTest(); - }]; + 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) + CHIP_ERROR Test3a2DutUpdatesItsAttributes_14() { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + SetIdentity("alpha"); + WaitForMs(2000); + return CHIP_NO_ERROR; } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - - ~TV_AccountLoginCluster() {} - /////////// TestCommand Interface ///////// - void NextTest() override + CHIP_ERROR Test3bIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_15() { - CHIP_ERROR err = CHIP_NO_ERROR; + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: TV_AccountLoginCluster\n"); - } + [cluster readAttributeCurrentPositionLiftPercent100thsWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3b: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT Error: %@", err); - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: TV_AccountLoginCluster\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + VerifyOrReturn(CheckValue("status", err, 0)); - Wait(); + VerifyOrReturn(CheckConstraintType("currentPositionLiftPercent100ths", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue( + "currentPositionLiftPercent100ths", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue( + "currentPositionLiftPercent100ths", [value unsignedShortValue], 9999U)); + } - // 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 : Get Setup PIN Command\n"); - err = TestGetSetupPinCommand_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Login Command\n"); - err = TestLoginCommand_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Logout Command\n"); - err = TestLogoutCommand_3(); - 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 Test3cIfPaLfThReadsCurrentPositionLiftPercentageOptionalAttributeFromDut_16() { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } + SetIdentity("alpha"); + 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 = 4; + [cluster + readAttributeCurrentPositionLiftPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3c: If (PA & LF) TH reads CurrentPositionLiftPercentage optional attribute from DUT Error: %@", err); - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; + 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], 99)); + } + + NextTest(); + }]; - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestGetSetupPinCommand_1() + CHIP_ERROR Test3dIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_17() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestAccountLogin * cluster = [[CHIPTestAccountLogin alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 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); + [cluster readAttributeCurrentPositionTiltPercent100thsWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3d: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = values.setupPIN; - VerifyOrReturn(CheckValueAsString("setupPIN", actualValue, @"tempPin123")); - } + VerifyOrReturn(CheckConstraintType("currentPositionTiltPercent100ths", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue( + "currentPositionTiltPercent100ths", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue( + "currentPositionTiltPercent100ths", [value unsignedShortValue], 9999U)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestLoginCommand_2() + CHIP_ERROR Test3eIfPaLfThReadsCurrentPositionTiltPercentageOptionalAttributeFromDut_18() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestAccountLogin * cluster = [[CHIPTestAccountLogin alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 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); + [cluster + readAttributeCurrentPositionTiltPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3e: If (PA & LF) TH reads CurrentPositionTiltPercentage optional attribute from DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + 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; } - CHIP_ERROR TestLogoutCommand_3() + CHIP_ERROR Test4aThSendsAStopMotionCommandToDut_19() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestAccountLogin * cluster = [[CHIPTestAccountLogin alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster logoutWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Logout Command Error: %@", err); + [cluster stopMotionWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"4a: TH sends a StopMotion command to DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -51386,96 +56979,94 @@ class TV_AccountLoginCluster : public TestCommandBridge { 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) + CHIP_ERROR Test4bThWaitsFor3SecondsTheEndOfInertialMovementsOnTheDevice_20() { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + SetIdentity("alpha"); + WaitForMs(3000); + return CHIP_NO_ERROR; } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - - ~TV_WakeOnLanCluster() {} - /////////// TestCommand Interface ///////// - void NextTest() override + CHIP_ERROR Test4cVerifyDutUpdateOperationalStatusAttributeToThAfterAStopMotion_21() { - CHIP_ERROR err = CHIP_NO_ERROR; + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: TV_WakeOnLanCluster\n"); - } + [cluster readAttributeOperationalStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"4c: Verify DUT update OperationalStatus attribute to TH after a StopMotion Error: %@", err); - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: TV_WakeOnLanCluster\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + VerifyOrReturn(CheckValue("status", err, 0)); - Wait(); + { + id actualValue = value; + VerifyOrReturn(CheckValue("OperationalStatus", actualValue, 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 : Read mac address\n"); - err = TestReadMacAddress_1(); - 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 Test5aThWaitsForXSecondsAttributesUpdateOnTheDevice_22() { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + SetIdentity("alpha"); + WaitForMs(1000); + return CHIP_NO_ERROR; } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 2; + CHIP_ERROR Test5bIfPaLfThReadsTargetPositionLiftPercent100thsAttributeFromDut_23() + { + SetIdentity("alpha"); + 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 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(); + }]; - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestReadMacAddress_1() + CHIP_ERROR Test5cIfPaTlThReadsTargetPositionTiltPercent100thsAttributeFromDut_24() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestWakeOnLan * cluster = [[CHIPTestWakeOnLan alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering 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); + [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)); - { - id actualValue = value; - VerifyOrReturn(CheckValueAsString("MACAddress", actualValue, @"00:00:00:00:00")); + VerifyOrReturn(CheckConstraintType("targetPositionTiltPercent100ths", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue( + "targetPositionTiltPercent100ths", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue( + "targetPositionTiltPercent100ths", [value unsignedShortValue], 9999U)); } NextTest(); @@ -51485,11 +57076,11 @@ class TV_WakeOnLanCluster : public TestCommandBridge { } }; -class TV_ApplicationBasicCluster : public TestCommandBridge { +class Test_TC_WNCV_3_2 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - TV_ApplicationBasicCluster() - : TestCommandBridge("TV_ApplicationBasicCluster") + Test_TC_WNCV_3_2() + : TestCommandBridge("Test_TC_WNCV_3_2") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -51499,7 +57090,7 @@ class TV_ApplicationBasicCluster : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~TV_ApplicationBasicCluster() {} + ~Test_TC_WNCV_3_2() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -51507,11 +57098,11 @@ class TV_ApplicationBasicCluster : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: TV_ApplicationBasicCluster\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_3_2\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: TV_ApplicationBasicCluster\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_3_2\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -51524,400 +57115,254 @@ class TV_ApplicationBasicCluster : 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 : Read attribute vendor name\n"); - err = TestReadAttributeVendorName_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 : Read attribute vendor id\n"); - err = TestReadAttributeVendorId_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 : Read attribute application name\n"); - err = TestReadAttributeApplicationName_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 : Read attribute product id\n"); - err = TestReadAttributeProductId_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 : Read attribute application status\n"); - err = TestReadAttributeApplicationStatus_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 = Test1eIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Read attribute application status\n"); - err = TestReadAttributeApplicationStatus_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 = Test1fIfPaTlThReadsCurrentPositionTiltPercentageOptionalAttributeFromDut_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Read attribute application version\n"); - err = TestReadAttributeApplicationVersion_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 : Read attribute application allowed vendor list\n"); - err = TestReadAttributeApplicationAllowedVendorList_8(); + ChipLogProgress(chipTool, " ***** Test Step 8 : 2: Subscribe to DUT reports on OperationalStatus attribute\n"); + err = Test2SubscribeToDutReportsOnOperationalStatusAttribute_8(); 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 = 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)); + 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; } - - 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")); + 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; } - - 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)); + 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; } - - 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)); + 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; } - - 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")); + 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; } - - 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")); + 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; } - - 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)); + 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; } - - 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"); + err = Test5cIfPaTlThReadsTargetPositionTiltPercent100thsAttributeFromDut_24(); + break; } - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: TV_MediaPlaybackCluster\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); } + } - 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++) { + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read attribute playback state\n"); - err = TestReadAttributePlaybackState_1(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read attribute start time\n"); - err = TestReadAttributeStartTime_2(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read attribute duration\n"); - err = TestReadAttributeDuration_3(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read attribute position\n"); - err = TestReadAttributePosition_4(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read attribute playback speed\n"); - err = TestReadAttributePlaybackSpeed_5(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Read attribute seek range end\n"); - err = TestReadAttributeSeekRangeEnd_6(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Read attribute seek range start\n"); - err = TestReadAttributeSeekRangeStart_7(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Media Playback Play Command\n"); - err = TestMediaPlaybackPlayCommand_8(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Media Playback Pause Command\n"); - err = TestMediaPlaybackPauseCommand_9(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Media Playback Stop Command\n"); - err = TestMediaPlaybackStopCommand_10(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Media Playback Start Over Command\n"); - err = TestMediaPlaybackStartOverCommand_11(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Media Playback Previous Command\n"); - err = TestMediaPlaybackPreviousCommand_12(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Media Playback Next Command\n"); - err = TestMediaPlaybackNextCommand_13(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Media Playback Rewind Command\n"); - err = TestMediaPlaybackRewindCommand_14(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Media Playback Fast Forward Command\n"); - err = TestMediaPlaybackFastForwardCommand_15(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : Media Playback Skip Forward Command\n"); - err = TestMediaPlaybackSkipForwardCommand_16(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : Read attribute position after skip forward\n"); - err = TestReadAttributePositionAfterSkipForward_17(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : Media Playback Skip Backward Command\n"); - err = TestMediaPlaybackSkipBackwardCommand_18(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 19: - ChipLogProgress(chipTool, " ***** Test Step 19 : Read attribute position after skip backward\n"); - err = TestReadAttributePositionAfterSkipBackward_19(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 20: - ChipLogProgress(chipTool, " ***** Test Step 20 : Media Playback Seek Command\n"); - err = TestMediaPlaybackSeekCommand_20(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 21: - ChipLogProgress(chipTool, " ***** Test Step 21 : Read attribute position after seek\n"); - err = TestReadAttributePositionAfterSeek_21(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; } - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + // Go on to the next test. + WaitForMs(0); } chip::System::Clock::Timeout GetWaitDuration() const override @@ -51927,56 +57372,66 @@ class TV_MediaPlaybackCluster : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 22; + const uint16_t mTestCount = 25; chip::Optional mNodeId; chip::Optional mCluster; chip::Optional mEndpoint; chip::Optional mTimeout; - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + CHIP_ERROR Test0WaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributePlaybackState_1() + CHIP_ERROR Test1aThSendsUpOrOpenCommandToPrepositionTheDutInTheOppositeDirection_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute playback state Error: %@", err); + [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)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("CurrentState", actualValue, 0)); - } - NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeStartTime_2() + CHIP_ERROR Test1bThWaitsFor10SecondsMovementsOnTheDevice_2() + { + SetIdentity("alpha"); + WaitForMs(10000); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test1cIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeStartTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute start time Error: %@", err); + [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)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("StartTime", actualValue)); - VerifyOrReturn(CheckValue("StartTime", actualValue, 0ULL)); + VerifyOrReturn(CheckConstraintType("currentPositionLiftPercent100ths", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue( + "currentPositionLiftPercent100ths", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue( + "currentPositionLiftPercent100ths", [value unsignedShortValue], 9999U)); } NextTest(); @@ -51985,47 +57440,56 @@ class TV_MediaPlaybackCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeDuration_3() + CHIP_ERROR Test1dIfPaLfThReadsCurrentPositionLiftPercentageOptionalAttributeFromDut_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeDurationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute duration Error: %@", err); + [cluster + readAttributeCurrentPositionLiftPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"1d: If (PA & LF) TH reads CurrentPositionLiftPercentage optional attribute from DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("Duration", actualValue)); - VerifyOrReturn(CheckValue("Duration", actualValue, 80000ULL)); - } + VerifyOrReturn(CheckConstraintType("currentPositionLiftPercentage", "", "uint8")); + if (value != nil) { + VerifyOrReturn( + CheckConstraintMinValue("currentPositionLiftPercentage", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn( + CheckConstraintMaxValue("currentPositionLiftPercentage", [value unsignedCharValue], 99)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributePosition_4() + CHIP_ERROR Test1eIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeSampledPositionWithCompletionHandler:^( - CHIPMediaPlaybackClusterPlaybackPosition * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute position 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, 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)); + VerifyOrReturn(CheckConstraintType("currentPositionTiltPercent100ths", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue( + "currentPositionTiltPercent100ths", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue( + "currentPositionTiltPercent100ths", [value unsignedShortValue], 9999U)); } NextTest(); @@ -52034,150 +57498,131 @@ class TV_MediaPlaybackCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributePlaybackSpeed_5() + CHIP_ERROR Test1fIfPaTlThReadsCurrentPositionTiltPercentageOptionalAttributeFromDut_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributePlaybackSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute playback speed 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, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("PlaybackSpeed", actualValue, 0.0f)); - } + VerifyOrReturn(CheckConstraintType("currentPositionTiltPercentage", "", "uint8")); + if (value != nil) { + VerifyOrReturn( + CheckConstraintMinValue("currentPositionTiltPercentage", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn( + CheckConstraintMaxValue("currentPositionTiltPercentage", [value unsignedCharValue], 99)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } + bool testSendClusterTest_TC_WNCV_3_2_7_WaitForReport_Fulfilled = false; + ResponseHandler _Nullable test_Test_TC_WNCV_3_2_OperationalStatus_Reported = nil; - CHIP_ERROR TestReadAttributeSeekRangeEnd_6() + CHIP_ERROR TestReport2SubscribeToDutReportsOnOperationalStatusAttribute_7() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 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); + 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, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("SeekRangeEnd", actualValue)); - VerifyOrReturn(CheckValue("SeekRangeEnd", actualValue, 80000ULL)); - } - - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("operationalStatus", "", "map8")); + testSendClusterTest_TC_WNCV_3_2_7_WaitForReport_Fulfilled = true; + }; + NextTest(); return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeSeekRangeStart_7() + CHIP_ERROR Test2SubscribeToDutReportsOnOperationalStatusAttribute_8() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 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)); + 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_7_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); - NextTest(); - }]; + 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; } - CHIP_ERROR TestMediaPlaybackPlayCommand_8() + CHIP_ERROR Test2aThSendsDownOrCloseCommandToDut_9() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster playWithCompletionHandler:^( - CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Media Playback Play Command Error: %@", err); + [cluster downOrCloseWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"2a: TH sends DownOrClose command to DUT 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() + CHIP_ERROR Test2bDutUpdatesItsAttributes_10() { - 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(); - }]; - + SetIdentity("alpha"); + WaitForMs(100); return CHIP_NO_ERROR; } - CHIP_ERROR TestMediaPlaybackStopCommand_10() + CHIP_ERROR Test2cIfPaLfThReadsTargetPositionLiftPercent100thsAttributeFromDut_11() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster stopPlaybackWithCompletionHandler:^( - CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Media Playback Stop Command 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 = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0)); - } - - { - id actualValue = values.data; - VerifyOrReturn(CheckValueAsString("data", actualValue, @"data response")); + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("TargetPositionLiftPercent100ths", actualValue)); + VerifyOrReturn(CheckValue("TargetPositionLiftPercent100ths", actualValue, 10000U)); } NextTest(); @@ -52186,82 +57631,67 @@ class TV_MediaPlaybackCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestMediaPlaybackStartOverCommand_11() + CHIP_ERROR Test2eThLeaveTheDeviceMovingFor2Seconds_12() { - 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(); - }]; - + SetIdentity("alpha"); + WaitForMs(2000); return CHIP_NO_ERROR; } - CHIP_ERROR TestMediaPlaybackPreviousCommand_12() + CHIP_ERROR Test3aVerifyDutReportsOperationalStatusAttributeToThAfterADownOrClose_13() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster previousWithCompletionHandler:^( - CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Media Playback Previous Command Error: %@", err); + 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)); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0)); + VerifyOrReturn(CheckConstraintType("operationalStatus", "", "map8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("operationalStatus", [value unsignedCharValue], 10)); } - - { - id actualValue = values.data; - VerifyOrReturn(CheckValueAsString("data", actualValue, @"data response")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("operationalStatus", [value unsignedCharValue], 42)); } NextTest(); - }]; + }; return CHIP_NO_ERROR; } - CHIP_ERROR TestMediaPlaybackNextCommand_13() + CHIP_ERROR Test3a2DutUpdatesItsAttributes_14() + { + SetIdentity("alpha"); + WaitForMs(2000); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test3bIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_15() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster nextWithCompletionHandler:^( - CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Media Playback Next Command Error: %@", err); + [cluster readAttributeCurrentPositionLiftPercent100thsWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3b: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0)); + VerifyOrReturn(CheckConstraintType("currentPositionLiftPercent100ths", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue( + "currentPositionLiftPercent100ths", [value unsignedShortValue], 1U)); } - - { - id actualValue = values.data; - VerifyOrReturn(CheckValueAsString("data", actualValue, @"data response")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue( + "currentPositionLiftPercent100ths", [value unsignedShortValue], 10000U)); } NextTest(); @@ -52270,54 +57700,56 @@ class TV_MediaPlaybackCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestMediaPlaybackRewindCommand_14() + CHIP_ERROR Test3cIfPaLfThReadsCurrentPositionLiftPercentageOptionalAttributeFromDut_16() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 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)); + [cluster + readAttributeCurrentPositionLiftPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3c: If (PA & LF) TH reads CurrentPositionLiftPercentage optional attribute from DUT Error: %@", err); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = values.data; - VerifyOrReturn(CheckValueAsString("data", actualValue, @"data response")); - } + VerifyOrReturn(CheckConstraintType("currentPositionLiftPercentage", "", "uint8")); + if (value != nil) { + VerifyOrReturn( + CheckConstraintMinValue("currentPositionLiftPercentage", [value unsignedCharValue], 1)); + } + if (value != nil) { + VerifyOrReturn( + CheckConstraintMaxValue("currentPositionLiftPercentage", [value unsignedCharValue], 100)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestMediaPlaybackFastForwardCommand_15() + CHIP_ERROR Test3dIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_17() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 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); + [cluster readAttributeCurrentPositionTiltPercent100thsWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3d: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0)); + VerifyOrReturn(CheckConstraintType("currentPositionTiltPercent100ths", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue( + "currentPositionTiltPercent100ths", [value unsignedShortValue], 1U)); } - - { - id actualValue = values.data; - VerifyOrReturn(CheckValueAsString("data", actualValue, @"data response")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue( + "currentPositionTiltPercent100ths", [value unsignedShortValue], 10000U)); } NextTest(); @@ -52326,112 +57758,75 @@ class TV_MediaPlaybackCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestMediaPlaybackSkipForwardCommand_16() + CHIP_ERROR Test3eIfPaLfThReadsCurrentPositionTiltPercentageOptionalAttributeFromDut_18() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 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)); + readAttributeCurrentPositionTiltPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3e: If (PA & LF) TH reads CurrentPositionTiltPercentage optional attribute from DUT Error: %@", err); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = values.data; - VerifyOrReturn(CheckValueAsString("data", actualValue, @"data response")); - } + VerifyOrReturn(CheckConstraintType("currentPositionTiltPercentage", "", "uint8")); + if (value != nil) { + VerifyOrReturn( + CheckConstraintMinValue("currentPositionTiltPercentage", [value unsignedCharValue], 1)); + } + if (value != nil) { + VerifyOrReturn( + CheckConstraintMaxValue("currentPositionTiltPercentage", [value unsignedCharValue], 100)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributePositionAfterSkipForward_17() + CHIP_ERROR Test4aThSendsAStopMotionCommandToDut_19() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 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); + [cluster stopMotionWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"4a: TH sends a StopMotion command to DUT 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() + CHIP_ERROR Test4bThWaitsFor3SecondsTheEndOfInertialMovementsOnTheDevice_20() { - 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(); - }]; - + SetIdentity("alpha"); + WaitForMs(3000); return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributePositionAfterSkipBackward_19() + CHIP_ERROR Test4cVerifyDutUpdateOperationalStatusAttributeToThAfterAStopMotion_21() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 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); + [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(CheckValueNonNull("SampledPosition", actualValue)); - VerifyOrReturn(CheckValue("updatedAt", ((CHIPMediaPlaybackClusterPlaybackPosition *) actualValue).updatedAt, 0ULL)); - VerifyOrReturn(CheckValueNonNull("position", ((CHIPMediaPlaybackClusterPlaybackPosition *) actualValue).position)); - VerifyOrReturn(CheckValue("position", ((CHIPMediaPlaybackClusterPlaybackPosition *) actualValue).position, 400ULL)); + VerifyOrReturn(CheckValue("OperationalStatus", actualValue, 0)); } NextTest(); @@ -52440,55 +57835,63 @@ class TV_MediaPlaybackCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestMediaPlaybackSeekCommand_20() + CHIP_ERROR Test5aThWaitsForXSecondsAttributesUpdateOnTheDevice_22() + { + SetIdentity("alpha"); + WaitForMs(1000); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test5bIfPaLfThReadsTargetPositionLiftPercent100thsAttributeFromDut_23() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 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)); + [cluster readAttributeTargetPositionLiftPercent100thsWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"5b: If (PA & LF) TH reads TargetPositionLiftPercent100ths attribute from DUT Error: %@", err); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = values.data; - VerifyOrReturn(CheckValueAsString("data", actualValue, @"data response")); - } + VerifyOrReturn(CheckConstraintType("targetPositionLiftPercent100ths", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue( + "targetPositionLiftPercent100ths", [value unsignedShortValue], 1U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue( + "targetPositionLiftPercent100ths", [value unsignedShortValue], 10000U)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributePositionAfterSeek_21() + CHIP_ERROR Test5cIfPaTlThReadsTargetPositionTiltPercent100thsAttributeFromDut_24() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 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); + [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)); - { - 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)); + VerifyOrReturn(CheckConstraintType("targetPositionTiltPercent100ths", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue( + "targetPositionTiltPercent100ths", [value unsignedShortValue], 1U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue( + "targetPositionTiltPercent100ths", [value unsignedShortValue], 10000U)); } NextTest(); @@ -52498,11 +57901,11 @@ class TV_MediaPlaybackCluster : public TestCommandBridge { } }; -class TV_ChannelCluster : public TestCommandBridge { +class Test_TC_WNCV_3_3 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - TV_ChannelCluster() - : TestCommandBridge("TV_ChannelCluster") + Test_TC_WNCV_3_3() + : TestCommandBridge("Test_TC_WNCV_3_3") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -52512,7 +57915,7 @@ class TV_ChannelCluster : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~TV_ChannelCluster() {} + ~Test_TC_WNCV_3_3() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -52520,11 +57923,11 @@ class TV_ChannelCluster : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: TV_ChannelCluster\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_3_3\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: TV_ChannelCluster\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_3_3\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -52537,32 +57940,94 @@ class TV_ChannelCluster : 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 : Read attribute Channel list\n"); - err = TestReadAttributeChannelList_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 : Read attribute channel lineup\n"); - err = TestReadAttributeChannelLineup_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 : Read attribute current channel\n"); - err = TestReadAttributeCurrentChannel_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 : Change Channel Command\n"); - err = TestChangeChannelCommand_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 : Change Channel By Number Command\n"); - err = TestChangeChannelByNumberCommand_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 : Skip Channel Command\n"); - err = TestSkipChannelCommand_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 : 2a: TH sends a StopMotion command to DUT\n"); + err = Test2aThSendsAStopMotionCommandToDut_7(); + break; + case 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 : 2c: Verify DUT reports OperationalStatus attribute to TH after a StopMotion\n"); + err = Test2cVerifyDutReportsOperationalStatusAttributeToThAfterAStopMotion_9(); + break; + case 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 : 2e: TH reads OperationalStatus attribute from DUT\n"); + err = Test2eThReadsOperationalStatusAttributeFromDut_11(); + break; + case 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 : 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 : 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 : 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; } @@ -52572,70 +58037,120 @@ class TV_ChannelCluster : public TestCommandBridge { } } - 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() + void OnStatusUpdate(const chip::app::StatusIB & status) override { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + + 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() + { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeChannelList_1() + CHIP_ERROR Test1aThSendsDownOrCloseCommandToPrepositionTheDutInTheOppositeDirection_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestChannel * cluster = [[CHIPTestChannel alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering 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); + [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)); - { - 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 Test1bThWaitsFor68SecondsMovementsOnTheDevice_2() + { + SetIdentity("alpha"); + WaitForMs(6000); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test1cThSendsUpOrOpenCommandToPrepositionTheDutInTheOppositeDirection_3() + { + SetIdentity("alpha"); + 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(); }]; @@ -52643,58 +58158,137 @@ class TV_ChannelCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeChannelLineup_2() + CHIP_ERROR Test1dThWaitsFor2SecondsMovementsOnTheDevice_4() + { + SetIdentity("alpha"); + WaitForMs(2000); + return CHIP_NO_ERROR; + } + bool testSendClusterTest_TC_WNCV_3_3_5_WaitForReport_Fulfilled = false; + ResponseHandler _Nullable test_Test_TC_WNCV_3_3_OperationalStatus_Reported = nil; + + CHIP_ERROR TestReport2SubscribeToDutReportsOnOperationalStatusAttribute_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestChannel * cluster = [[CHIPTestChannel alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering 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); + 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(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)); - } + VerifyOrReturn(CheckConstraintType("operationalStatus", "", "map8")); + testSendClusterTest_TC_WNCV_3_3_5_WaitForReport_Fulfilled = true; + }; + + NextTest(); + return CHIP_NO_ERROR; + } + CHIP_ERROR Test2SubscribeToDutReportsOnOperationalStatusAttribute_6() + { + SetIdentity("alpha"); + 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_5_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 TestReadAttributeCurrentChannel_3() + CHIP_ERROR Test2aThSendsAStopMotionCommandToDut_7() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestChannel * cluster = [[CHIPTestChannel alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering 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); + [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() + { + SetIdentity("alpha"); + WaitForMs(3000); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test2cVerifyDutReportsOperationalStatusAttributeToThAfterAStopMotion_9() + { + SetIdentity("alpha"); + 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(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")); + VerifyOrReturn(CheckValue("OperationalStatus", actualValue, 0)); + } + + NextTest(); + }; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test2dThWaitsFor100ms3sAttributesUpdateOnTheDevice_10() + { + SetIdentity("alpha"); + WaitForMs(2000); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test2eThReadsOperationalStatusAttributeFromDut_11() + { + SetIdentity("alpha"); + 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(); @@ -52702,95 +58296,153 @@ class TV_ChannelCluster : public TestCommandBridge { return CHIP_NO_ERROR; } + NSNumber * _Nullable attrCurrentPositionLift; - CHIP_ERROR TestChangeChannelCommand_4() + CHIP_ERROR Test3aIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_12() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestChannel * cluster = [[CHIPTestChannel alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering 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); + [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)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0)); - } + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue( + "currentPositionLiftPercent100ths", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue( + "currentPositionLiftPercent100ths", [value unsignedShortValue], 10000U)); + } + { + attrCurrentPositionLift = value; + } - { - id actualValue = values.data; - VerifyOrReturn(CheckValueAsString("data", actualValue, @"data response")); - } + NextTest(); + }]; - NextTest(); - }]; + return CHIP_NO_ERROR; + } + + CHIP_ERROR + Test3bIfPaLfThReadsTargetPositionLiftPercent100thsAttribute3cItMustBeEqualWithCurrentPositionLiftPercent100thsFromDut_13() + { + SetIdentity("alpha"); + 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 TestChangeChannelByNumberCommand_5() + CHIP_ERROR Test4aIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_14() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestChannel * cluster = [[CHIPTestChannel alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering 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); + [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)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + 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 TestSkipChannelCommand_6() + CHIP_ERROR + Test4bIfPaTlThReadsTargetPositionTiltPercent100thsAttribute4cItMustBeEqualWithCurrentPositionTiltPercent100thsFromDut_15() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestChannel * cluster = [[CHIPTestChannel alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering 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); + [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)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + 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 TV_LowPowerCluster : public TestCommandBridge { +class Test_TC_WNCV_3_4 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - TV_LowPowerCluster() - : TestCommandBridge("TV_LowPowerCluster") + 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) - ~TV_LowPowerCluster() {} + ~Test_TC_WNCV_3_4() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -52798,11 +58450,11 @@ class TV_LowPowerCluster : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: TV_LowPowerCluster\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_3_4\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: TV_LowPowerCluster\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_3_4\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -52815,12 +58467,63 @@ class TV_LowPowerCluster : 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 : Sleep Input Status Command\n"); - err = TestSleepInputStatusCommand_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 : 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 UpOrOpen command to DUT\n"); + err = Test2aThSendsUpOrOpenCommandToDut_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")) { + NextTest(); + return; + } + err = Test3dIfPaTlThReadsCurrentPositionTiltPercentageOptionalAttributeFromDut_8(); break; } @@ -52830,6 +58533,42 @@ class TV_LowPowerCluster : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -52837,27 +58576,31 @@ class TV_LowPowerCluster : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 2; + 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 TestWaitForTheCommissionedDeviceToBeRetrieved_0() + CHIP_ERROR Test0WaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestSleepInputStatusCommand_1() + CHIP_ERROR Test1aThSendsDownOrCloseCommandToPrepositionTheDutInTheOppositeDirection_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestLowPower * cluster = [[CHIPTestLowPower alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering 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); + [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)); @@ -52866,35 +58609,169 @@ class TV_LowPowerCluster : public TestCommandBridge { 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) + CHIP_ERROR Test1bThWaitsForFastMotionDurationSecondsMovementsOnTheDevice_2() { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + SetIdentity("alpha"); + WaitForMs(mFastMotionDuration.HasValue() ? mFastMotionDuration.Value() : 3000U); + return CHIP_NO_ERROR; } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - - ~TV_ContentLauncherCluster() {} - /////////// TestCommand Interface ///////// - void NextTest() override + CHIP_ERROR Test2aThSendsUpOrOpenCommandToDut_3() { - CHIP_ERROR err = CHIP_NO_ERROR; + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + WaitForMs(mFullMotionDuration.HasValue() ? mFullMotionDuration.Value() : 6000U); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test3aIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_5() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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: TV_ContentLauncherCluster\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_3_5\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: TV_ContentLauncherCluster\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_3_5\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -52907,24 +58784,63 @@ class TV_ContentLauncherCluster : 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 : Read attribute accept header list\n"); - err = TestReadAttributeAcceptHeaderList_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 : Read attribute supported streaming protocols\n"); - err = TestReadAttributeSupportedStreamingProtocols_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 : Launch Content Command\n"); - err = TestLaunchContentCommand_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 : Launch URL Command\n"); - err = TestLaunchUrlCommand_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")) { + NextTest(); + return; + } + err = Test3dIfPaTlThReadsCurrentPositionTiltPercentageOptionalAttributeFromDut_8(); break; } @@ -52934,6 +58850,42 @@ class TV_ContentLauncherCluster : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -52941,35 +58893,89 @@ class TV_ContentLauncherCluster : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 5; + 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 TestWaitForTheCommissionedDeviceToBeRetrieved_0() + CHIP_ERROR Test0WaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeAcceptHeaderList_1() + CHIP_ERROR Test1aThSendsUpOrOpenCommandToPrepositionTheDutInTheOppositeDirection_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestContentLauncher * cluster = [[CHIPTestContentLauncher alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering 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); + [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() + { + SetIdentity("alpha"); + WaitForMs(mFastMotionDuration.HasValue() ? mFastMotionDuration.Value() : 3000U); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test2aThSendsDownOrCloseCommandToDut_3() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + WaitForMs(mFullMotionDuration.HasValue() ? mFullMotionDuration.Value() : 6000U); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test3aIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_5() + { + SetIdentity("alpha"); + 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(CheckValue("AcceptHeader", [actualValue count], static_cast(2))); - VerifyOrReturn(CheckValueAsString("", actualValue[0], @"example")); - VerifyOrReturn(CheckValueAsString("", actualValue[1], @"example")); + VerifyOrReturn(CheckValueNonNull("CurrentPositionLiftPercent100ths", actualValue)); + VerifyOrReturn(CheckValue("CurrentPositionLiftPercent100ths", actualValue, 10000U)); } NextTest(); @@ -52978,21 +58984,23 @@ class TV_ContentLauncherCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeSupportedStreamingProtocols_2() + CHIP_ERROR Test3bIfPaLfThReadsCurrentPositionLiftPercentageOptionalAttributeFromDut_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestContentLauncher * cluster = [[CHIPTestContentLauncher alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering 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); + 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(CheckValue("SupportedStreamingProtocols", actualValue, 0UL)); + VerifyOrReturn(CheckValueNonNull("CurrentPositionLiftPercentage", actualValue)); + VerifyOrReturn(CheckValue("CurrentPositionLiftPercentage", actualValue, 100)); } NextTest(); @@ -53001,285 +59009,453 @@ class TV_ContentLauncherCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestLaunchContentCommand_3() + CHIP_ERROR Test3cIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_7() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestContentLauncher * cluster = [[CHIPTestContentLauncher alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering 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"; + [cluster readAttributeCurrentPositionTiltPercent100thsWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3c: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT Error: %@", err); - ((CHIPContentLauncherClusterParameter *) temp_1[0]).externalIDList = temp_4; + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentPositionTiltPercent100ths", actualValue)); + VerifyOrReturn(CheckValue("CurrentPositionTiltPercent100ths", actualValue, 10000U)); } - ((CHIPContentLauncherClusterContentSearch *) params.search).parameterList = temp_1; - } + NextTest(); + }]; - params.autoPlay = [NSNumber numberWithBool:true]; - params.data = @"exampleData"; - [cluster - launchContentWithParams:params - completionHandler:^(CHIPContentLauncherClusterLaunchResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Launch Content Command Error: %@", err); + return CHIP_NO_ERROR; + } - VerifyOrReturn(CheckValue("status", err, 0)); + CHIP_ERROR Test3dIfPaTlThReadsCurrentPositionTiltPercentageOptionalAttributeFromDut_8() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0)); - } + [cluster + readAttributeCurrentPositionTiltPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3d: If (PA & TL) TH reads CurrentPositionTiltPercentage optional attribute from DUT Error: %@", err); - { - id actualValue = values.data; - VerifyOrReturn(CheckValueAsString("data", actualValue, @"exampleData")); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentPositionTiltPercentage", actualValue)); + VerifyOrReturn(CheckValue("CurrentPositionTiltPercentage", actualValue, 100)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } +}; - CHIP_ERROR TestLaunchUrlCommand_4() +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) { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestContentLauncher * cluster = [[CHIPTestContentLauncher 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("fullMotionDuration", 0, UINT16_MAX, &mFullMotionDuration); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - __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]; + ~Test_TC_WNCV_4_1() {} - ((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]; + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; - ((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]; + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_4_1\n"); + } - ((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]; + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_4_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } - ((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]; + Wait(); - [cluster launchURLWithParams:params - completionHandler:^(CHIPContentLauncherClusterLaunchResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Launch URL Command 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 : 0: Wait for the commissioned device to be retrieved\n"); + err = Test0WaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + 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 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : 1b: TH waits for x seconds movement(s) on the DUT\n"); + err = Test1bThWaitsForXSecondsMovementsOnTheDut_2(); + break; + 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 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 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : 2b: DUT updates its attributes\n"); + err = Test2bDutUpdatesItsAttributes_5(); + break; + 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 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : 3a: TH set a timeout of X minutes for failure\n"); + err = Test3aThSetATimeoutOfXMinutesForFailure_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : 3b: TH reads OperationalStatus attribute from DUT\n"); + err = Test3bThReadsOperationalStatusAttributeFromDut_8(); + break; + 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 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : 4b: DUT updates its attributes\n"); + err = Test4bDutUpdatesItsAttributes_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : 5a: TH waits for x seconds movement(s) on the DUT\n"); + err = Test5aThWaitsForXSecondsMovementsOnTheDut_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : 5b: TH reads OperationalStatus attribute from DUT\n"); + err = Test5bThReadsOperationalStatusAttributeFromDut_12(); + break; + } - VerifyOrReturn(CheckValue("status", err, 0)); + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0)); - } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } - { - id actualValue = values.data; - VerifyOrReturn(CheckValueAsString("data", actualValue, @"exampleData")); - } + // Go on to the next test. + WaitForMs(0); + } - NextTest(); - }]; + 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() + { + SetIdentity("alpha"); + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test1aThSendsDownOrCloseCommandToPrepositionTheDutInTheOppositeDirection_1() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + WaitForMs(mFullMotionDuration.HasValue() ? mFullMotionDuration.Value() : 6000U); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test1cIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_3() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + WaitForMs(100); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test2cIfPaLfThReadsTargetPositionLiftPercent100thsAttributeFromDut_6() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + WaitForMs(mFullMotionDuration.HasValue() ? mFullMotionDuration.Value() : 6000U); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test3bThReadsOperationalStatusAttributeFromDut_8() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + WaitForMs(100); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test5aThWaitsForXSecondsMovementsOnTheDut_11() + { + SetIdentity("alpha"); + WaitForMs(mFullMotionDuration.HasValue() ? mFullMotionDuration.Value() : 6000U); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test5bThReadsOperationalStatusAttributeFromDut_12() + { + SetIdentity("alpha"); + 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 TV_MediaInputCluster : public TestCommandBridge { +class Test_TC_WNCV_4_2 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - TV_MediaInputCluster() - : TestCommandBridge("TV_MediaInputCluster") + 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) - ~TV_MediaInputCluster() {} + ~Test_TC_WNCV_4_2() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -53287,11 +59463,11 @@ class TV_MediaInputCluster : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: TV_MediaInputCluster\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_4_2\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: TV_MediaInputCluster\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_4_2\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -53304,36 +59480,6855 @@ class TV_MediaInputCluster : 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 : 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 : 1b: TH waits for x seconds movement(s) on the DUT\n"); + err = Test1bThWaitsForXSecondsMovementsOnTheDut_2(); + break; + 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 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 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : 2b: DUT updates its attributes\n"); + err = Test2bDutUpdatesItsAttributes_5(); + break; + 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 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : 3a: TH set a timeout of X minutes for failure\n"); + err = Test3aThSetATimeoutOfXMinutesForFailure_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : 3b: TH reads OperationalStatus attribute from DUT\n"); + err = Test3bThReadsOperationalStatusAttributeFromDut_8(); + break; + 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 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : 4b: DUT updates its attributes\n"); + err = Test4bDutUpdatesItsAttributes_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : 5a: TH waits for x seconds movement(s) on the DUT\n"); + err = Test5aThWaitsForXSecondsMovementsOnTheDut_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : 5b: TH reads OperationalStatus attribute from DUT\n"); + err = Test5bThReadsOperationalStatusAttributeFromDut_12(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + + 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() + { + SetIdentity("alpha"); + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test1aThSendsDownOrCloseCommandToPrepositionTheDutInTheOppositeDirection_1() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + WaitForMs(mFullMotionDuration.HasValue() ? mFullMotionDuration.Value() : 6000U); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test1cIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_3() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + WaitForMs(100); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test2cIfPaTlThReadsTargetPositionTiltPercent100thsAttributeFromDut_6() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + WaitForMs(mFullMotionDuration.HasValue() ? mFullMotionDuration.Value() : 6000U); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test3bThReadsOperationalStatusAttributeFromDut_8() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + WaitForMs(100); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test5aThWaitsForXSecondsMovementsOnTheDut_11() + { + SetIdentity("alpha"); + WaitForMs(mFullMotionDuration.HasValue() ? mFullMotionDuration.Value() : 6000U); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test5bThReadsOperationalStatusAttributeFromDut_12() + { + SetIdentity("alpha"); + 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 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 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 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 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 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; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + + 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() + { + SetIdentity("alpha"); + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + NSNumber * _Nullable attrCurrentPositionLiftPercent100ths; + + CHIP_ERROR Test1aIfPaLfLfThReadsCurrentPositionLiftPercent100thsFromDut_1() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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 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; + } + 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; + } + 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; + } + err = Test4aThSendsGoToTiltPercentageCommandWith0xFFFFToDut_5(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + + 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() + { + SetIdentity("alpha"); + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + NSNumber * _Nullable attrCurrentPositionTiltPercent100ths; + + CHIP_ERROR Test1aIfPaTlTlThReadsCurrentPositionTiltPercent100thsFromDut_1() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : 0b: TH sends UpOrOpen command to preposition the DUT\n"); + err = Test0bThSendsUpOrOpenCommandToPrepositionTheDut_1(); + break; + case 2: + ChipLogProgress( + 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 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : 1b: TH Waits for 100ms-1s\n"); + err = Test1bThWaitsFor100ms1s_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : 1c: TH sends StopMotion command to DUT\n"); + err = Test1cThSendsStopMotionCommandToDut_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : 1d: TH Waits for 100ms-1s\n"); + err = Test1dThWaitsFor100ms1s_5(); + break; + case 6: + ChipLogProgress( + 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 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : 2b: TH Waits for 100ms-1s\n"); + err = Test2bThWaitsFor100ms1s_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : 2c: TH sends StopMotion command to DUT\n"); + err = Test2cThSendsStopMotionCommandToDut_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : 2d: TH Waits for 100ms-1s\n"); + err = Test2dThWaitsFor100ms1s_9(); + break; + 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 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 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : 3c: reboot/restart the DUT\n"); + err = Test3cRebootRestartTheDut_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : 3d: Wait for the commissioned device to be retrieved\n"); + err = Test3dWaitForTheCommissionedDeviceToBeRetrieved_13(); + break; + 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 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; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + + 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() + { + SetIdentity("alpha"); + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test0bThSendsUpOrOpenCommandToPrepositionTheDut_1() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + WaitForMs(500); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test1cThSendsStopMotionCommandToDut_4() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + WaitForMs(500); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test2aIfPaTlTlThSendsGoToTiltPercentageCommandWith90ToDut_6() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + WaitForMs(500); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test2cThSendsStopMotionCommandToDut_8() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + WaitForMs(500); + return CHIP_NO_ERROR; + } + NSNumber * _Nullable attrCurrentPositionLiftPercent100ths; + + CHIP_ERROR Test3aThReadsCurrentPositionLiftPercent100thsFromDut_10() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + Reboot(mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test3dWaitForTheCommissionedDeviceToBeRetrieved_13() + { + SetIdentity("alpha"); + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test3eThReadsCurrentPositionLiftPercent100thsFromDut_14() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read attribute Target Navigator list\n"); + err = TestReadAttributeTargetNavigatorList_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read attribute current navigator target\n"); + err = TestReadAttributeCurrentNavigatorTarget_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Navigate Target Request Command\n"); + err = TestNavigateTargetRequestCommand_3(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + + 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() + { + SetIdentity("alpha"); + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeTargetNavigatorList_1() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read attribute Audio Output list\n"); + err = TestReadAttributeAudioOutputList_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read attribute current audio output\n"); + err = TestReadAttributeCurrentAudioOutput_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Select Output Command\n"); + err = TestSelectOutputCommand_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Rename Output Command\n"); + err = TestRenameOutputCommand_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read attribute Audio Output list\n"); + err = TestReadAttributeAudioOutputList_5(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + + 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() + { + SetIdentity("alpha"); + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeAudioOutputList_1() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read attribute Application Launcher list\n"); + err = TestReadAttributeApplicationLauncherList_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read attribute application launcher app\n"); + err = TestReadAttributeApplicationLauncherApp_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Launch App Command\n"); + err = TestLaunchAppCommand_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Stop App Command\n"); + err = TestStopAppCommand_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Hide App Command\n"); + err = TestHideAppCommand_5(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + + 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() + { + SetIdentity("alpha"); + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeApplicationLauncherList_1() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Send Key Command\n"); + err = TestSendKeyCommand_1(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + + 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() + { + SetIdentity("alpha"); + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSendKeyCommand_1() + { + SetIdentity("alpha"); + 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 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Get Setup PIN Command\n"); + err = TestGetSetupPinCommand_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Login Command\n"); + err = TestLoginCommand_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Logout Command\n"); + err = TestLogoutCommand_3(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + + 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() + { + SetIdentity("alpha"); + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGetSetupPinCommand_1() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read mac address\n"); + err = TestReadMacAddress_1(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + + 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() + { + SetIdentity("alpha"); + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadMacAddress_1() + { + SetIdentity("alpha"); + 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 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read attribute vendor name\n"); + err = TestReadAttributeVendorName_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read attribute vendor id\n"); + err = TestReadAttributeVendorId_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Read attribute application name\n"); + err = TestReadAttributeApplicationName_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Read attribute product id\n"); + err = TestReadAttributeProductId_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read attribute application status\n"); + err = TestReadAttributeApplicationStatus_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Read attribute application status\n"); + err = TestReadAttributeApplicationStatus_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Read attribute application version\n"); + err = TestReadAttributeApplicationVersion_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Read attribute application allowed vendor list\n"); + err = TestReadAttributeApplicationAllowedVendorList_8(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + + 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() + { + SetIdentity("alpha"); + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeVendorName_1() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read attribute playback state\n"); + err = TestReadAttributePlaybackState_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read attribute start time\n"); + err = TestReadAttributeStartTime_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Read attribute duration\n"); + err = TestReadAttributeDuration_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Read attribute position\n"); + err = TestReadAttributePosition_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read attribute playback speed\n"); + err = TestReadAttributePlaybackSpeed_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Read attribute seek range end\n"); + err = TestReadAttributeSeekRangeEnd_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Read attribute seek range start\n"); + err = TestReadAttributeSeekRangeStart_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Media Playback Play Command\n"); + err = TestMediaPlaybackPlayCommand_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Media Playback Pause Command\n"); + err = TestMediaPlaybackPauseCommand_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Media Playback Stop Command\n"); + err = TestMediaPlaybackStopCommand_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Media Playback Start Over Command\n"); + err = TestMediaPlaybackStartOverCommand_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Media Playback Previous Command\n"); + err = TestMediaPlaybackPreviousCommand_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : Media Playback Next Command\n"); + err = TestMediaPlaybackNextCommand_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Media Playback Rewind Command\n"); + err = TestMediaPlaybackRewindCommand_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Media Playback Fast Forward Command\n"); + err = TestMediaPlaybackFastForwardCommand_15(); + break; + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : Media Playback Skip Forward Command\n"); + err = TestMediaPlaybackSkipForwardCommand_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : Read attribute position after skip forward\n"); + err = TestReadAttributePositionAfterSkipForward_17(); + break; + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : Media Playback Skip Backward Command\n"); + err = TestMediaPlaybackSkipBackwardCommand_18(); + break; + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : Read attribute position after skip backward\n"); + err = TestReadAttributePositionAfterSkipBackward_19(); + break; + case 20: + ChipLogProgress(chipTool, " ***** Test Step 20 : Media Playback Seek Command\n"); + err = TestMediaPlaybackSeekCommand_20(); + break; + case 21: + ChipLogProgress(chipTool, " ***** Test Step 21 : Read attribute position after seek\n"); + err = TestReadAttributePositionAfterSeek_21(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + + 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() + { + SetIdentity("alpha"); + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributePlaybackState_1() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read attribute Channel list\n"); + err = TestReadAttributeChannelList_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read attribute channel lineup\n"); + err = TestReadAttributeChannelLineup_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Read attribute current channel\n"); + err = TestReadAttributeCurrentChannel_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Change Channel Command\n"); + err = TestChangeChannelCommand_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Change Channel By Number Command\n"); + err = TestChangeChannelByNumberCommand_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Skip Channel Command\n"); + err = TestSkipChannelCommand_6(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + + 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() + { + SetIdentity("alpha"); + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeChannelList_1() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Sleep Input Status Command\n"); + err = TestSleepInputStatusCommand_1(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + + 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() + { + SetIdentity("alpha"); + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSleepInputStatusCommand_1() + { + SetIdentity("alpha"); + 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 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read attribute accept header list\n"); + err = TestReadAttributeAcceptHeaderList_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read attribute supported streaming protocols\n"); + err = TestReadAttributeSupportedStreamingProtocols_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Launch Content Command\n"); + err = TestLaunchContentCommand_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Launch URL Command\n"); + err = TestLaunchUrlCommand_4(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + + 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() + { + SetIdentity("alpha"); + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeAcceptHeaderList_1() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read attribute media input list\n"); + err = TestReadAttributeMediaInputList_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read current media input\n"); + err = TestReadCurrentMediaInput_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Select Input Command\n"); + err = TestSelectInputCommand_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Hide Input Status Command\n"); + err = TestHideInputStatusCommand_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Show Input Status Command\n"); + err = TestShowInputStatusCommand_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Rename Input Command\n"); + err = TestRenameInputCommand_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Read attribute media input list\n"); + err = TestReadAttributeMediaInputList_7(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + + 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() + { + SetIdentity("alpha"); + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeMediaInputList_1() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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() + { + SetIdentity("alpha"); + 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 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Send Test Command\n"); + err = TestSendTestCommand_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Send Test Not Handled Command\n"); + err = TestSendTestNotHandledCommand_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Send Test Specific Command\n"); + err = TestSendTestSpecificCommand_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Send Test Add Arguments Command\n"); + err = TestSendTestAddArgumentsCommand_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Send failing Test Add Arguments Command\n"); + err = TestSendFailingTestAddArgumentsCommand_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Read attribute BOOLEAN Default Value\n"); + err = TestReadAttributeBooleanDefaultValue_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Write attribute BOOLEAN True\n"); + err = TestWriteAttributeBooleanTrue_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Read attribute BOOLEAN True\n"); + err = TestReadAttributeBooleanTrue_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Write attribute BOOLEAN False\n"); + err = TestWriteAttributeBooleanFalse_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Read attribute BOOLEAN False\n"); + err = TestReadAttributeBooleanFalse_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Read attribute BITMAP8 Default Value\n"); + err = TestReadAttributeBitmap8DefaultValue_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Write attribute BITMAP8 Max Value\n"); + err = TestWriteAttributeBitmap8MaxValue_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : Read attribute BITMAP8 Max Value\n"); + err = TestReadAttributeBitmap8MaxValue_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Write attribute BITMAP8 Min Value\n"); + err = TestWriteAttributeBitmap8MinValue_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(); + break; + case 33: + ChipLogProgress(chipTool, " ***** Test Step 33 : Read attribute INT8U Max Value\n"); + err = TestReadAttributeInt8uMaxValue_33(); + break; + case 34: + ChipLogProgress(chipTool, " ***** Test Step 34 : Write attribute INT8U Min Value\n"); + err = TestWriteAttributeInt8uMinValue_34(); + break; + case 35: + ChipLogProgress(chipTool, " ***** Test Step 35 : Read attribute INT8U Min Value\n"); + err = TestReadAttributeInt8uMinValue_35(); + break; + case 36: + ChipLogProgress(chipTool, " ***** Test Step 36 : Read attribute INT16U Default Value\n"); + err = TestReadAttributeInt16uDefaultValue_36(); + break; + case 37: + ChipLogProgress(chipTool, " ***** Test Step 37 : Write attribute INT16U Max Value\n"); + err = TestWriteAttributeInt16uMaxValue_37(); + break; + case 38: + ChipLogProgress(chipTool, " ***** Test Step 38 : Read attribute INT16U Max Value\n"); + err = TestReadAttributeInt16uMaxValue_38(); + break; + case 39: + ChipLogProgress(chipTool, " ***** Test Step 39 : Write attribute INT16U Min Value\n"); + err = TestWriteAttributeInt16uMinValue_39(); + break; + case 40: + ChipLogProgress(chipTool, " ***** Test Step 40 : Read attribute INT16U Min Value\n"); + err = TestReadAttributeInt16uMinValue_40(); + break; + case 41: + ChipLogProgress(chipTool, " ***** Test Step 41 : Read attribute INT32U Default Value\n"); + err = TestReadAttributeInt32uDefaultValue_41(); + break; + case 42: + ChipLogProgress(chipTool, " ***** Test Step 42 : Write attribute INT32U Max Value\n"); + err = TestWriteAttributeInt32uMaxValue_42(); + break; + case 43: + ChipLogProgress(chipTool, " ***** Test Step 43 : Read attribute INT32U Max Value\n"); + err = TestReadAttributeInt32uMaxValue_43(); + break; + case 44: + ChipLogProgress(chipTool, " ***** Test Step 44 : Write attribute INT32U Min Value\n"); + err = TestWriteAttributeInt32uMinValue_44(); + break; + case 45: + ChipLogProgress(chipTool, " ***** Test Step 45 : Read attribute INT32U Min Value\n"); + err = TestReadAttributeInt32uMinValue_45(); + break; + case 46: + ChipLogProgress(chipTool, " ***** Test Step 46 : Read attribute INT64U Default Value\n"); + err = TestReadAttributeInt64uDefaultValue_46(); + break; + case 47: + ChipLogProgress(chipTool, " ***** Test Step 47 : Write attribute INT64U Max Value\n"); + err = TestWriteAttributeInt64uMaxValue_47(); + break; + case 48: + ChipLogProgress(chipTool, " ***** Test Step 48 : Read attribute INT64U Max Value\n"); + err = TestReadAttributeInt64uMaxValue_48(); + break; + case 49: + ChipLogProgress(chipTool, " ***** Test Step 49 : Write attribute INT64U Min Value\n"); + err = TestWriteAttributeInt64uMinValue_49(); + break; + case 50: + ChipLogProgress(chipTool, " ***** Test Step 50 : Read attribute INT64U Min Value\n"); + err = TestReadAttributeInt64uMinValue_50(); + break; + case 51: + ChipLogProgress(chipTool, " ***** Test Step 51 : Read attribute INT8S Default Value\n"); + err = TestReadAttributeInt8sDefaultValue_51(); + break; + case 52: + ChipLogProgress(chipTool, " ***** Test Step 52 : Write attribute INT8S Max Value\n"); + err = TestWriteAttributeInt8sMaxValue_52(); + break; + case 53: + ChipLogProgress(chipTool, " ***** Test Step 53 : Read attribute INT8S Max Value\n"); + err = TestReadAttributeInt8sMaxValue_53(); + 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(); + break; + case 98: + ChipLogProgress(chipTool, " ***** Test Step 98 : Write attribute ENUM8 Max Value\n"); + err = TestWriteAttributeEnum8MaxValue_98(); + break; + case 99: + ChipLogProgress(chipTool, " ***** Test Step 99 : Read attribute ENUM8 Max Value\n"); + err = TestReadAttributeEnum8MaxValue_99(); + break; + case 100: + ChipLogProgress(chipTool, " ***** Test Step 100 : Write attribute ENUM8 Min Value\n"); + err = TestWriteAttributeEnum8MinValue_100(); + break; + case 101: + ChipLogProgress(chipTool, " ***** Test Step 101 : Read attribute ENUM8 Min Value\n"); + err = TestReadAttributeEnum8MinValue_101(); + break; + case 102: + ChipLogProgress(chipTool, " ***** Test Step 102 : Read attribute ENUM16 Default Value\n"); + err = TestReadAttributeEnum16DefaultValue_102(); + break; + case 103: + ChipLogProgress(chipTool, " ***** Test Step 103 : Write attribute ENUM16 Max Value\n"); + err = TestWriteAttributeEnum16MaxValue_103(); + break; + case 104: + ChipLogProgress(chipTool, " ***** Test Step 104 : Read attribute ENUM16 Max Value\n"); + err = TestReadAttributeEnum16MaxValue_104(); + break; + case 105: + ChipLogProgress(chipTool, " ***** Test Step 105 : Write attribute ENUM16 Min Value\n"); + err = TestWriteAttributeEnum16MinValue_105(); + break; + case 106: + ChipLogProgress(chipTool, " ***** Test Step 106 : Read attribute ENUM16 Min Value\n"); + err = TestReadAttributeEnum16MinValue_106(); + break; + case 107: + ChipLogProgress(chipTool, " ***** Test Step 107 : Read attribute OCTET_STRING Default Value\n"); + err = TestReadAttributeOctetStringDefaultValue_107(); + break; + case 108: + ChipLogProgress(chipTool, " ***** Test Step 108 : Write attribute OCTET_STRING with embedded null\n"); + err = TestWriteAttributeOctetStringWithEmbeddedNull_108(); + break; + case 109: + ChipLogProgress(chipTool, " ***** Test Step 109 : Read attribute OCTET_STRING with embedded null\n"); + err = TestReadAttributeOctetStringWithEmbeddedNull_109(); + break; + case 110: + ChipLogProgress(chipTool, " ***** Test Step 110 : Write attribute OCTET_STRING with weird chars\n"); + err = TestWriteAttributeOctetStringWithWeirdChars_110(); + break; + case 111: + ChipLogProgress(chipTool, " ***** Test Step 111 : Read attribute OCTET_STRING with weird chars\n"); + err = TestReadAttributeOctetStringWithWeirdChars_111(); + break; + case 112: + ChipLogProgress(chipTool, " ***** Test Step 112 : Write attribute OCTET_STRING\n"); + err = TestWriteAttributeOctetString_112(); + break; + case 113: + ChipLogProgress(chipTool, " ***** Test Step 113 : Read attribute OCTET_STRING\n"); + err = TestReadAttributeOctetString_113(); + break; + case 114: + ChipLogProgress(chipTool, " ***** Test Step 114 : Write attribute OCTET_STRING\n"); + err = TestWriteAttributeOctetString_114(); + break; + case 115: + ChipLogProgress(chipTool, " ***** Test Step 115 : Read attribute OCTET_STRING\n"); + err = TestReadAttributeOctetString_115(); + break; + case 116: + ChipLogProgress(chipTool, " ***** Test Step 116 : Write attribute OCTET_STRING\n"); + err = TestWriteAttributeOctetString_116(); + break; + case 117: + ChipLogProgress(chipTool, " ***** Test Step 117 : Read attribute LONG_OCTET_STRING Default Value\n"); + err = TestReadAttributeLongOctetStringDefaultValue_117(); + break; + case 118: + ChipLogProgress(chipTool, " ***** Test Step 118 : Write attribute LONG_OCTET_STRING\n"); + err = TestWriteAttributeLongOctetString_118(); + break; + case 119: + ChipLogProgress(chipTool, " ***** Test Step 119 : Read attribute LONG_OCTET_STRING\n"); + err = TestReadAttributeLongOctetString_119(); + 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(); + break; + case 123: + ChipLogProgress(chipTool, " ***** Test Step 123 : Read attribute CHAR_STRING\n"); + err = TestReadAttributeCharString_123(); + break; + case 124: + ChipLogProgress(chipTool, " ***** Test Step 124 : Write attribute CHAR_STRING - Value too long\n"); + err = TestWriteAttributeCharStringValueTooLong_124(); + break; + case 125: + ChipLogProgress(chipTool, " ***** Test Step 125 : Read attribute CHAR_STRING\n"); + err = TestReadAttributeCharString_125(); + break; + case 126: + ChipLogProgress(chipTool, " ***** Test Step 126 : Write attribute CHAR_STRING - Empty\n"); + err = TestWriteAttributeCharStringEmpty_126(); + break; + case 127: + ChipLogProgress(chipTool, " ***** Test Step 127 : Read attribute LONG_CHAR_STRING Default Value\n"); + err = TestReadAttributeLongCharStringDefaultValue_127(); + break; + 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 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(); + 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(); + 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(); + 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(); + break; + case 168: + 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(); + 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 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(); + 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 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read attribute media input list\n"); - err = TestReadAttributeMediaInputList_1(); + 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 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read current media input\n"); - err = TestReadCurrentMediaInput_2(); + 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 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Select Input Command\n"); - err = TestSelectInputCommand_3(); + 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 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Hide Input Status Command\n"); - err = TestHideInputStatusCommand_4(); + 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 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Show Input Status Command\n"); - err = TestShowInputStatusCommand_5(); + 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 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Rename Input Command\n"); - err = TestRenameInputCommand_6(); + 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 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Read attribute media input list\n"); - err = TestReadAttributeMediaInputList_7(); + 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; } @@ -53343,2263 +66338,1459 @@ class TV_MediaInputCluster : public TestCommandBridge { } } - 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 + void OnStatusUpdate(const chip::app::StatusIB & status) 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++) { + switch (mTestIndex - 1) { case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Send Test Command\n"); - err = TestSendTestCommand_1(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Send Test Not Handled Command\n"); - err = TestSendTestNotHandledCommand_2(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Send Test Specific Command\n"); - err = TestSendTestSpecificCommand_3(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Send Test Add Arguments Command\n"); - err = TestSendTestAddArgumentsCommand_4(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Send failing Test Add Arguments Command\n"); - err = TestSendFailingTestAddArgumentsCommand_5(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Read attribute BOOLEAN Default Value\n"); - err = TestReadAttributeBooleanDefaultValue_6(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Write attribute BOOLEAN True\n"); - err = TestWriteAttributeBooleanTrue_7(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Read attribute BOOLEAN True\n"); - err = TestReadAttributeBooleanTrue_8(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Write attribute BOOLEAN False\n"); - err = TestWriteAttributeBooleanFalse_9(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Read attribute BOOLEAN False\n"); - err = TestReadAttributeBooleanFalse_10(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Read attribute BITMAP8 Default Value\n"); - err = TestReadAttributeBitmap8DefaultValue_11(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Write attribute BITMAP8 Max Value\n"); - err = TestWriteAttributeBitmap8MaxValue_12(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Read attribute BITMAP8 Max Value\n"); - err = TestReadAttributeBitmap8MaxValue_13(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Write attribute BITMAP8 Min Value\n"); - err = TestWriteAttributeBitmap8MinValue_14(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Read attribute BITMAP8 Min Value\n"); - err = TestReadAttributeBitmap8MinValue_15(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : Read attribute BITMAP16 Default Value\n"); - err = TestReadAttributeBitmap16DefaultValue_16(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : Write attribute BITMAP16 Max Value\n"); - err = TestWriteAttributeBitmap16MaxValue_17(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : Read attribute BITMAP16 Max Value\n"); - err = TestReadAttributeBitmap16MaxValue_18(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 19: - ChipLogProgress(chipTool, " ***** Test Step 19 : Write attribute BITMAP16 Min Value\n"); - err = TestWriteAttributeBitmap16MinValue_19(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 20: - ChipLogProgress(chipTool, " ***** Test Step 20 : Read attribute BITMAP16 Min Value\n"); - err = TestReadAttributeBitmap16MinValue_20(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 21: - ChipLogProgress(chipTool, " ***** Test Step 21 : Read attribute BITMAP32 Default Value\n"); - err = TestReadAttributeBitmap32DefaultValue_21(); + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 22: - ChipLogProgress(chipTool, " ***** Test Step 22 : Write attribute BITMAP32 Max Value\n"); - err = TestWriteAttributeBitmap32MaxValue_22(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 23: - ChipLogProgress(chipTool, " ***** Test Step 23 : Read attribute BITMAP32 Max Value\n"); - err = TestReadAttributeBitmap32MaxValue_23(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 24: - ChipLogProgress(chipTool, " ***** Test Step 24 : Write attribute BITMAP32 Min Value\n"); - err = TestWriteAttributeBitmap32MinValue_24(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 25: - ChipLogProgress(chipTool, " ***** Test Step 25 : Read attribute BITMAP32 Min Value\n"); - err = TestReadAttributeBitmap32MinValue_25(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 26: - ChipLogProgress(chipTool, " ***** Test Step 26 : Read attribute BITMAP64 Default Value\n"); - err = TestReadAttributeBitmap64DefaultValue_26(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 27: - ChipLogProgress(chipTool, " ***** Test Step 27 : Write attribute BITMAP64 Max Value\n"); - err = TestWriteAttributeBitmap64MaxValue_27(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 28: - ChipLogProgress(chipTool, " ***** Test Step 28 : Read attribute BITMAP64 Max Value\n"); - err = TestReadAttributeBitmap64MaxValue_28(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 29: - ChipLogProgress(chipTool, " ***** Test Step 29 : Write attribute BITMAP64 Min Value\n"); - err = TestWriteAttributeBitmap64MinValue_29(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 30: - ChipLogProgress(chipTool, " ***** Test Step 30 : Read attribute BITMAP64 Min Value\n"); - err = TestReadAttributeBitmap64MinValue_30(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 31: - ChipLogProgress(chipTool, " ***** Test Step 31 : Read attribute INT8U Default Value\n"); - err = TestReadAttributeInt8uDefaultValue_31(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 32: - ChipLogProgress(chipTool, " ***** Test Step 32 : Write attribute INT8U Max Value\n"); - err = TestWriteAttributeInt8uMaxValue_32(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 33: - ChipLogProgress(chipTool, " ***** Test Step 33 : Read attribute INT8U Max Value\n"); - err = TestReadAttributeInt8uMaxValue_33(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 34: - ChipLogProgress(chipTool, " ***** Test Step 34 : Write attribute INT8U Min Value\n"); - err = TestWriteAttributeInt8uMinValue_34(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 35: - ChipLogProgress(chipTool, " ***** Test Step 35 : Read attribute INT8U Min Value\n"); - err = TestReadAttributeInt8uMinValue_35(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 36: - ChipLogProgress(chipTool, " ***** Test Step 36 : Read attribute INT16U Default Value\n"); - err = TestReadAttributeInt16uDefaultValue_36(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 37: - ChipLogProgress(chipTool, " ***** Test Step 37 : Write attribute INT16U Max Value\n"); - err = TestWriteAttributeInt16uMaxValue_37(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 38: - ChipLogProgress(chipTool, " ***** Test Step 38 : Read attribute INT16U Max Value\n"); - err = TestReadAttributeInt16uMaxValue_38(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 39: - ChipLogProgress(chipTool, " ***** Test Step 39 : Write attribute INT16U Min Value\n"); - err = TestWriteAttributeInt16uMinValue_39(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 40: - ChipLogProgress(chipTool, " ***** Test Step 40 : Read attribute INT16U Min Value\n"); - err = TestReadAttributeInt16uMinValue_40(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 41: - ChipLogProgress(chipTool, " ***** Test Step 41 : Read attribute INT32U Default Value\n"); - err = TestReadAttributeInt32uDefaultValue_41(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 42: - ChipLogProgress(chipTool, " ***** Test Step 42 : Write attribute INT32U Max Value\n"); - err = TestWriteAttributeInt32uMaxValue_42(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 43: - ChipLogProgress(chipTool, " ***** Test Step 43 : Read attribute INT32U Max Value\n"); - err = TestReadAttributeInt32uMaxValue_43(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 44: - ChipLogProgress(chipTool, " ***** Test Step 44 : Write attribute INT32U Min Value\n"); - err = TestWriteAttributeInt32uMinValue_44(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 45: - ChipLogProgress(chipTool, " ***** Test Step 45 : Read attribute INT32U Min Value\n"); - err = TestReadAttributeInt32uMinValue_45(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 46: - ChipLogProgress(chipTool, " ***** Test Step 46 : Read attribute INT64U Default Value\n"); - err = TestReadAttributeInt64uDefaultValue_46(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 47: - ChipLogProgress(chipTool, " ***** Test Step 47 : Write attribute INT64U Max Value\n"); - err = TestWriteAttributeInt64uMaxValue_47(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 48: - ChipLogProgress(chipTool, " ***** Test Step 48 : Read attribute INT64U Max Value\n"); - err = TestReadAttributeInt64uMaxValue_48(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 49: - ChipLogProgress(chipTool, " ***** Test Step 49 : Write attribute INT64U Min Value\n"); - err = TestWriteAttributeInt64uMinValue_49(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 50: - ChipLogProgress(chipTool, " ***** Test Step 50 : Read attribute INT64U Min Value\n"); - err = TestReadAttributeInt64uMinValue_50(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 51: - ChipLogProgress(chipTool, " ***** Test Step 51 : Read attribute INT8S Default Value\n"); - err = TestReadAttributeInt8sDefaultValue_51(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 52: - ChipLogProgress(chipTool, " ***** Test Step 52 : Write attribute INT8S Max Value\n"); - err = TestWriteAttributeInt8sMaxValue_52(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 53: - ChipLogProgress(chipTool, " ***** Test Step 53 : Read attribute INT8S Max Value\n"); - err = TestReadAttributeInt8sMaxValue_53(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 54: - ChipLogProgress(chipTool, " ***** Test Step 54 : Write attribute INT8S Min Value\n"); - err = TestWriteAttributeInt8sMinValue_54(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 55: - ChipLogProgress(chipTool, " ***** Test Step 55 : Read attribute INT8S Min Value\n"); - err = TestReadAttributeInt8sMinValue_55(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 56: - ChipLogProgress(chipTool, " ***** Test Step 56 : Write attribute INT8S Default Value\n"); - err = TestWriteAttributeInt8sDefaultValue_56(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 57: - ChipLogProgress(chipTool, " ***** Test Step 57 : Read attribute INT8S Default Value\n"); - err = TestReadAttributeInt8sDefaultValue_57(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 58: - ChipLogProgress(chipTool, " ***** Test Step 58 : Read attribute INT16S Default Value\n"); - err = TestReadAttributeInt16sDefaultValue_58(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 59: - ChipLogProgress(chipTool, " ***** Test Step 59 : Write attribute INT16S Max Value\n"); - err = TestWriteAttributeInt16sMaxValue_59(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 60: - ChipLogProgress(chipTool, " ***** Test Step 60 : Read attribute INT16S Max Value\n"); - err = TestReadAttributeInt16sMaxValue_60(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 61: - ChipLogProgress(chipTool, " ***** Test Step 61 : Write attribute INT16S Min Value\n"); - err = TestWriteAttributeInt16sMinValue_61(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 62: - ChipLogProgress(chipTool, " ***** Test Step 62 : Read attribute INT16S Min Value\n"); - err = TestReadAttributeInt16sMinValue_62(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 63: - ChipLogProgress(chipTool, " ***** Test Step 63 : Write attribute INT16S Default Value\n"); - err = TestWriteAttributeInt16sDefaultValue_63(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 64: - ChipLogProgress(chipTool, " ***** Test Step 64 : Read attribute INT16S Default Value\n"); - err = TestReadAttributeInt16sDefaultValue_64(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 65: - ChipLogProgress(chipTool, " ***** Test Step 65 : Read attribute INT32S Default Value\n"); - err = TestReadAttributeInt32sDefaultValue_65(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 66: - ChipLogProgress(chipTool, " ***** Test Step 66 : Write attribute INT32S Max Value\n"); - err = TestWriteAttributeInt32sMaxValue_66(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 67: - ChipLogProgress(chipTool, " ***** Test Step 67 : Read attribute INT32S Max Value\n"); - err = TestReadAttributeInt32sMaxValue_67(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 68: - ChipLogProgress(chipTool, " ***** Test Step 68 : Write attribute INT32S Min Value\n"); - err = TestWriteAttributeInt32sMinValue_68(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 69: - ChipLogProgress(chipTool, " ***** Test Step 69 : Read attribute INT32S Min Value\n"); - err = TestReadAttributeInt32sMinValue_69(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 70: - ChipLogProgress(chipTool, " ***** Test Step 70 : Write attribute INT32S Default Value\n"); - err = TestWriteAttributeInt32sDefaultValue_70(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 71: - ChipLogProgress(chipTool, " ***** Test Step 71 : Read attribute INT32S Default Value\n"); - err = TestReadAttributeInt32sDefaultValue_71(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 72: - ChipLogProgress(chipTool, " ***** Test Step 72 : Read attribute INT64S Default Value\n"); - err = TestReadAttributeInt64sDefaultValue_72(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 73: - ChipLogProgress(chipTool, " ***** Test Step 73 : Write attribute INT64S Max Value\n"); - err = TestWriteAttributeInt64sMaxValue_73(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 74: - ChipLogProgress(chipTool, " ***** Test Step 74 : Read attribute INT64S Max Value\n"); - err = TestReadAttributeInt64sMaxValue_74(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 75: - ChipLogProgress(chipTool, " ***** Test Step 75 : Write attribute INT64S Min Value\n"); - err = TestWriteAttributeInt64sMinValue_75(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 76: - ChipLogProgress(chipTool, " ***** Test Step 76 : Read attribute INT64S Min Value\n"); - err = TestReadAttributeInt64sMinValue_76(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 77: - ChipLogProgress(chipTool, " ***** Test Step 77 : Write attribute INT64S Default Value\n"); - err = TestWriteAttributeInt64sDefaultValue_77(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 78: - ChipLogProgress(chipTool, " ***** Test Step 78 : Read attribute INT64S Default Value\n"); - err = TestReadAttributeInt64sDefaultValue_78(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 79: - ChipLogProgress(chipTool, " ***** Test Step 79 : Read attribute SINGLE Default Value\n"); - err = TestReadAttributeSingleDefaultValue_79(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 80: - ChipLogProgress(chipTool, " ***** Test Step 80 : Write attribute SINGLE medium Value\n"); - err = TestWriteAttributeSingleMediumValue_80(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 81: - ChipLogProgress(chipTool, " ***** Test Step 81 : Read attribute SINGLE medium Value\n"); - err = TestReadAttributeSingleMediumValue_81(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 82: - ChipLogProgress(chipTool, " ***** Test Step 82 : Write attribute SINGLE large Value\n"); - err = TestWriteAttributeSingleLargeValue_82(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 83: - ChipLogProgress(chipTool, " ***** Test Step 83 : Read attribute SINGLE large Value\n"); - err = TestReadAttributeSingleLargeValue_83(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 84: - ChipLogProgress(chipTool, " ***** Test Step 84 : Write attribute SINGLE small Value\n"); - err = TestWriteAttributeSingleSmallValue_84(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 85: - ChipLogProgress(chipTool, " ***** Test Step 85 : Read attribute SINGLE small Value\n"); - err = TestReadAttributeSingleSmallValue_85(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 86: - ChipLogProgress(chipTool, " ***** Test Step 86 : Write attribute SINGLE Default Value\n"); - err = TestWriteAttributeSingleDefaultValue_86(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 87: - ChipLogProgress(chipTool, " ***** Test Step 87 : Read attribute SINGLE Default Value\n"); - err = TestReadAttributeSingleDefaultValue_87(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 88: - ChipLogProgress(chipTool, " ***** Test Step 88 : Read attribute DOUBLE Default Value\n"); - err = TestReadAttributeDoubleDefaultValue_88(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 89: - ChipLogProgress(chipTool, " ***** Test Step 89 : Write attribute DOUBLE medium Value\n"); - err = TestWriteAttributeDoubleMediumValue_89(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 90: - ChipLogProgress(chipTool, " ***** Test Step 90 : Read attribute DOUBLE medium Value\n"); - err = TestReadAttributeDoubleMediumValue_90(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 91: - ChipLogProgress(chipTool, " ***** Test Step 91 : Write attribute DOUBLE large Value\n"); - err = TestWriteAttributeDoubleLargeValue_91(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 92: - ChipLogProgress(chipTool, " ***** Test Step 92 : Read attribute DOUBLE large Value\n"); - err = TestReadAttributeDoubleLargeValue_92(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 93: - ChipLogProgress(chipTool, " ***** Test Step 93 : Write attribute DOUBLE small Value\n"); - err = TestWriteAttributeDoubleSmallValue_93(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 94: - ChipLogProgress(chipTool, " ***** Test Step 94 : Read attribute DOUBLE small Value\n"); - err = TestReadAttributeDoubleSmallValue_94(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 95: - ChipLogProgress(chipTool, " ***** Test Step 95 : Write attribute DOUBLE Default Value\n"); - err = TestWriteAttributeDoubleDefaultValue_95(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 96: - ChipLogProgress(chipTool, " ***** Test Step 96 : Read attribute DOUBLE Default Value\n"); - err = TestReadAttributeDoubleDefaultValue_96(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 97: - ChipLogProgress(chipTool, " ***** Test Step 97 : Read attribute ENUM8 Default Value\n"); - err = TestReadAttributeEnum8DefaultValue_97(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 98: - ChipLogProgress(chipTool, " ***** Test Step 98 : Write attribute ENUM8 Max Value\n"); - err = TestWriteAttributeEnum8MaxValue_98(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 99: - ChipLogProgress(chipTool, " ***** Test Step 99 : Read attribute ENUM8 Max Value\n"); - err = TestReadAttributeEnum8MaxValue_99(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 100: - ChipLogProgress(chipTool, " ***** Test Step 100 : Write attribute ENUM8 Min Value\n"); - err = TestWriteAttributeEnum8MinValue_100(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 101: - ChipLogProgress(chipTool, " ***** Test Step 101 : Read attribute ENUM8 Min Value\n"); - err = TestReadAttributeEnum8MinValue_101(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 102: - ChipLogProgress(chipTool, " ***** Test Step 102 : Read attribute ENUM16 Default Value\n"); - err = TestReadAttributeEnum16DefaultValue_102(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 103: - ChipLogProgress(chipTool, " ***** Test Step 103 : Write attribute ENUM16 Max Value\n"); - err = TestWriteAttributeEnum16MaxValue_103(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 104: - ChipLogProgress(chipTool, " ***** Test Step 104 : Read attribute ENUM16 Max Value\n"); - err = TestReadAttributeEnum16MaxValue_104(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 105: - ChipLogProgress(chipTool, " ***** Test Step 105 : Write attribute ENUM16 Min Value\n"); - err = TestWriteAttributeEnum16MinValue_105(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 106: - ChipLogProgress(chipTool, " ***** Test Step 106 : Read attribute ENUM16 Min Value\n"); - err = TestReadAttributeEnum16MinValue_106(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 107: - ChipLogProgress(chipTool, " ***** Test Step 107 : Read attribute OCTET_STRING Default Value\n"); - err = TestReadAttributeOctetStringDefaultValue_107(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 108: - ChipLogProgress(chipTool, " ***** Test Step 108 : Write attribute OCTET_STRING with embedded null\n"); - err = TestWriteAttributeOctetStringWithEmbeddedNull_108(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 109: - ChipLogProgress(chipTool, " ***** Test Step 109 : Read attribute OCTET_STRING with embedded null\n"); - err = TestReadAttributeOctetStringWithEmbeddedNull_109(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 110: - ChipLogProgress(chipTool, " ***** Test Step 110 : Write attribute OCTET_STRING with weird chars\n"); - err = TestWriteAttributeOctetStringWithWeirdChars_110(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 111: - ChipLogProgress(chipTool, " ***** Test Step 111 : Read attribute OCTET_STRING with weird chars\n"); - err = TestReadAttributeOctetStringWithWeirdChars_111(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 112: - ChipLogProgress(chipTool, " ***** Test Step 112 : Write attribute OCTET_STRING\n"); - err = TestWriteAttributeOctetString_112(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 113: - ChipLogProgress(chipTool, " ***** Test Step 113 : Read attribute OCTET_STRING\n"); - err = TestReadAttributeOctetString_113(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 114: - ChipLogProgress(chipTool, " ***** Test Step 114 : Write attribute OCTET_STRING\n"); - err = TestWriteAttributeOctetString_114(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 115: - ChipLogProgress(chipTool, " ***** Test Step 115 : Read attribute OCTET_STRING\n"); - err = TestReadAttributeOctetString_115(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 116: - ChipLogProgress(chipTool, " ***** Test Step 116 : Write attribute OCTET_STRING\n"); - err = TestWriteAttributeOctetString_116(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 117: - ChipLogProgress(chipTool, " ***** Test Step 117 : Read attribute LONG_OCTET_STRING Default Value\n"); - err = TestReadAttributeLongOctetStringDefaultValue_117(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 118: - ChipLogProgress(chipTool, " ***** Test Step 118 : Write attribute LONG_OCTET_STRING\n"); - err = TestWriteAttributeLongOctetString_118(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 119: - ChipLogProgress(chipTool, " ***** Test Step 119 : Read attribute LONG_OCTET_STRING\n"); - err = TestReadAttributeLongOctetString_119(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 120: - ChipLogProgress(chipTool, " ***** Test Step 120 : Write attribute LONG_OCTET_STRING\n"); - err = TestWriteAttributeLongOctetString_120(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 121: - ChipLogProgress(chipTool, " ***** Test Step 121 : Read attribute CHAR_STRING Default Value\n"); - err = TestReadAttributeCharStringDefaultValue_121(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 122: - ChipLogProgress(chipTool, " ***** Test Step 122 : Write attribute CHAR_STRING\n"); - err = TestWriteAttributeCharString_122(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 123: - ChipLogProgress(chipTool, " ***** Test Step 123 : Read attribute CHAR_STRING\n"); - err = TestReadAttributeCharString_123(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 124: - ChipLogProgress(chipTool, " ***** Test Step 124 : Write attribute CHAR_STRING - Value too long\n"); - err = TestWriteAttributeCharStringValueTooLong_124(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 125: - ChipLogProgress(chipTool, " ***** Test Step 125 : Read attribute CHAR_STRING\n"); - err = TestReadAttributeCharString_125(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 126: - ChipLogProgress(chipTool, " ***** Test Step 126 : Write attribute CHAR_STRING - Empty\n"); - err = TestWriteAttributeCharStringEmpty_126(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 127: - ChipLogProgress(chipTool, " ***** Test Step 127 : Read attribute LONG_CHAR_STRING Default Value\n"); - err = TestReadAttributeLongCharStringDefaultValue_127(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 128: - ChipLogProgress(chipTool, " ***** Test Step 128 : Write attribute LONG_CHAR_STRING\n"); - err = TestWriteAttributeLongCharString_128(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 129: - ChipLogProgress(chipTool, " ***** Test Step 129 : Read attribute LONG_CHAR_STRING\n"); - err = TestReadAttributeLongCharString_129(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 130: - ChipLogProgress(chipTool, " ***** Test Step 130 : Write attribute LONG_CHAR_STRING\n"); - err = TestWriteAttributeLongCharString_130(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 131: - ChipLogProgress(chipTool, " ***** Test Step 131 : Read attribute LIST_LONG_OCTET_STRING (for chunked read)\n"); - err = TestReadAttributeListLongOctetStringForChunkedRead_131(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 132: - ChipLogProgress(chipTool, " ***** Test Step 132 : Write attribute LIST_LONG_OCTET_STRING (for chunked write)\n"); - err = TestWriteAttributeListLongOctetStringForChunkedWrite_132(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 133: - ChipLogProgress(chipTool, " ***** Test Step 133 : Read attribute LIST_LONG_OCTET_STRING (for chunked read)\n"); - err = TestReadAttributeListLongOctetStringForChunkedRead_133(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 134: - ChipLogProgress(chipTool, " ***** Test Step 134 : Read attribute EPOCH_US Default Value\n"); - err = TestReadAttributeEpochUsDefaultValue_134(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 135: - ChipLogProgress(chipTool, " ***** Test Step 135 : Write attribute EPOCH_US Max Value\n"); - err = TestWriteAttributeEpochUsMaxValue_135(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 136: - ChipLogProgress(chipTool, " ***** Test Step 136 : Read attribute EPOCH_US Max Value\n"); - err = TestReadAttributeEpochUsMaxValue_136(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 137: - ChipLogProgress(chipTool, " ***** Test Step 137 : Write attribute EPOCH_US Min Value\n"); - err = TestWriteAttributeEpochUsMinValue_137(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 138: - ChipLogProgress(chipTool, " ***** Test Step 138 : Read attribute EPOCH_US Min Value\n"); - err = TestReadAttributeEpochUsMinValue_138(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 139: - ChipLogProgress(chipTool, " ***** Test Step 139 : Read attribute EPOCH_S Default Value\n"); - err = TestReadAttributeEpochSDefaultValue_139(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 140: - ChipLogProgress(chipTool, " ***** Test Step 140 : Write attribute EPOCH_S Max Value\n"); - err = TestWriteAttributeEpochSMaxValue_140(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 141: - ChipLogProgress(chipTool, " ***** Test Step 141 : Read attribute EPOCH_S Max Value\n"); - err = TestReadAttributeEpochSMaxValue_141(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 142: - ChipLogProgress(chipTool, " ***** Test Step 142 : Write attribute EPOCH_S Min Value\n"); - err = TestWriteAttributeEpochSMinValue_142(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 143: - ChipLogProgress(chipTool, " ***** Test Step 143 : Read attribute EPOCH_S Min Value\n"); - err = TestReadAttributeEpochSMinValue_143(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 144: - ChipLogProgress(chipTool, " ***** Test Step 144 : Read attribute UNSUPPORTED\n"); - err = TestReadAttributeUnsupported_144(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 145: - ChipLogProgress(chipTool, " ***** Test Step 145 : Writeattribute UNSUPPORTED\n"); - err = TestWriteattributeUnsupported_145(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 146: - ChipLogProgress(chipTool, " ***** Test Step 146 : Send Test Command to unsupported endpoint\n"); - err = TestSendTestCommandToUnsupportedEndpoint_146(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_ENDPOINT)); break; case 147: - ChipLogProgress(chipTool, " ***** Test Step 147 : Send Test Command to unsupported cluster\n"); - err = TestSendTestCommandToUnsupportedCluster_147(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_CLUSTER)); break; case 148: - ChipLogProgress(chipTool, " ***** Test Step 148 : Read attribute vendor_id Default Value\n"); - err = TestReadAttributeVendorIdDefaultValue_148(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 149: - ChipLogProgress(chipTool, " ***** Test Step 149 : Write attribute vendor_id\n"); - err = TestWriteAttributeVendorId_149(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 150: - ChipLogProgress(chipTool, " ***** Test Step 150 : Read attribute vendor_id\n"); - err = TestReadAttributeVendorId_150(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 151: - ChipLogProgress(chipTool, " ***** Test Step 151 : Restore attribute vendor_id\n"); - err = TestRestoreAttributeVendorId_151(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 152: - ChipLogProgress(chipTool, " ***** Test Step 152 : Send a command with a vendor_id and enum\n"); - err = TestSendACommandWithAVendorIdAndEnum_152(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 153: - ChipLogProgress(chipTool, " ***** Test Step 153 : Send Test Command With Struct Argument and arg1.b is true\n"); - err = TestSendTestCommandWithStructArgumentAndArg1bIsTrue_153(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 154: - ChipLogProgress(chipTool, " ***** Test Step 154 : Send Test Command With Struct Argument and arg1.b is false\n"); - err = TestSendTestCommandWithStructArgumentAndArg1bIsFalse_154(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); 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(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 156: - ChipLogProgress(chipTool, " ***** Test Step 156 : Send Test Command With Nested Struct Argument arg1.c.b is false\n"); - err = TestSendTestCommandWithNestedStructArgumentArg1cbIsFalse_156(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); 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(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); 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(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 159: - ChipLogProgress(chipTool, " ***** Test Step 159 : Send Test Command With Struct Argument and see what we get back\n"); - err = TestSendTestCommandWithStructArgumentAndSeeWhatWeGetBack_159(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); 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(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); 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(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 162: - ChipLogProgress(chipTool, " ***** Test Step 162 : Send Test Command With List of INT8U and get it reversed\n"); - err = TestSendTestCommandWithListOfInt8uAndGetItReversed_162(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); 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(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); 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(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); 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(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); 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(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 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(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 168: - ChipLogProgress( - chipTool, " ***** Test Step 168 : Write attribute LIST With List of INT8U and none of them is set to 0\n"); - err = TestWriteAttributeListWithListOfInt8uAndNoneOfThemIsSetTo0_168(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 169: - ChipLogProgress(chipTool, " ***** Test Step 169 : Read attribute LIST With List of INT8U\n"); - err = TestReadAttributeListWithListOfInt8u_169(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 170: - ChipLogProgress(chipTool, " ***** Test Step 170 : Write attribute LIST With List of OCTET_STRING\n"); - err = TestWriteAttributeListWithListOfOctetString_170(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 171: - ChipLogProgress(chipTool, " ***** Test Step 171 : Read attribute LIST With List of OCTET_STRING\n"); - err = TestReadAttributeListWithListOfOctetString_171(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 172: - ChipLogProgress(chipTool, " ***** Test Step 172 : Write attribute LIST With List of LIST_STRUCT_OCTET_STRING\n"); - err = TestWriteAttributeListWithListOfListStructOctetString_172(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 173: - ChipLogProgress(chipTool, " ***** Test Step 173 : Read attribute LIST With List of LIST_STRUCT_OCTET_STRING\n"); - err = TestReadAttributeListWithListOfListStructOctetString_173(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 174: - ChipLogProgress(chipTool, " ***** Test Step 174 : Send Test Command with optional arg set.\n"); - err = TestSendTestCommandWithOptionalArgSet_174(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 175: - ChipLogProgress(chipTool, " ***** Test Step 175 : Send Test Command without its optional arg.\n"); - err = TestSendTestCommandWithoutItsOptionalArg_175(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 176: - ChipLogProgress(chipTool, " ***** Test Step 176 : Read list of structs containing nullables and optionals\n"); - err = TestReadListOfStructsContainingNullablesAndOptionals_176(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 177: - ChipLogProgress(chipTool, " ***** Test Step 177 : Write list of structs containing nullables and optionals\n"); - err = TestWriteListOfStructsContainingNullablesAndOptionals_177(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 178: - ChipLogProgress( - chipTool, " ***** Test Step 178 : Read list of structs containing nullables and optionals after writing\n"); - err = TestReadListOfStructsContainingNullablesAndOptionalsAfterWriting_178(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 179: - ChipLogProgress(chipTool, " ***** Test Step 179 : Write attribute NULLABLE_BOOLEAN null\n"); - err = TestWriteAttributeNullableBooleanNull_179(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 180: - ChipLogProgress(chipTool, " ***** Test Step 180 : Read attribute NULLABLE_BOOLEAN null\n"); - err = TestReadAttributeNullableBooleanNull_180(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 181: - ChipLogProgress(chipTool, " ***** Test Step 181 : Write attribute NULLABLE_BOOLEAN True\n"); - err = TestWriteAttributeNullableBooleanTrue_181(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 182: - ChipLogProgress(chipTool, " ***** Test Step 182 : Read attribute NULLABLE_BOOLEAN True\n"); - err = TestReadAttributeNullableBooleanTrue_182(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 183: - ChipLogProgress(chipTool, " ***** Test Step 183 : Write attribute NULLABLE_BITMAP8 Max Value\n"); - err = TestWriteAttributeNullableBitmap8MaxValue_183(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 184: - ChipLogProgress(chipTool, " ***** Test Step 184 : Read attribute NULLABLE_BITMAP8 Max Value\n"); - err = TestReadAttributeNullableBitmap8MaxValue_184(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 185: - ChipLogProgress(chipTool, " ***** Test Step 185 : Write attribute NULLABLE_BITMAP8 Invalid Value\n"); - err = TestWriteAttributeNullableBitmap8InvalidValue_185(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 186: - ChipLogProgress(chipTool, " ***** Test Step 186 : Read attribute NULLABLE_BITMAP8 unchanged Value\n"); - err = TestReadAttributeNullableBitmap8UnchangedValue_186(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 187: - ChipLogProgress(chipTool, " ***** Test Step 187 : Write attribute NULLABLE_BITMAP8 null Value\n"); - err = TestWriteAttributeNullableBitmap8NullValue_187(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 188: - ChipLogProgress(chipTool, " ***** Test Step 188 : Read attribute NULLABLE_BITMAP8 null Value\n"); - err = TestReadAttributeNullableBitmap8NullValue_188(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 189: - ChipLogProgress(chipTool, " ***** Test Step 189 : Write attribute NULLABLE_BITMAP16 Max Value\n"); - err = TestWriteAttributeNullableBitmap16MaxValue_189(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 190: - ChipLogProgress(chipTool, " ***** Test Step 190 : Read attribute NULLABLE_BITMAP16 Max Value\n"); - err = TestReadAttributeNullableBitmap16MaxValue_190(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 191: - ChipLogProgress(chipTool, " ***** Test Step 191 : Write attribute NULLABLE_BITMAP16 Invalid Value\n"); - err = TestWriteAttributeNullableBitmap16InvalidValue_191(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 192: - ChipLogProgress(chipTool, " ***** Test Step 192 : Read attribute NULLABLE_BITMAP16 unchanged Value\n"); - err = TestReadAttributeNullableBitmap16UnchangedValue_192(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 193: - ChipLogProgress(chipTool, " ***** Test Step 193 : Write attribute NULLABLE_BITMAP16 null Value\n"); - err = TestWriteAttributeNullableBitmap16NullValue_193(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 194: - ChipLogProgress(chipTool, " ***** Test Step 194 : Read attribute NULLABLE_BITMAP16 null Value\n"); - err = TestReadAttributeNullableBitmap16NullValue_194(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 195: - ChipLogProgress(chipTool, " ***** Test Step 195 : Write attribute NULLABLE_BITMAP32 Max Value\n"); - err = TestWriteAttributeNullableBitmap32MaxValue_195(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 196: - ChipLogProgress(chipTool, " ***** Test Step 196 : Read attribute NULLABLE_BITMAP32 Max Value\n"); - err = TestReadAttributeNullableBitmap32MaxValue_196(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 197: - ChipLogProgress(chipTool, " ***** Test Step 197 : Write attribute NULLABLE_BITMAP32 Invalid Value\n"); - err = TestWriteAttributeNullableBitmap32InvalidValue_197(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 198: - ChipLogProgress(chipTool, " ***** Test Step 198 : Read attribute NULLABLE_BITMAP32 unchanged Value\n"); - err = TestReadAttributeNullableBitmap32UnchangedValue_198(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 199: - ChipLogProgress(chipTool, " ***** Test Step 199 : Write attribute NULLABLE_BITMAP32 null Value\n"); - err = TestWriteAttributeNullableBitmap32NullValue_199(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 200: - ChipLogProgress(chipTool, " ***** Test Step 200 : Read attribute NULLABLE_BITMAP32 null Value\n"); - err = TestReadAttributeNullableBitmap32NullValue_200(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 201: - ChipLogProgress(chipTool, " ***** Test Step 201 : Write attribute NULLABLE_BITMAP64 Max Value\n"); - err = TestWriteAttributeNullableBitmap64MaxValue_201(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 202: - ChipLogProgress(chipTool, " ***** Test Step 202 : Read attribute NULLABLE_BITMAP64 Max Value\n"); - err = TestReadAttributeNullableBitmap64MaxValue_202(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 203: - ChipLogProgress(chipTool, " ***** Test Step 203 : Write attribute NULLABLE_BITMAP64 Invalid Value\n"); - err = TestWriteAttributeNullableBitmap64InvalidValue_203(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 204: - ChipLogProgress(chipTool, " ***** Test Step 204 : Read attribute NULLABLE_BITMAP64 unchanged Value\n"); - err = TestReadAttributeNullableBitmap64UnchangedValue_204(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 205: - ChipLogProgress(chipTool, " ***** Test Step 205 : Write attribute NULLABLE_BITMAP64 null Value\n"); - err = TestWriteAttributeNullableBitmap64NullValue_205(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 206: - ChipLogProgress(chipTool, " ***** Test Step 206 : Read attribute NULLABLE_BITMAP64 null Value\n"); - err = TestReadAttributeNullableBitmap64NullValue_206(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 207: - ChipLogProgress(chipTool, " ***** Test Step 207 : Write attribute NULLABLE_INT8U Min Value\n"); - err = TestWriteAttributeNullableInt8uMinValue_207(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 208: - ChipLogProgress(chipTool, " ***** Test Step 208 : Read attribute NULLABLE_INT8U Min Value\n"); - err = TestReadAttributeNullableInt8uMinValue_208(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 209: - ChipLogProgress(chipTool, " ***** Test Step 209 : Write attribute NULLABLE_INT8U Max Value\n"); - err = TestWriteAttributeNullableInt8uMaxValue_209(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 210: - ChipLogProgress(chipTool, " ***** Test Step 210 : Read attribute NULLABLE_INT8U Max Value\n"); - err = TestReadAttributeNullableInt8uMaxValue_210(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 211: - ChipLogProgress(chipTool, " ***** Test Step 211 : Write attribute NULLABLE_INT8U Invalid Value\n"); - err = TestWriteAttributeNullableInt8uInvalidValue_211(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 212: - ChipLogProgress(chipTool, " ***** Test Step 212 : Read attribute NULLABLE_INT8U unchanged Value\n"); - err = TestReadAttributeNullableInt8uUnchangedValue_212(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 213: - ChipLogProgress(chipTool, " ***** Test Step 213 : Read attribute NULLABLE_INT8U unchanged Value with constraint\n"); - err = TestReadAttributeNullableInt8uUnchangedValueWithConstraint_213(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 214: - ChipLogProgress(chipTool, " ***** Test Step 214 : Write attribute NULLABLE_INT8U null Value\n"); - err = TestWriteAttributeNullableInt8uNullValue_214(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 215: - ChipLogProgress(chipTool, " ***** Test Step 215 : Read attribute NULLABLE_INT8U null Value\n"); - err = TestReadAttributeNullableInt8uNullValue_215(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 216: - ChipLogProgress(chipTool, " ***** Test Step 216 : Read attribute NULLABLE_INT8U null Value & range\n"); - err = TestReadAttributeNullableInt8uNullValueRange_216(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 217: - ChipLogProgress(chipTool, " ***** Test Step 217 : Read attribute NULLABLE_INT8U null Value & not\n"); - err = TestReadAttributeNullableInt8uNullValueNot_217(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 218: - ChipLogProgress(chipTool, " ***** Test Step 218 : Write attribute NULLABLE_INT8U Value\n"); - err = TestWriteAttributeNullableInt8uValue_218(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 219: - ChipLogProgress(chipTool, " ***** Test Step 219 : Read attribute NULLABLE_INT8U Value in range\n"); - err = TestReadAttributeNullableInt8uValueInRange_219(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 220: - ChipLogProgress(chipTool, " ***** Test Step 220 : Read attribute NULLABLE_INT8U notValue OK\n"); - err = TestReadAttributeNullableInt8uNotValueOk_220(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 221: - ChipLogProgress(chipTool, " ***** Test Step 221 : Write attribute NULLABLE_INT16U Min Value\n"); - err = TestWriteAttributeNullableInt16uMinValue_221(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 222: - ChipLogProgress(chipTool, " ***** Test Step 222 : Read attribute NULLABLE_INT16U Min Value\n"); - err = TestReadAttributeNullableInt16uMinValue_222(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 223: - ChipLogProgress(chipTool, " ***** Test Step 223 : Write attribute NULLABLE_INT16U Max Value\n"); - err = TestWriteAttributeNullableInt16uMaxValue_223(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 224: - ChipLogProgress(chipTool, " ***** Test Step 224 : Read attribute NULLABLE_INT16U Max Value\n"); - err = TestReadAttributeNullableInt16uMaxValue_224(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 225: - ChipLogProgress(chipTool, " ***** Test Step 225 : Write attribute NULLABLE_INT16U Invalid Value\n"); - err = TestWriteAttributeNullableInt16uInvalidValue_225(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 226: - ChipLogProgress(chipTool, " ***** Test Step 226 : Read attribute NULLABLE_INT16U unchanged Value\n"); - err = TestReadAttributeNullableInt16uUnchangedValue_226(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 227: - ChipLogProgress(chipTool, " ***** Test Step 227 : Write attribute NULLABLE_INT16U null Value\n"); - err = TestWriteAttributeNullableInt16uNullValue_227(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 228: - ChipLogProgress(chipTool, " ***** Test Step 228 : Read attribute NULLABLE_INT16U null Value\n"); - err = TestReadAttributeNullableInt16uNullValue_228(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 229: - ChipLogProgress(chipTool, " ***** Test Step 229 : Read attribute NULLABLE_INT16U null Value & range\n"); - err = TestReadAttributeNullableInt16uNullValueRange_229(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 230: - ChipLogProgress(chipTool, " ***** Test Step 230 : Read attribute NULLABLE_INT16U null Value & not\n"); - err = TestReadAttributeNullableInt16uNullValueNot_230(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 231: - ChipLogProgress(chipTool, " ***** Test Step 231 : Write attribute NULLABLE_INT16U Value\n"); - err = TestWriteAttributeNullableInt16uValue_231(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 232: - ChipLogProgress(chipTool, " ***** Test Step 232 : Read attribute NULLABLE_INT16U Value in range\n"); - err = TestReadAttributeNullableInt16uValueInRange_232(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 233: - ChipLogProgress(chipTool, " ***** Test Step 233 : Read attribute NULLABLE_INT16U notValue OK\n"); - err = TestReadAttributeNullableInt16uNotValueOk_233(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 234: - ChipLogProgress(chipTool, " ***** Test Step 234 : Write attribute NULLABLE_INT32U Min Value\n"); - err = TestWriteAttributeNullableInt32uMinValue_234(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 235: - ChipLogProgress(chipTool, " ***** Test Step 235 : Read attribute NULLABLE_INT32U Min Value\n"); - err = TestReadAttributeNullableInt32uMinValue_235(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 236: - ChipLogProgress(chipTool, " ***** Test Step 236 : Write attribute NULLABLE_INT32U Max Value\n"); - err = TestWriteAttributeNullableInt32uMaxValue_236(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 237: - ChipLogProgress(chipTool, " ***** Test Step 237 : Read attribute NULLABLE_INT32U Max Value\n"); - err = TestReadAttributeNullableInt32uMaxValue_237(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 238: - ChipLogProgress(chipTool, " ***** Test Step 238 : Write attribute NULLABLE_INT32U Invalid Value\n"); - err = TestWriteAttributeNullableInt32uInvalidValue_238(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 239: - ChipLogProgress(chipTool, " ***** Test Step 239 : Read attribute NULLABLE_INT32U unchanged Value\n"); - err = TestReadAttributeNullableInt32uUnchangedValue_239(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 240: - ChipLogProgress(chipTool, " ***** Test Step 240 : Write attribute NULLABLE_INT32U null Value\n"); - err = TestWriteAttributeNullableInt32uNullValue_240(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 241: - ChipLogProgress(chipTool, " ***** Test Step 241 : Read attribute NULLABLE_INT32U null Value\n"); - err = TestReadAttributeNullableInt32uNullValue_241(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 242: - ChipLogProgress(chipTool, " ***** Test Step 242 : Read attribute NULLABLE_INT32U null Value & range\n"); - err = TestReadAttributeNullableInt32uNullValueRange_242(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 243: - ChipLogProgress(chipTool, " ***** Test Step 243 : Read attribute NULLABLE_INT32U null Value & not\n"); - err = TestReadAttributeNullableInt32uNullValueNot_243(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 244: - ChipLogProgress(chipTool, " ***** Test Step 244 : Write attribute NULLABLE_INT32U Value\n"); - err = TestWriteAttributeNullableInt32uValue_244(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 245: - ChipLogProgress(chipTool, " ***** Test Step 245 : Read attribute NULLABLE_INT32U Value in range\n"); - err = TestReadAttributeNullableInt32uValueInRange_245(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 246: - ChipLogProgress(chipTool, " ***** Test Step 246 : Read attribute NULLABLE_INT32U notValue OK\n"); - err = TestReadAttributeNullableInt32uNotValueOk_246(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 247: - ChipLogProgress(chipTool, " ***** Test Step 247 : Write attribute NULLABLE_INT64U Min Value\n"); - err = TestWriteAttributeNullableInt64uMinValue_247(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 248: - ChipLogProgress(chipTool, " ***** Test Step 248 : Read attribute NULLABLE_INT64U Min Value\n"); - err = TestReadAttributeNullableInt64uMinValue_248(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 249: - ChipLogProgress(chipTool, " ***** Test Step 249 : Write attribute NULLABLE_INT64U Max Value\n"); - err = TestWriteAttributeNullableInt64uMaxValue_249(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 250: - ChipLogProgress(chipTool, " ***** Test Step 250 : Read attribute NULLABLE_INT64U Max Value\n"); - err = TestReadAttributeNullableInt64uMaxValue_250(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 251: - ChipLogProgress(chipTool, " ***** Test Step 251 : Write attribute NULLABLE_INT64U Invalid Value\n"); - err = TestWriteAttributeNullableInt64uInvalidValue_251(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 252: - ChipLogProgress(chipTool, " ***** Test Step 252 : Read attribute NULLABLE_INT64U unchanged Value\n"); - err = TestReadAttributeNullableInt64uUnchangedValue_252(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 253: - ChipLogProgress(chipTool, " ***** Test Step 253 : Write attribute NULLABLE_INT64U null Value\n"); - err = TestWriteAttributeNullableInt64uNullValue_253(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 254: - ChipLogProgress(chipTool, " ***** Test Step 254 : Read attribute NULLABLE_INT64U null Value\n"); - err = TestReadAttributeNullableInt64uNullValue_254(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 255: - ChipLogProgress(chipTool, " ***** Test Step 255 : Read attribute NULLABLE_INT64U null Value & range\n"); - err = TestReadAttributeNullableInt64uNullValueRange_255(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 256: - ChipLogProgress(chipTool, " ***** Test Step 256 : Read attribute NULLABLE_INT64U null Value & not\n"); - err = TestReadAttributeNullableInt64uNullValueNot_256(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 257: - ChipLogProgress(chipTool, " ***** Test Step 257 : Write attribute NULLABLE_INT64U Value\n"); - err = TestWriteAttributeNullableInt64uValue_257(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 258: - ChipLogProgress(chipTool, " ***** Test Step 258 : Read attribute NULLABLE_INT64U Value in range\n"); - err = TestReadAttributeNullableInt64uValueInRange_258(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 259: - ChipLogProgress(chipTool, " ***** Test Step 259 : Read attribute NULLABLE_INT64U notValue OK\n"); - err = TestReadAttributeNullableInt64uNotValueOk_259(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 260: - ChipLogProgress(chipTool, " ***** Test Step 260 : Write attribute NULLABLE_INT8S Min Value\n"); - err = TestWriteAttributeNullableInt8sMinValue_260(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 261: - ChipLogProgress(chipTool, " ***** Test Step 261 : Read attribute NULLABLE_INT8S Min Value\n"); - err = TestReadAttributeNullableInt8sMinValue_261(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 262: - ChipLogProgress(chipTool, " ***** Test Step 262 : Write attribute NULLABLE_INT8S Invalid Value\n"); - err = TestWriteAttributeNullableInt8sInvalidValue_262(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 263: - ChipLogProgress(chipTool, " ***** Test Step 263 : Read attribute NULLABLE_INT8S unchanged Value\n"); - err = TestReadAttributeNullableInt8sUnchangedValue_263(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 264: - ChipLogProgress(chipTool, " ***** Test Step 264 : Write attribute NULLABLE_INT8S null Value\n"); - err = TestWriteAttributeNullableInt8sNullValue_264(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 265: - ChipLogProgress(chipTool, " ***** Test Step 265 : Read attribute NULLABLE_INT8S null Value\n"); - err = TestReadAttributeNullableInt8sNullValue_265(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 266: - ChipLogProgress(chipTool, " ***** Test Step 266 : Read attribute NULLABLE_INT8S null Value & range\n"); - err = TestReadAttributeNullableInt8sNullValueRange_266(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 267: - ChipLogProgress(chipTool, " ***** Test Step 267 : Read attribute NULLABLE_INT8S null Value & not\n"); - err = TestReadAttributeNullableInt8sNullValueNot_267(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 268: - ChipLogProgress(chipTool, " ***** Test Step 268 : Write attribute NULLABLE_INT8S Value\n"); - err = TestWriteAttributeNullableInt8sValue_268(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 269: - ChipLogProgress(chipTool, " ***** Test Step 269 : Read attribute NULLABLE_INT8S Value in range\n"); - err = TestReadAttributeNullableInt8sValueInRange_269(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 270: - ChipLogProgress(chipTool, " ***** Test Step 270 : Read attribute NULLABLE_INT8S notValue OK\n"); - err = TestReadAttributeNullableInt8sNotValueOk_270(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 271: - ChipLogProgress(chipTool, " ***** Test Step 271 : Write attribute NULLABLE_INT16S Min Value\n"); - err = TestWriteAttributeNullableInt16sMinValue_271(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 272: - ChipLogProgress(chipTool, " ***** Test Step 272 : Read attribute NULLABLE_INT16S Min Value\n"); - err = TestReadAttributeNullableInt16sMinValue_272(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 273: - ChipLogProgress(chipTool, " ***** Test Step 273 : Write attribute NULLABLE_INT16S Invalid Value\n"); - err = TestWriteAttributeNullableInt16sInvalidValue_273(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 274: - ChipLogProgress(chipTool, " ***** Test Step 274 : Read attribute NULLABLE_INT16S unchanged Value\n"); - err = TestReadAttributeNullableInt16sUnchangedValue_274(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 275: - ChipLogProgress(chipTool, " ***** Test Step 275 : Write attribute NULLABLE_INT16S null Value\n"); - err = TestWriteAttributeNullableInt16sNullValue_275(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 276: - ChipLogProgress(chipTool, " ***** Test Step 276 : Read attribute NULLABLE_INT16S null Value\n"); - err = TestReadAttributeNullableInt16sNullValue_276(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 277: - ChipLogProgress(chipTool, " ***** Test Step 277 : Read attribute NULLABLE_INT16S null Value & range\n"); - err = TestReadAttributeNullableInt16sNullValueRange_277(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 278: - ChipLogProgress(chipTool, " ***** Test Step 278 : Read attribute NULLABLE_INT16S null Value & not\n"); - err = TestReadAttributeNullableInt16sNullValueNot_278(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 279: - ChipLogProgress(chipTool, " ***** Test Step 279 : Write attribute NULLABLE_INT16S Value\n"); - err = TestWriteAttributeNullableInt16sValue_279(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 280: - ChipLogProgress(chipTool, " ***** Test Step 280 : Read attribute NULLABLE_INT16S Value in range\n"); - err = TestReadAttributeNullableInt16sValueInRange_280(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 281: - ChipLogProgress(chipTool, " ***** Test Step 281 : Read attribute NULLABLE_INT16S notValue OK\n"); - err = TestReadAttributeNullableInt16sNotValueOk_281(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 282: - ChipLogProgress(chipTool, " ***** Test Step 282 : Write attribute NULLABLE_INT32S Min Value\n"); - err = TestWriteAttributeNullableInt32sMinValue_282(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 283: - ChipLogProgress(chipTool, " ***** Test Step 283 : Read attribute NULLABLE_INT32S Min Value\n"); - err = TestReadAttributeNullableInt32sMinValue_283(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 284: - ChipLogProgress(chipTool, " ***** Test Step 284 : Write attribute NULLABLE_INT32S Invalid Value\n"); - err = TestWriteAttributeNullableInt32sInvalidValue_284(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 285: - ChipLogProgress(chipTool, " ***** Test Step 285 : Read attribute NULLABLE_INT32S unchanged Value\n"); - err = TestReadAttributeNullableInt32sUnchangedValue_285(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 286: - ChipLogProgress(chipTool, " ***** Test Step 286 : Write attribute NULLABLE_INT32S null Value\n"); - err = TestWriteAttributeNullableInt32sNullValue_286(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 287: - ChipLogProgress(chipTool, " ***** Test Step 287 : Read attribute NULLABLE_INT32S null Value\n"); - err = TestReadAttributeNullableInt32sNullValue_287(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 288: - ChipLogProgress(chipTool, " ***** Test Step 288 : Read attribute NULLABLE_INT32S null Value & range\n"); - err = TestReadAttributeNullableInt32sNullValueRange_288(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 289: - ChipLogProgress(chipTool, " ***** Test Step 289 : Read attribute NULLABLE_INT32S null Value & not\n"); - err = TestReadAttributeNullableInt32sNullValueNot_289(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 290: - ChipLogProgress(chipTool, " ***** Test Step 290 : Write attribute NULLABLE_INT32S Value\n"); - err = TestWriteAttributeNullableInt32sValue_290(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 291: - ChipLogProgress(chipTool, " ***** Test Step 291 : Read attribute NULLABLE_INT32S Value in range\n"); - err = TestReadAttributeNullableInt32sValueInRange_291(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 292: - ChipLogProgress(chipTool, " ***** Test Step 292 : Read attribute NULLABLE_INT32S notValue OK\n"); - err = TestReadAttributeNullableInt32sNotValueOk_292(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 293: - ChipLogProgress(chipTool, " ***** Test Step 293 : Write attribute NULLABLE_INT64S Min Value\n"); - err = TestWriteAttributeNullableInt64sMinValue_293(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 294: - ChipLogProgress(chipTool, " ***** Test Step 294 : Read attribute NULLABLE_INT64S Min Value\n"); - err = TestReadAttributeNullableInt64sMinValue_294(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 295: - ChipLogProgress(chipTool, " ***** Test Step 295 : Write attribute NULLABLE_INT64S Invalid Value\n"); - err = TestWriteAttributeNullableInt64sInvalidValue_295(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 296: - ChipLogProgress(chipTool, " ***** Test Step 296 : Read attribute NULLABLE_INT64S unchanged Value\n"); - err = TestReadAttributeNullableInt64sUnchangedValue_296(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 297: - ChipLogProgress(chipTool, " ***** Test Step 297 : Write attribute NULLABLE_INT64S null Value\n"); - err = TestWriteAttributeNullableInt64sNullValue_297(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 298: - ChipLogProgress(chipTool, " ***** Test Step 298 : Read attribute NULLABLE_INT64S null Value\n"); - err = TestReadAttributeNullableInt64sNullValue_298(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 299: - ChipLogProgress(chipTool, " ***** Test Step 299 : Read attribute NULLABLE_INT64S null Value & range\n"); - err = TestReadAttributeNullableInt64sNullValueRange_299(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 300: - ChipLogProgress(chipTool, " ***** Test Step 300 : Read attribute NULLABLE_INT64S null Value & not\n"); - err = TestReadAttributeNullableInt64sNullValueNot_300(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 301: - ChipLogProgress(chipTool, " ***** Test Step 301 : Write attribute NULLABLE_INT64S Value\n"); - err = TestWriteAttributeNullableInt64sValue_301(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 302: - ChipLogProgress(chipTool, " ***** Test Step 302 : Read attribute NULLABLE_INT64S Value in range\n"); - err = TestReadAttributeNullableInt64sValueInRange_302(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 303: - ChipLogProgress(chipTool, " ***** Test Step 303 : Read attribute NULLABLE_INT64S notValue OK\n"); - err = TestReadAttributeNullableInt64sNotValueOk_303(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 304: - ChipLogProgress(chipTool, " ***** Test Step 304 : Write attribute NULLABLE_SINGLE medium Value\n"); - err = TestWriteAttributeNullableSingleMediumValue_304(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 305: - ChipLogProgress(chipTool, " ***** Test Step 305 : Read attribute NULLABLE_SINGLE medium Value\n"); - err = TestReadAttributeNullableSingleMediumValue_305(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 306: - ChipLogProgress(chipTool, " ***** Test Step 306 : Write attribute NULLABLE_SINGLE largest Value\n"); - err = TestWriteAttributeNullableSingleLargestValue_306(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 307: - ChipLogProgress(chipTool, " ***** Test Step 307 : Read attribute NULLABLE_SINGLE largest Value\n"); - err = TestReadAttributeNullableSingleLargestValue_307(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 308: - ChipLogProgress(chipTool, " ***** Test Step 308 : Write attribute NULLABLE_SINGLE smallest Value\n"); - err = TestWriteAttributeNullableSingleSmallestValue_308(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 309: - ChipLogProgress(chipTool, " ***** Test Step 309 : Read attribute NULLABLE_SINGLE smallest Value\n"); - err = TestReadAttributeNullableSingleSmallestValue_309(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 310: - ChipLogProgress(chipTool, " ***** Test Step 310 : Write attribute NULLABLE_SINGLE null Value\n"); - err = TestWriteAttributeNullableSingleNullValue_310(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 311: - ChipLogProgress(chipTool, " ***** Test Step 311 : Read attribute NULLABLE_SINGLE null Value\n"); - err = TestReadAttributeNullableSingleNullValue_311(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 312: - ChipLogProgress(chipTool, " ***** Test Step 312 : Write attribute NULLABLE_SINGLE 0 Value\n"); - err = TestWriteAttributeNullableSingle0Value_312(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 313: - ChipLogProgress(chipTool, " ***** Test Step 313 : Read attribute NULLABLE_SINGLE 0 Value\n"); - err = TestReadAttributeNullableSingle0Value_313(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 314: - ChipLogProgress(chipTool, " ***** Test Step 314 : Write attribute NULLABLE_DOUBLE medium Value\n"); - err = TestWriteAttributeNullableDoubleMediumValue_314(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 315: - ChipLogProgress(chipTool, " ***** Test Step 315 : Read attribute NULLABLE_DOUBLE medium Value\n"); - err = TestReadAttributeNullableDoubleMediumValue_315(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 316: - ChipLogProgress(chipTool, " ***** Test Step 316 : Write attribute NULLABLE_DOUBLE largest Value\n"); - err = TestWriteAttributeNullableDoubleLargestValue_316(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 317: - ChipLogProgress(chipTool, " ***** Test Step 317 : Read attribute NULLABLE_DOUBLE largest Value\n"); - err = TestReadAttributeNullableDoubleLargestValue_317(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 318: - ChipLogProgress(chipTool, " ***** Test Step 318 : Write attribute NULLABLE_DOUBLE smallest Value\n"); - err = TestWriteAttributeNullableDoubleSmallestValue_318(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 319: - ChipLogProgress(chipTool, " ***** Test Step 319 : Read attribute NULLABLE_DOUBLE smallest Value\n"); - err = TestReadAttributeNullableDoubleSmallestValue_319(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 320: - ChipLogProgress(chipTool, " ***** Test Step 320 : Write attribute NULLABLE_DOUBLE null Value\n"); - err = TestWriteAttributeNullableDoubleNullValue_320(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 321: - ChipLogProgress(chipTool, " ***** Test Step 321 : Read attribute NULLABLE_DOUBLE null Value\n"); - err = TestReadAttributeNullableDoubleNullValue_321(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 322: - ChipLogProgress(chipTool, " ***** Test Step 322 : Write attribute NULLABLE_DOUBLE 0 Value\n"); - err = TestWriteAttributeNullableDouble0Value_322(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 323: - ChipLogProgress(chipTool, " ***** Test Step 323 : Read attribute NULLABLE_DOUBLE 0 Value\n"); - err = TestReadAttributeNullableDouble0Value_323(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 324: - ChipLogProgress(chipTool, " ***** Test Step 324 : Write attribute NULLABLE_ENUM8 Min Value\n"); - err = TestWriteAttributeNullableEnum8MinValue_324(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 325: - ChipLogProgress(chipTool, " ***** Test Step 325 : Read attribute NULLABLE_ENUM8 Min Value\n"); - err = TestReadAttributeNullableEnum8MinValue_325(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 326: - ChipLogProgress(chipTool, " ***** Test Step 326 : Write attribute NULLABLE_ENUM8 Max Value\n"); - err = TestWriteAttributeNullableEnum8MaxValue_326(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 327: - ChipLogProgress(chipTool, " ***** Test Step 327 : Read attribute NULLABLE_ENUM8 Max Value\n"); - err = TestReadAttributeNullableEnum8MaxValue_327(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 328: - ChipLogProgress(chipTool, " ***** Test Step 328 : Write attribute NULLABLE_ENUM8 Invalid Value\n"); - err = TestWriteAttributeNullableEnum8InvalidValue_328(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 329: - ChipLogProgress(chipTool, " ***** Test Step 329 : Read attribute NULLABLE_ENUM8 unchanged Value\n"); - err = TestReadAttributeNullableEnum8UnchangedValue_329(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 330: - ChipLogProgress(chipTool, " ***** Test Step 330 : Write attribute NULLABLE_ENUM8 null Value\n"); - err = TestWriteAttributeNullableEnum8NullValue_330(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 331: - ChipLogProgress(chipTool, " ***** Test Step 331 : Read attribute NULLABLE_ENUM8 null Value\n"); - err = TestReadAttributeNullableEnum8NullValue_331(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 332: - ChipLogProgress(chipTool, " ***** Test Step 332 : Write attribute NULLABLE_ENUM16 Min Value\n"); - err = TestWriteAttributeNullableEnum16MinValue_332(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 333: - ChipLogProgress(chipTool, " ***** Test Step 333 : Read attribute NULLABLE_ENUM16 Min Value\n"); - err = TestReadAttributeNullableEnum16MinValue_333(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 334: - ChipLogProgress(chipTool, " ***** Test Step 334 : Write attribute NULLABLE_ENUM16 Max Value\n"); - err = TestWriteAttributeNullableEnum16MaxValue_334(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 335: - ChipLogProgress(chipTool, " ***** Test Step 335 : Read attribute NULLABLE_ENUM16 Max Value\n"); - err = TestReadAttributeNullableEnum16MaxValue_335(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 336: - ChipLogProgress(chipTool, " ***** Test Step 336 : Write attribute NULLABLE_ENUM16 Invalid Value\n"); - err = TestWriteAttributeNullableEnum16InvalidValue_336(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 337: - ChipLogProgress(chipTool, " ***** Test Step 337 : Read attribute NULLABLE_ENUM16 unchanged Value\n"); - err = TestReadAttributeNullableEnum16UnchangedValue_337(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 338: - ChipLogProgress(chipTool, " ***** Test Step 338 : Write attribute NULLABLE_ENUM16 null Value\n"); - err = TestWriteAttributeNullableEnum16NullValue_338(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 339: - ChipLogProgress(chipTool, " ***** Test Step 339 : Read attribute NULLABLE_ENUM16 null Value\n"); - err = TestReadAttributeNullableEnum16NullValue_339(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 340: - ChipLogProgress(chipTool, " ***** Test Step 340 : Write attribute NULLABLE_SIMPLE_ENUM Min Value\n"); - err = TestWriteAttributeNullableSimpleEnumMinValue_340(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 341: - ChipLogProgress(chipTool, " ***** Test Step 341 : Read attribute NULLABLE_SIMPLE_ENUM Min Value\n"); - err = TestReadAttributeNullableSimpleEnumMinValue_341(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 342: - ChipLogProgress(chipTool, " ***** Test Step 342 : Write attribute NULLABLE_SIMPLE_ENUM Max Value\n"); - err = TestWriteAttributeNullableSimpleEnumMaxValue_342(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 343: - ChipLogProgress(chipTool, " ***** Test Step 343 : Read attribute NULLABLE_SIMPLE_ENUM Max Value\n"); - err = TestReadAttributeNullableSimpleEnumMaxValue_343(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 344: - ChipLogProgress(chipTool, " ***** Test Step 344 : Write attribute NULLABLE_SIMPLE_ENUM Invalid Value\n"); - err = TestWriteAttributeNullableSimpleEnumInvalidValue_344(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 345: - ChipLogProgress(chipTool, " ***** Test Step 345 : Read attribute NULLABLE_SIMPLE_ENUM unchanged Value\n"); - err = TestReadAttributeNullableSimpleEnumUnchangedValue_345(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 346: - ChipLogProgress(chipTool, " ***** Test Step 346 : Write attribute NULLABLE_SIMPLE_ENUM null Value\n"); - err = TestWriteAttributeNullableSimpleEnumNullValue_346(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 347: - ChipLogProgress(chipTool, " ***** Test Step 347 : Read attribute NULLABLE_SIMPLE_ENUM null Value\n"); - err = TestReadAttributeNullableSimpleEnumNullValue_347(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 348: - ChipLogProgress(chipTool, " ***** Test Step 348 : Read attribute NULLABLE_OCTET_STRING Default Value\n"); - err = TestReadAttributeNullableOctetStringDefaultValue_348(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 349: - ChipLogProgress(chipTool, " ***** Test Step 349 : Write attribute NULLABLE_OCTET_STRING\n"); - err = TestWriteAttributeNullableOctetString_349(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 350: - ChipLogProgress(chipTool, " ***** Test Step 350 : Read attribute NULLABLE_OCTET_STRING\n"); - err = TestReadAttributeNullableOctetString_350(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 351: - ChipLogProgress(chipTool, " ***** Test Step 351 : Write attribute NULLABLE_OCTET_STRING\n"); - err = TestWriteAttributeNullableOctetString_351(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 352: - ChipLogProgress(chipTool, " ***** Test Step 352 : Read attribute NULLABLE_OCTET_STRING\n"); - err = TestReadAttributeNullableOctetString_352(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 353: - ChipLogProgress(chipTool, " ***** Test Step 353 : Write attribute NULLABLE_OCTET_STRING\n"); - err = TestWriteAttributeNullableOctetString_353(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 354: - ChipLogProgress(chipTool, " ***** Test Step 354 : Read attribute NULLABLE_OCTET_STRING\n"); - err = TestReadAttributeNullableOctetString_354(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 355: - ChipLogProgress(chipTool, " ***** Test Step 355 : Read attribute NULLABLE_CHAR_STRING Default Value\n"); - err = TestReadAttributeNullableCharStringDefaultValue_355(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 356: - ChipLogProgress(chipTool, " ***** Test Step 356 : Write attribute NULLABLE_CHAR_STRING\n"); - err = TestWriteAttributeNullableCharString_356(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 357: - ChipLogProgress(chipTool, " ***** Test Step 357 : Read attribute NULLABLE_CHAR_STRING\n"); - err = TestReadAttributeNullableCharString_357(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 358: - ChipLogProgress(chipTool, " ***** Test Step 358 : Write attribute NULLABLE_CHAR_STRING - Value too long\n"); - err = TestWriteAttributeNullableCharStringValueTooLong_358(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 359: - ChipLogProgress(chipTool, " ***** Test Step 359 : Read attribute NULLABLE_CHAR_STRING\n"); - err = TestReadAttributeNullableCharString_359(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 360: - ChipLogProgress(chipTool, " ***** Test Step 360 : Write attribute NULLABLE_CHAR_STRING - Empty\n"); - err = TestWriteAttributeNullableCharStringEmpty_360(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 361: - ChipLogProgress(chipTool, " ***** Test Step 361 : Read attribute NULLABLE_CHAR_STRING\n"); - err = TestReadAttributeNullableCharString_361(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 362: - ChipLogProgress(chipTool, " ***** Test Step 362 : Read attribute from nonexistent endpoint.\n"); - err = TestReadAttributeFromNonexistentEndpoint_362(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_ENDPOINT)); break; case 363: - ChipLogProgress(chipTool, " ***** Test Step 363 : Read attribute from nonexistent cluster.\n"); - err = TestReadAttributeFromNonexistentCluster_363(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_CLUSTER)); 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(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_VALUE)); 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(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 366: - ChipLogProgress(chipTool, " ***** Test Step 366 : Report: Subscribe to list attribute\n"); - err = TestReportSubscribeToListAttribute_366(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 367: - ChipLogProgress(chipTool, " ***** Test Step 367 : Subscribe to list attribute\n"); - err = TestSubscribeToListAttribute_367(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 368: - ChipLogProgress(chipTool, " ***** Test Step 368 : Write subscribed-to list attribute\n"); - err = TestWriteSubscribedToListAttribute_368(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 369: - ChipLogProgress(chipTool, " ***** Test Step 369 : Check for list attribute report\n"); - err = TestCheckForListAttributeReport_369(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 370: - ChipLogProgress(chipTool, " ***** Test Step 370 : Read range-restricted unsigned 8-bit integer\n"); - err = TestReadRangeRestrictedUnsigned8BitInteger_370(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 371: - ChipLogProgress(chipTool, " ***** Test Step 371 : Write min value to a range-restricted unsigned 8-bit integer\n"); - err = TestWriteMinValueToARangeRestrictedUnsigned8BitInteger_371(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); 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(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); 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(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 374: - ChipLogProgress(chipTool, " ***** Test Step 374 : Write max value to a range-restricted unsigned 8-bit integer\n"); - err = TestWriteMaxValueToARangeRestrictedUnsigned8BitInteger_374(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 375: - ChipLogProgress( - chipTool, " ***** Test Step 375 : Verify range-restricted unsigned 8-bit integer value has not changed\n"); - err = TestVerifyRangeRestrictedUnsigned8BitIntegerValueHasNotChanged_375(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 376: - ChipLogProgress( - chipTool, " ***** Test Step 376 : Write min valid value to a range-restricted unsigned 8-bit integer\n"); - err = TestWriteMinValidValueToARangeRestrictedUnsigned8BitInteger_376(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 377: - ChipLogProgress( - chipTool, " ***** Test Step 377 : Verify range-restricted unsigned 8-bit integer value is at min valid\n"); - err = TestVerifyRangeRestrictedUnsigned8BitIntegerValueIsAtMinValid_377(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 378: - ChipLogProgress( - chipTool, " ***** Test Step 378 : Write max valid value to a range-restricted unsigned 8-bit integer\n"); - err = TestWriteMaxValidValueToARangeRestrictedUnsigned8BitInteger_378(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 379: - ChipLogProgress( - chipTool, " ***** Test Step 379 : Verify range-restricted unsigned 8-bit integer value is at max valid\n"); - err = TestVerifyRangeRestrictedUnsigned8BitIntegerValueIsAtMaxValid_379(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 380: - ChipLogProgress( - chipTool, " ***** Test Step 380 : Write middle valid value to a range-restricted unsigned 8-bit integer\n"); - err = TestWriteMiddleValidValueToARangeRestrictedUnsigned8BitInteger_380(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 381: - ChipLogProgress( - chipTool, " ***** Test Step 381 : Verify range-restricted unsigned 8-bit integer value is at mid valid\n"); - err = TestVerifyRangeRestrictedUnsigned8BitIntegerValueIsAtMidValid_381(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 382: - ChipLogProgress(chipTool, " ***** Test Step 382 : Read range-restricted unsigned 16-bit integer\n"); - err = TestReadRangeRestrictedUnsigned16BitInteger_382(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 383: - ChipLogProgress(chipTool, " ***** Test Step 383 : Write min value to a range-restricted unsigned 16-bit integer\n"); - err = TestWriteMinValueToARangeRestrictedUnsigned16BitInteger_383(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); 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(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); 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(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 386: - ChipLogProgress(chipTool, " ***** Test Step 386 : Write max value to a range-restricted unsigned 16-bit integer\n"); - err = TestWriteMaxValueToARangeRestrictedUnsigned16BitInteger_386(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 387: - ChipLogProgress( - chipTool, " ***** Test Step 387 : Verify range-restricted unsigned 16-bit integer value has not changed\n"); - err = TestVerifyRangeRestrictedUnsigned16BitIntegerValueHasNotChanged_387(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 388: - ChipLogProgress( - chipTool, " ***** Test Step 388 : Write min valid value to a range-restricted unsigned 16-bit integer\n"); - err = TestWriteMinValidValueToARangeRestrictedUnsigned16BitInteger_388(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 389: - ChipLogProgress( - chipTool, " ***** Test Step 389 : Verify range-restricted unsigned 16-bit integer value is at min valid\n"); - err = TestVerifyRangeRestrictedUnsigned16BitIntegerValueIsAtMinValid_389(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 390: - ChipLogProgress( - chipTool, " ***** Test Step 390 : Write max valid value to a range-restricted unsigned 16-bit integer\n"); - err = TestWriteMaxValidValueToARangeRestrictedUnsigned16BitInteger_390(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 391: - ChipLogProgress( - chipTool, " ***** Test Step 391 : Verify range-restricted unsigned 16-bit integer value is at max valid\n"); - err = TestVerifyRangeRestrictedUnsigned16BitIntegerValueIsAtMaxValid_391(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 392: - ChipLogProgress( - chipTool, " ***** Test Step 392 : Write middle valid value to a range-restricted unsigned 16-bit integer\n"); - err = TestWriteMiddleValidValueToARangeRestrictedUnsigned16BitInteger_392(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 393: - ChipLogProgress( - chipTool, " ***** Test Step 393 : Verify range-restricted unsigned 16-bit integer value is at mid valid\n"); - err = TestVerifyRangeRestrictedUnsigned16BitIntegerValueIsAtMidValid_393(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 394: - ChipLogProgress(chipTool, " ***** Test Step 394 : Read range-restricted signed 8-bit integer\n"); - err = TestReadRangeRestrictedSigned8BitInteger_394(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 395: - ChipLogProgress(chipTool, " ***** Test Step 395 : Write min value to a range-restricted signed 8-bit integer\n"); - err = TestWriteMinValueToARangeRestrictedSigned8BitInteger_395(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); 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(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); 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(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 398: - ChipLogProgress(chipTool, " ***** Test Step 398 : Write max value to a range-restricted signed 8-bit integer\n"); - err = TestWriteMaxValueToARangeRestrictedSigned8BitInteger_398(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 399: - ChipLogProgress( - chipTool, " ***** Test Step 399 : Verify range-restricted signed 8-bit integer value has not changed\n"); - err = TestVerifyRangeRestrictedSigned8BitIntegerValueHasNotChanged_399(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 400: - ChipLogProgress(chipTool, " ***** Test Step 400 : Write min valid value to a range-restricted signed 8-bit integer\n"); - err = TestWriteMinValidValueToARangeRestrictedSigned8BitInteger_400(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 401: - ChipLogProgress( - chipTool, " ***** Test Step 401 : Verify range-restricted signed 8-bit integer value is at min valid\n"); - err = TestVerifyRangeRestrictedSigned8BitIntegerValueIsAtMinValid_401(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 402: - ChipLogProgress(chipTool, " ***** Test Step 402 : Write max valid value to a range-restricted signed 8-bit integer\n"); - err = TestWriteMaxValidValueToARangeRestrictedSigned8BitInteger_402(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 403: - ChipLogProgress( - chipTool, " ***** Test Step 403 : Verify range-restricted signed 8-bit integer value is at max valid\n"); - err = TestVerifyRangeRestrictedSigned8BitIntegerValueIsAtMaxValid_403(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 404: - ChipLogProgress( - chipTool, " ***** Test Step 404 : Write middle valid value to a range-restricted signed 8-bit integer\n"); - err = TestWriteMiddleValidValueToARangeRestrictedSigned8BitInteger_404(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 405: - ChipLogProgress( - chipTool, " ***** Test Step 405 : Verify range-restricted signed 8-bit integer value is at mid valid\n"); - err = TestVerifyRangeRestrictedSigned8BitIntegerValueIsAtMidValid_405(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 406: - ChipLogProgress(chipTool, " ***** Test Step 406 : Read range-restricted signed 16-bit integer\n"); - err = TestReadRangeRestrictedSigned16BitInteger_406(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 407: - ChipLogProgress(chipTool, " ***** Test Step 407 : Write min value to a range-restricted signed 16-bit integer\n"); - err = TestWriteMinValueToARangeRestrictedSigned16BitInteger_407(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); 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(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); 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(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 410: - ChipLogProgress(chipTool, " ***** Test Step 410 : Write max value to a range-restricted signed 16-bit integer\n"); - err = TestWriteMaxValueToARangeRestrictedSigned16BitInteger_410(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 411: - ChipLogProgress( - chipTool, " ***** Test Step 411 : Verify range-restricted signed 16-bit integer value has not changed\n"); - err = TestVerifyRangeRestrictedSigned16BitIntegerValueHasNotChanged_411(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 412: - ChipLogProgress(chipTool, " ***** Test Step 412 : Write min valid value to a range-restricted signed 16-bit integer\n"); - err = TestWriteMinValidValueToARangeRestrictedSigned16BitInteger_412(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 413: - ChipLogProgress( - chipTool, " ***** Test Step 413 : Verify range-restricted signed 16-bit integer value is at min valid\n"); - err = TestVerifyRangeRestrictedSigned16BitIntegerValueIsAtMinValid_413(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 414: - ChipLogProgress(chipTool, " ***** Test Step 414 : Write max valid value to a range-restricted signed 16-bit integer\n"); - err = TestWriteMaxValidValueToARangeRestrictedSigned16BitInteger_414(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 415: - ChipLogProgress( - chipTool, " ***** Test Step 415 : Verify range-restricted signed 16-bit integer value is at max valid\n"); - err = TestVerifyRangeRestrictedSigned16BitIntegerValueIsAtMaxValid_415(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 416: - ChipLogProgress( - chipTool, " ***** Test Step 416 : Write middle valid value to a range-restricted signed 16-bit integer\n"); - err = TestWriteMiddleValidValueToARangeRestrictedSigned16BitInteger_416(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 417: - ChipLogProgress( - chipTool, " ***** Test Step 417 : Verify range-restricted signed 16-bit integer value is at mid valid\n"); - err = TestVerifyRangeRestrictedSigned16BitIntegerValueIsAtMidValid_417(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 418: - ChipLogProgress(chipTool, " ***** Test Step 418 : Read nullable range-restricted unsigned 8-bit integer\n"); - err = TestReadNullableRangeRestrictedUnsigned8BitInteger_418(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 419: - ChipLogProgress( - chipTool, " ***** Test Step 419 : Write min value to a nullable range-restricted unsigned 8-bit integer\n"); - err = TestWriteMinValueToANullableRangeRestrictedUnsigned8BitInteger_419(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); 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(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); 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(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 422: - ChipLogProgress( - chipTool, " ***** Test Step 422 : Write max value to a nullable range-restricted unsigned 8-bit integer\n"); - err = TestWriteMaxValueToANullableRangeRestrictedUnsigned8BitInteger_422(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 423: - ChipLogProgress( - chipTool, " ***** Test Step 423 : Verify nullable range-restricted unsigned 8-bit integer value has not changed\n"); - err = TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueHasNotChanged_423(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); 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(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); 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(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); 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(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); 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(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); 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(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); 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(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 430: - ChipLogProgress( - chipTool, " ***** Test Step 430 : Write null value to a nullable range-restricted unsigned 8-bit integer\n"); - err = TestWriteNullValueToANullableRangeRestrictedUnsigned8BitInteger_430(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 431: - ChipLogProgress( - chipTool, " ***** Test Step 431 : Verify nullable range-restricted unsigned 8-bit integer value is null\n"); - err = TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueIsNull_431(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 432: - ChipLogProgress(chipTool, " ***** Test Step 432 : Read nullable range-restricted unsigned 16-bit integer\n"); - err = TestReadNullableRangeRestrictedUnsigned16BitInteger_432(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 433: - ChipLogProgress( - chipTool, " ***** Test Step 433 : Write min value to a nullable range-restricted unsigned 16-bit integer\n"); - err = TestWriteMinValueToANullableRangeRestrictedUnsigned16BitInteger_433(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); 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(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); 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(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 436: - ChipLogProgress( - chipTool, " ***** Test Step 436 : Write max value to a nullable range-restricted unsigned 16-bit integer\n"); - err = TestWriteMaxValueToANullableRangeRestrictedUnsigned16BitInteger_436(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 437: - ChipLogProgress(chipTool, - " ***** Test Step 437 : Verify nullable range-restricted unsigned 16-bit integer value has not changed\n"); - err = TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueHasNotChanged_437(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); 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(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); 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(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); 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(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); 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(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); 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(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); 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(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 444: - ChipLogProgress( - chipTool, " ***** Test Step 444 : Write null value to a nullable range-restricted unsigned 16-bit integer\n"); - err = TestWriteNullValueToANullableRangeRestrictedUnsigned16BitInteger_444(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 445: - ChipLogProgress( - chipTool, " ***** Test Step 445 : Verify nullable range-restricted unsigned 16-bit integer value is null\n"); - err = TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueIsNull_445(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 446: - ChipLogProgress(chipTool, " ***** Test Step 446 : Read nullable range-restricted signed 8-bit integer\n"); - err = TestReadNullableRangeRestrictedSigned8BitInteger_446(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 447: - ChipLogProgress( - chipTool, " ***** Test Step 447 : Write min value to a nullable range-restricted signed 8-bit integer\n"); - err = TestWriteMinValueToANullableRangeRestrictedSigned8BitInteger_447(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); 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(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); 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(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 450: - ChipLogProgress( - chipTool, " ***** Test Step 450 : Write max value to a nullable range-restricted signed 8-bit integer\n"); - err = TestWriteMaxValueToANullableRangeRestrictedSigned8BitInteger_450(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 451: - ChipLogProgress( - chipTool, " ***** Test Step 451 : Verify nullable range-restricted signed 8-bit integer value has not changed\n"); - err = TestVerifyNullableRangeRestrictedSigned8BitIntegerValueHasNotChanged_451(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); 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(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); 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(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); 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(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); 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(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); 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(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); 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(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 458: - ChipLogProgress( - chipTool, " ***** Test Step 458 : Write null value to a nullable range-restricted signed 8-bit integer\n"); - err = TestWriteNullValueToANullableRangeRestrictedSigned8BitInteger_458(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 459: - ChipLogProgress( - chipTool, " ***** Test Step 459 : Verify nullable range-restricted signed 8-bit integer value is at null\n"); - err = TestVerifyNullableRangeRestrictedSigned8BitIntegerValueIsAtNull_459(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 460: - ChipLogProgress(chipTool, " ***** Test Step 460 : Read nullable range-restricted signed 16-bit integer\n"); - err = TestReadNullableRangeRestrictedSigned16BitInteger_460(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 461: - ChipLogProgress( - chipTool, " ***** Test Step 461 : Write min value to a nullable range-restricted signed 16-bit integer\n"); - err = TestWriteMinValueToANullableRangeRestrictedSigned16BitInteger_461(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); 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(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); 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(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 464: - ChipLogProgress( - chipTool, " ***** Test Step 464 : Write max value to a nullable range-restricted signed 16-bit integer\n"); - err = TestWriteMaxValueToANullableRangeRestrictedSigned16BitInteger_464(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 465: - ChipLogProgress( - chipTool, " ***** Test Step 465 : Verify nullable range-restricted signed 16-bit integer value has not changed\n"); - err = TestVerifyNullableRangeRestrictedSigned16BitIntegerValueHasNotChanged_465(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); 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(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); 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(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); 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(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); 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(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); 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(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); 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(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 472: - ChipLogProgress( - chipTool, " ***** Test Step 472 : Write null value to a nullable range-restricted signed 16-bit integer\n"); - err = TestWriteNullValueToANullableRangeRestrictedSigned16BitInteger_472(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 473: - ChipLogProgress( - chipTool, " ***** Test Step 473 : Verify nullable range-restricted signed 16-bit integer value is null\n"); - err = TestVerifyNullableRangeRestrictedSigned16BitIntegerValueIsNull_473(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 474: - ChipLogProgress(chipTool, " ***** Test Step 474 : Write attribute that returns general status on write\n"); - err = TestWriteAttributeThatReturnsGeneralStatusOnWrite_474(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_DATA_TYPE)); break; case 475: - ChipLogProgress(chipTool, " ***** Test Step 475 : Write attribute that returns cluster-specific status on write\n"); - err = TestWriteAttributeThatReturnsClusterSpecificStatusOnWrite_475(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); break; case 476: - ChipLogProgress(chipTool, " ***** Test Step 476 : Read attribute that returns general status on read\n"); - err = TestReadAttributeThatReturnsGeneralStatusOnRead_476(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_DATA_TYPE)); break; case 477: - ChipLogProgress(chipTool, " ***** Test Step 477 : read attribute that returns cluster-specific status on read\n"); - err = TestReadAttributeThatReturnsClusterSpecificStatusOnRead_477(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); break; case 478: - ChipLogProgress(chipTool, " ***** Test Step 478 : read AcceptedCommandList attribute\n"); - err = TestReadAcceptedCommandListAttribute_478(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 479: - ChipLogProgress(chipTool, " ***** Test Step 479 : read GeneratedCommandList attribute\n"); - err = TestReadGeneratedCommandListAttribute_479(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 480: - ChipLogProgress(chipTool, " ***** Test Step 480 : Write struct-typed attribute\n"); - err = TestWriteStructTypedAttribute_480(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 481: - ChipLogProgress(chipTool, " ***** Test Step 481 : Read struct-typed attribute\n"); - err = TestReadStructTypedAttribute_481(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; } - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + // Go on to the next test. + WaitForMs(0); } chip::System::Clock::Timeout GetWaitDuration() const override @@ -55618,12 +67809,14 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestSendTestCommand_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -55641,6 +67834,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestSendTestNotHandledCommand_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -55657,6 +67851,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestSendTestSpecificCommand_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -55680,6 +67875,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestSendTestAddArgumentsCommand_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -55707,6 +67903,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestSendFailingTestAddArgumentsCommand_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -55728,6 +67925,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeBooleanDefaultValue_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -55750,6 +67948,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeBooleanTrue_7() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -55770,6 +67969,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeBooleanTrue_8() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -55792,6 +67992,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeBooleanFalse_9() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -55812,6 +68013,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeBooleanFalse_10() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -55834,6 +68036,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeBitmap8DefaultValue_11() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -55856,6 +68059,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeBitmap8MaxValue_12() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -55876,6 +68080,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeBitmap8MaxValue_13() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -55898,6 +68103,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeBitmap8MinValue_14() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -55918,6 +68124,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeBitmap8MinValue_15() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -55940,6 +68147,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeBitmap16DefaultValue_16() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -55962,6 +68170,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeBitmap16MaxValue_17() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -55982,6 +68191,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeBitmap16MaxValue_18() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -56004,6 +68214,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeBitmap16MinValue_19() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -56024,6 +68235,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeBitmap16MinValue_20() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -56046,6 +68258,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeBitmap32DefaultValue_21() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -56068,6 +68281,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeBitmap32MaxValue_22() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -56088,6 +68302,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeBitmap32MaxValue_23() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -56110,6 +68325,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeBitmap32MinValue_24() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -56130,6 +68346,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeBitmap32MinValue_25() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -56152,6 +68369,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeBitmap64DefaultValue_26() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -56174,6 +68392,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeBitmap64MaxValue_27() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -56194,6 +68413,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeBitmap64MaxValue_28() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -56216,6 +68436,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeBitmap64MinValue_29() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -56236,6 +68457,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeBitmap64MinValue_30() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -56258,6 +68480,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeInt8uDefaultValue_31() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -56280,6 +68503,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeInt8uMaxValue_32() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -56300,6 +68524,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeInt8uMaxValue_33() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -56322,6 +68547,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeInt8uMinValue_34() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -56342,6 +68568,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeInt8uMinValue_35() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -56364,6 +68591,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeInt16uDefaultValue_36() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -56386,6 +68614,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeInt16uMaxValue_37() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -56406,6 +68635,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeInt16uMaxValue_38() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -56428,6 +68658,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeInt16uMinValue_39() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -56448,6 +68679,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeInt16uMinValue_40() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -56470,6 +68702,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeInt32uDefaultValue_41() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -56492,6 +68725,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeInt32uMaxValue_42() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -56512,6 +68746,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeInt32uMaxValue_43() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -56534,6 +68769,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeInt32uMinValue_44() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -56554,6 +68790,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeInt32uMinValue_45() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -56576,6 +68813,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeInt64uDefaultValue_46() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -56598,6 +68836,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeInt64uMaxValue_47() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -56618,6 +68857,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeInt64uMaxValue_48() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -56640,6 +68880,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeInt64uMinValue_49() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -56660,6 +68901,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeInt64uMinValue_50() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -56682,6 +68924,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeInt8sDefaultValue_51() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -56704,6 +68947,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeInt8sMaxValue_52() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -56724,6 +68968,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeInt8sMaxValue_53() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -56746,6 +68991,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeInt8sMinValue_54() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -56766,6 +69012,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeInt8sMinValue_55() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -56788,6 +69035,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeInt8sDefaultValue_56() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -56808,6 +69056,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeInt8sDefaultValue_57() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -56830,6 +69079,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeInt16sDefaultValue_58() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -56852,6 +69102,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeInt16sMaxValue_59() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -56872,6 +69123,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeInt16sMaxValue_60() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -56894,6 +69146,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeInt16sMinValue_61() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -56914,6 +69167,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeInt16sMinValue_62() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -56936,6 +69190,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeInt16sDefaultValue_63() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -56956,6 +69211,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeInt16sDefaultValue_64() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -56978,6 +69234,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeInt32sDefaultValue_65() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -57000,6 +69257,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeInt32sMaxValue_66() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -57020,6 +69278,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeInt32sMaxValue_67() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -57042,6 +69301,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeInt32sMinValue_68() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -57062,6 +69322,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeInt32sMinValue_69() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -57084,6 +69345,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeInt32sDefaultValue_70() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -57104,6 +69366,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeInt32sDefaultValue_71() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -57126,6 +69389,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeInt64sDefaultValue_72() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -57148,6 +69412,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeInt64sMaxValue_73() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -57168,6 +69433,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeInt64sMaxValue_74() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -57190,6 +69456,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeInt64sMinValue_75() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -57210,6 +69477,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeInt64sMinValue_76() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -57232,6 +69500,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeInt64sDefaultValue_77() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -57252,6 +69521,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeInt64sDefaultValue_78() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -57274,6 +69544,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeSingleDefaultValue_79() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -57296,6 +69567,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeSingleMediumValue_80() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -57316,6 +69588,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeSingleMediumValue_81() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -57338,6 +69611,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeSingleLargeValue_82() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -57358,6 +69632,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeSingleLargeValue_83() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -57380,6 +69655,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeSingleSmallValue_84() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -57400,6 +69676,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeSingleSmallValue_85() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -57422,6 +69699,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeSingleDefaultValue_86() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -57442,6 +69720,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeSingleDefaultValue_87() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -57464,6 +69743,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeDoubleDefaultValue_88() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -57486,6 +69766,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeDoubleMediumValue_89() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -57506,6 +69787,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeDoubleMediumValue_90() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -57528,6 +69810,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeDoubleLargeValue_91() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -57548,6 +69831,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeDoubleLargeValue_92() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -57570,6 +69854,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeDoubleSmallValue_93() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -57590,6 +69875,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeDoubleSmallValue_94() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -57612,6 +69898,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeDoubleDefaultValue_95() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -57632,6 +69919,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeDoubleDefaultValue_96() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -57654,6 +69942,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeEnum8DefaultValue_97() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -57676,6 +69965,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeEnum8MaxValue_98() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -57696,6 +69986,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeEnum8MaxValue_99() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -57718,6 +70009,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeEnum8MinValue_100() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -57738,6 +70030,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeEnum8MinValue_101() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -57760,6 +70053,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeEnum16DefaultValue_102() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -57782,6 +70076,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeEnum16MaxValue_103() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -57802,6 +70097,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeEnum16MaxValue_104() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -57824,6 +70120,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeEnum16MinValue_105() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -57844,6 +70141,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeEnum16MinValue_106() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -57866,6 +70164,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeOctetStringDefaultValue_107() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -57888,6 +70187,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeOctetStringWithEmbeddedNull_108() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -57908,6 +70208,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeOctetStringWithEmbeddedNull_109() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -57931,6 +70232,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeOctetStringWithWeirdChars_110() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -57951,6 +70253,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeOctetStringWithWeirdChars_111() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -57974,6 +70277,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeOctetString_112() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -57994,6 +70298,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeOctetString_113() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -58017,6 +70322,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeOctetString_114() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -58036,6 +70342,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeOctetString_115() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -58059,6 +70366,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeOctetString_116() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -58079,6 +70387,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeLongOctetStringDefaultValue_117() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -58101,6 +70410,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeLongOctetString_118() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -58125,6 +70435,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeLongOctetString_119() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -58153,6 +70464,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeLongOctetString_120() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -58173,6 +70485,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeCharStringDefaultValue_121() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -58195,6 +70508,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeCharString_122() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -58215,6 +70529,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeCharString_123() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -58237,6 +70552,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeCharStringValueTooLong_124() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -58256,6 +70572,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeCharString_125() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -58278,6 +70595,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeCharStringEmpty_126() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -58298,6 +70616,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeLongCharStringDefaultValue_127() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -58320,6 +70639,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeLongCharString_128() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -58343,6 +70663,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeLongCharString_129() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -58368,6 +70689,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeLongCharString_130() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -58388,6 +70710,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeListLongOctetStringForChunkedRead_131() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -58446,6 +70769,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeListLongOctetStringForChunkedWrite_132() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -58509,6 +70833,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeListLongOctetStringForChunkedRead_133() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -58576,6 +70901,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeEpochUsDefaultValue_134() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -58598,6 +70924,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeEpochUsMaxValue_135() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -58618,6 +70945,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeEpochUsMaxValue_136() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -58640,6 +70968,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeEpochUsMinValue_137() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -58660,6 +70989,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeEpochUsMinValue_138() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -58682,6 +71012,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeEpochSDefaultValue_139() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -58704,6 +71035,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeEpochSMaxValue_140() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -58724,6 +71056,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeEpochSMaxValue_141() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -58746,6 +71079,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeEpochSMinValue_142() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -58766,6 +71100,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeEpochSMinValue_143() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -58788,6 +71123,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeUnsupported_144() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -58815,6 +71151,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteattributeUnsupported_145() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -58840,6 +71177,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestSendTestCommandToUnsupportedEndpoint_146() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:200 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -58856,6 +71194,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestSendTestCommandToUnsupportedCluster_147() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -58872,6 +71211,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeVendorIdDefaultValue_148() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -58894,6 +71234,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeVendorId_149() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -58914,6 +71255,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeVendorId_150() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -58936,6 +71278,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestRestoreAttributeVendorId_151() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -58956,6 +71299,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestSendACommandWithAVendorIdAndEnum_152() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -58988,6 +71332,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestSendTestCommandWithStructArgumentAndArg1bIsTrue_153() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -59023,6 +71368,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestSendTestCommandWithStructArgumentAndArg1bIsFalse_154() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -59058,6 +71404,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestSendTestCommandWithNestedStructArgumentAndArg1cbIsTrue_155() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -59104,6 +71451,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestSendTestCommandWithNestedStructArgumentArg1cbIsFalse_156() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -59150,6 +71498,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestSendTestCommandWithNestedStructListArgumentAndAllFieldsBOfArg1dAreTrue_157() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -59242,6 +71591,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestSendTestCommandWithNestedStructListArgumentAndSomeFieldsBOfArg1dAreFalse_158() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -59334,6 +71684,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestSendTestCommandWithStructArgumentAndSeeWhatWeGetBack_159() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -59379,6 +71730,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestSendTestCommandWithListOfInt8uAndNoneOfThemIsSetTo0_160() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -59418,6 +71770,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestSendTestCommandWithListOfInt8uAndOneOfThemIsSetTo0_161() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -59457,6 +71810,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestSendTestCommandWithListOfInt8uAndGetItReversed_162() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -59505,6 +71859,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestSendTestCommandWithEmptyListOfInt8uAndGetAnEmptyListBack_163() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -59535,6 +71890,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestSendTestCommandWithListOfStructArgumentAndArg1bOfFirstItemIsTrue_164() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -59586,6 +71942,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestSendTestCommandWithListOfStructArgumentAndArg1bOfFirstItemIsFalse_165() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -59637,6 +71994,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestSendTestCommandWithListOfNestedStructListArgumentAndAllFieldsBOfElementsOfArg1dAreTrue_166() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -59735,6 +72093,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestSendTestCommandWithNestedStructListArgumentAndSomeFieldsBOfElementsOfArg1dAreFalse_167() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -59833,6 +72192,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeListWithListOfInt8uAndNoneOfThemIsSetTo0_168() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -59860,6 +72220,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeListWithListOfInt8u_169() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -59886,6 +72247,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeListWithListOfOctetString_170() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -59913,6 +72275,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeListWithListOfOctetString_171() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -59939,6 +72302,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeListWithListOfListStructOctetString_172() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -59982,6 +72346,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeListWithListOfListStructOctetString_173() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -60024,6 +72389,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestSendTestCommandWithOptionalArgSet_174() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -60067,6 +72433,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestSendTestCommandWithoutItsOptionalArg_175() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -60093,6 +72460,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadListOfStructsContainingNullablesAndOptionals_176() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -60124,6 +72492,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteListOfStructsContainingNullablesAndOptionals_177() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -60160,6 +72529,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadListOfStructsContainingNullablesAndOptionalsAfterWriting_178() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -60198,6 +72568,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableBooleanNull_179() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -60218,6 +72589,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableBooleanNull_180() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -60240,6 +72612,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableBooleanTrue_181() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -60260,6 +72633,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableBooleanTrue_182() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -60283,6 +72657,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableBitmap8MaxValue_183() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -60303,6 +72678,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableBitmap8MaxValue_184() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -60326,6 +72702,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableBitmap8InvalidValue_185() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -60345,6 +72722,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableBitmap8UnchangedValue_186() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -60368,6 +72746,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableBitmap8NullValue_187() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -60388,6 +72767,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableBitmap8NullValue_188() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -60410,6 +72790,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableBitmap16MaxValue_189() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -60430,6 +72811,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableBitmap16MaxValue_190() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -60453,6 +72835,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableBitmap16InvalidValue_191() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -60472,6 +72855,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableBitmap16UnchangedValue_192() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -60495,6 +72879,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableBitmap16NullValue_193() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -60515,6 +72900,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableBitmap16NullValue_194() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -60537,6 +72923,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableBitmap32MaxValue_195() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -60557,6 +72944,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableBitmap32MaxValue_196() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -60580,6 +72968,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableBitmap32InvalidValue_197() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -60599,6 +72988,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableBitmap32UnchangedValue_198() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -60622,6 +73012,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableBitmap32NullValue_199() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -60642,6 +73033,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableBitmap32NullValue_200() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -60664,6 +73056,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableBitmap64MaxValue_201() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -60684,6 +73077,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableBitmap64MaxValue_202() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -60707,6 +73101,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableBitmap64InvalidValue_203() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -60726,6 +73121,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableBitmap64UnchangedValue_204() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -60749,6 +73145,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableBitmap64NullValue_205() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -60769,6 +73166,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableBitmap64NullValue_206() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -60791,6 +73189,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableInt8uMinValue_207() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -60811,6 +73210,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableInt8uMinValue_208() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -60834,6 +73234,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableInt8uMaxValue_209() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -60854,6 +73255,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableInt8uMaxValue_210() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -60877,6 +73279,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableInt8uInvalidValue_211() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -60896,6 +73299,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableInt8uUnchangedValue_212() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -60919,6 +73323,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableInt8uUnchangedValueWithConstraint_213() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -60938,6 +73343,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableInt8uNullValue_214() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -60958,6 +73364,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableInt8uNullValue_215() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -60980,6 +73387,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableInt8uNullValueRange_216() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -61004,6 +73412,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableInt8uNullValueNot_217() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -61025,6 +73434,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableInt8uValue_218() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -61045,6 +73455,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableInt8uValueInRange_219() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -61069,6 +73480,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableInt8uNotValueOk_220() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -61090,6 +73502,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableInt16uMinValue_221() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -61110,6 +73523,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableInt16uMinValue_222() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -61133,6 +73547,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableInt16uMaxValue_223() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -61153,6 +73568,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableInt16uMaxValue_224() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -61176,6 +73592,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableInt16uInvalidValue_225() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -61195,6 +73612,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableInt16uUnchangedValue_226() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -61218,6 +73636,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableInt16uNullValue_227() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -61238,6 +73657,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableInt16uNullValue_228() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -61260,6 +73680,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableInt16uNullValueRange_229() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -61284,6 +73705,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableInt16uNullValueNot_230() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -61305,6 +73727,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableInt16uValue_231() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -61325,6 +73748,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableInt16uValueInRange_232() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -61349,6 +73773,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableInt16uNotValueOk_233() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -61370,6 +73795,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableInt32uMinValue_234() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -61390,6 +73816,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableInt32uMinValue_235() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -61413,6 +73840,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableInt32uMaxValue_236() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -61433,6 +73861,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableInt32uMaxValue_237() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -61456,6 +73885,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableInt32uInvalidValue_238() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -61475,6 +73905,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableInt32uUnchangedValue_239() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -61498,6 +73929,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableInt32uNullValue_240() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -61518,6 +73950,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableInt32uNullValue_241() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -61540,6 +73973,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableInt32uNullValueRange_242() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -61564,6 +73998,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableInt32uNullValueNot_243() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -61585,6 +74020,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableInt32uValue_244() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -61605,6 +74041,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableInt32uValueInRange_245() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -61629,6 +74066,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableInt32uNotValueOk_246() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -61650,6 +74088,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableInt64uMinValue_247() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -61670,6 +74109,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableInt64uMinValue_248() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -61693,6 +74133,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableInt64uMaxValue_249() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -61713,6 +74154,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableInt64uMaxValue_250() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -61736,6 +74178,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableInt64uInvalidValue_251() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -61755,6 +74198,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableInt64uUnchangedValue_252() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -61778,6 +74222,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableInt64uNullValue_253() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -61798,6 +74243,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableInt64uNullValue_254() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -61820,6 +74266,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableInt64uNullValueRange_255() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -61845,6 +74292,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableInt64uNullValueNot_256() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -61866,6 +74314,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableInt64uValue_257() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -61886,6 +74335,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableInt64uValueInRange_258() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -61911,6 +74361,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableInt64uNotValueOk_259() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -61932,6 +74383,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableInt8sMinValue_260() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -61952,6 +74404,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableInt8sMinValue_261() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -61975,6 +74428,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableInt8sInvalidValue_262() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -61994,6 +74448,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableInt8sUnchangedValue_263() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -62017,6 +74472,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableInt8sNullValue_264() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -62037,6 +74493,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableInt8sNullValue_265() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -62059,6 +74516,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableInt8sNullValueRange_266() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -62083,6 +74541,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableInt8sNullValueNot_267() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -62104,6 +74563,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableInt8sValue_268() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -62124,6 +74584,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableInt8sValueInRange_269() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -62148,6 +74609,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableInt8sNotValueOk_270() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -62169,6 +74631,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableInt16sMinValue_271() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -62189,6 +74652,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableInt16sMinValue_272() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -62212,6 +74676,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableInt16sInvalidValue_273() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -62231,6 +74696,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableInt16sUnchangedValue_274() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -62254,6 +74720,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableInt16sNullValue_275() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -62274,6 +74741,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableInt16sNullValue_276() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -62296,6 +74764,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableInt16sNullValueRange_277() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -62320,6 +74789,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableInt16sNullValueNot_278() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -62341,6 +74811,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableInt16sValue_279() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -62361,6 +74832,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableInt16sValueInRange_280() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -62385,6 +74857,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableInt16sNotValueOk_281() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -62406,6 +74879,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableInt32sMinValue_282() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -62426,6 +74900,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableInt32sMinValue_283() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -62449,6 +74924,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableInt32sInvalidValue_284() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -62468,6 +74944,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableInt32sUnchangedValue_285() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -62491,6 +74968,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableInt32sNullValue_286() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -62511,6 +74989,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableInt32sNullValue_287() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -62533,6 +75012,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableInt32sNullValueRange_288() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -62557,6 +75037,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableInt32sNullValueNot_289() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -62578,6 +75059,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableInt32sValue_290() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -62598,6 +75080,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableInt32sValueInRange_291() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -62622,6 +75105,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableInt32sNotValueOk_292() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -62643,6 +75127,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableInt64sMinValue_293() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -62663,6 +75148,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableInt64sMinValue_294() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -62686,6 +75172,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableInt64sInvalidValue_295() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -62705,6 +75192,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableInt64sUnchangedValue_296() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -62728,6 +75216,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableInt64sNullValue_297() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -62748,6 +75237,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableInt64sNullValue_298() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -62770,6 +75260,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableInt64sNullValueRange_299() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -62794,6 +75285,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableInt64sNullValueNot_300() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -62815,6 +75307,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableInt64sValue_301() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -62835,6 +75328,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableInt64sValueInRange_302() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -62859,6 +75353,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableInt64sNotValueOk_303() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -62880,6 +75375,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableSingleMediumValue_304() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -62900,6 +75396,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableSingleMediumValue_305() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -62923,6 +75420,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableSingleLargestValue_306() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -62943,6 +75441,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableSingleLargestValue_307() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -62966,6 +75465,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableSingleSmallestValue_308() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -62986,6 +75486,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableSingleSmallestValue_309() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -63009,6 +75510,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableSingleNullValue_310() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -63029,6 +75531,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableSingleNullValue_311() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -63051,6 +75554,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableSingle0Value_312() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -63071,6 +75575,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableSingle0Value_313() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -63094,6 +75599,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableDoubleMediumValue_314() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -63114,6 +75620,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableDoubleMediumValue_315() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -63137,6 +75644,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableDoubleLargestValue_316() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -63157,6 +75665,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableDoubleLargestValue_317() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -63180,6 +75689,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableDoubleSmallestValue_318() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -63200,6 +75710,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableDoubleSmallestValue_319() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -63223,6 +75734,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableDoubleNullValue_320() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -63243,6 +75755,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableDoubleNullValue_321() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -63265,6 +75778,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableDouble0Value_322() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -63285,6 +75799,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableDouble0Value_323() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -63308,6 +75823,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableEnum8MinValue_324() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -63328,6 +75844,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableEnum8MinValue_325() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -63351,6 +75868,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableEnum8MaxValue_326() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -63371,6 +75889,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableEnum8MaxValue_327() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -63394,6 +75913,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableEnum8InvalidValue_328() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -63413,6 +75933,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableEnum8UnchangedValue_329() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -63436,6 +75957,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableEnum8NullValue_330() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -63456,6 +75978,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableEnum8NullValue_331() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -63478,6 +76001,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableEnum16MinValue_332() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -63498,6 +76022,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableEnum16MinValue_333() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -63521,6 +76046,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableEnum16MaxValue_334() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -63541,6 +76067,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableEnum16MaxValue_335() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -63564,6 +76091,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableEnum16InvalidValue_336() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -63583,6 +76111,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableEnum16UnchangedValue_337() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -63606,6 +76135,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableEnum16NullValue_338() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -63626,6 +76156,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableEnum16NullValue_339() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -63648,6 +76179,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableSimpleEnumMinValue_340() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -63668,6 +76200,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableSimpleEnumMinValue_341() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -63691,6 +76224,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableSimpleEnumMaxValue_342() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -63711,6 +76245,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableSimpleEnumMaxValue_343() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -63734,6 +76269,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableSimpleEnumInvalidValue_344() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -63753,6 +76289,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableSimpleEnumUnchangedValue_345() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -63776,6 +76313,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableSimpleEnumNullValue_346() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -63796,6 +76334,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableSimpleEnumNullValue_347() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -63818,6 +76357,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableOctetStringDefaultValue_348() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -63842,6 +76382,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableOctetString_349() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -63862,6 +76403,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableOctetString_350() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -63886,6 +76428,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableOctetString_351() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -63906,6 +76449,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableOctetString_352() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -63928,6 +76472,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableOctetString_353() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -63948,6 +76493,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableOctetString_354() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -63972,6 +76518,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableCharStringDefaultValue_355() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -63995,6 +76542,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableCharString_356() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -64015,6 +76563,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableCharString_357() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -64038,6 +76587,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableCharStringValueTooLong_358() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -64058,6 +76608,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableCharString_359() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -64080,6 +76631,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeNullableCharStringEmpty_360() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -64100,6 +76652,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeNullableCharString_361() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -64123,6 +76676,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeFromNonexistentEndpoint_362() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:200 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -64139,6 +76693,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeFromNonexistentCluster_363() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -64155,6 +76710,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestSendACommandThatTakesAnOptionalParameterButDoNotSetIt_364() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -64175,6 +76731,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestSendACommandThatTakesAnOptionalParameterButDoNotSetIt_365() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -64199,6 +76756,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReportSubscribeToListAttribute_366() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -64226,6 +76784,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestSubscribeToListAttribute_367() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -64257,6 +76816,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteSubscribedToListAttribute_368() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -64284,6 +76844,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestCheckForListAttributeReport_369() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -64310,6 +76871,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadRangeRestrictedUnsigned8BitInteger_370() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -64332,6 +76894,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteMinValueToARangeRestrictedUnsigned8BitInteger_371() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -64352,6 +76915,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteJustBelowRangeValueToARangeRestrictedUnsigned8BitInteger_372() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -64373,6 +76937,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteJustAboveRangeValueToARangeRestrictedUnsigned8BitInteger_373() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -64394,6 +76959,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteMaxValueToARangeRestrictedUnsigned8BitInteger_374() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -64414,6 +76980,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestVerifyRangeRestrictedUnsigned8BitIntegerValueHasNotChanged_375() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -64436,6 +77003,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteMinValidValueToARangeRestrictedUnsigned8BitInteger_376() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -64458,6 +77026,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestVerifyRangeRestrictedUnsigned8BitIntegerValueIsAtMinValid_377() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -64480,6 +77049,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteMaxValidValueToARangeRestrictedUnsigned8BitInteger_378() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -64502,6 +77072,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestVerifyRangeRestrictedUnsigned8BitIntegerValueIsAtMaxValid_379() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -64524,6 +77095,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteMiddleValidValueToARangeRestrictedUnsigned8BitInteger_380() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -64546,6 +77118,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestVerifyRangeRestrictedUnsigned8BitIntegerValueIsAtMidValid_381() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -64568,6 +77141,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadRangeRestrictedUnsigned16BitInteger_382() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -64590,6 +77164,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteMinValueToARangeRestrictedUnsigned16BitInteger_383() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -64610,6 +77185,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteJustBelowRangeValueToARangeRestrictedUnsigned16BitInteger_384() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -64631,6 +77207,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteJustAboveRangeValueToARangeRestrictedUnsigned16BitInteger_385() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -64652,6 +77229,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteMaxValueToARangeRestrictedUnsigned16BitInteger_386() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -64672,6 +77250,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestVerifyRangeRestrictedUnsigned16BitIntegerValueHasNotChanged_387() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -64694,6 +77273,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteMinValidValueToARangeRestrictedUnsigned16BitInteger_388() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -64716,6 +77296,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestVerifyRangeRestrictedUnsigned16BitIntegerValueIsAtMinValid_389() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -64738,6 +77319,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteMaxValidValueToARangeRestrictedUnsigned16BitInteger_390() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -64760,6 +77342,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestVerifyRangeRestrictedUnsigned16BitIntegerValueIsAtMaxValid_391() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -64782,6 +77365,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteMiddleValidValueToARangeRestrictedUnsigned16BitInteger_392() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -64805,6 +77389,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestVerifyRangeRestrictedUnsigned16BitIntegerValueIsAtMidValid_393() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -64827,6 +77412,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadRangeRestrictedSigned8BitInteger_394() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -64849,6 +77435,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteMinValueToARangeRestrictedSigned8BitInteger_395() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -64868,6 +77455,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteJustBelowRangeValueToARangeRestrictedSigned8BitInteger_396() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -64890,6 +77478,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteJustAboveRangeValueToARangeRestrictedSigned8BitInteger_397() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -64912,6 +77501,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteMaxValueToARangeRestrictedSigned8BitInteger_398() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -64931,6 +77521,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestVerifyRangeRestrictedSigned8BitIntegerValueHasNotChanged_399() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -64953,6 +77544,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteMinValidValueToARangeRestrictedSigned8BitInteger_400() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -64974,6 +77566,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestVerifyRangeRestrictedSigned8BitIntegerValueIsAtMinValid_401() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -64996,6 +77589,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteMaxValidValueToARangeRestrictedSigned8BitInteger_402() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -65017,6 +77611,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestVerifyRangeRestrictedSigned8BitIntegerValueIsAtMaxValid_403() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -65039,6 +77634,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteMiddleValidValueToARangeRestrictedSigned8BitInteger_404() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -65061,6 +77657,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestVerifyRangeRestrictedSigned8BitIntegerValueIsAtMidValid_405() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -65083,6 +77680,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadRangeRestrictedSigned16BitInteger_406() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -65105,6 +77703,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteMinValueToARangeRestrictedSigned16BitInteger_407() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -65125,6 +77724,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteJustBelowRangeValueToARangeRestrictedSigned16BitInteger_408() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -65146,6 +77746,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteJustAboveRangeValueToARangeRestrictedSigned16BitInteger_409() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -65167,6 +77768,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteMaxValueToARangeRestrictedSigned16BitInteger_410() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -65187,6 +77789,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestVerifyRangeRestrictedSigned16BitIntegerValueHasNotChanged_411() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -65209,6 +77812,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteMinValidValueToARangeRestrictedSigned16BitInteger_412() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -65231,6 +77835,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestVerifyRangeRestrictedSigned16BitIntegerValueIsAtMinValid_413() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -65253,6 +77858,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteMaxValidValueToARangeRestrictedSigned16BitInteger_414() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -65275,6 +77881,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestVerifyRangeRestrictedSigned16BitIntegerValueIsAtMaxValid_415() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -65297,6 +77904,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteMiddleValidValueToARangeRestrictedSigned16BitInteger_416() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -65319,6 +77927,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestVerifyRangeRestrictedSigned16BitIntegerValueIsAtMidValid_417() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -65341,6 +77950,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadNullableRangeRestrictedUnsigned8BitInteger_418() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -65365,6 +77975,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteMinValueToANullableRangeRestrictedUnsigned8BitInteger_419() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -65386,6 +77997,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteJustBelowRangeValueToANullableRangeRestrictedUnsigned8BitInteger_420() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -65407,6 +78019,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteJustAboveRangeValueToANullableRangeRestrictedUnsigned8BitInteger_421() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -65428,6 +78041,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteMaxValueToANullableRangeRestrictedUnsigned8BitInteger_422() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -65449,6 +78063,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueHasNotChanged_423() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -65473,6 +78088,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteMinValidValueToANullableRangeRestrictedUnsigned8BitInteger_424() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -65495,6 +78111,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueIsAtMinValid_425() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -65519,6 +78136,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteMaxValidValueToANullableRangeRestrictedUnsigned8BitInteger_426() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -65541,6 +78159,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueIsAtMaxValid_427() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -65565,6 +78184,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteMiddleValidValueToANullableRangeRestrictedUnsigned8BitInteger_428() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -65587,6 +78207,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueIsAtMidValid_429() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -65611,6 +78232,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteNullValueToANullableRangeRestrictedUnsigned8BitInteger_430() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -65633,6 +78255,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueIsNull_431() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -65656,6 +78279,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadNullableRangeRestrictedUnsigned16BitInteger_432() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -65680,6 +78304,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteMinValueToANullableRangeRestrictedUnsigned16BitInteger_433() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -65702,6 +78327,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteJustBelowRangeValueToANullableRangeRestrictedUnsigned16BitInteger_434() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -65724,6 +78350,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteJustAboveRangeValueToANullableRangeRestrictedUnsigned16BitInteger_435() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -65746,6 +78373,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteMaxValueToANullableRangeRestrictedUnsigned16BitInteger_436() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -65768,6 +78396,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueHasNotChanged_437() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -65792,6 +78421,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteMinValidValueToANullableRangeRestrictedUnsigned16BitInteger_438() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -65814,6 +78444,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueIsAtMinValid_439() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -65838,6 +78469,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteMaxValidValueToANullableRangeRestrictedUnsigned16BitInteger_440() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -65860,6 +78492,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueIsAtMaxValid_441() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -65884,6 +78517,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteMiddleValidValueToANullableRangeRestrictedUnsigned16BitInteger_442() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -65906,6 +78540,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueIsAtMidValid_443() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -65930,6 +78565,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteNullValueToANullableRangeRestrictedUnsigned16BitInteger_444() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -65952,6 +78588,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueIsNull_445() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -65975,6 +78612,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadNullableRangeRestrictedSigned8BitInteger_446() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -65999,6 +78637,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteMinValueToANullableRangeRestrictedSigned8BitInteger_447() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -66020,6 +78659,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteJustBelowRangeValueToANullableRangeRestrictedSigned8BitInteger_448() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -66041,6 +78681,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteJustAboveRangeValueToANullableRangeRestrictedSigned8BitInteger_449() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -66062,6 +78703,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteMaxValueToANullableRangeRestrictedSigned8BitInteger_450() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -66083,6 +78725,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestVerifyNullableRangeRestrictedSigned8BitIntegerValueHasNotChanged_451() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -66107,6 +78750,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteMinValidValueToANullableRangeRestrictedSigned8BitInteger_452() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -66129,6 +78773,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestVerifyNullableRangeRestrictedSigned8BitIntegerValueIsAtMinValid_453() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -66153,6 +78798,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteMaxValidValueToANullableRangeRestrictedSigned8BitInteger_454() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -66175,6 +78821,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestVerifyNullableRangeRestrictedSigned8BitIntegerValueIsAtMaxValid_455() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -66199,6 +78846,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteMiddleValidValueToANullableRangeRestrictedSigned8BitInteger_456() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -66221,6 +78869,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestVerifyNullableRangeRestrictedSigned8BitIntegerValueIsAtMidValid_457() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -66245,6 +78894,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteNullValueToANullableRangeRestrictedSigned8BitInteger_458() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -66267,6 +78917,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestVerifyNullableRangeRestrictedSigned8BitIntegerValueIsAtNull_459() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -66290,6 +78941,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadNullableRangeRestrictedSigned16BitInteger_460() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -66314,6 +78966,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteMinValueToANullableRangeRestrictedSigned16BitInteger_461() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -66336,6 +78989,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteJustBelowRangeValueToANullableRangeRestrictedSigned16BitInteger_462() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -66358,6 +79012,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteJustAboveRangeValueToANullableRangeRestrictedSigned16BitInteger_463() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -66380,6 +79035,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteMaxValueToANullableRangeRestrictedSigned16BitInteger_464() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -66402,6 +79058,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestVerifyNullableRangeRestrictedSigned16BitIntegerValueHasNotChanged_465() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -66426,6 +79083,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteMinValidValueToANullableRangeRestrictedSigned16BitInteger_466() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -66448,6 +79106,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestVerifyNullableRangeRestrictedSigned16BitIntegerValueIsAtMinValid_467() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -66472,6 +79131,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteMaxValidValueToANullableRangeRestrictedSigned16BitInteger_468() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -66494,6 +79154,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestVerifyNullableRangeRestrictedSigned16BitIntegerValueIsAtMaxValid_469() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -66518,6 +79179,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteMiddleValidValueToANullableRangeRestrictedSigned16BitInteger_470() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -66540,6 +79202,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestVerifyNullableRangeRestrictedSigned16BitIntegerValueIsAtMidValid_471() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -66564,6 +79227,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteNullValueToANullableRangeRestrictedSigned16BitInteger_472() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -66586,6 +79250,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestVerifyNullableRangeRestrictedSigned16BitIntegerValueIsNull_473() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -66609,6 +79274,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeThatReturnsGeneralStatusOnWrite_474() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -66628,6 +79294,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteAttributeThatReturnsClusterSpecificStatusOnWrite_475() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -66648,6 +79315,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeThatReturnsGeneralStatusOnRead_476() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -66664,6 +79332,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAttributeThatReturnsClusterSpecificStatusOnRead_477() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -66680,6 +79349,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadAcceptedCommandListAttribute_478() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -66720,6 +79390,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadGeneratedCommandListAttribute_479() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -66750,6 +79421,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestWriteStructTypedAttribute_480() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -66779,6 +79451,7 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR TestReadStructTypedAttribute_481() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -66946,6 +79619,81 @@ class TestConstraints : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -66962,12 +79710,14 @@ class TestConstraints : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestWriteAttributeInt32uValue_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -66988,6 +79738,7 @@ class TestConstraints : public TestCommandBridge { CHIP_ERROR TestReadAttributeInt32uValueMinValueConstraints_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -67009,6 +79760,7 @@ class TestConstraints : public TestCommandBridge { CHIP_ERROR TestReadAttributeInt32uValueMaxValueConstraints_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -67030,6 +79782,7 @@ class TestConstraints : public TestCommandBridge { CHIP_ERROR TestReadAttributeInt32uValueNotValueConstraints_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -67051,6 +79804,7 @@ class TestConstraints : public TestCommandBridge { CHIP_ERROR TestWriteAttributeInt32uValueBackToDefaultValue_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -67071,6 +79825,7 @@ class TestConstraints : public TestCommandBridge { CHIP_ERROR TestWriteAttributeCharStringValue_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -67091,6 +79846,7 @@ class TestConstraints : public TestCommandBridge { CHIP_ERROR TestReadAttributeCharStringValueMinLengthConstraints_7() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -67109,6 +79865,7 @@ class TestConstraints : public TestCommandBridge { CHIP_ERROR TestReadAttributeCharStringValueMaxLengthConstraints_8() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -67127,6 +79884,7 @@ class TestConstraints : public TestCommandBridge { CHIP_ERROR TestReadAttributeCharStringValueStartsWithConstraints_9() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -67145,6 +79903,7 @@ class TestConstraints : public TestCommandBridge { CHIP_ERROR TestReadAttributeCharStringValueEndsWithConstraints_10() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -67163,6 +79922,7 @@ class TestConstraints : public TestCommandBridge { CHIP_ERROR TestWriteAttributeCharStringValue_11() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -67183,6 +79943,7 @@ class TestConstraints : public TestCommandBridge { CHIP_ERROR TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_12() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -67202,6 +79963,7 @@ class TestConstraints : public TestCommandBridge { CHIP_ERROR TestWriteAttributeCharStringValue_13() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -67222,6 +79984,7 @@ class TestConstraints : public TestCommandBridge { CHIP_ERROR TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_14() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -67241,6 +80004,7 @@ class TestConstraints : public TestCommandBridge { CHIP_ERROR TestWriteAttributeCharStringValue_15() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -67261,6 +80025,7 @@ class TestConstraints : public TestCommandBridge { CHIP_ERROR TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_16() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -67280,6 +80045,7 @@ class TestConstraints : public TestCommandBridge { CHIP_ERROR TestWriteAttributeCharStringValue_17() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -67300,6 +80066,7 @@ class TestConstraints : public TestCommandBridge { CHIP_ERROR TestReadAttributeCharStringValueIsHexStringConstraints_18() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -67318,6 +80085,7 @@ class TestConstraints : public TestCommandBridge { CHIP_ERROR TestWriteAttributeCharStringValue_19() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -67338,6 +80106,7 @@ class TestConstraints : public TestCommandBridge { CHIP_ERROR TestReadAttributeCharStringValueIsHexStringConstraints_20() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -67356,6 +80125,7 @@ class TestConstraints : public TestCommandBridge { CHIP_ERROR TestWriteAttributeCharStringValueBackToDefaultValue_21() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -67429,6 +80199,21 @@ class TestDelayCommands : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -67445,12 +80230,14 @@ class TestDelayCommands : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestWait100ms_1() { + SetIdentity("alpha"); WaitForMs(100); return CHIP_NO_ERROR; } @@ -67514,6 +80301,24 @@ class TestLogCommands : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -67530,18 +80335,21 @@ class TestLogCommands : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestLogASimpleMessage_1() { + SetIdentity("alpha"); Log(@"This is a simple message"); return CHIP_NO_ERROR; } CHIP_ERROR TestDoASimpleUserPromptMessage_2() { + SetIdentity("alpha"); UserPrompt(@"This is a simple message"); return CHIP_NO_ERROR; } @@ -67686,482 +80494,1282 @@ class TestSaveAs : public TestCommandBridge { err = TestReadAttributeBitmap64DefaultValue_24(); break; case 25: - ChipLogProgress(chipTool, " ***** Test Step 25 : Write attribute BITMAP64 Not Default Value\n"); - err = TestWriteAttributeBitmap64NotDefaultValue_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; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 26: - ChipLogProgress(chipTool, " ***** Test Step 26 : Read attribute BITMAP64 Default Value\n"); - err = TestReadAttributeBitmap64DefaultValue_26(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 27: - ChipLogProgress(chipTool, " ***** Test Step 27 : Write attribute BITMAP64 Default Value\n"); - err = TestWriteAttributeBitmap64DefaultValue_27(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 28: - ChipLogProgress(chipTool, " ***** Test Step 28 : Read attribute BITMAP64 Default Value\n"); - err = TestReadAttributeBitmap64DefaultValue_28(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 29: - ChipLogProgress(chipTool, " ***** Test Step 29 : Read attribute INT8U Default Value\n"); - err = TestReadAttributeInt8uDefaultValue_29(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 30: - ChipLogProgress(chipTool, " ***** Test Step 30 : Write attribute INT8U Not Default Value\n"); - err = TestWriteAttributeInt8uNotDefaultValue_30(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 31: - ChipLogProgress(chipTool, " ***** Test Step 31 : Read attribute INT8U Not Default Value\n"); - err = TestReadAttributeInt8uNotDefaultValue_31(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 32: - ChipLogProgress(chipTool, " ***** Test Step 32 : Write attribute INT8U Default Value\n"); - err = TestWriteAttributeInt8uDefaultValue_32(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 33: - ChipLogProgress(chipTool, " ***** Test Step 33 : Read attribute INT8U Default Value\n"); - err = TestReadAttributeInt8uDefaultValue_33(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 34: - ChipLogProgress(chipTool, " ***** Test Step 34 : Read attribute INT16U Default Value\n"); - err = TestReadAttributeInt16uDefaultValue_34(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 35: - ChipLogProgress(chipTool, " ***** Test Step 35 : Write attribute INT16U Not Default Value\n"); - err = TestWriteAttributeInt16uNotDefaultValue_35(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 36: - ChipLogProgress(chipTool, " ***** Test Step 36 : Read attribute INT16U Not Default Value\n"); - err = TestReadAttributeInt16uNotDefaultValue_36(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 37: - ChipLogProgress(chipTool, " ***** Test Step 37 : Write attribute INT16U Default Value\n"); - err = TestWriteAttributeInt16uDefaultValue_37(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 38: - ChipLogProgress(chipTool, " ***** Test Step 38 : Read attribute INT16U Default Value\n"); - err = TestReadAttributeInt16uDefaultValue_38(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 39: - ChipLogProgress(chipTool, " ***** Test Step 39 : Read attribute INT32U Default Value\n"); - err = TestReadAttributeInt32uDefaultValue_39(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 40: - ChipLogProgress(chipTool, " ***** Test Step 40 : Write attribute INT32U Not Default Value\n"); - err = TestWriteAttributeInt32uNotDefaultValue_40(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 41: - ChipLogProgress(chipTool, " ***** Test Step 41 : Read attribute INT32U Not Default Value\n"); - err = TestReadAttributeInt32uNotDefaultValue_41(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 42: - ChipLogProgress(chipTool, " ***** Test Step 42 : Write attribute INT32U Default Value\n"); - err = TestWriteAttributeInt32uDefaultValue_42(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 43: - ChipLogProgress(chipTool, " ***** Test Step 43 : Read attribute INT32U Default Value\n"); - err = TestReadAttributeInt32uDefaultValue_43(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 44: - ChipLogProgress(chipTool, " ***** Test Step 44 : Read attribute INT64U Default Value\n"); - err = TestReadAttributeInt64uDefaultValue_44(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 45: - ChipLogProgress(chipTool, " ***** Test Step 45 : Write attribute INT64U Not Default Value\n"); - err = TestWriteAttributeInt64uNotDefaultValue_45(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 46: - ChipLogProgress(chipTool, " ***** Test Step 46 : Read attribute INT64U Not Default Value\n"); - err = TestReadAttributeInt64uNotDefaultValue_46(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 47: - ChipLogProgress(chipTool, " ***** Test Step 47 : Write attribute INT64U Default Value\n"); - err = TestWriteAttributeInt64uDefaultValue_47(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 48: - ChipLogProgress(chipTool, " ***** Test Step 48 : Read attribute INT64U Default Value\n"); - err = TestReadAttributeInt64uDefaultValue_48(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 49: - ChipLogProgress(chipTool, " ***** Test Step 49 : Read attribute INT8S Default Value\n"); - err = TestReadAttributeInt8sDefaultValue_49(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 50: - ChipLogProgress(chipTool, " ***** Test Step 50 : Write attribute INT8S Not Default Value\n"); - err = TestWriteAttributeInt8sNotDefaultValue_50(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 51: - ChipLogProgress(chipTool, " ***** Test Step 51 : Read attribute INT8S Not Default Value\n"); - err = TestReadAttributeInt8sNotDefaultValue_51(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 52: - ChipLogProgress(chipTool, " ***** Test Step 52 : Write attribute INT8S Default Value\n"); - err = TestWriteAttributeInt8sDefaultValue_52(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 53: - ChipLogProgress(chipTool, " ***** Test Step 53 : Read attribute INT8S Default Value\n"); - err = TestReadAttributeInt8sDefaultValue_53(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 54: - ChipLogProgress(chipTool, " ***** Test Step 54 : Read attribute INT16S Default Value\n"); - err = TestReadAttributeInt16sDefaultValue_54(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 55: - ChipLogProgress(chipTool, " ***** Test Step 55 : Write attribute INT16S Not Default Value\n"); - err = TestWriteAttributeInt16sNotDefaultValue_55(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 56: - ChipLogProgress(chipTool, " ***** Test Step 56 : Read attribute INT16S Not Default Value\n"); - err = TestReadAttributeInt16sNotDefaultValue_56(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 57: - ChipLogProgress(chipTool, " ***** Test Step 57 : Write attribute INT16S Default Value\n"); - err = TestWriteAttributeInt16sDefaultValue_57(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 58: - ChipLogProgress(chipTool, " ***** Test Step 58 : Read attribute INT16S Default Value\n"); - err = TestReadAttributeInt16sDefaultValue_58(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 59: - ChipLogProgress(chipTool, " ***** Test Step 59 : Read attribute INT32S Default Value\n"); - err = TestReadAttributeInt32sDefaultValue_59(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 60: - ChipLogProgress(chipTool, " ***** Test Step 60 : Write attribute INT32S Not Default Value\n"); - err = TestWriteAttributeInt32sNotDefaultValue_60(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 61: - ChipLogProgress(chipTool, " ***** Test Step 61 : Read attribute INT32S Not Default Value\n"); - err = TestReadAttributeInt32sNotDefaultValue_61(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 62: - ChipLogProgress(chipTool, " ***** Test Step 62 : Write attribute INT32S Default Value\n"); - err = TestWriteAttributeInt32sDefaultValue_62(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 63: - ChipLogProgress(chipTool, " ***** Test Step 63 : Read attribute INT32S Default Value\n"); - err = TestReadAttributeInt32sDefaultValue_63(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 64: - ChipLogProgress(chipTool, " ***** Test Step 64 : Read attribute INT64S Default Value\n"); - err = TestReadAttributeInt64sDefaultValue_64(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 65: - ChipLogProgress(chipTool, " ***** Test Step 65 : Write attribute INTS Not Default Value\n"); - err = TestWriteAttributeIntsNotDefaultValue_65(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 66: - ChipLogProgress(chipTool, " ***** Test Step 66 : Read attribute INT64S Not Default Value\n"); - err = TestReadAttributeInt64sNotDefaultValue_66(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 67: - ChipLogProgress(chipTool, " ***** Test Step 67 : Write attribute INT64S Default Value\n"); - err = TestWriteAttributeInt64sDefaultValue_67(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 68: - ChipLogProgress(chipTool, " ***** Test Step 68 : Read attribute INT64S Default Value\n"); - err = TestReadAttributeInt64sDefaultValue_68(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 69: - ChipLogProgress(chipTool, " ***** Test Step 69 : Read attribute ENUM8 Default Value\n"); - err = TestReadAttributeEnum8DefaultValue_69(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 70: - ChipLogProgress(chipTool, " ***** Test Step 70 : Write attribute ENUM8 Not Default Value\n"); - err = TestWriteAttributeEnum8NotDefaultValue_70(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 71: - ChipLogProgress(chipTool, " ***** Test Step 71 : Read attribute ENUM8 Not Default Value\n"); - err = TestReadAttributeEnum8NotDefaultValue_71(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 72: - ChipLogProgress(chipTool, " ***** Test Step 72 : Write attribute ENUM8 Default Value\n"); - err = TestWriteAttributeEnum8DefaultValue_72(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 73: - ChipLogProgress(chipTool, " ***** Test Step 73 : Read attribute ENUM8 Default Value\n"); - err = TestReadAttributeEnum8DefaultValue_73(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 74: - ChipLogProgress(chipTool, " ***** Test Step 74 : Read attribute ENUM16 Default Value\n"); - err = TestReadAttributeEnum16DefaultValue_74(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 75: - ChipLogProgress(chipTool, " ***** Test Step 75 : Write attribute ENUM16 Not Default Value\n"); - err = TestWriteAttributeEnum16NotDefaultValue_75(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 76: - ChipLogProgress(chipTool, " ***** Test Step 76 : Read attribute ENUM16 Not Default Value\n"); - err = TestReadAttributeEnum16NotDefaultValue_76(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 77: - ChipLogProgress(chipTool, " ***** Test Step 77 : Write attribute ENUM16 Default Value\n"); - err = TestWriteAttributeEnum16DefaultValue_77(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 78: - ChipLogProgress(chipTool, " ***** Test Step 78 : Read attribute ENUM16 Default Value\n"); - err = TestReadAttributeEnum16DefaultValue_78(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 79: - ChipLogProgress(chipTool, " ***** Test Step 79 : Read attribute EPOCH_US Default Value\n"); - err = TestReadAttributeEpochUsDefaultValue_79(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 80: - ChipLogProgress(chipTool, " ***** Test Step 80 : Write attribute EPOCH_US Not Default Value\n"); - err = TestWriteAttributeEpochUsNotDefaultValue_80(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 81: - ChipLogProgress(chipTool, " ***** Test Step 81 : Read attribute EPOCH_US Not Default Value\n"); - err = TestReadAttributeEpochUsNotDefaultValue_81(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 82: - ChipLogProgress(chipTool, " ***** Test Step 82 : Write attribute EPOCH_US Default Value\n"); - err = TestWriteAttributeEpochUsDefaultValue_82(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 83: - ChipLogProgress(chipTool, " ***** Test Step 83 : Read attribute EPOCH_US Default Value\n"); - err = TestReadAttributeEpochUsDefaultValue_83(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 84: - ChipLogProgress(chipTool, " ***** Test Step 84 : Read attribute EPOCH_S Default Value\n"); - err = TestReadAttributeEpochSDefaultValue_84(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 85: - ChipLogProgress(chipTool, " ***** Test Step 85 : Write attribute EPOCH_S Not Default Value\n"); - err = TestWriteAttributeEpochSNotDefaultValue_85(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 86: - ChipLogProgress(chipTool, " ***** Test Step 86 : Read attribute EPOCH_S Not Default Value\n"); - err = TestReadAttributeEpochSNotDefaultValue_86(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 87: - ChipLogProgress(chipTool, " ***** Test Step 87 : Write attribute EPOCH_S Default Value\n"); - err = TestWriteAttributeEpochSDefaultValue_87(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 88: - ChipLogProgress(chipTool, " ***** Test Step 88 : Read attribute EPOCH_S Default Value\n"); - err = TestReadAttributeEpochSDefaultValue_88(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 89: - ChipLogProgress(chipTool, " ***** Test Step 89 : Read attribute vendor_id Default Value\n"); - err = TestReadAttributeVendorIdDefaultValue_89(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 90: - ChipLogProgress(chipTool, " ***** Test Step 90 : Write attribute vendor_id Not Default Value\n"); - err = TestWriteAttributeVendorIdNotDefaultValue_90(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 91: - ChipLogProgress(chipTool, " ***** Test Step 91 : Read attribute vendor_id Not Default Value\n"); - err = TestReadAttributeVendorIdNotDefaultValue_91(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 92: - ChipLogProgress(chipTool, " ***** Test Step 92 : Write attribute vendor_id Default Value\n"); - err = TestWriteAttributeVendorIdDefaultValue_92(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 93: - ChipLogProgress(chipTool, " ***** Test Step 93 : Read attribute vendor_id Default Value\n"); - err = TestReadAttributeVendorIdDefaultValue_93(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 94: - ChipLogProgress(chipTool, " ***** Test Step 94 : Read attribute char_string Default Value\n"); - err = TestReadAttributeCharStringDefaultValue_94(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 95: - ChipLogProgress( - chipTool, " ***** Test Step 95 : Read attribute char_string Default Value and compare to saved value\n"); - err = TestReadAttributeCharStringDefaultValueAndCompareToSavedValue_95(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 96: - ChipLogProgress(chipTool, " ***** Test Step 96 : Write attribute char_string Not Default Value\n"); - err = TestWriteAttributeCharStringNotDefaultValue_96(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 97: - ChipLogProgress(chipTool, " ***** Test Step 97 : Read attribute char_string Not Default Value\n"); - err = TestReadAttributeCharStringNotDefaultValue_97(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 98: - ChipLogProgress( - chipTool, " ***** Test Step 98 : Read attribute char_string Not Default Value and compare to saved value\n"); - err = TestReadAttributeCharStringNotDefaultValueAndCompareToSavedValue_98(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 99: - ChipLogProgress(chipTool, " ***** Test Step 99 : Write attribute char_string Not Default Value from saved value\n"); - err = TestWriteAttributeCharStringNotDefaultValueFromSavedValue_99(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 100: - ChipLogProgress( - chipTool, " ***** Test Step 100 : Read attribute char_string Not Default Value and compare to expected value\n"); - err = TestReadAttributeCharStringNotDefaultValueAndCompareToExpectedValue_100(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 101: - ChipLogProgress(chipTool, " ***** Test Step 101 : Write attribute char_string Default Value\n"); - err = TestWriteAttributeCharStringDefaultValue_101(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 102: - ChipLogProgress(chipTool, " ***** Test Step 102 : Read attribute octet_string Default Value\n"); - err = TestReadAttributeOctetStringDefaultValue_102(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 103: - ChipLogProgress( - chipTool, " ***** Test Step 103 : Read attribute octet_string Default Value and compare to saved value\n"); - err = TestReadAttributeOctetStringDefaultValueAndCompareToSavedValue_103(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 104: - ChipLogProgress(chipTool, " ***** Test Step 104 : Write attribute octet_string Not Default Value\n"); - err = TestWriteAttributeOctetStringNotDefaultValue_104(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 105: - ChipLogProgress(chipTool, " ***** Test Step 105 : Read attribute octet_string Not Default Value\n"); - err = TestReadAttributeOctetStringNotDefaultValue_105(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 106: - ChipLogProgress( - chipTool, " ***** Test Step 106 : Read attribute octet_string Not Default Value and compare to saved value\n"); - err = TestReadAttributeOctetStringNotDefaultValueAndCompareToSavedValue_106(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 107: - ChipLogProgress(chipTool, " ***** Test Step 107 : Write attribute octet_string Not Default Value from saved value\n"); - err = TestWriteAttributeOctetStringNotDefaultValueFromSavedValue_107(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 108: - ChipLogProgress( - chipTool, " ***** Test Step 108 : Read attribute octet_string Not Default Value and compare to expected value\n"); - err = TestReadAttributeOctetStringNotDefaultValueAndCompareToExpectedValue_108(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 109: - ChipLogProgress(chipTool, " ***** Test Step 109 : Write attribute octet_string Default Value\n"); - err = TestWriteAttributeOctetStringDefaultValue_109(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; } - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + // Go on to the next test. + WaitForMs(0); + } + + 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 = 110; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity("alpha"); + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + NSNumber * _Nonnull TestAddArgumentDefaultValue; + + CHIP_ERROR TestSendTestAddArgumentsCommand_1() + { + SetIdentity("alpha"); + 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)); + } + { + TestAddArgumentDefaultValue = values.returnValue; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSendTestAddArgumentsCommand_2() + { + SetIdentity("alpha"); + 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, TestAddArgumentDefaultValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSendTestAddArgumentsCommand_3() + { + SetIdentity("alpha"); + 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); + + VerifyOrReturn(CheckValue("status", err, 0)); + + if (values.returnValue != nil) { + VerifyOrReturn( + CheckConstraintNotValue("returnValue", values.returnValue, TestAddArgumentDefaultValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nonnull readAttributeBooleanDefaultValue; + + CHIP_ERROR TestReadAttributeBooleanDefaultValue_4() + { + SetIdentity("alpha"); + 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)); + } + { + readAttributeBooleanDefaultValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeBooleanNotDefaultValue_5() + { + SetIdentity("alpha"); + 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); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeBooleanNotDefaultValue_6() + { + SetIdentity("alpha"); + 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); + + VerifyOrReturn(CheckValue("status", err, 0)); + + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("boolean", value, readAttributeBooleanDefaultValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeBooleanDefaultValue_7() + { + SetIdentity("alpha"); + 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); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeBooleanFalse_8() + { + SetIdentity("alpha"); + 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, readAttributeBooleanDefaultValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nonnull readAttributeBitmap8DefaultValue; + + CHIP_ERROR TestReadAttributeBitmap8DefaultValue_9() + { + SetIdentity("alpha"); + 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)); + } + { + readAttributeBitmap8DefaultValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeBitmap8NotDefaultValue_10() + { + SetIdentity("alpha"); + 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); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeBitmap8NotDefaultValue_11() + { + SetIdentity("alpha"); + 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); + + VerifyOrReturn(CheckValue("status", err, 0)); + + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("bitmap8", value, readAttributeBitmap8DefaultValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeBitmap8DefaultValue_12() + { + SetIdentity("alpha"); + 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); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeBitmap8DefaultValue_13() + { + SetIdentity("alpha"); + 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, readAttributeBitmap8DefaultValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nonnull readAttributeBitmap16DefaultValue; + + CHIP_ERROR TestReadAttributeBitmap16DefaultValue_14() + { + SetIdentity("alpha"); + 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)); + } + { + readAttributeBitmap16DefaultValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; } - chip::System::Clock::Timeout GetWaitDuration() const override + CHIP_ERROR TestWriteAttributeBitmap16NotDefaultValue_15() { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + SetIdentity("alpha"); + 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); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 110; + CHIP_ERROR TestReadAttributeBitmap16NotDefaultValue_16() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster 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 readAttributeBitmap16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BITMAP16 Not Default Value Error: %@", err); - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + VerifyOrReturn(CheckValue("status", err, 0)); + + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("bitmap16", value, readAttributeBitmap16DefaultValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeBitmap16DefaultValue_17() { - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + SetIdentity("alpha"); + 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); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + return CHIP_NO_ERROR; } - NSNumber * _Nonnull TestAddArgumentDefaultValue; - CHIP_ERROR TestSendTestAddArgumentsCommand_1() + CHIP_ERROR TestReadAttributeBitmap16DefaultValue_18() { + SetIdentity("alpha"); 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 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 = values.returnValue; - VerifyOrReturn(CheckValue("returnValue", actualValue, 20)); - } - { - TestAddArgumentDefaultValue = values.returnValue; - } + { + id actualValue = value; + VerifyOrReturn(CheckValue("bitmap16", actualValue, readAttributeBitmap16DefaultValue)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } + NSNumber * _Nonnull readAttributeBitmap32DefaultValue; - CHIP_ERROR TestSendTestAddArgumentsCommand_2() + CHIP_ERROR TestReadAttributeBitmap32DefaultValue_19() { + SetIdentity("alpha"); 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 readAttributeBitmap32WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BITMAP32 Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = values.returnValue; - VerifyOrReturn(CheckValue("returnValue", actualValue, TestAddArgumentDefaultValue)); - } + { + id actualValue = value; + VerifyOrReturn(CheckValue("bitmap32", actualValue, 0UL)); + } + { + readAttributeBitmap32DefaultValue = value; + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendTestAddArgumentsCommand_3() + CHIP_ERROR TestWriteAttributeBitmap32NotDefaultValue_20() { + SetIdentity("alpha"); 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 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, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - if (values.returnValue != nil) { - VerifyOrReturn( - CheckConstraintNotValue("returnValue", values.returnValue, TestAddArgumentDefaultValue)); - } + NextTest(); + }]; - NextTest(); - }]; + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeBitmap32NotDefaultValue_21() + { + SetIdentity("alpha"); + 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); + + VerifyOrReturn(CheckValue("status", err, 0)); + + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("bitmap32", value, readAttributeBitmap32DefaultValue)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - NSNumber * _Nonnull readAttributeBooleanDefaultValue; - CHIP_ERROR TestReadAttributeBooleanDefaultValue_4() + CHIP_ERROR TestWriteAttributeBitmap32DefaultValue_22() { + SetIdentity("alpha"); 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 bitmap32Argument; + bitmap32Argument = [readAttributeBitmap32DefaultValue copy]; + [cluster writeAttributeBitmap32WithValue:bitmap32Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute BITMAP32 Default Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeBitmap32DefaultValue_23() + { + SetIdentity("alpha"); + 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("boolean", actualValue, 0)); + VerifyOrReturn(CheckValue("bitmap32", actualValue, readAttributeBitmap32DefaultValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nonnull readAttributeBitmap64DefaultValue; + + CHIP_ERROR TestReadAttributeBitmap64DefaultValue_24() + { + SetIdentity("alpha"); + 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)); } { - readAttributeBooleanDefaultValue = value; + readAttributeBitmap64DefaultValue = value; } NextTest(); @@ -68170,39 +81778,41 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeBooleanNotDefaultValue_5() + CHIP_ERROR TestWriteAttributeBitmap64NotDefaultValue_25() { + SetIdentity("alpha"); 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 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 TestReadAttributeBooleanNotDefaultValue_6() + CHIP_ERROR TestReadAttributeBitmap64DefaultValue_26() { + SetIdentity("alpha"); 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 readAttributeBitmap64WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BITMAP64 Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("boolean", value, readAttributeBooleanDefaultValue)); + VerifyOrReturn(CheckConstraintNotValue("bitmap64", value, readAttributeBitmap64DefaultValue)); } NextTest(); @@ -68211,40 +81821,42 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeBooleanDefaultValue_7() + CHIP_ERROR TestWriteAttributeBitmap64DefaultValue_27() { + SetIdentity("alpha"); 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 bitmap64Argument; + bitmap64Argument = [readAttributeBitmap64DefaultValue copy]; + [cluster writeAttributeBitmap64WithValue:bitmap64Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute BITMAP64 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 TestReadAttributeBitmap64DefaultValue_28() { + SetIdentity("alpha"); 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 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("boolean", actualValue, readAttributeBooleanDefaultValue)); + VerifyOrReturn(CheckValue("bitmap64", actualValue, readAttributeBitmap64DefaultValue)); } NextTest(); @@ -68252,25 +81864,254 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull readAttributeBitmap8DefaultValue; + NSNumber * _Nonnull readAttributeInt8uDefaultValue; - CHIP_ERROR TestReadAttributeBitmap8DefaultValue_9() + CHIP_ERROR TestReadAttributeInt8uDefaultValue_29() { + SetIdentity("alpha"); 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 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)); + } + { + readAttributeInt8uDefaultValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeInt8uNotDefaultValue_30() + { + SetIdentity("alpha"); + 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); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeInt8uNotDefaultValue_31() + { + SetIdentity("alpha"); + 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); + + VerifyOrReturn(CheckValue("status", err, 0)); + + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("int8u", value, readAttributeInt8uDefaultValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeInt8uDefaultValue_32() + { + SetIdentity("alpha"); + 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); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeInt8uDefaultValue_33() + { + SetIdentity("alpha"); + 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, readAttributeInt8uDefaultValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nonnull readAttributeInt16uDefaultValue; + + CHIP_ERROR TestReadAttributeInt16uDefaultValue_34() + { + SetIdentity("alpha"); + 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)); + } + { + readAttributeInt16uDefaultValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeInt16uNotDefaultValue_35() + { + SetIdentity("alpha"); + 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 + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT16U Not Default Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeInt16uNotDefaultValue_36() + { + SetIdentity("alpha"); + 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); + + VerifyOrReturn(CheckValue("status", err, 0)); + + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("int16u", value, readAttributeInt16uDefaultValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeInt16uDefaultValue_37() + { + SetIdentity("alpha"); + 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 + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT16U Default Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeInt16uDefaultValue_38() + { + SetIdentity("alpha"); + 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, readAttributeInt16uDefaultValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nonnull readAttributeInt32uDefaultValue; + + CHIP_ERROR TestReadAttributeInt32uDefaultValue_39() + { + SetIdentity("alpha"); + 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("bitmap8", actualValue, 0)); + VerifyOrReturn(CheckValue("int32u", actualValue, 0UL)); } { - readAttributeBitmap8DefaultValue = value; + readAttributeInt32uDefaultValue = value; } NextTest(); @@ -68279,39 +82120,41 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeBitmap8NotDefaultValue_10() + CHIP_ERROR TestWriteAttributeInt32uNotDefaultValue_40() { + SetIdentity("alpha"); 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() { + SetIdentity("alpha"); 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(); @@ -68320,40 +82163,42 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeBitmap8DefaultValue_12() + CHIP_ERROR TestWriteAttributeInt32uDefaultValue_42() { + SetIdentity("alpha"); 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() { + SetIdentity("alpha"); 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(); @@ -68361,25 +82206,26 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull readAttributeBitmap16DefaultValue; + NSNumber * _Nonnull readAttributeInt64uDefaultValue; - CHIP_ERROR TestReadAttributeBitmap16DefaultValue_14() + CHIP_ERROR TestReadAttributeInt64uDefaultValue_44() { + SetIdentity("alpha"); 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(); @@ -68388,39 +82234,41 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeBitmap16NotDefaultValue_15() + CHIP_ERROR TestWriteAttributeInt64uNotDefaultValue_45() { + SetIdentity("alpha"); 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() { + SetIdentity("alpha"); 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(); @@ -68429,40 +82277,42 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeBitmap16DefaultValue_17() + CHIP_ERROR TestWriteAttributeInt64uDefaultValue_47() { + SetIdentity("alpha"); 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() { + SetIdentity("alpha"); 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(); @@ -68470,25 +82320,26 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull readAttributeBitmap32DefaultValue; + NSNumber * _Nonnull readAttributeInt8sDefaultValue; - CHIP_ERROR TestReadAttributeBitmap32DefaultValue_19() + CHIP_ERROR TestReadAttributeInt8sDefaultValue_49() { + SetIdentity("alpha"); 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(); @@ -68497,39 +82348,41 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeBitmap32NotDefaultValue_20() + CHIP_ERROR TestWriteAttributeInt8sNotDefaultValue_50() { + SetIdentity("alpha"); 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() { + SetIdentity("alpha"); 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(); @@ -68538,40 +82391,42 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeBitmap32DefaultValue_22() + CHIP_ERROR TestWriteAttributeInt8sDefaultValue_52() { + SetIdentity("alpha"); 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() { + SetIdentity("alpha"); 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(); @@ -68579,25 +82434,26 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull readAttributeBitmap64DefaultValue; + NSNumber * _Nonnull readAttributeInt16sDefaultValue; - CHIP_ERROR TestReadAttributeBitmap64DefaultValue_24() + CHIP_ERROR TestReadAttributeInt16sDefaultValue_54() { + SetIdentity("alpha"); 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(); @@ -68606,39 +82462,41 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeBitmap64NotDefaultValue_25() + CHIP_ERROR TestWriteAttributeInt16sNotDefaultValue_55() { + SetIdentity("alpha"); 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() { + SetIdentity("alpha"); 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(); @@ -68647,40 +82505,42 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeBitmap64DefaultValue_27() + CHIP_ERROR TestWriteAttributeInt16sDefaultValue_57() { + SetIdentity("alpha"); 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() { + SetIdentity("alpha"); 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(); @@ -68688,25 +82548,26 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull readAttributeInt8uDefaultValue; + NSNumber * _Nonnull readAttributeInt32sDefaultValue; - CHIP_ERROR TestReadAttributeInt8uDefaultValue_29() + CHIP_ERROR TestReadAttributeInt32sDefaultValue_59() { + SetIdentity("alpha"); 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(); @@ -68715,39 +82576,41 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt8uNotDefaultValue_30() + CHIP_ERROR TestWriteAttributeInt32sNotDefaultValue_60() { + SetIdentity("alpha"); 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() { + SetIdentity("alpha"); 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(); @@ -68756,40 +82619,42 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt8uDefaultValue_32() + CHIP_ERROR TestWriteAttributeInt32sDefaultValue_62() { + SetIdentity("alpha"); 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() { + SetIdentity("alpha"); 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(); @@ -68797,25 +82662,26 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull readAttributeInt16uDefaultValue; + NSNumber * _Nonnull readAttributeInt64sDefaultValue; - CHIP_ERROR TestReadAttributeInt16uDefaultValue_34() + CHIP_ERROR TestReadAttributeInt64sDefaultValue_64() { + SetIdentity("alpha"); 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(); @@ -68824,17 +82690,18 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt16uNotDefaultValue_35() + CHIP_ERROR TestWriteAttributeIntsNotDefaultValue_65() { + SetIdentity("alpha"); 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)); @@ -68844,19 +82711,20 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt16uNotDefaultValue_36() + CHIP_ERROR TestReadAttributeInt64sNotDefaultValue_66() { + SetIdentity("alpha"); 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(); @@ -68865,17 +82733,18 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt16uDefaultValue_37() + CHIP_ERROR TestWriteAttributeInt64sDefaultValue_67() { + SetIdentity("alpha"); 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)); @@ -68885,20 +82754,21 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt16uDefaultValue_38() + CHIP_ERROR TestReadAttributeInt64sDefaultValue_68() { + SetIdentity("alpha"); 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(); @@ -68906,25 +82776,26 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull readAttributeInt32uDefaultValue; + NSNumber * _Nonnull readAttributeEnum8DefaultValue; - CHIP_ERROR TestReadAttributeInt32uDefaultValue_39() + CHIP_ERROR TestReadAttributeEnum8DefaultValue_69() { + SetIdentity("alpha"); 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(); @@ -68933,39 +82804,41 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt32uNotDefaultValue_40() + CHIP_ERROR TestWriteAttributeEnum8NotDefaultValue_70() { + SetIdentity("alpha"); 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() { + SetIdentity("alpha"); 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(); @@ -68974,40 +82847,42 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt32uDefaultValue_42() + CHIP_ERROR TestWriteAttributeEnum8DefaultValue_72() { + SetIdentity("alpha"); 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() { + SetIdentity("alpha"); 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(); @@ -69015,25 +82890,26 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull readAttributeInt64uDefaultValue; + NSNumber * _Nonnull readAttributeEnum16DefaultValue; - CHIP_ERROR TestReadAttributeInt64uDefaultValue_44() + CHIP_ERROR TestReadAttributeEnum16DefaultValue_74() { + SetIdentity("alpha"); 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(); @@ -69042,17 +82918,18 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt64uNotDefaultValue_45() + CHIP_ERROR TestWriteAttributeEnum16NotDefaultValue_75() { + SetIdentity("alpha"); 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)); @@ -69062,19 +82939,20 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt64uNotDefaultValue_46() + CHIP_ERROR TestReadAttributeEnum16NotDefaultValue_76() { + SetIdentity("alpha"); 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(); @@ -69083,17 +82961,18 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt64uDefaultValue_47() + CHIP_ERROR TestWriteAttributeEnum16DefaultValue_77() { + SetIdentity("alpha"); 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)); @@ -69103,20 +82982,21 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt64uDefaultValue_48() + CHIP_ERROR TestReadAttributeEnum16DefaultValue_78() { + SetIdentity("alpha"); 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(); @@ -69124,25 +83004,26 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull readAttributeInt8sDefaultValue; + NSNumber * _Nonnull readAttributeEpochUSDefaultValue; - CHIP_ERROR TestReadAttributeInt8sDefaultValue_49() + CHIP_ERROR TestReadAttributeEpochUsDefaultValue_79() { + SetIdentity("alpha"); 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(); @@ -69151,39 +83032,41 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt8sNotDefaultValue_50() + CHIP_ERROR TestWriteAttributeEpochUsNotDefaultValue_80() { + SetIdentity("alpha"); 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() { + SetIdentity("alpha"); 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(); @@ -69192,40 +83075,42 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt8sDefaultValue_52() + CHIP_ERROR TestWriteAttributeEpochUsDefaultValue_82() { + SetIdentity("alpha"); 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() { + SetIdentity("alpha"); 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(); @@ -69233,25 +83118,26 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull readAttributeInt16sDefaultValue; + NSNumber * _Nonnull readAttributeEpochSDefaultValue; - CHIP_ERROR TestReadAttributeInt16sDefaultValue_54() + CHIP_ERROR TestReadAttributeEpochSDefaultValue_84() { + SetIdentity("alpha"); 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(); @@ -69260,17 +83146,18 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt16sNotDefaultValue_55() + CHIP_ERROR TestWriteAttributeEpochSNotDefaultValue_85() { + SetIdentity("alpha"); 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)); @@ -69280,19 +83167,20 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt16sNotDefaultValue_56() + CHIP_ERROR TestReadAttributeEpochSNotDefaultValue_86() { + SetIdentity("alpha"); 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(); @@ -69301,17 +83189,18 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt16sDefaultValue_57() + CHIP_ERROR TestWriteAttributeEpochSDefaultValue_87() { + SetIdentity("alpha"); 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)); @@ -69321,20 +83210,21 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt16sDefaultValue_58() + CHIP_ERROR TestReadAttributeEpochSDefaultValue_88() { + SetIdentity("alpha"); 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(); @@ -69342,25 +83232,26 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull readAttributeInt32sDefaultValue; + NSNumber * _Nonnull readAttributeVendorIdDefaultValue; - CHIP_ERROR TestReadAttributeInt32sDefaultValue_59() + CHIP_ERROR TestReadAttributeVendorIdDefaultValue_89() { + SetIdentity("alpha"); 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(); @@ -69369,39 +83260,41 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt32sNotDefaultValue_60() + CHIP_ERROR TestWriteAttributeVendorIdNotDefaultValue_90() { + SetIdentity("alpha"); 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() { + SetIdentity("alpha"); 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(); @@ -69410,40 +83303,42 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt32sDefaultValue_62() + CHIP_ERROR TestWriteAttributeVendorIdDefaultValue_92() { + SetIdentity("alpha"); 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() { + SetIdentity("alpha"); 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(); @@ -69451,25 +83346,26 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull readAttributeInt64sDefaultValue; + NSString * _Nonnull readAttributeCharStringDefaultValue; - CHIP_ERROR TestReadAttributeInt64sDefaultValue_64() + CHIP_ERROR TestReadAttributeCharStringDefaultValue_94() { + SetIdentity("alpha"); 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(); @@ -69478,39 +83374,21 @@ 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() { + SetIdentity("alpha"); 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(); @@ -69519,40 +83397,50 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt64sDefaultValue_67() + CHIP_ERROR TestWriteAttributeCharStringNotDefaultValue_96() { + SetIdentity("alpha"); 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() { + SetIdentity("alpha"); 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(); @@ -69560,25 +83448,26 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull readAttributeEnum8DefaultValue; - CHIP_ERROR TestReadAttributeEnum8DefaultValue_69() + CHIP_ERROR TestReadAttributeCharStringNotDefaultValueAndCompareToSavedValue_98() { + SetIdentity("alpha"); 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(); @@ -69587,39 +83476,42 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeEnum8NotDefaultValue_70() + CHIP_ERROR TestWriteAttributeCharStringNotDefaultValueFromSavedValue_99() { + SetIdentity("alpha"); 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() { + SetIdentity("alpha"); 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(); @@ -69628,40 +83520,46 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeEnum8DefaultValue_72() + CHIP_ERROR TestWriteAttributeCharStringDefaultValue_101() { + SetIdentity("alpha"); 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); + id charStringArgument; + charStringArgument = [readAttributeCharStringDefaultValue copy]; + [cluster writeAttributeCharStringWithValue:charStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute char_string Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } + NSData * _Nonnull readAttributeOctetStringDefaultValue; - CHIP_ERROR TestReadAttributeEnum8DefaultValue_73() + CHIP_ERROR TestReadAttributeOctetStringDefaultValue_102() { + SetIdentity("alpha"); 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 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("enum8", actualValue, readAttributeEnum8DefaultValue)); + VerifyOrReturn(CheckValueAsString("octet_string", actualValue, [[NSData alloc] initWithBytes:"" length:0])); + } + { + readAttributeOctetStringDefaultValue = value; } NextTest(); @@ -69669,25 +83567,22 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull readAttributeEnum16DefaultValue; - CHIP_ERROR TestReadAttributeEnum16DefaultValue_74() + CHIP_ERROR TestReadAttributeOctetStringDefaultValueAndCompareToSavedValue_103() { + SetIdentity("alpha"); 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 and compare to saved value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("enum16", actualValue, 0U)); - } - { - readAttributeEnum16DefaultValue = value; + VerifyOrReturn(CheckValueAsString("octet_string", actualValue, readAttributeOctetStringDefaultValue)); } NextTest(); @@ -69696,39 +83591,51 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeEnum16NotDefaultValue_75() + CHIP_ERROR TestWriteAttributeOctetStringNotDefaultValue_104() { + SetIdentity("alpha"); 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); + 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); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } + NSData * _Nonnull readAttributeOctetStringNotDefaultValue; - CHIP_ERROR TestReadAttributeEnum16NotDefaultValue_76() + CHIP_ERROR TestReadAttributeOctetStringNotDefaultValue_105() { + SetIdentity("alpha"); 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 Not Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = value; + VerifyOrReturn( + CheckValueAsString("octet_string", actualValue, [[NSData alloc] initWithBytes:"NotDefault" length:10])); + } + if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("enum16", value, readAttributeEnum16DefaultValue)); + VerifyOrReturn(CheckConstraintNotValue("octetString", value, readAttributeOctetStringDefaultValue)); + } + { + readAttributeOctetStringNotDefaultValue = value; } NextTest(); @@ -69737,66 +83644,70 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeEnum16DefaultValue_77() + CHIP_ERROR TestReadAttributeOctetStringNotDefaultValueAndCompareToSavedValue_106() { + SetIdentity("alpha"); 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); + [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)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValueAsString("octet_string", actualValue, readAttributeOctetStringNotDefaultValue)); + } + + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("octetString", value, readAttributeOctetStringDefaultValue)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeEnum16DefaultValue_78() + CHIP_ERROR TestWriteAttributeOctetStringNotDefaultValueFromSavedValue_107() { + SetIdentity("alpha"); 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); - - VerifyOrReturn(CheckValue("status", err, 0)); + 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); - { - id actualValue = value; - VerifyOrReturn(CheckValue("enum16", actualValue, readAttributeEnum16DefaultValue)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - NSNumber * _Nonnull readAttributeEpochUSDefaultValue; - CHIP_ERROR TestReadAttributeEpochUsDefaultValue_79() + CHIP_ERROR TestReadAttributeOctetStringNotDefaultValueAndCompareToExpectedValue_108() { + SetIdentity("alpha"); 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 expected value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("epoch_us", actualValue, 0ULL)); - } - { - readAttributeEpochUSDefaultValue = value; + VerifyOrReturn( + CheckValueAsString("octet_string", actualValue, [[NSData alloc] initWithBytes:"NotDefault" length:10])); } NextTest(); @@ -69805,107 +83716,156 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeEpochUsNotDefaultValue_80() + CHIP_ERROR TestWriteAttributeOctetStringDefaultValue_109() { + SetIdentity("alpha"); 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 = [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 TestReadAttributeEpochUsNotDefaultValue_81() +class TestDescriptorCluster : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + TestDescriptorCluster() + : TestCommandBridge("TestDescriptorCluster") + , mTestIndex(0) { - 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); - - VerifyOrReturn(CheckValue("status", err, 0)); - - if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("epochUs", value, readAttributeEpochUSDefaultValue)); - } - - 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 TestWriteAttributeEpochUsDefaultValue_82() + ~TestDescriptorCluster() {} + + /////////// 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 epochUsArgument; - epochUsArgument = [readAttributeEpochUSDefaultValue copy]; - [cluster writeAttributeEpochUsWithValue:epochUsArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute EPOCH_US Default Value Error: %@", err); + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: TestDescriptorCluster\n"); + } - VerifyOrReturn(CheckValue("status", err, 0)); + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: TestDescriptorCluster\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } - NextTest(); - }]; + Wait(); - return CHIP_NO_ERROR; + // 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_ERROR TestReadAttributeEpochUsDefaultValue_83() + void OnStatusUpdate(const chip::app::StatusIB & status) override { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } - [cluster readAttributeEpochUsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute EPOCH_US Default Value Error: %@", err); + // Go on to the next test. + WaitForMs(0); + } - VerifyOrReturn(CheckValue("status", err, 0)); + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } - { - id actualValue = value; - VerifyOrReturn(CheckValue("epoch_us", actualValue, readAttributeEpochUSDefaultValue)); - } +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() + { + SetIdentity("alpha"); + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - NSNumber * _Nonnull readAttributeEpochSDefaultValue; - CHIP_ERROR TestReadAttributeEpochSDefaultValue_84() + CHIP_ERROR TestReadAttributeDeviceList_1() { + SetIdentity("alpha"); 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 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_s", actualValue, 0UL)); - } - { - readAttributeEpochSDefaultValue = 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(); @@ -69914,39 +83874,46 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - 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 epochSArgument; - epochSArgument = [NSNumber numberWithUnsignedInt:1UL]; - [cluster writeAttributeEpochSWithValue:epochSArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute EPOCH_S Not Default Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadAttributeEpochSNotDefaultValue_86() + CHIP_ERROR TestReadAttributeServerList_2() { + SetIdentity("alpha"); 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 readAttributeServerListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute Server list Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("epochS", value, readAttributeEpochSDefaultValue)); + { + 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)); } NextTest(); @@ -69955,40 +83922,22 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - 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 epochSArgument; - epochSArgument = [readAttributeEpochSDefaultValue copy]; - [cluster writeAttributeEpochSWithValue:epochSArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute EPOCH_S Default Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadAttributeEpochSDefaultValue_88() + CHIP_ERROR TestReadAttributeClientList_3() { + SetIdentity("alpha"); 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 readAttributeClientListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute Client list Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("epoch_s", actualValue, readAttributeEpochSDefaultValue)); + VerifyOrReturn(CheckValue("client list", [actualValue count], static_cast(1))); + VerifyOrReturn(CheckValue("", actualValue[0], 41UL)); } NextTest(); @@ -69996,25 +83945,24 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull readAttributeVendorIdDefaultValue; - CHIP_ERROR TestReadAttributeVendorIdDefaultValue_89() + CHIP_ERROR TestReadAttributePartsList_4() { + SetIdentity("alpha"); 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 readAttributeVendorIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute vendor_id Default Value Error: %@", err); + [cluster readAttributePartsListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute Parts list Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("vendor_id", actualValue, 0U)); - } - { - readAttributeVendorIdDefaultValue = value; + VerifyOrReturn(CheckValue("parts list", [actualValue count], static_cast(2))); + VerifyOrReturn(CheckValue("", actualValue[0], 1U)); + VerifyOrReturn(CheckValue("", actualValue[1], 2U)); } NextTest(); @@ -70022,82 +83970,225 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } +}; - CHIP_ERROR TestWriteAttributeVendorIdNotDefaultValue_90() +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); - - 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)); - - 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 TestReadAttributeVendorIdNotDefaultValue_91() + ~TestBasicInformation() {} + + /////////// 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; - [cluster readAttributeVendorIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute vendor_id Not Default Value Error: %@", err); + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: TestBasicInformation\n"); + } - VerifyOrReturn(CheckValue("status", err, 0)); + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: TestBasicInformation\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } - if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("vendorId", value, readAttributeVendorIdDefaultValue)); - } + 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 : 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; + } - return CHIP_NO_ERROR; + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - CHIP_ERROR TestWriteAttributeVendorIdDefaultValue_92() + void OnStatusUpdate(const chip::app::StatusIB & status) override { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } - id vendorIdArgument; - vendorIdArgument = [readAttributeVendorIdDefaultValue copy]; - [cluster writeAttributeVendorIdWithValue:vendorIdArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute vendor_id Default Value Error: %@", err); + // Go on to the next test. + WaitForMs(0); + } - 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 = 18; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity("alpha"); + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeVendorIdDefaultValue_93() + CHIP_ERROR TestReadLocation_1() { + SetIdentity("alpha"); 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, readAttributeVendorIdDefaultValue)); + VerifyOrReturn(CheckValueAsString("Location", actualValue, @"XX")); } NextTest(); @@ -70105,47 +84196,43 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - NSString * _Nonnull readAttributeCharStringDefaultValue; - CHIP_ERROR TestReadAttributeCharStringDefaultValue_94() + CHIP_ERROR TestWriteLocation_2() { + SetIdentity("alpha"); 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); - - VerifyOrReturn(CheckValue("status", err, 0)); + id locationArgument; + locationArgument = @"US"; + [cluster writeAttributeLocationWithValue:locationArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write location Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValueAsString("char_string", actualValue, @"")); - } - { - readAttributeCharStringDefaultValue = value; - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeCharStringDefaultValueAndCompareToSavedValue_95() + CHIP_ERROR TestReadBackLocation_3() { + SetIdentity("alpha"); 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 readAttributeLocationWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read back location Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueAsString("char_string", actualValue, readAttributeCharStringDefaultValue)); + VerifyOrReturn(CheckValueAsString("Location", actualValue, @"US")); } NextTest(); @@ -70154,74 +84241,66 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - 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 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)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - NSString * _Nonnull readAttributeCharStringNotDefaultValue; - - CHIP_ERROR TestReadAttributeCharStringNotDefaultValue_97() + CHIP_ERROR TestRestoreInitialLocationValue_4() { + SetIdentity("alpha"); 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); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValueAsString("char_string", actualValue, @"NotDefault")); - } + id locationArgument; + locationArgument = @"XX"; + [cluster writeAttributeLocationWithValue:locationArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Restore initial location value Error: %@", err); - if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("charString", value, readAttributeCharStringDefaultValue)); - } - { - readAttributeCharStringNotDefaultValue = value; - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeCharStringNotDefaultValueAndCompareToSavedValue_98() + CHIP_ERROR TestReadAttributeListValue_5() { + SetIdentity("alpha"); 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 readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read AttributeList value 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(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(); @@ -70230,40 +84309,21 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - 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 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)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadAttributeCharStringNotDefaultValueAndCompareToExpectedValue_100() + CHIP_ERROR TestReadNodeLabel_6() { + SetIdentity("alpha"); 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 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, @"NotDefault")); + VerifyOrReturn(CheckValueAsString("NodeLabel", actualValue, @"")); } NextTest(); @@ -70272,44 +84332,42 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeCharStringDefaultValue_101() + CHIP_ERROR TestWriteNodeLabel_7() { + SetIdentity("alpha"); 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 nodeLabelArgument; + nodeLabelArgument = @"My node"; + [cluster writeAttributeNodeLabelWithValue:nodeLabelArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write NodeLabel 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() + CHIP_ERROR TestReadBackNodeLabel_8() { + SetIdentity("alpha"); 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 readAttributeOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute octet_string Default Value Error: %@", err); + [cluster readAttributeNodeLabelWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read back NodeLabel Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueAsString("octet_string", actualValue, [[NSData alloc] initWithBytes:"" length:0])); - } - { - readAttributeOctetStringDefaultValue = value; + VerifyOrReturn(CheckValueAsString("NodeLabel", actualValue, @"My node")); } NextTest(); @@ -70318,20 +84376,21 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeOctetStringDefaultValueAndCompareToSavedValue_103() + CHIP_ERROR TestReadLocalConfigDisabled_9() { + SetIdentity("alpha"); 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 readAttributeOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute octet_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("octet_string", actualValue, readAttributeOctetStringDefaultValue)); + VerifyOrReturn(CheckValue("LocalConfigDisabled", actualValue, false)); } NextTest(); @@ -70340,49 +84399,42 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeOctetStringNotDefaultValue_104() + CHIP_ERROR TestWriteLocalConfigDisabled_10() { + SetIdentity("alpha"); 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 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); + 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; } - NSData * _Nonnull readAttributeOctetStringNotDefaultValue; - CHIP_ERROR TestReadAttributeOctetStringNotDefaultValue_105() + CHIP_ERROR TestReadBackLocalConfigDisabled_11() { + SetIdentity("alpha"); 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 readAttributeOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute octet_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("octet_string", actualValue, [[NSData alloc] initWithBytes:"NotDefault" length:10])); - } - - if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("octetString", value, readAttributeOctetStringDefaultValue)); - } - { - readAttributeOctetStringNotDefaultValue = value; + VerifyOrReturn(CheckValue("LocalConfigDisabled", actualValue, true)); } NextTest(); @@ -70391,24 +84443,35 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeOctetStringNotDefaultValueAndCompareToSavedValue_106() + CHIP_ERROR TestRebootTheDevice_12() + { + SetIdentity("alpha"); + Reboot(); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestConnectToTheDeviceAgain_13() + { + SetIdentity("alpha"); + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadBackNodeLabelAfterReboot_14() { + SetIdentity("alpha"); 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 readAttributeOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute octet_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("octet_string", actualValue, readAttributeOctetStringNotDefaultValue)); - } - - if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("octetString", value, readAttributeOctetStringDefaultValue)); + VerifyOrReturn(CheckValueAsString("NodeLabel", actualValue, @"My node")); } NextTest(); @@ -70417,41 +84480,42 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeOctetStringNotDefaultValueFromSavedValue_107() + CHIP_ERROR TestRestoreInitialNodeLabelValue_15() { + SetIdentity("alpha"); 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 octetStringArgument; - octetStringArgument = [readAttributeOctetStringNotDefaultValue copy]; - [cluster writeAttributeOctetStringWithValue:octetStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute octet_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 TestReadAttributeOctetStringNotDefaultValueAndCompareToExpectedValue_108() + CHIP_ERROR TestReadBackLocalConfigDisabledAfterReboot_16() { + SetIdentity("alpha"); 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 readAttributeOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute octet_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("octet_string", actualValue, [[NSData alloc] initWithBytes:"NotDefault" length:10])); + VerifyOrReturn(CheckValue("LocalConfigDisabled", actualValue, true)); } NextTest(); @@ -70460,42 +84524,45 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeOctetStringDefaultValue_109() + CHIP_ERROR TestRestoreInitialLocalConfigDisabledValue_17() { + SetIdentity("alpha"); 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 octetStringArgument; - octetStringArgument = [readAttributeOctetStringDefaultValue copy]; - [cluster writeAttributeOctetStringWithValue:octetStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute octet_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; } }; -class TestDescriptorCluster : public TestCommandBridge { +class TestGeneralCommissioning : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - TestDescriptorCluster() - : TestCommandBridge("TestDescriptorCluster") + TestGeneralCommissioning() + : TestCommandBridge("TestGeneralCommissioning") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); 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) - ~TestDescriptorCluster() {} + ~TestGeneralCommissioning() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -70503,11 +84570,11 @@ class TestDescriptorCluster : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: TestDescriptorCluster\n"); + ChipLogProgress(chipTool, " **** Test Start: TestGeneralCommissioning\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: TestDescriptorCluster\n"); + ChipLogProgress(chipTool, " **** Test Complete: TestGeneralCommissioning\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -70524,20 +84591,127 @@ 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 Breadcrumb (1/2)\n"); + err = TestWriteBreadcrumb12_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read attribute Server list\n"); - err = TestReadAttributeServerList_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Read back Breadcrumb (1/2)\n"); + err = TestReadBackBreadcrumb12_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read attribute Client list\n"); - err = TestReadAttributeClientList_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Write Breadcrumb (2/2)\n"); + err = TestWriteBreadcrumb22_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read attribute Parts list\n"); - err = TestReadAttributePartsList_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Read back Breadcrumb (2/2)\n"); + err = TestReadBackBreadcrumb22_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Reboot to reset Breadcrumb\n"); + err = TestRebootToResetBreadcrumb_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Connect to the device again\n"); + err = TestConnectToTheDeviceAgain_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Read back Breadcrumb after reboot and ensure it was not persisted\n"); + err = TestReadBackBreadcrumbAfterRebootAndEnsureItWasNotPersisted_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Set Breadcrumb to nonzero value\n"); + err = TestSetBreadcrumbToNonzeroValue_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Check Breadcrumb set worked\n"); + err = TestCheckBreadcrumbSetWorked_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Send CommissioningComplete without armed fail-safe\n"); + err = TestSendCommissioningCompleteWithoutArmedFailSafe_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Check Breadcrumb was not touched by invalid CommissioningComplete\n"); + err = TestCheckBreadcrumbWasNotTouchedByInvalidCommissioningComplete_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Open Commissioning Window from alpha\n"); + err = TestOpenCommissioningWindowFromAlpha_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : Try to arm fail-safe\n"); + err = TestTryToArmFailSafe_13(); + break; + case 14: + ChipLogProgress( + chipTool, " ***** Test Step 14 : Check Breadcrumb was not touched by ArmFailSafe with commissioning window open\n"); + err = TestCheckBreadcrumbWasNotTouchedByArmFailSafeWithCommissioningWindowOpen_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Reset Breadcrumb to 0 so we can commission\n"); + err = TestResetBreadcrumbTo0SoWeCanCommission_15(); + break; + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : Commission from beta\n"); + err = TestCommissionFromBeta_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : Wait for the commissioned device to be retrieved for beta\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrievedForBeta_17(); + break; + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : Arm fail-safe\n"); + err = TestArmFailSafe_18(); + break; + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : Check Breadcrumb was properly set by ArmFailSafe\n"); + err = TestCheckBreadcrumbWasProperlySetByArmFailSafe_19(); + break; + case 20: + ChipLogProgress(chipTool, " ***** Test Step 20 : Try to arm fail-safe from wrong fabric\n"); + err = TestTryToArmFailSafeFromWrongFabric_20(); + break; + case 21: + ChipLogProgress( + chipTool, " ***** Test Step 21 : Check Breadcrumb was not touched by ArmFailSafe with existing fail-safe armed\n"); + err = TestCheckBreadcrumbWasNotTouchedByArmFailSafeWithExistingFailSafeArmed_21(); + break; + case 22: + ChipLogProgress(chipTool, " ***** Test Step 22 : Send CommissioningComplete from wrong fabric\n"); + err = TestSendCommissioningCompleteFromWrongFabric_22(); + break; + case 23: + ChipLogProgress( + chipTool, " ***** Test Step 23 : Check Breadcrumb was not touched by CommissioningComplete from wrong fabric\n"); + err = TestCheckBreadcrumbWasNotTouchedByCommissioningCompleteFromWrongFabric_23(); + break; + case 24: + ChipLogProgress(chipTool, " ***** Test Step 24 : Close out the fail-safe gracefully\n"); + err = TestCloseOutTheFailSafeGracefully_24(); + break; + case 25: + ChipLogProgress(chipTool, " ***** Test Step 25 : Check Breadcrumb was reset to 0 by CommissioningComplete\n"); + err = TestCheckBreadcrumbWasResetTo0ByCommissioningComplete_25(); + break; + case 26: + ChipLogProgress(chipTool, " ***** Test Step 26 : Arm fail-safe again\n"); + err = TestArmFailSafeAgain_26(); + break; + case 27: + ChipLogProgress(chipTool, " ***** Test Step 27 : Check Breadcrumb was set by arming fail-safe again\n"); + err = TestCheckBreadcrumbWasSetByArmingFailSafeAgain_27(); + break; + case 28: + ChipLogProgress(chipTool, " ***** Test Step 28 : Force-expire the fail-safe\n"); + err = TestForceExpireTheFailSafe_28(); + break; + case 29: + ChipLogProgress(chipTool, " ***** Test Step 29 : Check Breadcrumb was reset by expiring the fail-safe\n"); + err = TestCheckBreadcrumbWasResetByExpiringTheFailSafe_29(); + break; + case 30: + ChipLogProgress(chipTool, " ***** Test Step 30 : Validate presence of SupportsConcurrentConnection\n"); + err = TestValidatePresenceOfSupportsConcurrentConnection_30(); break; } @@ -70547,6 +84721,108 @@ class TestDescriptorCluster : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -70554,82 +84830,62 @@ class TestDescriptorCluster : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 5; + const uint16_t mTestCount = 31; chip::Optional mNodeId; chip::Optional mCluster; chip::Optional mEndpoint; + chip::Optional mDiscriminator; + chip::Optional mPayload; chip::Optional mTimeout; CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeDeviceList_1() + CHIP_ERROR TestWriteBreadcrumb12_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestDescriptor * cluster = [[CHIPTestDescriptor alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + CHIPTestGeneralCommissioning * cluster = [[CHIPTestGeneralCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeDeviceListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute Device list Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id breadcrumbArgument; + breadcrumbArgument = [NSNumber numberWithUnsignedLongLong:137438953472ULL]; + [cluster writeAttributeBreadcrumbWithValue:breadcrumbArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write Breadcrumb (1/2) Error: %@", err); - { - 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)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeServerList_2() + CHIP_ERROR TestReadBackBreadcrumb12_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestDescriptor * cluster = [[CHIPTestDescriptor alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + CHIPTestGeneralCommissioning * cluster = [[CHIPTestGeneralCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeServerListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute Server list Error: %@", err); + [cluster readAttributeBreadcrumbWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read back Breadcrumb (1/2) Error: %@", err); VerifyOrReturn(CheckValue("status", err, 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)); + VerifyOrReturn(CheckValue("Breadcrumb", actualValue, 137438953472ULL)); } NextTest(); @@ -70638,45 +84894,46 @@ class TestDescriptorCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeClientList_3() + CHIP_ERROR TestWriteBreadcrumb22_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestDescriptor * cluster = [[CHIPTestDescriptor alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + CHIPTestGeneralCommissioning * cluster = [[CHIPTestGeneralCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeClientListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute Client list Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id breadcrumbArgument; + breadcrumbArgument = [NSNumber numberWithUnsignedLongLong:81ULL]; + [cluster writeAttributeBreadcrumbWithValue:breadcrumbArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write Breadcrumb (2/2) Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("client list", [actualValue count], static_cast(1))); - VerifyOrReturn(CheckValue("", actualValue[0], 41UL)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributePartsList_4() + CHIP_ERROR TestReadBackBreadcrumb22_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestDescriptor * cluster = [[CHIPTestDescriptor alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + CHIPTestGeneralCommissioning * cluster = [[CHIPTestGeneralCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributePartsListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute Parts list Error: %@", err); + [cluster readAttributeBreadcrumbWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read back Breadcrumb (2/2) Error: %@", err); 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)); + VerifyOrReturn(CheckValue("Breadcrumb", actualValue, 81ULL)); } NextTest(); @@ -70684,160 +84941,86 @@ class TestDescriptorCluster : public TestCommandBridge { return CHIP_NO_ERROR; } -}; - -class TestBasicInformation : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - TestBasicInformation() - : TestCommandBridge("TestBasicInformation") - , 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) - - ~TestBasicInformation() {} - /////////// TestCommand Interface ///////// - void NextTest() override + CHIP_ERROR TestRebootToResetBreadcrumb_5() { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: TestBasicInformation\n"); - } - - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: TestBasicInformation\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 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; - } - - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + SetIdentity("alpha"); + Reboot(); + return CHIP_NO_ERROR; } - chip::System::Clock::Timeout GetWaitDuration() const override + CHIP_ERROR TestConnectToTheDeviceAgain_6() { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + SetIdentity("alpha"); + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 18; + CHIP_ERROR TestReadBackBreadcrumbAfterRebootAndEnsureItWasNotPersisted_7() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestGeneralCommissioning * cluster = [[CHIPTestGeneralCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; + [cluster readAttributeBreadcrumbWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read back Breadcrumb after reboot and ensure it was not persisted Error: %@", err); - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("Breadcrumb", actualValue, 0ULL)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSetBreadcrumbToNonzeroValue_8() { - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestGeneralCommissioning * cluster = [[CHIPTestGeneralCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id breadcrumbArgument; + breadcrumbArgument = [NSNumber numberWithUnsignedLongLong:1ULL]; + [cluster writeAttributeBreadcrumbWithValue:breadcrumbArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Set Breadcrumb to nonzero value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + return CHIP_NO_ERROR; } - CHIP_ERROR TestReadLocation_1() + CHIP_ERROR TestCheckBreadcrumbSetWorked_9() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + CHIPTestGeneralCommissioning * cluster = [[CHIPTestGeneralCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeLocationWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read location Error: %@", err); + [cluster readAttributeBreadcrumbWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check Breadcrumb set worked Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueAsString("Location", actualValue, @"XX")); + VerifyOrReturn(CheckValue("Breadcrumb", actualValue, 1ULL)); } NextTest(); @@ -70846,40 +85029,49 @@ class TestBasicInformation : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteLocation_2() + CHIP_ERROR TestSendCommissioningCompleteWithoutArmedFailSafe_10() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + CHIPTestGeneralCommissioning * cluster = [[CHIPTestGeneralCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id locationArgument; - locationArgument = @"US"; - [cluster writeAttributeLocationWithValue:locationArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write location Error: %@", err); + [cluster commissioningCompleteWithCompletionHandler:^( + CHIPGeneralCommissioningClusterCommissioningCompleteResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send CommissioningComplete without armed fail-safe Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = values.errorCode; + VerifyOrReturn(CheckValue("errorCode", actualValue, 3)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadBackLocation_3() + CHIP_ERROR TestCheckBreadcrumbWasNotTouchedByInvalidCommissioningComplete_11() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + CHIPTestGeneralCommissioning * cluster = [[CHIPTestGeneralCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeLocationWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read back location Error: %@", err); + [cluster readAttributeBreadcrumbWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check Breadcrumb was not touched by invalid CommissioningComplete Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueAsString("Location", actualValue, @"US")); + VerifyOrReturn(CheckValue("Breadcrumb", actualValue, 1ULL)); } NextTest(); @@ -70888,64 +85080,76 @@ class TestBasicInformation : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestRestoreInitialLocationValue_4() + CHIP_ERROR TestOpenCommissioningWindowFromAlpha_12() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + CHIPTestAdministratorCommissioning * cluster = [[CHIPTestAdministratorCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id locationArgument; - locationArgument = @"XX"; - [cluster writeAttributeLocationWithValue:locationArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Restore initial location value Error: %@", err); + __auto_type * params = [[CHIPAdministratorCommissioningClusterOpenBasicCommissioningWindowParams alloc] init]; + params.commissioningTimeout = [NSNumber numberWithUnsignedShort:180U]; + [cluster openBasicCommissioningWindowWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Open Commissioning Window from alpha Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeListValue_5() + CHIP_ERROR TestTryToArmFailSafe_13() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + CHIPTestGeneralCommissioning * cluster = [[CHIPTestGeneralCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read AttributeList value Error: %@", err); + __auto_type * params = [[CHIPGeneralCommissioningClusterArmFailSafeParams alloc] init]; + params.expiryLengthSeconds = [NSNumber numberWithUnsignedShort:10U]; + params.breadcrumb = [NSNumber numberWithUnsignedLongLong:5000ULL]; + [cluster armFailSafeWithParams:params + completionHandler:^( + CHIPGeneralCommissioningClusterArmFailSafeResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Try to arm fail-safe Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.errorCode; + VerifyOrReturn(CheckValue("errorCode", actualValue, 4)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckBreadcrumbWasNotTouchedByArmFailSafeWithCommissioningWindowOpen_14() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestGeneralCommissioning * cluster = [[CHIPTestGeneralCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeBreadcrumbWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check Breadcrumb was not touched by ArmFailSafe with commissioning window open Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - 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)); + VerifyOrReturn(CheckValue("Breadcrumb", actualValue, 1ULL)); } NextTest(); @@ -70954,20 +85158,90 @@ class TestBasicInformation : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadNodeLabel_6() + CHIP_ERROR TestResetBreadcrumbTo0SoWeCanCommission_15() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + CHIPTestGeneralCommissioning * cluster = [[CHIPTestGeneralCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNodeLabelWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read NodeLabel Error: %@", err); + id breadcrumbArgument; + breadcrumbArgument = [NSNumber numberWithUnsignedLongLong:0ULL]; + [cluster writeAttributeBreadcrumbWithValue:breadcrumbArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Reset Breadcrumb to 0 so we can commission Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCommissionFromBeta_16() + { + SetIdentity("beta"); + PairWithQRCode(74565, mPayload.HasValue() ? mPayload.Value() : chip::CharSpan::fromCharString("MT:-24J0AFN00KA0648G00")); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrievedForBeta_17() + { + SetIdentity("beta"); + WaitForCommissionee(74565); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestArmFailSafe_18() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestGeneralCommissioning * cluster = [[CHIPTestGeneralCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPGeneralCommissioningClusterArmFailSafeParams alloc] init]; + params.expiryLengthSeconds = [NSNumber numberWithUnsignedShort:500U]; + params.breadcrumb = [NSNumber numberWithUnsignedLongLong:2ULL]; + [cluster armFailSafeWithParams:params + completionHandler:^( + CHIPGeneralCommissioningClusterArmFailSafeResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Arm fail-safe Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.errorCode; + VerifyOrReturn(CheckValue("errorCode", actualValue, 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckBreadcrumbWasProperlySetByArmFailSafe_19() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestGeneralCommissioning * cluster = [[CHIPTestGeneralCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeBreadcrumbWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check Breadcrumb was properly set by ArmFailSafe Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueAsString("NodeLabel", actualValue, @"")); + VerifyOrReturn(CheckValue("Breadcrumb", actualValue, 2ULL)); } NextTest(); @@ -70976,40 +85250,53 @@ class TestBasicInformation : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteNodeLabel_7() + CHIP_ERROR TestTryToArmFailSafeFromWrongFabric_20() { + SetIdentity("beta"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + CHIPTestGeneralCommissioning * cluster = [[CHIPTestGeneralCommissioning 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); + __auto_type * params = [[CHIPGeneralCommissioningClusterArmFailSafeParams alloc] init]; + params.expiryLengthSeconds = [NSNumber numberWithUnsignedShort:10U]; + params.breadcrumb = [NSNumber numberWithUnsignedLongLong:5000ULL]; + [cluster armFailSafeWithParams:params + completionHandler:^( + CHIPGeneralCommissioningClusterArmFailSafeResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Try to arm fail-safe from wrong fabric Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = values.errorCode; + VerifyOrReturn(CheckValue("errorCode", actualValue, 4)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadBackNodeLabel_8() + CHIP_ERROR TestCheckBreadcrumbWasNotTouchedByArmFailSafeWithExistingFailSafeArmed_21() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + CHIPTestGeneralCommissioning * cluster = [[CHIPTestGeneralCommissioning 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); + [cluster readAttributeBreadcrumbWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check Breadcrumb was not touched by ArmFailSafe with existing fail-safe armed Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueAsString("NodeLabel", actualValue, @"My node")); + VerifyOrReturn(CheckValue("Breadcrumb", actualValue, 2ULL)); } NextTest(); @@ -71018,20 +85305,24 @@ class TestBasicInformation : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadLocalConfigDisabled_9() + CHIP_ERROR TestSendCommissioningCompleteFromWrongFabric_22() { + SetIdentity("beta"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + CHIPTestGeneralCommissioning * cluster = [[CHIPTestGeneralCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeLocalConfigDisabledWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read LocalConfigDisabled Error: %@", err); + [cluster commissioningCompleteWithCompletionHandler:^( + CHIPGeneralCommissioningClusterCommissioningCompleteResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send CommissioningComplete from wrong fabric Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { - id actualValue = value; - VerifyOrReturn(CheckValue("LocalConfigDisabled", actualValue, false)); + id actualValue = values.errorCode; + VerifyOrReturn(CheckValue("errorCode", actualValue, 2)); } NextTest(); @@ -71040,40 +85331,49 @@ class TestBasicInformation : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteLocalConfigDisabled_10() + CHIP_ERROR TestCheckBreadcrumbWasNotTouchedByCommissioningCompleteFromWrongFabric_23() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + CHIPTestGeneralCommissioning * cluster = [[CHIPTestGeneralCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id localConfigDisabledArgument; - localConfigDisabledArgument = [NSNumber numberWithBool:true]; - [cluster writeAttributeLocalConfigDisabledWithValue:localConfigDisabledArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write LocalConfigDisabled Error: %@", err); + [cluster readAttributeBreadcrumbWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check Breadcrumb was not touched by CommissioningComplete from wrong fabric Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValue("Breadcrumb", actualValue, 2ULL)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadBackLocalConfigDisabled_11() + CHIP_ERROR TestCloseOutTheFailSafeGracefully_24() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + CHIPTestGeneralCommissioning * cluster = [[CHIPTestGeneralCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeLocalConfigDisabledWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read back LocalConfigDisabled Error: %@", err); + [cluster commissioningCompleteWithCompletionHandler:^( + CHIPGeneralCommissioningClusterCommissioningCompleteResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Close out the fail-safe gracefully Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { - id actualValue = value; - VerifyOrReturn(CheckValue("LocalConfigDisabled", actualValue, true)); + id actualValue = values.errorCode; + VerifyOrReturn(CheckValue("errorCode", actualValue, 0)); } NextTest(); @@ -71082,32 +85382,78 @@ class TestBasicInformation : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestRebootTheDevice_12() + CHIP_ERROR TestCheckBreadcrumbWasResetTo0ByCommissioningComplete_25() { - Reboot(); + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestGeneralCommissioning * cluster = [[CHIPTestGeneralCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeBreadcrumbWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check Breadcrumb was reset to 0 by CommissioningComplete Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("Breadcrumb", actualValue, 0ULL)); + } + + NextTest(); + }]; + return CHIP_NO_ERROR; } - CHIP_ERROR TestConnectToTheDeviceAgain_13() + CHIP_ERROR TestArmFailSafeAgain_26() { - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestGeneralCommissioning * cluster = [[CHIPTestGeneralCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPGeneralCommissioningClusterArmFailSafeParams alloc] init]; + params.expiryLengthSeconds = [NSNumber numberWithUnsignedShort:500U]; + params.breadcrumb = [NSNumber numberWithUnsignedLongLong:3ULL]; + [cluster armFailSafeWithParams:params + completionHandler:^( + CHIPGeneralCommissioningClusterArmFailSafeResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Arm fail-safe again Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.errorCode; + VerifyOrReturn(CheckValue("errorCode", actualValue, 0)); + } + + NextTest(); + }]; + return CHIP_NO_ERROR; } - CHIP_ERROR TestReadBackNodeLabelAfterReboot_14() + CHIP_ERROR TestCheckBreadcrumbWasSetByArmingFailSafeAgain_27() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + CHIPTestGeneralCommissioning * cluster = [[CHIPTestGeneralCommissioning 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 after reboot Error: %@", err); + [cluster readAttributeBreadcrumbWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check Breadcrumb was set by arming fail-safe again Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueAsString("NodeLabel", actualValue, @"My node")); + VerifyOrReturn(CheckValue("Breadcrumb", actualValue, 3ULL)); } NextTest(); @@ -71116,40 +85462,53 @@ class TestBasicInformation : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestRestoreInitialNodeLabelValue_15() + CHIP_ERROR TestForceExpireTheFailSafe_28() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + CHIPTestGeneralCommissioning * cluster = [[CHIPTestGeneralCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nodeLabelArgument; - nodeLabelArgument = @""; - [cluster writeAttributeNodeLabelWithValue:nodeLabelArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Restore initial NodeLabel value Error: %@", err); + __auto_type * params = [[CHIPGeneralCommissioningClusterArmFailSafeParams alloc] init]; + params.expiryLengthSeconds = [NSNumber numberWithUnsignedShort:0U]; + params.breadcrumb = [NSNumber numberWithUnsignedLongLong:4ULL]; + [cluster armFailSafeWithParams:params + completionHandler:^( + CHIPGeneralCommissioningClusterArmFailSafeResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Force-expire the fail-safe Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = values.errorCode; + VerifyOrReturn(CheckValue("errorCode", actualValue, 0)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadBackLocalConfigDisabledAfterReboot_16() + CHIP_ERROR TestCheckBreadcrumbWasResetByExpiringTheFailSafe_29() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + CHIPTestGeneralCommissioning * cluster = [[CHIPTestGeneralCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeLocalConfigDisabledWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read back LocalConfigDisabled after reboot Error: %@", err); + [cluster readAttributeBreadcrumbWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check Breadcrumb was reset by expiring the fail-safe Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("LocalConfigDisabled", actualValue, true)); + VerifyOrReturn(CheckValue("Breadcrumb", actualValue, 0ULL)); } NextTest(); @@ -71158,22 +85517,24 @@ class TestBasicInformation : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestRestoreInitialLocalConfigDisabledValue_17() + CHIP_ERROR TestValidatePresenceOfSupportsConcurrentConnection_30() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + CHIPTestGeneralCommissioning * cluster = [[CHIPTestGeneralCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id localConfigDisabledArgument; - localConfigDisabledArgument = [NSNumber numberWithBool:false]; - [cluster writeAttributeLocalConfigDisabledWithValue:localConfigDisabledArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Restore initial LocalConfigDisabled value Error: %@", err); + [cluster + readAttributeSupportsConcurrentConnectionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate presence of SupportsConcurrentConnection Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("supportsConcurrentConnection", "", "bool")); + NextTest(); + }]; return CHIP_NO_ERROR; } @@ -71233,6 +85594,21 @@ class TestIdentifyCluster : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -71249,12 +85625,14 @@ class TestIdentifyCluster : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestSendIdentifyCommandAndExpectSuccessResponse_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -71352,6 +85730,39 @@ class TestOperationalCredentialsCluster : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -71368,12 +85779,14 @@ class TestOperationalCredentialsCluster : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestReadNumberOfSupportedFabrics_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device endpoint:0 @@ -71398,6 +85811,7 @@ class TestOperationalCredentialsCluster : public TestCommandBridge { CHIP_ERROR TestReadNumberOfCommissionedFabrics_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device endpoint:0 @@ -71423,6 +85837,7 @@ class TestOperationalCredentialsCluster : public TestCommandBridge { CHIP_ERROR TestReadCurrentFabricIndex_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device endpoint:0 @@ -71450,6 +85865,7 @@ class TestOperationalCredentialsCluster : public TestCommandBridge { CHIP_ERROR TestRemoveNonexistentFabric_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device endpoint:0 @@ -71478,6 +85894,7 @@ class TestOperationalCredentialsCluster : public TestCommandBridge { CHIP_ERROR TestReadFabricListBeforeSettingLabel_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device endpoint:0 @@ -71510,6 +85927,7 @@ class TestOperationalCredentialsCluster : public TestCommandBridge { CHIP_ERROR TestSetTheFabricLabel_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device endpoint:0 @@ -71543,6 +85961,7 @@ class TestOperationalCredentialsCluster : public TestCommandBridge { CHIP_ERROR TestReadFabricListAfterSettingLabel_7() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device endpoint:0 @@ -71751,6 +86170,111 @@ class TestModeSelectCluster : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -71768,12 +86292,14 @@ class TestModeSelectCluster : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestReadDescription_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -71796,6 +86322,7 @@ class TestModeSelectCluster : public TestCommandBridge { CHIP_ERROR TestReadStandardNamespace_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -71819,6 +86346,7 @@ class TestModeSelectCluster : public TestCommandBridge { CHIP_ERROR TestReadSupportedModes_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -71856,6 +86384,7 @@ class TestModeSelectCluster : public TestCommandBridge { CHIP_ERROR TestReadCurrentMode_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -71878,6 +86407,7 @@ class TestModeSelectCluster : public TestCommandBridge { CHIP_ERROR TestReadStartUpMode_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -71901,6 +86431,7 @@ class TestModeSelectCluster : public TestCommandBridge { CHIP_ERROR TestReadOnMode_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -71923,6 +86454,7 @@ class TestModeSelectCluster : public TestCommandBridge { CHIP_ERROR TestChangeToSupportedMode_7() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -71944,6 +86476,7 @@ class TestModeSelectCluster : public TestCommandBridge { CHIP_ERROR TestVerifyCurrentModeChange_8() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -71969,6 +86502,7 @@ class TestModeSelectCluster : public TestCommandBridge { CHIP_ERROR TestChangeToUnsupportedMode_9() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -71988,6 +86522,7 @@ class TestModeSelectCluster : public TestCommandBridge { CHIP_ERROR TestToggleOnOff_10() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -72005,6 +86540,7 @@ class TestModeSelectCluster : public TestCommandBridge { CHIP_ERROR TestToggleOnOff_11() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -72022,6 +86558,7 @@ class TestModeSelectCluster : public TestCommandBridge { CHIP_ERROR TestVerifyCurrentModeDoesNotChangeWhenOnModeIsNull_12() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -72044,6 +86581,7 @@ class TestModeSelectCluster : public TestCommandBridge { CHIP_ERROR TestChangeToUnsupportedOnMode_13() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -72063,6 +86601,7 @@ class TestModeSelectCluster : public TestCommandBridge { CHIP_ERROR TestChangeOnMode_14() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -72084,6 +86623,7 @@ class TestModeSelectCluster : public TestCommandBridge { CHIP_ERROR TestVerifyOnMode_15() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -72110,6 +86650,7 @@ class TestModeSelectCluster : public TestCommandBridge { CHIP_ERROR TestToggleOnOff_16() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -72127,6 +86668,7 @@ class TestModeSelectCluster : public TestCommandBridge { CHIP_ERROR TestToggleOnOff_17() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -72144,6 +86686,7 @@ class TestModeSelectCluster : public TestCommandBridge { CHIP_ERROR TestVerifyCurrentModeChangesIfOnModeIsNotNull_18() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -72166,6 +86709,7 @@ class TestModeSelectCluster : public TestCommandBridge { CHIP_ERROR TestChangeToUnsupportedStartUpMode_19() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -72185,6 +86729,7 @@ class TestModeSelectCluster : public TestCommandBridge { CHIP_ERROR TestChangeToSupportedStartUpMode_20() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -72205,6 +86750,7 @@ class TestModeSelectCluster : public TestCommandBridge { CHIP_ERROR TestVerifyStartUpModeChange_21() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -72228,6 +86774,7 @@ class TestModeSelectCluster : public TestCommandBridge { CHIP_ERROR TestChangeCurrentModeToAnotherValue_22() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -72248,6 +86795,7 @@ class TestModeSelectCluster : public TestCommandBridge { CHIP_ERROR TestChangeOnMode_23() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -72268,6 +86816,7 @@ class TestModeSelectCluster : public TestCommandBridge { CHIP_ERROR TestSetStartUpOnOff_24() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -72288,18 +86837,21 @@ class TestModeSelectCluster : public TestCommandBridge { CHIP_ERROR TestRebootTargetDevice_25() { + SetIdentity("alpha"); Reboot(mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U); return CHIP_NO_ERROR; } CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_26() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestVerifyCurrentModeChangeBasedOnOnModeAsItOverwritesStartUpMode_27() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -72322,6 +86874,7 @@ class TestModeSelectCluster : public TestCommandBridge { CHIP_ERROR TestChangeOnModeToNull_28() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -72342,18 +86895,21 @@ class TestModeSelectCluster : public TestCommandBridge { CHIP_ERROR TestRebootTargetDevice_29() { + SetIdentity("alpha"); Reboot(mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U); return CHIP_NO_ERROR; } CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_30() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestVerifyCurrentModeChangeBasedOnNewStartUpMode_31() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -72437,6 +86993,27 @@ class TestSelfFabricRemoval : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -72453,12 +87030,14 @@ class TestSelfFabricRemoval : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestReadNumberOfCommissionedFabrics_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device endpoint:0 @@ -72485,6 +87064,7 @@ class TestSelfFabricRemoval : public TestCommandBridge { CHIP_ERROR TestReadCurrentFabricIndex_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device endpoint:0 @@ -72512,6 +87092,7 @@ class TestSelfFabricRemoval : public TestCommandBridge { CHIP_ERROR TestRemoveSingleOwnFabric_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device endpoint:0 @@ -72616,6 +87197,42 @@ class TestBinding : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -72632,12 +87249,14 @@ class TestBinding : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestWriteEmptyBindingTable_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBinding * cluster = [[CHIPTestBinding alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -72661,6 +87280,7 @@ class TestBinding : public TestCommandBridge { CHIP_ERROR TestReadEmptyBindingTable_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBinding * cluster = [[CHIPTestBinding alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -72686,6 +87306,7 @@ class TestBinding : public TestCommandBridge { CHIP_ERROR TestWriteInvalidBindingTable_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBinding * cluster = [[CHIPTestBinding alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -72718,6 +87339,7 @@ class TestBinding : public TestCommandBridge { CHIP_ERROR TestWriteBindingTableEndpoint1_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBinding * cluster = [[CHIPTestBinding alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -72756,6 +87378,7 @@ class TestBinding : public TestCommandBridge { CHIP_ERROR TestReadBindingTableEndpoint1_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBinding * cluster = [[CHIPTestBinding alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -72797,6 +87420,7 @@ class TestBinding : public TestCommandBridge { CHIP_ERROR TestWriteBindingTableEndpoint0_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBinding * cluster = [[CHIPTestBinding alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -72825,6 +87449,7 @@ class TestBinding : public TestCommandBridge { CHIP_ERROR TestReadBindingTableEndpoint0_7() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBinding * cluster = [[CHIPTestBinding alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -72856,6 +87481,7 @@ class TestBinding : public TestCommandBridge { CHIP_ERROR TestVerifyEndpoint1NotChanged_8() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestBinding * cluster = [[CHIPTestBinding alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -72971,6 +87597,36 @@ class TestUserLabelCluster : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -72988,12 +87644,14 @@ class TestUserLabelCluster : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestClearUserLabelList_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestUserLabel * cluster = [[CHIPTestUserLabel alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -73017,6 +87675,7 @@ class TestUserLabelCluster : public TestCommandBridge { CHIP_ERROR TestReadUserLabelList_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestUserLabel * cluster = [[CHIPTestUserLabel alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -73031,88 +87690,297 @@ class TestUserLabelCluster : public TestCommandBridge { VerifyOrReturn(CheckValue("label list", [actualValue count], static_cast(0))); } - NextTest(); - }]; + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteUserLabelList_3() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestUserLabel * cluster = [[CHIPTestUserLabel alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id labelListArgument; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + 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 writeAttributeLabelListWithValue:labelListArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write User Label List Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestRebootTargetDevice_4() + { + SetIdentity("alpha"); + Reboot(mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_5() + { + SetIdentity("alpha"); + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestVerify_6() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestUserLabel * cluster = [[CHIPTestUserLabel alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeLabelListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + 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(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class TestArmFailSafe : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + TestArmFailSafe() + : TestCommandBridge("TestArmFailSafe") + , mTestIndex(0) + { + 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) + + ~TestArmFailSafe() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: TestArmFailSafe\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: TestArmFailSafe\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 : 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); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + + 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() + { + SetIdentity("alpha"); + Reboot(mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWaitForTheAlphaDeviceToBeRetrieved_1() + { + SetIdentity("alpha"); + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestQueryFabricsList_2() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials 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 readAttributeFabricsWithParams:params + completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Query fabrics list Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("Fabrics", [actualValue count], static_cast(1))); + VerifyOrReturn(CheckValueAsString("Label", + ((CHIPOperationalCredentialsClusterFabricDescriptor *) actualValue[0]).label, @"")); + } + + VerifyOrReturn(CheckConstraintType("fabrics", "", "list")); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteUserLabelList_3() + CHIP_ERROR TestArmFailSafeOnTargetDeviceWithTimeout0_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestUserLabel * cluster = [[CHIPTestUserLabel alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + CHIPTestGeneralCommissioning * cluster = [[CHIPTestGeneralCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id labelListArgument; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - 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 writeAttributeLabelListWithValue:labelListArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write User Label List Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + __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); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); - return CHIP_NO_ERROR; - } + { + id actualValue = values.errorCode; + VerifyOrReturn(CheckValue("errorCode", actualValue, 0)); + } - CHIP_ERROR TestRebootTargetDevice_4() - { - Reboot(mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U); - return CHIP_NO_ERROR; - } + NextTest(); + }]; - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_5() - { - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestVerify_6() + CHIP_ERROR TestReadsNodeLabelMandatoryAttributeOfTargetDevice_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestUserLabel * cluster = [[CHIPTestUserLabel alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeLabelListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify Error: %@", err); + [cluster readAttributeNodeLabelWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads NodeLabel mandatory attribute of target device Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { 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")); + VerifyOrReturn(CheckValueAsString("NodeLabel", actualValue, @"")); } NextTest(); @@ -73122,14 +87990,17 @@ class TestUserLabelCluster : public TestCommandBridge { } }; -class TestArmFailSafe : public TestCommandBridge { +class TestMultiAdmin : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - TestArmFailSafe() - : TestCommandBridge("TestArmFailSafe") + TestMultiAdmin() + : TestCommandBridge("TestMultiAdmin") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("nodeIdForDuplicateCommissioning", 0, UINT64_MAX, &mNodeIdForDuplicateCommissioning); + AddArgument("nodeId2", 0, UINT64_MAX, &mNodeId2); + AddArgument("nodeId3", 0, UINT64_MAX, &mNodeId3); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); AddArgument("discriminator", 0, UINT16_MAX, &mDiscriminator); AddArgument("payload", &mPayload); @@ -73137,7 +88008,7 @@ class TestArmFailSafe : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~TestArmFailSafe() {} + ~TestMultiAdmin() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -73145,11 +88016,11 @@ class TestArmFailSafe : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: TestArmFailSafe\n"); + ChipLogProgress(chipTool, " **** Test Start: TestMultiAdmin\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: TestArmFailSafe\n"); + ChipLogProgress(chipTool, " **** Test Complete: TestMultiAdmin\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -73166,20 +88037,68 @@ class TestArmFailSafe : public TestCommandBridge { err = TestRebootTargetDevice_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Wait for the alpha device to be retrieved \n"); - err = TestWaitForTheAlphaDeviceToBeRetrieved_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Wait for the commissioned device to be retrieved for alpha\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrievedForAlpha_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Query fabrics list\n"); - err = TestQueryFabricsList_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Commission from alpha when the commissioning window is not opened\n"); + err = TestCommissionFromAlphaWhenTheCommissioningWindowIsNotOpened_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : ArmFailSafe on target device with timeout 0\n"); - err = TestArmFailSafeOnTargetDeviceWithTimeout0_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Open Commissioning Window from alpha\n"); + err = TestOpenCommissioningWindowFromAlpha_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Reads NodeLabel mandatory attribute of target device\n"); - err = TestReadsNodeLabelMandatoryAttributeOfTargetDevice_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Commission from alpha again\n"); + err = TestCommissionFromAlphaAgain_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Check that we just have the one fabric and did not add a new one\n"); + err = TestCheckThatWeJustHaveTheOneFabricAndDidNotAddANewOne_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Close Commissioning Window after failed commissioning\n"); + err = TestCloseCommissioningWindowAfterFailedCommissioning_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Open Commissioning Window from alpha again\n"); + err = TestOpenCommissioningWindowFromAlphaAgain_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Commission from beta\n"); + err = TestCommissionFromBeta_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Wait for the commissioned device to be retrieved for beta\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrievedForBeta_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Open Commissioning Window from beta\n"); + err = TestOpenCommissioningWindowFromBeta_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Commission from gamma\n"); + err = TestCommissionFromGamma_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Wait for the commissioned device to be retrieved for gamma\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrievedForGamma_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : read the mandatory attribute: NodeLabel from alpha\n"); + err = TestReadTheMandatoryAttributeNodeLabelFromAlpha_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : write the mandatory attribute NodeLabel from beta\n"); + err = TestWriteTheMandatoryAttributeNodeLabelFromBeta_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : read the mandatory attribute: NodeLabel from gamma\n"); + err = TestReadTheMandatoryAttributeNodeLabelFromGamma_15(); + break; + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : write the mandatory attribute NodeLabel back to default\n"); + err = TestWriteTheMandatoryAttributeNodeLabelBackToDefault_16(); break; } @@ -73189,6 +88108,68 @@ class TestArmFailSafe : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + VerifyOrReturn(CheckValue("clusterStatus present", status.mClusterStatus.HasValue(), true)); + VerifyOrReturn(CheckValue("clusterStatus value", status.mClusterStatus.Value(), 9)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -73196,9 +88177,12 @@ class TestArmFailSafe : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 5; + const uint16_t mTestCount = 17; chip::Optional mNodeId; + chip::Optional mNodeIdForDuplicateCommissioning; + chip::Optional mNodeId2; + chip::Optional mNodeId3; chip::Optional mEndpoint; chip::Optional mDiscriminator; chip::Optional mPayload; @@ -73206,18 +88190,60 @@ class TestArmFailSafe : public TestCommandBridge { CHIP_ERROR TestRebootTargetDevice_0() { + SetIdentity("alpha"); Reboot(mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U); return CHIP_NO_ERROR; } - CHIP_ERROR TestWaitForTheAlphaDeviceToBeRetrieved_1() + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrievedForAlpha_1() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestQueryFabricsList_2() + CHIP_ERROR TestCommissionFromAlphaWhenTheCommissioningWindowIsNotOpened_2() + { + SetIdentity("alpha"); + PairWithQRCode(mNodeIdForDuplicateCommissioning.HasValue() ? mNodeIdForDuplicateCommissioning.Value() : 17ULL, + mPayload.HasValue() ? mPayload.Value() : chip::CharSpan::fromCharString("MT:-24J0AFN00KA0648G00")); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestOpenCommissioningWindowFromAlpha_3() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestAdministratorCommissioning * cluster = [[CHIPTestAdministratorCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPAdministratorCommissioningClusterOpenBasicCommissioningWindowParams alloc] init]; + params.commissioningTimeout = [NSNumber numberWithUnsignedShort:180U]; + [cluster openBasicCommissioningWindowWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Open Commissioning Window from alpha Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCommissionFromAlphaAgain_4() + { + SetIdentity("alpha"); + PairWithQRCode(mNodeIdForDuplicateCommissioning.HasValue() ? mNodeIdForDuplicateCommissioning.Value() : 17ULL, + mPayload.HasValue() ? mPayload.Value() : chip::CharSpan::fromCharString("MT:-24J0AFN00KA0648G00")); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckThatWeJustHaveTheOneFabricAndDidNotAddANewOne_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device endpoint:0 @@ -73225,64 +88251,130 @@ class TestArmFailSafe : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); CHIPReadParams * params = [[CHIPReadParams alloc] init]; - params.fabricFiltered = [NSNumber numberWithBool:true]; + params.fabricFiltered = [NSNumber numberWithBool:false]; [cluster readAttributeFabricsWithParams:params completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Query fabrics list Error: %@", err); + NSLog(@"Check that we just have the one fabric and did not add a new one Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; VerifyOrReturn(CheckValue("Fabrics", [actualValue count], static_cast(1))); - VerifyOrReturn(CheckValueAsString("Label", - ((CHIPOperationalCredentialsClusterFabricDescriptor *) actualValue[0]).label, @"")); } - VerifyOrReturn(CheckConstraintType("fabrics", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestArmFailSafeOnTargetDeviceWithTimeout0_3() + CHIP_ERROR TestCloseCommissioningWindowAfterFailedCommissioning_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestGeneralCommissioning * cluster = [[CHIPTestGeneralCommissioning alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestAdministratorCommissioning * cluster = [[CHIPTestAdministratorCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __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); + [cluster revokeCommissioningWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Close Commissioning Window after failed commissioning Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = values.errorCode; - VerifyOrReturn(CheckValue("errorCode", actualValue, 0)); - } + NextTest(); + }]; - NextTest(); - }]; + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestOpenCommissioningWindowFromAlphaAgain_7() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestAdministratorCommissioning * cluster = [[CHIPTestAdministratorCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPAdministratorCommissioningClusterOpenBasicCommissioningWindowParams alloc] init]; + params.commissioningTimeout = [NSNumber numberWithUnsignedShort:180U]; + [cluster openBasicCommissioningWindowWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Open Commissioning Window from alpha again Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsNodeLabelMandatoryAttributeOfTargetDevice_4() + CHIP_ERROR TestCommissionFromBeta_8() + { + SetIdentity("beta"); + PairWithQRCode(mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL, + mPayload.HasValue() ? mPayload.Value() : chip::CharSpan::fromCharString("MT:-24J0AFN00KA0648G00")); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrievedForBeta_9() + { + SetIdentity("beta"); + WaitForCommissionee(mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestOpenCommissioningWindowFromBeta_10() + { + SetIdentity("beta"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestAdministratorCommissioning * cluster = [[CHIPTestAdministratorCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPAdministratorCommissioningClusterOpenBasicCommissioningWindowParams alloc] init]; + params.commissioningTimeout = [NSNumber numberWithUnsignedShort:180U]; + [cluster openBasicCommissioningWindowWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Open Commissioning Window from beta Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCommissionFromGamma_11() + { + SetIdentity("gamma"); + PairWithQRCode(mNodeId3.HasValue() ? mNodeId3.Value() : 12586990ULL, + mPayload.HasValue() ? mPayload.Value() : chip::CharSpan::fromCharString("MT:-24J0AFN00KA0648G00")); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrievedForGamma_12() + { + SetIdentity("gamma"); + WaitForCommissionee(mNodeId3.HasValue() ? mNodeId3.Value() : 12586990ULL); + return CHIP_NO_ERROR; + } + NSString * _Nonnull readFromAlpha; + + CHIP_ERROR TestReadTheMandatoryAttributeNodeLabelFromAlpha_13() { + SetIdentity("alpha"); 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(@"Reads NodeLabel mandatory attribute of target device Error: %@", err); + NSLog(@"read the mandatory attribute: NodeLabel from alpha Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -73290,12 +88382,79 @@ class TestArmFailSafe : public TestCommandBridge { id actualValue = value; VerifyOrReturn(CheckValueAsString("NodeLabel", actualValue, @"")); } + { + readFromAlpha = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteTheMandatoryAttributeNodeLabelFromBeta_14() + { + SetIdentity("beta"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id nodeLabelArgument; + nodeLabelArgument = @"written from beta"; + [cluster writeAttributeNodeLabelWithValue:nodeLabelArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"write the mandatory attribute NodeLabel from beta Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheMandatoryAttributeNodeLabelFromGamma_15() + { + SetIdentity("gamma"); + 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 the mandatory attribute: NodeLabel from gamma Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("nodeLabel", value, readFromAlpha)); + } NextTest(); }]; return CHIP_NO_ERROR; } + + CHIP_ERROR TestWriteTheMandatoryAttributeNodeLabelBackToDefault_16() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id nodeLabelArgument; + nodeLabelArgument = [readFromAlpha copy]; + [cluster writeAttributeNodeLabelWithValue:nodeLabelArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"write the mandatory attribute NodeLabel back to default Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } }; class Test_TC_SWDIAG_1_1 : public TestCommandBridge { @@ -73376,6 +88535,30 @@ class Test_TC_SWDIAG_1_1 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -73392,12 +88575,14 @@ class Test_TC_SWDIAG_1_1 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestReadsAListOfThreadMetricsStructNonGlobalAttributeFromDut_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestSoftwareDiagnostics * cluster = [[CHIPTestSoftwareDiagnostics alloc] initWithDevice:device endpoint:0 @@ -73418,6 +88603,7 @@ class Test_TC_SWDIAG_1_1 : public TestCommandBridge { CHIP_ERROR TestReadsCurrentHeapFreeNonGlobalAttributeValueFromDut_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestSoftwareDiagnostics * cluster = [[CHIPTestSoftwareDiagnostics alloc] initWithDevice:device endpoint:0 @@ -73443,6 +88629,7 @@ class Test_TC_SWDIAG_1_1 : public TestCommandBridge { CHIP_ERROR TestReadsCurrentHeapUsedNonGlobalAttributeValueFromDut_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestSoftwareDiagnostics * cluster = [[CHIPTestSoftwareDiagnostics alloc] initWithDevice:device endpoint:0 @@ -73468,6 +88655,7 @@ class Test_TC_SWDIAG_1_1 : public TestCommandBridge { CHIP_ERROR TestReadsCurrentHeapHighWaterMarkNonGlobalAttributeValueFromDut_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestSoftwareDiagnostics * cluster = [[CHIPTestSoftwareDiagnostics alloc] initWithDevice:device endpoint:0 @@ -73538,6 +88726,15 @@ class Test_TC_SWDIAG_2_1 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -73627,6 +88824,27 @@ class Test_TC_SWDIAG_3_1 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -73643,12 +88861,14 @@ class Test_TC_SWDIAG_3_1 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestSendsResetWatermarksToDut_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestSoftwareDiagnostics * cluster = [[CHIPTestSoftwareDiagnostics alloc] initWithDevice:device endpoint:0 @@ -73668,6 +88888,7 @@ class Test_TC_SWDIAG_3_1 : public TestCommandBridge { CHIP_ERROR TestReadsCurrentHeapUsedAttributeValueFromDut_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestSoftwareDiagnostics * cluster = [[CHIPTestSoftwareDiagnostics alloc] initWithDevice:device endpoint:0 @@ -73693,6 +88914,7 @@ class Test_TC_SWDIAG_3_1 : public TestCommandBridge { CHIP_ERROR TestReadsCurrentHeapHighWaterMarkAttributeValueFromDut_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestSoftwareDiagnostics * cluster = [[CHIPTestSoftwareDiagnostics alloc] initWithDevice:device endpoint:0 @@ -73795,6 +89017,39 @@ class TestSubscribe_OnOff : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -73811,12 +89066,14 @@ class TestSubscribe_OnOff : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestSetOnOffAttributeToFalse_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -73836,6 +89093,7 @@ class TestSubscribe_OnOff : public TestCommandBridge { CHIP_ERROR TestReportSubscribeOnOffAttribute_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -73859,6 +89117,7 @@ class TestSubscribe_OnOff : public TestCommandBridge { CHIP_ERROR TestSubscribeOnOffAttribute_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -73890,6 +89149,7 @@ class TestSubscribe_OnOff : public TestCommandBridge { CHIP_ERROR TestTurnOnTheLightToSeeAttributeChange_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -73907,6 +89167,7 @@ class TestSubscribe_OnOff : public TestCommandBridge { CHIP_ERROR TestCheckForAttributeReport_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -73929,6 +89190,7 @@ class TestSubscribe_OnOff : public TestCommandBridge { CHIP_ERROR TestTurnOffTheLightToSeeAttributeChange_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -73946,6 +89208,7 @@ class TestSubscribe_OnOff : public TestCommandBridge { CHIP_ERROR TestCheckForAttributeReport_7() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -74057,6 +89320,48 @@ class DL_LockUnlock : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -74073,12 +89378,14 @@ class DL_LockUnlock : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestCreateNewPinCredentialAndLockUnlockUser_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -74125,6 +89432,7 @@ class DL_LockUnlock : public TestCommandBridge { CHIP_ERROR TestTryToUnlockTheDoorWithInvalidPin_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -74144,6 +89452,7 @@ class DL_LockUnlock : public TestCommandBridge { CHIP_ERROR TestVerifyThatLockStateAttributeValueIsSetToLocked_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -74167,6 +89476,7 @@ class DL_LockUnlock : public TestCommandBridge { CHIP_ERROR TestTryToUnlockTheDoorWithValidPin_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -74187,6 +89497,7 @@ class DL_LockUnlock : public TestCommandBridge { CHIP_ERROR TestVerifyThatLockStateAttributeValueIsSetToUnlocked_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -74210,6 +89521,7 @@ class DL_LockUnlock : public TestCommandBridge { CHIP_ERROR TestTryToLockTheDoorWithInvalidPin_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -74229,6 +89541,7 @@ class DL_LockUnlock : public TestCommandBridge { CHIP_ERROR TestVerifyThatLockStateAttributeValueIsSetToUnlocked_7() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -74252,6 +89565,7 @@ class DL_LockUnlock : public TestCommandBridge { CHIP_ERROR TestTryToUnlockTheDoorWithValidPin_8() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -74272,6 +89586,7 @@ class DL_LockUnlock : public TestCommandBridge { CHIP_ERROR TestVerifyThatLockStateAttributeValueIsSetToLocked_9() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -74295,6 +89610,7 @@ class DL_LockUnlock : public TestCommandBridge { CHIP_ERROR TestCleanTheCreatedCredential_10() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -74399,6 +89715,42 @@ class Test_TC_DL_1_3 : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -74415,12 +89767,14 @@ class Test_TC_DL_1_3 : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestCreateNewPinCredentialAndLockUnlockUser_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -74467,6 +89821,7 @@ class Test_TC_DL_1_3 : public TestCommandBridge { CHIP_ERROR TestPreconditionDoorIsInLockedState_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -74487,6 +89842,7 @@ class Test_TC_DL_1_3 : public TestCommandBridge { CHIP_ERROR TestThWritesAutoRelockTimeAttributeValueAs10SecondsOnTheDut_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -74507,6 +89863,7 @@ class Test_TC_DL_1_3 : public TestCommandBridge { CHIP_ERROR TestThSendsTheUnlockDoorCommandToTheDutWithValidPINCode_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -74527,6 +89884,7 @@ class Test_TC_DL_1_3 : public TestCommandBridge { CHIP_ERROR TestThReadsAutoRelockTimeAttributeFromDut_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -74549,12 +89907,14 @@ class Test_TC_DL_1_3 : public TestCommandBridge { CHIP_ERROR TestWait10000ms_6() { + SetIdentity("alpha"); WaitForMs(10000); return CHIP_NO_ERROR; } CHIP_ERROR TestThReadsLockStateAttriute_7() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -74578,6 +89938,7 @@ class Test_TC_DL_1_3 : public TestCommandBridge { CHIP_ERROR TestCleanTheCreatedCredential_8() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -74722,6 +90083,72 @@ class TestGroupsCluster : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -74738,12 +90165,14 @@ class TestGroupsCluster : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestViewGroup0Invalid_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -74774,6 +90203,7 @@ class TestGroupsCluster : public TestCommandBridge { CHIP_ERROR TestViewGroup1NotFound_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -74804,6 +90234,7 @@ class TestGroupsCluster : public TestCommandBridge { CHIP_ERROR TestAddGroup1New_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -74835,6 +90266,7 @@ class TestGroupsCluster : public TestCommandBridge { CHIP_ERROR TestViewGroup1New_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -74870,6 +90302,7 @@ class TestGroupsCluster : public TestCommandBridge { CHIP_ERROR TestViewGroup2NotFound_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -74900,6 +90333,7 @@ class TestGroupsCluster : public TestCommandBridge { CHIP_ERROR TestGetGroupMembership1All_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -74935,6 +90369,7 @@ class TestGroupsCluster : public TestCommandBridge { CHIP_ERROR TestViewGroup3NotFound_7() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -74965,6 +90400,7 @@ class TestGroupsCluster : public TestCommandBridge { CHIP_ERROR TestViewGroup1Existing_8() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -75000,6 +90436,7 @@ class TestGroupsCluster : public TestCommandBridge { CHIP_ERROR TestRemoveGroup0Invalid_9() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -75030,6 +90467,7 @@ class TestGroupsCluster : public TestCommandBridge { CHIP_ERROR TestRemoveGroup4NotFound_10() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -75060,6 +90498,7 @@ class TestGroupsCluster : public TestCommandBridge { CHIP_ERROR TestViewGroup1NotRemoved_11() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -75095,6 +90534,7 @@ class TestGroupsCluster : public TestCommandBridge { CHIP_ERROR TestViewGroup2Removed_12() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -75125,6 +90565,7 @@ class TestGroupsCluster : public TestCommandBridge { CHIP_ERROR TestGetGroupMembership3_13() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -75164,6 +90605,7 @@ class TestGroupsCluster : public TestCommandBridge { CHIP_ERROR TestRemoveAll_14() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -75181,6 +90623,7 @@ class TestGroupsCluster : public TestCommandBridge { CHIP_ERROR TestViewGroup1Removed_15() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -75211,6 +90654,7 @@ class TestGroupsCluster : public TestCommandBridge { CHIP_ERROR TestViewGroup2StillRemoved_16() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -75241,6 +90685,7 @@ class TestGroupsCluster : public TestCommandBridge { CHIP_ERROR TestViewGroup3Removed_17() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -75271,6 +90716,7 @@ class TestGroupsCluster : public TestCommandBridge { CHIP_ERROR TestGetGroupMembership4_18() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -75427,6 +90873,69 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { } } + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_NOT_FOUND)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_NOT_FOUND)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -75443,12 +90952,14 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { + SetIdentity("alpha"); WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } CHIP_ERROR TestReadMaxGroupsPerFabric_1() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device endpoint:0 @@ -75472,6 +90983,7 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { CHIP_ERROR TestReadMaxGroupKeysPerFabric_2() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device endpoint:0 @@ -75496,6 +91008,7 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { CHIP_ERROR TestAddGroup1_3() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -75527,6 +91040,7 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { CHIP_ERROR TestAddGroup2_4() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -75558,6 +91072,7 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { CHIP_ERROR TestKeySetWrite1_5() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device endpoint:0 @@ -75597,6 +91112,7 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { CHIP_ERROR TestKeySetWrite2_6() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device endpoint:0 @@ -75636,6 +91152,7 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { CHIP_ERROR TestKeySetRead_7() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device endpoint:0 @@ -75686,6 +91203,7 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { CHIP_ERROR TestWriteGroupKeysInvalid_8() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device endpoint:0 @@ -75715,6 +91233,7 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { CHIP_ERROR TestWriteGroupKeys_9() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device endpoint:0 @@ -75750,6 +91269,7 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { CHIP_ERROR TestReadGroupKeys_10() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device endpoint:0 @@ -75790,6 +91310,7 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { CHIP_ERROR TestReadGroupTable_11() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device endpoint:0 @@ -75831,6 +91352,7 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { CHIP_ERROR TestKeySetRemove1_12() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device endpoint:0 @@ -75853,6 +91375,7 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { CHIP_ERROR TestKeySetReadRemoved_13() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device endpoint:0 @@ -75875,6 +91398,7 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { CHIP_ERROR TestKeySetReadNotRemoved_14() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device endpoint:0 @@ -75925,6 +91449,7 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { CHIP_ERROR TestRemoveAll_15() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); @@ -75942,6 +91467,7 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { CHIP_ERROR TestKeySetRemove2_16() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device endpoint:0 @@ -75964,6 +91490,7 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { CHIP_ERROR TestKeySetReadAlsoRemoved_17() { + SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device endpoint:0 @@ -76084,6 +91611,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(), @@ -76156,6 +91688,7 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), + make_unique(), make_unique(), make_unique(), make_unique(), @@ -76163,6 +91696,7 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), + make_unique(), make_unique(), make_unique(), make_unique(),